@wix/form-public 0.580.0 → 0.582.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8427,8 +8427,8 @@ var init_metadata = __esm({
8427
8427
  // Deprecated.
8428
8428
  }, {
8429
8429
  key: "type",
8430
- value: function type(_type4) {
8431
- return this.numberingPlan.type(_type4);
8430
+ value: function type(_type5) {
8431
+ return this.numberingPlan.type(_type5);
8432
8432
  }
8433
8433
  // Deprecated.
8434
8434
  }, {
@@ -43885,6 +43885,7 @@ var EXPERIMENTS = {
43885
43885
  SUBMIT_SUCCESS_NO_FOCUS: "specs.forms.SubmitSuccessNoFocus",
43886
43886
  USE_FIELDS_V2: "specs.forms.UseFieldsV2",
43887
43887
  USE_FIELDS_V2_EVENTS: "useFieldsV2Events",
43888
+ USE_FIELDS_V2_IDENTITY: "useFieldsV2Identity",
43888
43889
  USE_FIELDS_V2_PP: "useFieldsV2PP",
43889
43890
  USE_FIELDS_V2_QUIZZES: "useFieldsV2Quizzes",
43890
43891
  USE_FIELDS_V2_STANDALONE: "useFieldsV2Standalone"};
@@ -51136,7 +51137,8 @@ var useFormView2 = (form, stepId, breakpoint) => {
51136
51137
  const useFormSchemaV2PricingPlans = experiments.isExperimentEnabled(EXPERIMENTS.ENABLE_FORM_SCHEMA_V2_PRICING_PLANS);
51137
51138
  const useFormSchemaV2Quizzes = experiments.isExperimentEnabled(EXPERIMENTS.USE_FIELDS_V2_QUIZZES);
51138
51139
  const useFieldsV2Events = experiments.isExperimentEnabled(EXPERIMENTS.USE_FIELDS_V2_EVENTS);
51139
- const useFieldsV2 = useFieldsV2App || useFieldsV2Events || useFieldsV2Standalone || useFormSchemaV2Quizzes || useFieldsV2PP || useFormSchemaV2PricingPlans;
51140
+ const useFieldsV2Identity = experiments.isExperimentEnabled(EXPERIMENTS.USE_FIELDS_V2_IDENTITY);
51141
+ const useFieldsV2 = useFieldsV2App || useFieldsV2Events || useFieldsV2Identity || useFieldsV2Standalone || useFormSchemaV2Quizzes || useFieldsV2PP || useFormSchemaV2PricingPlans;
51140
51142
  return useMemo(() => {
51141
51143
  return (form?.steps || []).filter((step) => !stepId || stepId === step.id).map((step) => {
51142
51144
  return createFormView({
@@ -52443,2176 +52445,2174 @@ var SortOrder2;
52443
52445
  SortOrder3["DESC"] = "DESC";
52444
52446
  })(SortOrder2 || (SortOrder2 = {}));
52445
52447
 
52446
- // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
52447
- var DEFAULT_FIRST_DAY = 1;
52448
- function getFirstDayOfTheWeek(locale) {
52449
- try {
52450
- const intlLocale = new Intl.Locale(locale);
52451
- if (typeof intlLocale.getWeekInfo === "function") {
52452
- const firstDay = intlLocale.getWeekInfo().firstDay;
52453
- if (firstDay !== void 0) {
52454
- return firstDay === 7 ? 0 : firstDay;
52455
- }
52448
+ // ../../node_modules/@internationalized/date/dist/private/utils.mjs
52449
+ function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
52450
+ return amount - numerator * Math.floor(amount / numerator);
52451
+ }
52452
+
52453
+ // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
52454
+ var $93635573935797de$var$EPOCH = 1721426;
52455
+ function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
52456
+ year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
52457
+ let y1 = year - 1;
52458
+ let monthOffset = -2;
52459
+ if (month <= 2) monthOffset = 0;
52460
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
52461
+ return $93635573935797de$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);
52462
+ }
52463
+ function $93635573935797de$export$553d7fa8e3805fc0(year) {
52464
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
52465
+ }
52466
+ function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
52467
+ return era === "BC" ? 1 - year : year;
52468
+ }
52469
+ function $93635573935797de$export$4475b7e617eb123c(year) {
52470
+ let era = "AD";
52471
+ if (year <= 0) {
52472
+ era = "BC";
52473
+ year = 1 - year;
52474
+ }
52475
+ return [
52476
+ era,
52477
+ year
52478
+ ];
52479
+ }
52480
+ var $93635573935797de$var$daysInMonth = {
52481
+ standard: [
52482
+ 31,
52483
+ 28,
52484
+ 31,
52485
+ 30,
52486
+ 31,
52487
+ 30,
52488
+ 31,
52489
+ 31,
52490
+ 30,
52491
+ 31,
52492
+ 30,
52493
+ 31
52494
+ ],
52495
+ leapyear: [
52496
+ 31,
52497
+ 29,
52498
+ 31,
52499
+ 30,
52500
+ 31,
52501
+ 30,
52502
+ 31,
52503
+ 31,
52504
+ 30,
52505
+ 31,
52506
+ 30,
52507
+ 31
52508
+ ]
52509
+ };
52510
+ var $93635573935797de$export$80ee6245ec4f29ec = class {
52511
+ fromJulianDay(jd) {
52512
+ let jd0 = jd;
52513
+ let depoch = jd0 - $93635573935797de$var$EPOCH;
52514
+ let quadricent = Math.floor(depoch / 146097);
52515
+ let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
52516
+ let cent = Math.floor(dqc / 36524);
52517
+ let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
52518
+ let quad = Math.floor(dcent / 1461);
52519
+ let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
52520
+ let yindex = Math.floor(dquad / 365);
52521
+ let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
52522
+ let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
52523
+ let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
52524
+ let leapAdj = 2;
52525
+ if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
52526
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
52527
+ let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
52528
+ let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
52529
+ return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
52530
+ }
52531
+ toJulianDay(date) {
52532
+ return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
52533
+ }
52534
+ getDaysInMonth(date) {
52535
+ return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
52536
+ }
52537
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52538
+ getMonthsInYear(date) {
52539
+ return 12;
52540
+ }
52541
+ getDaysInYear(date) {
52542
+ return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
52543
+ }
52544
+ getMaximumMonthsInYear() {
52545
+ return 12;
52546
+ }
52547
+ getMaximumDaysInMonth() {
52548
+ return 31;
52549
+ }
52550
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52551
+ getYearsInEra(date) {
52552
+ return 9999;
52553
+ }
52554
+ getEras() {
52555
+ return [
52556
+ "BC",
52557
+ "AD"
52558
+ ];
52559
+ }
52560
+ isInverseEra(date) {
52561
+ return date.era === "BC";
52562
+ }
52563
+ balanceDate(date) {
52564
+ if (date.year <= 0) {
52565
+ date.era = date.era === "BC" ? "AD" : "BC";
52566
+ date.year = 1 - date.year;
52456
52567
  }
52457
- return getFirstDayManual(locale);
52458
- } catch {
52459
- return getFirstDayManual(locale);
52460
52568
  }
52569
+ constructor() {
52570
+ this.identifier = "gregory";
52571
+ }
52572
+ };
52573
+
52574
+ // ../../node_modules/@internationalized/date/dist/private/queries.mjs
52575
+ function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
52576
+ return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
52461
52577
  }
52462
- var REGIONS_STARTING_SATURDAY = [
52463
- "AF",
52464
- "BH",
52465
- "DJ",
52466
- "DZ",
52467
- "EG",
52468
- "IQ",
52469
- "IR",
52470
- "JO",
52471
- "KW",
52472
- "LY",
52473
- "OM",
52474
- "QA",
52475
- "SD",
52476
- "SY"
52477
- ];
52478
- var REGIONS_STARTING_SUNDAY = [
52479
- "AG",
52480
- "AS",
52481
- "BD",
52482
- "BR",
52483
- "BS",
52484
- "BT",
52485
- "BW",
52486
- "BZ",
52487
- "CA",
52488
- "CO",
52489
- "DM",
52490
- "DO",
52491
- "ET",
52492
- "GT",
52493
- "GU",
52494
- "HK",
52495
- "HN",
52496
- "ID",
52497
- "IL",
52498
- "IN",
52499
- "IS",
52500
- "JM",
52501
- "JP",
52502
- "KE",
52503
- "KH",
52504
- "KR",
52505
- "LA",
52506
- "MH",
52507
- "MM",
52508
- "MO",
52509
- "MT",
52510
- "MX",
52511
- "MZ",
52512
- "NI",
52513
- "NP",
52514
- "PA",
52515
- "PE",
52516
- "PH",
52517
- "PK",
52518
- "PR",
52519
- "PT",
52520
- "PY",
52521
- "SA",
52522
- "SG",
52523
- "SV",
52524
- "TH",
52525
- "TT",
52526
- "TW",
52527
- "UM",
52528
- "US",
52529
- "VE",
52530
- "VI",
52531
- "WS",
52532
- "YE",
52533
- "ZA",
52534
- "ZW"
52535
- ];
52536
- var LANGUAGES_STARTING_SATURDAY = [
52537
- "ar"
52538
- ];
52539
- var LANGUAGES_STARTING_SUNDAY = [
52540
- "en",
52541
- "he",
52542
- "hi",
52543
- "id",
52544
- "ja",
52545
- "ko",
52546
- "pt",
52547
- "tl",
52548
- "th"
52549
- ];
52550
- function getFirstDayManual(locale) {
52551
- try {
52552
- const intlLocale = new Intl.Locale(locale);
52553
- const language = intlLocale.language?.toLowerCase();
52554
- const region = intlLocale.region?.toUpperCase();
52555
- if (region) {
52556
- if (REGIONS_STARTING_SUNDAY.includes(region)) {
52557
- return 0;
52558
- }
52559
- if (REGIONS_STARTING_SATURDAY.includes(region)) {
52560
- return 6;
52561
- }
52562
- return DEFAULT_FIRST_DAY;
52578
+ function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
52579
+ return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
52580
+ }
52581
+ function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
52582
+ return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
52583
+ }
52584
+ function $ad063034c8620db8$var$timeToMs(a2) {
52585
+ return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
52586
+ }
52587
+ var $ad063034c8620db8$var$localTimeZone = null;
52588
+ var $ad063034c8620db8$var$localTimeZoneOverride = false;
52589
+ function $ad063034c8620db8$export$aa8b41735afcabd2() {
52590
+ if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
52591
+ return $ad063034c8620db8$var$localTimeZone;
52592
+ }
52593
+ function $ad063034c8620db8$export$6ab69b273755230b() {
52594
+ return $ad063034c8620db8$var$localTimeZoneOverride;
52595
+ }
52596
+
52597
+ // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
52598
+ function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
52599
+ date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52600
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
52601
+ return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
52602
+ }
52603
+ function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
52604
+ let date = /* @__PURE__ */ new Date();
52605
+ date.setUTCHours(hour, minute, second, millisecond);
52606
+ date.setUTCFullYear(year, month - 1, day);
52607
+ return date.getTime();
52608
+ }
52609
+ function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
52610
+ if (timeZone === "UTC") return 0;
52611
+ if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
52612
+ let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
52613
+ let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
52614
+ return utc2 - Math.floor(ms / 1e3) * 1e3;
52615
+ }
52616
+ var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
52617
+ function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
52618
+ let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
52619
+ if (!formatter) {
52620
+ formatter = new Intl.DateTimeFormat("en-US", {
52621
+ timeZone,
52622
+ hour12: false,
52623
+ era: "short",
52624
+ year: "numeric",
52625
+ month: "numeric",
52626
+ day: "numeric",
52627
+ hour: "numeric",
52628
+ minute: "numeric",
52629
+ second: "numeric"
52630
+ });
52631
+ $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
52632
+ }
52633
+ let parts = formatter.formatToParts(new Date(ms));
52634
+ let namedParts = {};
52635
+ for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
52636
+ return {
52637
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
52638
+ year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
52639
+ month: +namedParts.month,
52640
+ day: +namedParts.day,
52641
+ hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
52642
+ minute: +namedParts.minute,
52643
+ second: +namedParts.second
52644
+ };
52645
+ }
52646
+ var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
52647
+ function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
52648
+ let found = earlier === later ? [
52649
+ earlier
52650
+ ] : [
52651
+ earlier,
52652
+ later
52653
+ ];
52654
+ return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
52655
+ }
52656
+ function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
52657
+ let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
52658
+ 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;
52659
+ }
52660
+ function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
52661
+ let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
52662
+ if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52663
+ if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
52664
+ dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
52665
+ let date2 = /* @__PURE__ */ new Date();
52666
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
52667
+ date2.setFullYear(year, dateTime.month - 1, dateTime.day);
52668
+ date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
52669
+ return date2.getTime();
52670
+ }
52671
+ let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52672
+ let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52673
+ let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52674
+ let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
52675
+ if (valid.length === 1) return valid[0];
52676
+ if (valid.length > 1) switch (disambiguation) {
52677
+ // 'compatible' means 'earlier' for "fall back" transitions
52678
+ case "compatible":
52679
+ case "earlier":
52680
+ return valid[0];
52681
+ case "later":
52682
+ return valid[valid.length - 1];
52683
+ case "reject":
52684
+ throw new RangeError("Multiple possible absolute times found");
52685
+ }
52686
+ switch (disambiguation) {
52687
+ case "earlier":
52688
+ return Math.min(ms - offsetBefore, ms - offsetAfter);
52689
+ // 'compatible' means 'later' for "spring forward" transitions
52690
+ case "compatible":
52691
+ case "later":
52692
+ return Math.max(ms - offsetBefore, ms - offsetAfter);
52693
+ case "reject":
52694
+ throw new RangeError("No such absolute time found");
52695
+ }
52696
+ }
52697
+ function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
52698
+ return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
52699
+ }
52700
+ function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
52701
+ let hour = 0, minute = 0, second = 0, millisecond = 0;
52702
+ if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
52703
+ else if ("hour" in date && !time) return date;
52704
+ if (time) ({ hour, minute, second, millisecond } = time);
52705
+ return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
52706
+ }
52707
+ function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
52708
+ if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
52709
+ let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
52710
+ let copy = date.copy();
52711
+ copy.calendar = calendar;
52712
+ copy.era = calendarDate.era;
52713
+ copy.year = calendarDate.year;
52714
+ copy.month = calendarDate.month;
52715
+ copy.day = calendarDate.day;
52716
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
52717
+ return copy;
52718
+ }
52719
+ function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
52720
+ let mutableDate = date.copy();
52721
+ let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
52722
+ $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
52723
+ if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
52724
+ mutableDate.month += duration.months || 0;
52725
+ $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
52726
+ $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
52727
+ mutableDate.day += (duration.weeks || 0) * 7;
52728
+ mutableDate.day += duration.days || 0;
52729
+ mutableDate.day += days;
52730
+ $435a2ceaa8778ed8$var$balanceDay(mutableDate);
52731
+ if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
52732
+ if (mutableDate.year < 1) {
52733
+ mutableDate.year = 1;
52734
+ mutableDate.month = 1;
52735
+ mutableDate.day = 1;
52736
+ }
52737
+ let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
52738
+ if (mutableDate.year > maxYear) {
52739
+ let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
52740
+ mutableDate.year = maxYear;
52741
+ mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
52742
+ mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
52743
+ }
52744
+ if (mutableDate.month < 1) {
52745
+ mutableDate.month = 1;
52746
+ mutableDate.day = 1;
52747
+ }
52748
+ let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
52749
+ if (mutableDate.month > maxMonth) {
52750
+ mutableDate.month = maxMonth;
52751
+ mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
52752
+ }
52753
+ mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
52754
+ return mutableDate;
52755
+ }
52756
+ function $435a2ceaa8778ed8$var$addYears(date, years) {
52757
+ if (date.calendar.isInverseEra?.(date)) years = -years;
52758
+ date.year += years;
52759
+ }
52760
+ function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
52761
+ while (date.month < 1) {
52762
+ $435a2ceaa8778ed8$var$addYears(date, -1);
52763
+ date.month += date.calendar.getMonthsInYear(date);
52764
+ }
52765
+ let monthsInYear = 0;
52766
+ while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
52767
+ date.month -= monthsInYear;
52768
+ $435a2ceaa8778ed8$var$addYears(date, 1);
52769
+ }
52770
+ }
52771
+ function $435a2ceaa8778ed8$var$balanceDay(date) {
52772
+ while (date.day < 1) {
52773
+ date.month--;
52774
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52775
+ date.day += date.calendar.getDaysInMonth(date);
52776
+ }
52777
+ while (date.day > date.calendar.getDaysInMonth(date)) {
52778
+ date.day -= date.calendar.getDaysInMonth(date);
52779
+ date.month++;
52780
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52781
+ }
52782
+ }
52783
+ function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
52784
+ date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
52785
+ date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
52786
+ }
52787
+ function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
52788
+ if (date.calendar.constrainDate) date.calendar.constrainDate(date);
52789
+ date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
52790
+ $435a2ceaa8778ed8$var$constrainMonthDay(date);
52791
+ }
52792
+ function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
52793
+ let inverseDuration = {};
52794
+ for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
52795
+ return inverseDuration;
52796
+ }
52797
+ function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
52798
+ return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52799
+ }
52800
+ function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
52801
+ let mutableDate = date.copy();
52802
+ if (fields.era != null) mutableDate.era = fields.era;
52803
+ if (fields.year != null) mutableDate.year = fields.year;
52804
+ if (fields.month != null) mutableDate.month = fields.month;
52805
+ if (fields.day != null) mutableDate.day = fields.day;
52806
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
52807
+ return mutableDate;
52808
+ }
52809
+ function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
52810
+ let mutableValue = value.copy();
52811
+ if (fields.hour != null) mutableValue.hour = fields.hour;
52812
+ if (fields.minute != null) mutableValue.minute = fields.minute;
52813
+ if (fields.second != null) mutableValue.second = fields.second;
52814
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
52815
+ $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
52816
+ return mutableValue;
52817
+ }
52818
+ function $435a2ceaa8778ed8$var$balanceTime(time) {
52819
+ time.second += Math.floor(time.millisecond / 1e3);
52820
+ time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
52821
+ time.minute += Math.floor(time.second / 60);
52822
+ time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
52823
+ time.hour += Math.floor(time.minute / 60);
52824
+ time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
52825
+ let days = Math.floor(time.hour / 24);
52826
+ time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
52827
+ return days;
52828
+ }
52829
+ function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
52830
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
52831
+ time.second = Math.max(0, Math.min(time.second, 59));
52832
+ time.minute = Math.max(0, Math.min(time.minute, 59));
52833
+ time.hour = Math.max(0, Math.min(time.hour, 23));
52834
+ }
52835
+ function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
52836
+ let result2 = a2 % b;
52837
+ if (result2 < 0) result2 += b;
52838
+ return result2;
52839
+ }
52840
+ function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
52841
+ time.hour += duration.hours || 0;
52842
+ time.minute += duration.minutes || 0;
52843
+ time.second += duration.seconds || 0;
52844
+ time.millisecond += duration.milliseconds || 0;
52845
+ return $435a2ceaa8778ed8$var$balanceTime(time);
52846
+ }
52847
+ function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
52848
+ let res = time.copy();
52849
+ $435a2ceaa8778ed8$var$addTimeFields(res, duration);
52850
+ return res;
52851
+ }
52852
+ function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
52853
+ return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52854
+ }
52855
+ function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
52856
+ let mutable = value.copy();
52857
+ switch (field) {
52858
+ case "era": {
52859
+ let eras = value.calendar.getEras();
52860
+ let eraIndex = eras.indexOf(value.era);
52861
+ if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
52862
+ eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
52863
+ mutable.era = eras[eraIndex];
52864
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52865
+ break;
52563
52866
  }
52564
- if (language) {
52565
- if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
52566
- return 0;
52567
- }
52568
- if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
52569
- return 6;
52867
+ case "year":
52868
+ if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
52869
+ mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
52870
+ if (mutable.year === -Infinity) mutable.year = 1;
52871
+ if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
52872
+ break;
52873
+ case "month":
52874
+ mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
52875
+ break;
52876
+ case "day":
52877
+ mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
52878
+ break;
52879
+ default:
52880
+ throw new Error("Unsupported field " + field);
52881
+ }
52882
+ if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
52883
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52884
+ return mutable;
52885
+ }
52886
+ function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
52887
+ let mutable = value.copy();
52888
+ switch (field) {
52889
+ case "hour": {
52890
+ let hours = value.hour;
52891
+ let min4 = 0;
52892
+ let max4 = 23;
52893
+ if (options?.hourCycle === 12) {
52894
+ let isPM = hours >= 12;
52895
+ min4 = isPM ? 12 : 0;
52896
+ max4 = isPM ? 23 : 11;
52570
52897
  }
52898
+ mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
52899
+ break;
52571
52900
  }
52572
- return DEFAULT_FIRST_DAY;
52573
- } catch {
52574
- return DEFAULT_FIRST_DAY;
52901
+ case "minute":
52902
+ mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
52903
+ break;
52904
+ case "second":
52905
+ mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
52906
+ break;
52907
+ case "millisecond":
52908
+ mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
52909
+ break;
52910
+ default:
52911
+ throw new Error("Unsupported field " + field);
52912
+ }
52913
+ return mutable;
52914
+ }
52915
+ function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
52916
+ if (round) {
52917
+ value += Math.sign(amount);
52918
+ if (value < min4) value = max4;
52919
+ let div = Math.abs(amount);
52920
+ if (amount > 0) value = Math.ceil(value / div) * div;
52921
+ else value = Math.floor(value / div) * div;
52922
+ if (value > max4) value = min4;
52923
+ } else {
52924
+ value += amount;
52925
+ if (value < min4) value = max4 - (min4 - value - 1);
52926
+ else if (value > max4) value = min4 + (value - max4 - 1);
52575
52927
  }
52928
+ return value;
52576
52929
  }
52577
52930
 
52578
- // ../form-fields/dist/esm/ui/shared/headless-styles.js
52579
- var VISUALLY_HIDDEN_STYLE = {
52580
- position: "absolute",
52581
- width: 1,
52582
- height: 1,
52583
- margin: -1,
52584
- padding: 0,
52585
- border: 0,
52586
- clipPath: "inset(50%)",
52587
- overflow: "hidden",
52588
- whiteSpace: "nowrap"
52589
- };
52590
- var FIELDSET_RESET_STYLE = {
52591
- border: "none",
52592
- padding: 0,
52593
- margin: 0,
52594
- minWidth: 0
52595
- };
52596
- var AppointmentSlotPickerContext = createContext(void 0);
52597
- var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
52598
- var getDateTitleId = (inputId) => `${inputId}-date-title`;
52599
- var useAppointmentSlotPickerContext = () => {
52600
- const context = useContext(AppointmentSlotPickerContext);
52601
- if (typeof context === "undefined") {
52602
- throw new Error("Appointment parts must be used inside an <Appointment> component");
52931
+ // ../../node_modules/@internationalized/date/dist/private/string.mjs
52932
+ var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
52933
+ var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
52934
+ var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
52935
+ function $58246871e4652552$export$c9698ec7f05a07e1(value) {
52936
+ let m = value.match($58246871e4652552$var$TIME_RE);
52937
+ if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
52938
+ return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
52939
+ }
52940
+ function $58246871e4652552$export$6b862160d295c8e(value) {
52941
+ let m = value.match($58246871e4652552$var$DATE_RE);
52942
+ if (!m) {
52943
+ if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
52944
+ throw new Error("Invalid ISO 8601 date string: " + value);
52603
52945
  }
52604
- return context;
52605
- };
52946
+ let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
52947
+ date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
52948
+ return date;
52949
+ }
52950
+ function $58246871e4652552$var$parseNumber(value, min4, max4) {
52951
+ let val = Number(value);
52952
+ if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
52953
+ return val;
52954
+ }
52955
+ function $58246871e4652552$export$f59dee82248f5ad4(time) {
52956
+ return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
52957
+ }
52958
+ function $58246871e4652552$export$60dfd74aa96791bd(date) {
52959
+ let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52960
+ let year;
52961
+ if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
52962
+ else year = String(gregorianDate.year).padStart(4, "0");
52963
+ return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
52964
+ }
52965
+ function $58246871e4652552$export$4223de14708adc63(date) {
52966
+ return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
52967
+ }
52606
52968
 
52607
- // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
52608
- var useIsLocked = () => {
52609
- const { disabled, readOnly } = useFieldPropsV2();
52610
- return !!disabled || !!readOnly;
52611
- };
52612
- var Dates = ({ children, className }) => {
52613
- const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
52614
- const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
52615
- const headingElement = findChildOfType(children, Dates.Heading);
52616
- const nextWeekElement = findChildOfType(children, Dates.NextWeek);
52617
- const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178.createElement(Dates.Day, null);
52618
- const selectedKeys = useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
52619
- days
52620
- ]);
52621
- const isLocked = useIsLocked();
52622
- const disabledKeys = useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
52623
- days,
52624
- isLocked
52625
- ]);
52626
- const handleSelectionChange = (keys3) => {
52627
- if (keys3 === "all") {
52628
- return;
52629
- }
52630
- const [selectedKey] = [
52631
- ...keys3
52632
- ];
52633
- const day = days.find(({ key }) => key === selectedKey);
52634
- if (day) {
52635
- selectDate(day.date);
52636
- }
52637
- };
52638
- return /* @__PURE__ */ React178.createElement("div", {
52639
- className
52640
- }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178.createElement(ListBox, {
52641
- "aria-label": weekRangeLabel,
52642
- orientation: "horizontal",
52643
- selectionMode: "single",
52644
- selectedKeys,
52645
- disabledKeys,
52646
- onSelectionChange: handleSelectionChange
52647
- }, days.map((day) => applyInternalProps(dayElement, {
52648
- key: day.key,
52969
+ // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
52970
+ function $2aaf608024c21ca1$var$shiftArgs(args) {
52971
+ let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
52972
+ let era;
52973
+ if (typeof args[0] === "string") era = args.shift();
52974
+ else {
52975
+ let eras = calendar.getEras();
52976
+ era = eras[eras.length - 1];
52977
+ }
52978
+ let year = args.shift();
52979
+ let month = args.shift();
52980
+ let day = args.shift();
52981
+ return [
52982
+ calendar,
52983
+ era,
52984
+ year,
52985
+ month,
52649
52986
  day
52650
- }))));
52651
- };
52652
- var PreviousWeek = ({ children, className }) => {
52653
- const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
52654
- const isLocked = useIsLocked();
52655
- const buttonRef = useRef(null);
52656
- const wasPressedRef = useRef(false);
52657
- useEffect(() => {
52658
- if (canGoToPreviousWeek || !wasPressedRef.current) {
52659
- return;
52660
- }
52661
- wasPressedRef.current = false;
52662
- const activeElement = document.activeElement;
52663
- if (activeElement !== document.body && activeElement !== buttonRef.current) {
52664
- return;
52665
- }
52666
- const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
52667
- Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
52668
- }, [
52669
- canGoToPreviousWeek,
52670
- nextWeekLabel
52671
- ]);
52672
- return /* @__PURE__ */ React178.createElement(Button, {
52673
- ref: buttonRef,
52674
- className,
52675
- "aria-label": previousWeekLabel,
52676
- isDisabled: !canGoToPreviousWeek || isLocked,
52677
- onPress: () => {
52678
- wasPressedRef.current = true;
52679
- changeWeek(-1);
52680
- }
52681
- }, children ?? "\u2039");
52682
- };
52683
- var NextWeek = ({ children, className }) => {
52684
- const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
52685
- const isLocked = useIsLocked();
52686
- return /* @__PURE__ */ React178.createElement(Button, {
52687
- className,
52688
- "aria-label": nextWeekLabel,
52689
- isDisabled: isLocked,
52690
- onPress: () => changeWeek(1)
52691
- }, children ?? "\u203A");
52692
- };
52693
- var Heading2 = ({ children, className }) => {
52694
- const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
52695
- return /* @__PURE__ */ React178.createElement("span", {
52696
- className,
52697
- "aria-live": "polite"
52698
- }, children ? children({
52699
- label: weekCaptionLabel,
52700
- weekRange: weekRangeLabel
52701
- }) : /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("span", {
52702
- "aria-hidden": "true"
52703
- }, weekCaptionLabel), /* @__PURE__ */ React178.createElement("span", {
52704
- style: VISUALLY_HIDDEN_STYLE
52705
- }, weekRangeLabel)));
52706
- };
52707
- var Day = ({ children, className, ...internal }) => {
52708
- const { day } = internal;
52709
- return /* @__PURE__ */ React178.createElement(ListBoxItem, {
52710
- id: day.key,
52711
- className,
52712
- textValue: day.label,
52713
- "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
52714
- "data-available": day.isAvailable || void 0,
52715
- "data-today": day.isToday || void 0
52716
- }, children ? children({
52717
- ...day,
52718
- date: new Date(day.date)
52719
- }) : /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178.createElement("span", null, day.dayOfMonthLabel)));
52720
- };
52721
- Dates.PreviousWeek = PreviousWeek;
52722
- Dates.Heading = Heading2;
52723
- Dates.NextWeek = NextWeek;
52724
- Dates.Day = Day;
52725
- var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
52726
- var Slots = ({ children, className, ...internal }) => {
52727
- const { hasTimezoneNote, hasDateTitle } = internal;
52728
- const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
52729
- const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
52730
- const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
52731
- const groupRef = useRef(null);
52732
- const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178.createElement(Slots.Slot, null);
52733
- const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
52734
- const describedBy = [
52735
- ariaDescribedBy,
52736
- hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
52737
- ].filter(Boolean).join(" ") || void 0;
52738
- const focusSlotAt = (index2, options) => {
52739
- groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
52740
- };
52741
- useFocusFieldEvent(() => {
52742
- const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
52743
- if (hasSlots) {
52744
- focusSlotAt(0, {
52745
- preventScroll: true
52746
- });
52747
- return;
52748
- }
52749
- const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
52750
- const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
52751
- fallback?.focus({
52752
- preventScroll: true
52753
- });
52754
- }, fieldId);
52755
- useEffect(() => {
52756
- if (pendingFocusIndex === void 0) {
52757
- return;
52758
- }
52759
- focusSlotAt(pendingFocusIndex);
52760
- consumePendingFocusIndex();
52761
- }, [
52762
- pendingFocusIndex,
52763
- slots.length
52764
- ]);
52765
- return /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("div", {
52766
- role: "status",
52767
- style: VISUALLY_HIDDEN_STYLE
52768
- }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178.createElement(RadioGroup$1, {
52769
- ref: groupRef,
52770
- className,
52771
- value: selectedSlotKey ?? null,
52772
- onChange: selectSlot,
52773
- isDisabled: disabled,
52774
- isReadOnly: readOnly,
52775
- isRequired: required,
52776
- isInvalid: hasError,
52777
- "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
52778
- "aria-describedby": describedBy,
52779
- "data-refetch": isReloadingSlots || void 0
52780
- }, slots.map((slot) => applyInternalProps(slotElement, {
52781
- key: slot.key,
52782
- slot
52783
- }))));
52784
- };
52785
- var Slot = ({ children, className, ...internal }) => {
52786
- const { slot } = internal;
52787
- return /* @__PURE__ */ React178.createElement(RadioField, {
52788
- value: slot.key,
52789
- "aria-label": slot.timeRange
52790
- }, /* @__PURE__ */ React178.createElement(RadioButton, {
52791
- className
52792
- }, children ? children(slot) : slot.timeRange));
52987
+ ];
52988
+ }
52989
+ var _type;
52990
+ var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
52991
+ constructor(...args) {
52992
+ // This prevents TypeScript from allowing other types with the same fields to match.
52993
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
52994
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
52995
+ // @ts-ignore
52996
+ __privateAdd(this, _type);
52997
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
52998
+ this.calendar = calendar;
52999
+ this.era = era;
53000
+ this.year = year;
53001
+ this.month = month;
53002
+ this.day = day;
53003
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
53004
+ }
53005
+ /** Returns a copy of this date. */
53006
+ copy() {
53007
+ if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
53008
+ else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
53009
+ }
53010
+ /** Returns a new `CalendarDate` with the given duration added to it. */
53011
+ add(duration) {
53012
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53013
+ }
53014
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */
53015
+ subtract(duration) {
53016
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53017
+ }
53018
+ /**
53019
+ * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
53020
+ * will be constrained accordingly.
53021
+ */
53022
+ set(fields) {
53023
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
53024
+ }
53025
+ /**
53026
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
53027
+ * When the resulting value reaches the limits of the field, it wraps around.
53028
+ */
53029
+ cycle(field, amount, options) {
53030
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53031
+ }
53032
+ /**
53033
+ * Converts the date to a native JavaScript Date object, with the time set to midnight in the
53034
+ * given time zone.
53035
+ */
53036
+ toDate(timeZone) {
53037
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
53038
+ }
53039
+ /** Converts the date to an ISO 8601 formatted string. */
53040
+ toString() {
53041
+ return ($58246871e4652552$export$60dfd74aa96791bd)(this);
53042
+ }
53043
+ /**
53044
+ * Compares this date with another. A negative result indicates that this date is before the given
53045
+ * one, and a positive date indicates that it is after.
53046
+ */
53047
+ compare(b) {
53048
+ return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53049
+ }
52793
53050
  };
52794
- Slots.Slot = Slot;
52795
- var import_cloneDeep = __toESM(require_cloneDeep());
52796
- var createIndicatorNode = (requiredIndicatorType, t, className) => {
52797
- const indicator = requiredIndicatorType === RequiredIndicator$1.TEXT ? t("settings.required-indicator-text") : "*";
52798
- const str = (v) => ({
52799
- stringValue: v
52800
- });
52801
- const fields = {
52802
- "aria-hidden": str("true")
52803
- };
52804
- if (className) {
52805
- fields.className = str(className);
53051
+ _type = new WeakMap();
53052
+ var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
53053
+ var _type2;
53054
+ var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
53055
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
53056
+ // This prevents TypeScript from allowing other types with the same fields to match.
53057
+ // @ts-ignore
53058
+ __privateAdd(this, _type2);
53059
+ this.hour = hour;
53060
+ this.minute = minute;
53061
+ this.second = second;
53062
+ this.millisecond = millisecond;
53063
+ ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
53064
+ }
53065
+ /** Returns a copy of this time. */
53066
+ copy() {
53067
+ return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
53068
+ }
53069
+ /** Returns a new `Time` with the given duration added to it. */
53070
+ add(duration) {
53071
+ return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
53072
+ }
53073
+ /** Returns a new `Time` with the given duration subtracted from it. */
53074
+ subtract(duration) {
53075
+ return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
53076
+ }
53077
+ /**
53078
+ * Returns a new `Time` with the given fields set to the provided values. Other fields will be
53079
+ * constrained accordingly.
53080
+ */
53081
+ set(fields) {
53082
+ return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
53083
+ }
53084
+ /**
53085
+ * Returns a new `Time` with the given field adjusted by a specified amount.
53086
+ * When the resulting value reaches the limits of the field, it wraps around.
53087
+ */
53088
+ cycle(field, amount, options) {
53089
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
53090
+ }
53091
+ /** Converts the time to an ISO 8601 formatted string. */
53092
+ toString() {
53093
+ return ($58246871e4652552$export$f59dee82248f5ad4)(this);
53094
+ }
53095
+ /**
53096
+ * Compares this time with another. A negative result indicates that this time is before the given
53097
+ * one, and a positive time indicates that it is after.
53098
+ */
53099
+ compare(b) {
53100
+ return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
52806
53101
  }
52807
- return {
52808
- type: Node_Type.EXTERNAL,
52809
- id: "",
52810
- nodes: [],
52811
- externalData: {
52812
- fields
52813
- },
52814
- textData: {
52815
- text: indicator,
52816
- decorations: []
52817
- }
52818
- };
52819
53102
  };
52820
- var injectRequiredIndicator = (label, placement, indicatorNode) => {
52821
- const result2 = (0, import_cloneDeep.default)(label);
52822
- switch (placement) {
52823
- case RequiredIndicatorPlacement$1.BEFORE_FIELD_TITLE:
52824
- const firstNode = result2?.nodes.find(Boolean);
52825
- if (firstNode) {
52826
- firstNode.nodes ?? (firstNode.nodes = []);
52827
- firstNode.nodes.unshift(indicatorNode);
52828
- }
52829
- break;
52830
- case RequiredIndicatorPlacement$1.AFTER_FIELD_TITLE:
52831
- const lastNode = result2?.nodes?.findLast(Boolean);
52832
- if (lastNode) {
52833
- lastNode.nodes ?? (lastNode.nodes = []);
52834
- lastNode.nodes.push(indicatorNode);
52835
- }
52836
- break;
53103
+ _type2 = new WeakMap();
53104
+ var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
53105
+ var _type3;
53106
+ var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
53107
+ constructor(...args) {
53108
+ // This prevents TypeScript from allowing other types with the same fields to match.
53109
+ // @ts-ignore
53110
+ __privateAdd(this, _type3);
53111
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
53112
+ this.calendar = calendar;
53113
+ this.era = era;
53114
+ this.year = year;
53115
+ this.month = month;
53116
+ this.day = day;
53117
+ this.hour = args.shift() || 0;
53118
+ this.minute = args.shift() || 0;
53119
+ this.second = args.shift() || 0;
53120
+ this.millisecond = args.shift() || 0;
53121
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
52837
53122
  }
52838
- return result2;
52839
- };
52840
- var stopLinkEventPropagation = (event) => {
52841
- if (event.target instanceof Element && event.target.closest("a")) {
52842
- event.stopPropagation();
53123
+ /** Returns a copy of this date. */
53124
+ copy() {
53125
+ if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
53126
+ else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
52843
53127
  }
52844
- };
52845
- var LINK_EVENT_HANDLERS = {
52846
- onPointerDown: stopLinkEventPropagation,
52847
- onMouseDown: stopLinkEventPropagation,
52848
- onClick: stopLinkEventPropagation
52849
- };
52850
- var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
52851
- const { requiredIndicatorHidden = false, leadingElement } = internal;
52852
- const fieldProps = useFieldPropsV2();
52853
- const { label, required = false, disabled = false, requiredIndicatorType = RequiredIndicator$1.ASTERISK, requiredIndicatorPlacement = RequiredIndicatorPlacement$1.AFTER_FIELD_TITLE } = fieldProps;
52854
- const { t } = useTranslation2();
52855
- const { language } = useConfig();
52856
- const labelWithIndicator = useMemo(() => {
52857
- if (!required || requiredIndicatorHidden || !label) {
52858
- return label;
53128
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */
53129
+ add(duration) {
53130
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53131
+ }
53132
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
53133
+ subtract(duration) {
53134
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53135
+ }
53136
+ /**
53137
+ * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
53138
+ * will be constrained accordingly.
53139
+ */
53140
+ set(fields) {
53141
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
53142
+ }
53143
+ /**
53144
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
53145
+ * When the resulting value reaches the limits of the field, it wraps around.
53146
+ */
53147
+ cycle(field, amount, options) {
53148
+ switch (field) {
53149
+ case "era":
53150
+ case "year":
53151
+ case "month":
53152
+ case "day":
53153
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53154
+ default:
53155
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
52859
53156
  }
52860
- const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
52861
- return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
52862
- }, [
52863
- required,
52864
- requiredIndicatorHidden,
52865
- label,
52866
- requiredIndicatorType,
52867
- requiredIndicatorPlacement,
52868
- t,
52869
- requiredClassName
52870
- ]);
52871
- return /* @__PURE__ */ React178.createElement("div", {
52872
- className,
52873
- ...disabled ? {} : LINK_EVENT_HANDLERS
52874
- }, leadingElement, children({
52875
- content: labelWithIndicator,
52876
- locale: language,
52877
- htmlAttributesPlugin
52878
- }));
52879
- };
52880
- var SelectionIndicator = ({ className, ...internal }) => {
52881
- const state = internal;
52882
- return /* @__PURE__ */ React178.createElement("div", {
52883
- "aria-hidden": "true",
52884
- className: typeof className === "function" ? className(state) : className
52885
- });
52886
- };
52887
-
52888
- // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
52889
- var Checkbox = ({ children }) => {
52890
- const { id: id6, FieldLayout } = useFieldPropsV2();
52891
- const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
52892
- const descriptionElement = findChildOfType(children, Checkbox.Description);
52893
- const errorElement = findChildOfType(children, Checkbox.Error);
52894
- return /* @__PURE__ */ React178.createElement(FieldLayout, {
52895
- fieldId: id6,
52896
- renderLabel: () => null,
52897
- renderInput: () => checkboxElement,
52898
- renderDescription: () => /* @__PURE__ */ React178.createElement(React178.Fragment, null, errorElement, descriptionElement)
52899
- });
52900
- };
52901
- var CheckboxContainer = ({ children, className }) => {
52902
- const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
52903
- const { inputId, ariaDescribedBy } = useFieldAttributes();
52904
- const ref = useRef(null);
52905
- useFocusFieldEvent(() => {
52906
- ref.current?.focus({
52907
- preventScroll: true
52908
- });
52909
- }, id6);
52910
- useKeepPrehydrationValue(ref);
52911
- const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
52912
- const inputElement = findChildOfType(children, CheckboxContainer.Input);
52913
- const handleChange = useCallback((isSelected) => {
52914
- onChange(isSelected);
52915
- }, [
52916
- onChange
52917
- ]);
52918
- return /* @__PURE__ */ React178.createElement(CheckboxField, {
52919
- id: inputId,
52920
- "aria-describedby": ariaDescribedBy,
52921
- isSelected: Boolean(value),
52922
- onChange: handleChange,
52923
- isDisabled: disabled,
52924
- isReadOnly: readOnly,
52925
- isRequired: required,
52926
- isInvalid: hasError,
52927
- onBlur,
52928
- onFocus
52929
- }, /* @__PURE__ */ React178.createElement(CheckboxButton, {
52930
- ref,
52931
- className
52932
- }, ({ isSelected, isHovered, isFocused }) => {
52933
- const input = applyInternalProps(inputElement, {
52934
- isSelected,
52935
- isHovered,
52936
- isFocused
52937
- });
52938
- return labelElement ? applyInternalProps(labelElement, {
52939
- leadingElement: input
52940
- }) : input;
52941
- }));
53157
+ }
53158
+ /** Converts the date to a native JavaScript Date object in the given time zone. */
53159
+ toDate(timeZone, disambiguation) {
53160
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
53161
+ }
53162
+ /** Converts the date to an ISO 8601 formatted string. */
53163
+ toString() {
53164
+ return ($58246871e4652552$export$4223de14708adc63)(this);
53165
+ }
53166
+ /**
53167
+ * Compares this date with another. A negative result indicates that this date is before the given
53168
+ * one, and a positive date indicates that it is after.
53169
+ */
53170
+ compare(b) {
53171
+ let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53172
+ if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
53173
+ return res;
53174
+ }
52942
53175
  };
52943
- CheckboxContainer.RichTextLabel = RichTextLabel;
52944
- CheckboxContainer.Input = SelectionIndicator;
52945
- Checkbox.Checkbox = CheckboxContainer;
52946
- Checkbox.Description = Description;
52947
- Checkbox.Error = Error2;
53176
+ _type3 = new WeakMap();
53177
+ var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
52948
53178
 
52949
- // ../../node_modules/ts-debounce/dist/src/index.esm.js
52950
- function r(r3, e, n) {
52951
- var i, t, o;
52952
- void 0 === n && (n = {});
52953
- var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
52954
- function f() {
52955
- if (void 0 !== c) {
52956
- var r4 = Date.now() - v;
52957
- if (r4 + e >= c) return c - r4;
53179
+ // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
53180
+ var DEFAULT_FIRST_DAY = 1;
53181
+ function getFirstDayOfTheWeek(locale) {
53182
+ try {
53183
+ const intlLocale = new Intl.Locale(locale);
53184
+ if (typeof intlLocale.getWeekInfo === "function") {
53185
+ const firstDay = intlLocale.getWeekInfo().firstDay;
53186
+ if (firstDay !== void 0) {
53187
+ return firstDay === 7 ? 0 : firstDay;
53188
+ }
52958
53189
  }
52959
- return e;
53190
+ return getFirstDayManual(locale);
53191
+ } catch {
53192
+ return getFirstDayManual(locale);
52960
53193
  }
52961
- var d = function() {
52962
- var e2 = [].slice.call(arguments), n2 = this;
52963
- return new Promise(function(i2, t2) {
52964
- var c2 = a2 && void 0 === o;
52965
- if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
52966
- if (o = void 0, v = Date.now(), !a2) {
52967
- var i3 = r3.apply(n2, e2);
52968
- u && u(i3), l.forEach(function(r4) {
52969
- return (0, r4.resolve)(i3);
52970
- }), l = [];
52971
- }
52972
- }, f()), c2) {
52973
- var d2 = r3.apply(n2, e2);
52974
- return u && u(d2), i2(d2);
53194
+ }
53195
+ var REGIONS_STARTING_SATURDAY = [
53196
+ "AF",
53197
+ "BH",
53198
+ "DJ",
53199
+ "DZ",
53200
+ "EG",
53201
+ "IQ",
53202
+ "IR",
53203
+ "JO",
53204
+ "KW",
53205
+ "LY",
53206
+ "OM",
53207
+ "QA",
53208
+ "SD",
53209
+ "SY"
53210
+ ];
53211
+ var REGIONS_STARTING_SUNDAY = [
53212
+ "AG",
53213
+ "AS",
53214
+ "BD",
53215
+ "BR",
53216
+ "BS",
53217
+ "BT",
53218
+ "BW",
53219
+ "BZ",
53220
+ "CA",
53221
+ "CO",
53222
+ "DM",
53223
+ "DO",
53224
+ "ET",
53225
+ "GT",
53226
+ "GU",
53227
+ "HK",
53228
+ "HN",
53229
+ "ID",
53230
+ "IL",
53231
+ "IN",
53232
+ "IS",
53233
+ "JM",
53234
+ "JP",
53235
+ "KE",
53236
+ "KH",
53237
+ "KR",
53238
+ "LA",
53239
+ "MH",
53240
+ "MM",
53241
+ "MO",
53242
+ "MT",
53243
+ "MX",
53244
+ "MZ",
53245
+ "NI",
53246
+ "NP",
53247
+ "PA",
53248
+ "PE",
53249
+ "PH",
53250
+ "PK",
53251
+ "PR",
53252
+ "PT",
53253
+ "PY",
53254
+ "SA",
53255
+ "SG",
53256
+ "SV",
53257
+ "TH",
53258
+ "TT",
53259
+ "TW",
53260
+ "UM",
53261
+ "US",
53262
+ "VE",
53263
+ "VI",
53264
+ "WS",
53265
+ "YE",
53266
+ "ZA",
53267
+ "ZW"
53268
+ ];
53269
+ var LANGUAGES_STARTING_SATURDAY = [
53270
+ "ar"
53271
+ ];
53272
+ var LANGUAGES_STARTING_SUNDAY = [
53273
+ "en",
53274
+ "he",
53275
+ "hi",
53276
+ "id",
53277
+ "ja",
53278
+ "ko",
53279
+ "pt",
53280
+ "tl",
53281
+ "th"
53282
+ ];
53283
+ function getFirstDayManual(locale) {
53284
+ try {
53285
+ const intlLocale = new Intl.Locale(locale);
53286
+ const language = intlLocale.language?.toLowerCase();
53287
+ const region = intlLocale.region?.toUpperCase();
53288
+ if (region) {
53289
+ if (REGIONS_STARTING_SUNDAY.includes(region)) {
53290
+ return 0;
52975
53291
  }
52976
- l.push({ resolve: i2, reject: t2 });
52977
- });
52978
- };
52979
- return d.cancel = function(r4) {
52980
- void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
52981
- return (0, e2.reject)(r4);
52982
- }), l = [];
52983
- }, d;
53292
+ if (REGIONS_STARTING_SATURDAY.includes(region)) {
53293
+ return 6;
53294
+ }
53295
+ return DEFAULT_FIRST_DAY;
53296
+ }
53297
+ if (language) {
53298
+ if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
53299
+ return 0;
53300
+ }
53301
+ if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
53302
+ return 6;
53303
+ }
53304
+ }
53305
+ return DEFAULT_FIRST_DAY;
53306
+ } catch {
53307
+ return DEFAULT_FIRST_DAY;
53308
+ }
52984
53309
  }
52985
53310
 
52986
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
52987
- var OTHER_ID = "Other";
52988
- var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
52989
- var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
52990
- var getOtherLabel = (addOtherLabel, t) => {
52991
- const otherLabelDefault = t?.("add-other.default-other-option-label");
52992
- return addOtherLabel || otherLabelDefault || OTHER_ID;
52993
- };
52994
- var getOtherValue = (value, addOtherLabel) => {
52995
- const addedSymbolsLength = 2;
52996
- const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
52997
- const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
52998
- return otherItem.slice(otherLabelLength);
52999
- };
53000
- var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
53001
-
53002
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
53003
- var CheckboxGroup = ({ children, className }) => {
53004
- const props2 = useFieldPropsV2();
53005
- const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
53006
- const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
53007
- const groupRef = useRef(null);
53008
- useKeepPrehydrationValue(groupRef);
53009
- const labelElement = findChildOfType(children, CheckboxGroup.Label);
53010
- const optionsElement = findChildOfType(children, CheckboxGroup.Options);
53011
- const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
53012
- const errorElement = findChildOfType(children, CheckboxGroup.Error);
53013
- const _value = useMemo(() => value || [], [
53014
- value
53015
- ]);
53016
- const handleChange = useCallback((newValue) => {
53017
- onChange?.(newValue);
53018
- }, [
53019
- onChange
53020
- ]);
53021
- return /* @__PURE__ */ React178.createElement(FieldLayout, {
53022
- fieldId: id6,
53023
- renderLabel: () => labelElement,
53024
- renderInput: () => /* @__PURE__ */ React178.createElement(FieldsetHeadless, {
53025
- id: inputId,
53026
- ariaLabelledBy: labelId,
53027
- ariaDescribedBy,
53028
- required,
53029
- onBlur,
53030
- onFocus
53031
- }, /* @__PURE__ */ React178.createElement(CheckboxGroup$1, {
53032
- ref: groupRef,
53033
- className,
53034
- "aria-labelledby": labelId,
53035
- value: _value,
53036
- onChange: handleChange,
53037
- isDisabled: disabled,
53038
- isRequired: required,
53039
- isInvalid: hasError
53040
- }, optionsElement)),
53041
- renderDescription: () => /* @__PURE__ */ React178.createElement(React178.Fragment, null, errorElement, descriptionElement)
53042
- });
53311
+ // ../form-fields/dist/esm/ui/shared/headless-styles.js
53312
+ var VISUALLY_HIDDEN_STYLE = {
53313
+ position: "absolute",
53314
+ width: 1,
53315
+ height: 1,
53316
+ margin: -1,
53317
+ padding: 0,
53318
+ border: 0,
53319
+ clipPath: "inset(50%)",
53320
+ overflow: "hidden",
53321
+ whiteSpace: "nowrap"
53043
53322
  };
53044
- var Options = ({ children, className }) => {
53045
- const props2 = useFieldPropsV2();
53046
- const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53047
- const { t } = useTranslation2();
53048
- const optionElement = findChildOfType(children, Options.Option);
53049
- const otherLabel = getOtherLabel(addOtherLabel, t);
53050
- return /* @__PURE__ */ React178.createElement("div", {
53051
- className,
53052
- "data-columns": numberOfColumns
53053
- }, options?.map((option2, index2) => {
53054
- const checkboxValue = option2.value ?? option2.label;
53055
- return applyInternalProps(optionElement, {
53056
- key: option2.id || option2.label,
53057
- value: checkboxValue,
53058
- label: option2.label,
53059
- isFirst: index2 === 0,
53060
- fieldId: id6
53061
- });
53062
- }), addOther && applyInternalProps(optionElement, {
53063
- key: OTHER_ID,
53064
- value: OTHER_ID,
53065
- label: otherLabel,
53066
- isOther: true
53067
- }));
53323
+ var FIELDSET_RESET_STYLE = {
53324
+ border: "none",
53325
+ padding: 0,
53326
+ margin: 0,
53327
+ minWidth: 0
53068
53328
  };
53069
- var OptionLabel = ({ className, ...internal }) => {
53070
- const { label } = internal;
53071
- return /* @__PURE__ */ React178.createElement("span", {
53072
- className
53073
- }, label);
53329
+ var AppointmentSlotPickerContext = createContext(void 0);
53330
+ var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
53331
+ var getDateTitleId = (inputId) => `${inputId}-date-title`;
53332
+ var useAppointmentSlotPickerContext = () => {
53333
+ const context = useContext(AppointmentSlotPickerContext);
53334
+ if (typeof context === "undefined") {
53335
+ throw new Error("Appointment parts must be used inside an <Appointment> component");
53336
+ }
53337
+ return context;
53074
53338
  };
53075
- var Checkbox2 = ({ children, className, ...internal }) => {
53076
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53077
- const props2 = useFieldPropsV2();
53078
- const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53079
- const checkboxRef = useRef(null);
53080
- useFocusFieldEvent(() => {
53081
- if (isFirst) {
53082
- checkboxRef.current?.focus({
53083
- preventScroll: true
53084
- });
53085
- }
53086
- }, fieldId);
53087
- const labelElement = findChildOfType(children, Checkbox2.Label);
53088
- const inputElement = findChildOfType(children, Checkbox2.Input);
53089
- const _value = useMemo(() => fieldValue || [], [
53090
- fieldValue
53091
- ]);
53092
- const actualValue = useMemo(() => {
53093
- if (isOther) {
53094
- return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53095
- }
53096
- return value;
53097
- }, [
53098
- isOther,
53099
- _value,
53100
- label,
53101
- value
53102
- ]);
53103
- const handleOtherCheckboxChange = useCallback((isSelected) => {
53104
- if (!isOther) {
53105
- return;
53106
- }
53107
- const optionsValues = getOptionsValues(options || []);
53108
- const removedOther = _value.filter((val) => optionsValues.includes(val));
53109
- const newValue = isSelected ? [
53110
- ...removedOther,
53111
- label
53112
- ] : removedOther;
53113
- onChange?.(newValue);
53114
- }, [
53115
- isOther,
53116
- label,
53117
- onChange,
53118
- options,
53119
- _value
53120
- ]);
53121
- return /* @__PURE__ */ React178.createElement(CheckboxField, {
53122
- value: actualValue,
53123
- onChange: isOther ? handleOtherCheckboxChange : void 0,
53124
- isDisabled: disabled,
53125
- isReadOnly: readOnly,
53126
- isInvalid: hasError
53127
- }, /* @__PURE__ */ React178.createElement(CheckboxButton, {
53128
- ref: checkboxRef,
53129
- className,
53130
- "data-hook": `checkbox-${label}`
53131
- }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178.createElement(React178.Fragment, null, applyInternalProps(inputElement, {
53132
- isSelected,
53133
- isHovered,
53134
- isFocused
53135
- }), applyInternalProps(labelElement, {
53136
- label
53137
- }))));
53339
+
53340
+ // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
53341
+ var useIsLocked = () => {
53342
+ const { disabled, readOnly } = useFieldPropsV2();
53343
+ return !!disabled || !!readOnly;
53138
53344
  };
53139
- Checkbox2.Label = OptionLabel;
53140
- Checkbox2.Input = SelectionIndicator;
53141
- var Option = ({ children, ...internal }) => {
53142
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53143
- const props2 = useFieldPropsV2();
53144
- const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53145
- const checkboxElement = findChildOfType(children, Checkbox2);
53146
- const otherInputElement = findChildOfType(children, OtherInput);
53147
- const _value = useMemo(() => fieldValue || [], [
53148
- fieldValue
53345
+ var Dates = ({ children, className }) => {
53346
+ const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
53347
+ const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
53348
+ const headingElement = findChildOfType(children, Dates.Heading);
53349
+ const nextWeekElement = findChildOfType(children, Dates.NextWeek);
53350
+ const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178.createElement(Dates.Day, null);
53351
+ const selectedKeys = useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
53352
+ days
53149
53353
  ]);
53150
- const isOtherSelected = useMemo(() => {
53151
- if (!isOther) {
53152
- return false;
53153
- }
53154
- const optionsValues = getOptionsValues(options || []);
53155
- return getIsOtherOptionSelected(_value, optionsValues);
53156
- }, [
53157
- isOther,
53158
- _value,
53159
- options
53354
+ const isLocked = useIsLocked();
53355
+ const disabledKeys = useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
53356
+ days,
53357
+ isLocked
53160
53358
  ]);
53161
- return /* @__PURE__ */ React178.createElement(React178.Fragment, null, applyInternalProps(checkboxElement, {
53162
- value,
53163
- label,
53164
- isFirst,
53165
- isOther,
53166
- fieldId
53167
- }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53168
- fieldValue: _value,
53169
- onChange,
53170
- label,
53171
- placeholder: addOtherPlaceholder,
53172
- maxLength: otherInputCharacterLimit,
53173
- disabled,
53174
- readOnly,
53175
- hasError,
53176
- ariaLabel: label,
53177
- addOtherLabel: label,
53178
- options
53179
- }));
53359
+ const handleSelectionChange = (keys3) => {
53360
+ if (keys3 === "all") {
53361
+ return;
53362
+ }
53363
+ const [selectedKey] = [
53364
+ ...keys3
53365
+ ];
53366
+ const day = days.find(({ key }) => key === selectedKey);
53367
+ if (day) {
53368
+ selectDate(day.date);
53369
+ }
53370
+ };
53371
+ return /* @__PURE__ */ React178.createElement("div", {
53372
+ className
53373
+ }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178.createElement(ListBox, {
53374
+ "aria-label": weekRangeLabel,
53375
+ orientation: "horizontal",
53376
+ selectionMode: "single",
53377
+ selectedKeys,
53378
+ disabledKeys,
53379
+ onSelectionChange: handleSelectionChange
53380
+ }, days.map((day) => applyInternalProps(dayElement, {
53381
+ key: day.key,
53382
+ day
53383
+ }))));
53180
53384
  };
53181
- var OtherInput = ({ className, inputClassName, ...internal }) => {
53182
- const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53183
- const [otherValue, setOtherValue] = useState(() => {
53184
- const optionsValues = getOptionsValues(options || []);
53185
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53186
- return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53187
- });
53385
+ var PreviousWeek = ({ children, className }) => {
53386
+ const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
53387
+ const isLocked = useIsLocked();
53388
+ const buttonRef = useRef(null);
53389
+ const wasPressedRef = useRef(false);
53188
53390
  useEffect(() => {
53189
- const optionsValues = getOptionsValues(options || []);
53190
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53191
- setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53192
- }, [
53193
- fieldValue,
53194
- options,
53195
- addOtherLabel
53196
- ]);
53197
- const debouncedHandleChange = useMemo(() => {
53198
- return r((input) => {
53199
- const optionsValues = getOptionsValues(options || []);
53200
- const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53201
- const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53202
- const newValue = [
53203
- ...removedOther,
53204
- _otherValue
53205
- ];
53206
- onChange(newValue);
53207
- }, 500);
53208
- }, [
53209
- onChange,
53210
- options,
53211
- fieldValue,
53212
- addOtherLabel,
53213
- label
53214
- ]);
53215
- const handleInputChange = useCallback((input) => {
53216
- setOtherValue(input);
53217
- debouncedHandleChange(input);
53391
+ if (canGoToPreviousWeek || !wasPressedRef.current) {
53392
+ return;
53393
+ }
53394
+ wasPressedRef.current = false;
53395
+ const activeElement = document.activeElement;
53396
+ if (activeElement !== document.body && activeElement !== buttonRef.current) {
53397
+ return;
53398
+ }
53399
+ const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
53400
+ Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
53218
53401
  }, [
53219
- debouncedHandleChange
53402
+ canGoToPreviousWeek,
53403
+ nextWeekLabel
53220
53404
  ]);
53221
- return /* @__PURE__ */ React178.createElement(TextField, {
53222
- "aria-label": ariaLabel,
53223
- value: otherValue,
53224
- onChange: handleInputChange,
53225
- isDisabled: disabled,
53226
- isReadOnly: readOnly,
53227
- isInvalid: hasError,
53228
- className
53229
- }, /* @__PURE__ */ React178.createElement(Input, {
53230
- className: inputClassName,
53231
- placeholder,
53232
- maxLength,
53233
- "aria-label": ariaLabel
53234
- }));
53235
- };
53236
- CheckboxGroup.Label = Label;
53237
- CheckboxGroup.Options = Options;
53238
- Options.Option = Option;
53239
- Option.Checkbox = Checkbox2;
53240
- Option.OtherInput = OtherInput;
53241
- CheckboxGroup.Description = Description;
53242
- CheckboxGroup.Error = Error2;
53243
-
53244
- // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53245
- function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53246
- if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53247
- preventScroll: true
53248
- });
53249
- else {
53250
- let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53251
- element.focus();
53252
- $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
53253
- }
53254
- }
53255
- var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53256
- function $1969ac565cfec8d0$var$supportsPreventScroll() {
53257
- if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53258
- $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
53259
- try {
53260
- let focusElem = document.createElement("div");
53261
- focusElem.focus({
53262
- get preventScroll() {
53263
- $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
53264
- return true;
53265
- }
53266
- });
53267
- } catch {
53405
+ return /* @__PURE__ */ React178.createElement(Button, {
53406
+ ref: buttonRef,
53407
+ className,
53408
+ "aria-label": previousWeekLabel,
53409
+ isDisabled: !canGoToPreviousWeek || isLocked,
53410
+ onPress: () => {
53411
+ wasPressedRef.current = true;
53412
+ changeWeek(-1);
53268
53413
  }
53269
- }
53270
- return $1969ac565cfec8d0$var$supportsPreventScrollCached;
53271
- }
53272
- function $1969ac565cfec8d0$var$getScrollableElements(element) {
53273
- let parent = element.parentNode;
53274
- let scrollableElements = [];
53275
- let rootScrollingElement = document.scrollingElement || document.documentElement;
53276
- while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
53277
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
53278
- element: parent,
53279
- scrollTop: parent.scrollTop,
53280
- scrollLeft: parent.scrollLeft
53281
- });
53282
- parent = parent.parentNode;
53283
- }
53284
- if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
53285
- element: rootScrollingElement,
53286
- scrollTop: rootScrollingElement.scrollTop,
53287
- scrollLeft: rootScrollingElement.scrollLeft
53288
- });
53289
- return scrollableElements;
53290
- }
53291
- function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
53292
- for (let { element, scrollTop, scrollLeft } of scrollableElements) {
53293
- element.scrollTop = scrollTop;
53294
- element.scrollLeft = scrollLeft;
53295
- }
53296
- }
53297
-
53298
- // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
53299
- var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
53300
- if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
53301
- if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
53302
- return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
53414
+ }, children ?? "\u2039");
53303
53415
  };
53304
- var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
53305
- let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
53306
- return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
53416
+ var NextWeek = ({ children, className }) => {
53417
+ const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
53418
+ const isLocked = useIsLocked();
53419
+ return /* @__PURE__ */ React178.createElement(Button, {
53420
+ className,
53421
+ "aria-label": nextWeekLabel,
53422
+ isDisabled: isLocked,
53423
+ onPress: () => changeWeek(1)
53424
+ }, children ?? "\u203A");
53307
53425
  };
53308
- function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
53309
- return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
53310
- }
53311
- function $d447af545b77c9f1$var$isWindow(value) {
53312
- return typeof value === "object" && value != null && "window" in value && value.window === value;
53313
- }
53314
- function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
53315
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
53316
- }
53317
- function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
53318
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
53319
- }
53320
-
53321
- // ../../node_modules/react-stately/dist/private/flags/flags.mjs
53322
- var $6a20a7989e6c817a$var$_shadowDOM = false;
53323
- function $6a20a7989e6c817a$export$98658e8c59125e6a() {
53324
- return $6a20a7989e6c817a$var$_shadowDOM;
53325
- }
53326
-
53327
- // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
53328
- function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
53329
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
53330
- if (!node || !otherNode) return false;
53331
- let currentNode = otherNode;
53332
- while (currentNode !== null) {
53333
- if (currentNode === node) return true;
53334
- if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
53335
- currentNode = currentNode.assignedSlot.parentNode;
53336
- else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
53337
- currentNode = currentNode.host;
53338
- else currentNode = currentNode.parentNode;
53339
- }
53340
- return false;
53341
- }
53342
- var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
53343
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
53344
- let activeElement = doc.activeElement;
53345
- while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
53346
- return activeElement;
53426
+ var Heading2 = ({ children, className }) => {
53427
+ const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
53428
+ return /* @__PURE__ */ React178.createElement("span", {
53429
+ className,
53430
+ "aria-live": "polite"
53431
+ }, children ? children({
53432
+ label: weekCaptionLabel,
53433
+ weekRange: weekRangeLabel
53434
+ }) : /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("span", {
53435
+ "aria-hidden": "true"
53436
+ }, weekCaptionLabel), /* @__PURE__ */ React178.createElement("span", {
53437
+ style: VISUALLY_HIDDEN_STYLE
53438
+ }, weekRangeLabel)));
53347
53439
  };
53348
- function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
53349
- if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
53350
- if ("composedPath" in event) return event.composedPath()[0] ?? null;
53351
- else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
53352
- }
53353
- return event.target;
53354
- }
53355
- var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178).useLayoutEffect : () => {
53440
+ var Day = ({ children, className, ...internal }) => {
53441
+ const { day } = internal;
53442
+ return /* @__PURE__ */ React178.createElement(ListBoxItem, {
53443
+ id: day.key,
53444
+ className,
53445
+ textValue: day.label,
53446
+ "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
53447
+ "data-available": day.isAvailable || void 0,
53448
+ "data-today": day.isToday || void 0
53449
+ }, children ? children({
53450
+ ...day,
53451
+ date: new Date(day.date)
53452
+ }) : /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178.createElement("span", null, day.dayOfMonthLabel)));
53356
53453
  };
53357
- function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
53358
- let event = nativeEvent;
53359
- event.nativeEvent = nativeEvent;
53360
- event.isDefaultPrevented = () => event.defaultPrevented;
53361
- event.isPropagationStopped = () => event.cancelBubble;
53362
- event.persist = () => {
53454
+ Dates.PreviousWeek = PreviousWeek;
53455
+ Dates.Heading = Heading2;
53456
+ Dates.NextWeek = NextWeek;
53457
+ Dates.Day = Day;
53458
+ var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
53459
+ var Slots = ({ children, className, ...internal }) => {
53460
+ const { hasTimezoneNote, hasDateTitle } = internal;
53461
+ const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
53462
+ const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
53463
+ const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
53464
+ const groupRef = useRef(null);
53465
+ const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178.createElement(Slots.Slot, null);
53466
+ const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
53467
+ const describedBy = [
53468
+ ariaDescribedBy,
53469
+ hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
53470
+ ].filter(Boolean).join(" ") || void 0;
53471
+ const focusSlotAt = (index2, options) => {
53472
+ groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
53363
53473
  };
53364
- return event;
53365
- }
53366
- function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
53367
- Object.defineProperty(event, "target", {
53368
- value: target
53369
- });
53370
- Object.defineProperty(event, "currentTarget", {
53371
- value: target
53372
- });
53373
- }
53374
- function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
53375
- let stateRef = (useRef)({
53376
- isFocused: false,
53377
- observer: null
53378
- });
53379
- ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
53380
- const state = stateRef.current;
53381
- return () => {
53382
- if (state.observer) {
53383
- state.observer.disconnect();
53384
- state.observer = null;
53385
- }
53386
- };
53387
- }, []);
53388
- return (useCallback)((e) => {
53389
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53390
- if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
53391
- stateRef.current.isFocused = true;
53392
- let target = eventTarget;
53393
- let onBlurHandler = (e2) => {
53394
- stateRef.current.isFocused = false;
53395
- if (target.disabled) {
53396
- let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
53397
- onBlur?.(event);
53398
- }
53399
- if (stateRef.current.observer) {
53400
- stateRef.current.observer.disconnect();
53401
- stateRef.current.observer = null;
53402
- }
53403
- };
53404
- target.addEventListener("focusout", onBlurHandler, {
53405
- once: true
53406
- });
53407
- stateRef.current.observer = new MutationObserver(() => {
53408
- if (stateRef.current.isFocused && target.disabled) {
53409
- stateRef.current.observer?.disconnect();
53410
- let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53411
- target.dispatchEvent(new FocusEvent("blur", {
53412
- relatedTarget: relatedTargetEl
53413
- }));
53414
- target.dispatchEvent(new FocusEvent("focusout", {
53415
- bubbles: true,
53416
- relatedTarget: relatedTargetEl
53417
- }));
53418
- }
53419
- });
53420
- stateRef.current.observer.observe(target, {
53421
- attributes: true,
53422
- attributeFilter: [
53423
- "disabled"
53424
- ]
53474
+ useFocusFieldEvent(() => {
53475
+ const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
53476
+ if (hasSlots) {
53477
+ focusSlotAt(0, {
53478
+ preventScroll: true
53425
53479
  });
53480
+ return;
53426
53481
  }
53482
+ const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
53483
+ const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
53484
+ fallback?.focus({
53485
+ preventScroll: true
53486
+ });
53487
+ }, fieldId);
53488
+ useEffect(() => {
53489
+ if (pendingFocusIndex === void 0) {
53490
+ return;
53491
+ }
53492
+ focusSlotAt(pendingFocusIndex);
53493
+ consumePendingFocusIndex();
53427
53494
  }, [
53428
- onBlur
53495
+ pendingFocusIndex,
53496
+ slots.length
53429
53497
  ]);
53430
- }
53431
-
53432
- // ../../node_modules/react-aria/dist/private/utils/platform.mjs
53433
- function $2add3ce32c6007eb$var$testUserAgent(re) {
53434
- if (typeof window === "undefined" || window.navigator == null) return false;
53435
- let brands = window.navigator["userAgentData"]?.brands;
53436
- return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
53437
- }
53438
- function $2add3ce32c6007eb$var$testPlatform(re) {
53439
- return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
53440
- }
53441
- function $2add3ce32c6007eb$var$cached(fn) {
53442
- let res = null;
53443
- return () => {
53444
- if (res == null) res = fn();
53445
- return res;
53446
- };
53447
- }
53448
- var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
53449
- return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
53450
- });
53451
- var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
53452
- return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
53453
- });
53454
- var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
53455
- return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
53456
- $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
53457
- });
53458
- var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
53459
- return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
53460
- });
53461
- var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
53462
- return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
53463
- });
53464
- var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
53465
- return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
53466
- });
53467
- var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
53468
- return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
53469
- });
53470
- var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
53471
- return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
53472
- });
53473
-
53474
- // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
53475
- function $b5c62b033c25b96d$export$60278871457622de(event) {
53476
- if (event.pointerType === "" && event.isTrusted) return true;
53477
- if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
53478
- return event.detail === 0 && !event.pointerType;
53479
- }
53480
- function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
53481
- let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
53482
- if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
53483
- if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
53484
- else ctrlKey = true;
53485
- }
53486
- let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
53487
- keyIdentifier: "Enter",
53488
- metaKey,
53489
- ctrlKey,
53490
- altKey,
53491
- shiftKey
53492
- }) : new MouseEvent("click", {
53493
- metaKey,
53494
- ctrlKey,
53495
- altKey,
53496
- shiftKey,
53497
- detail: 1,
53498
- bubbles: true,
53499
- cancelable: true
53500
- });
53501
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
53502
- ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
53503
- target.dispatchEvent(event);
53504
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53505
- }
53506
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53507
- var $8f5a2122b0992be3$var$currentModality = null;
53508
- var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
53509
- var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
53510
- var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53511
- var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53512
- var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
53513
- Tab: true,
53514
- Escape: true
53498
+ return /* @__PURE__ */ React178.createElement(React178.Fragment, null, /* @__PURE__ */ React178.createElement("div", {
53499
+ role: "status",
53500
+ style: VISUALLY_HIDDEN_STYLE
53501
+ }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178.createElement(RadioGroup$1, {
53502
+ ref: groupRef,
53503
+ className,
53504
+ value: selectedSlotKey ?? null,
53505
+ onChange: selectSlot,
53506
+ isDisabled: disabled,
53507
+ isReadOnly: readOnly,
53508
+ isRequired: required,
53509
+ isInvalid: hasError,
53510
+ "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
53511
+ "aria-describedby": describedBy,
53512
+ "data-refetch": isReloadingSlots || void 0
53513
+ }, slots.map((slot) => applyInternalProps(slotElement, {
53514
+ key: slot.key,
53515
+ slot
53516
+ }))));
53517
+ };
53518
+ var Slot = ({ children, className, ...internal }) => {
53519
+ const { slot } = internal;
53520
+ return /* @__PURE__ */ React178.createElement(RadioField, {
53521
+ value: slot.key,
53522
+ "aria-label": slot.timeRange
53523
+ }, /* @__PURE__ */ React178.createElement(RadioButton, {
53524
+ className
53525
+ }, children ? children(slot) : slot.timeRange));
53515
53526
  };
53516
- function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
53517
- for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
53518
- }
53519
- function $8f5a2122b0992be3$var$isValidKey(e) {
53520
- return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
53521
- }
53522
- function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
53523
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53524
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
53525
- $8f5a2122b0992be3$var$currentModality = "keyboard";
53526
- $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
53527
- }
53528
- }
53529
- function $8f5a2122b0992be3$var$handlePointerEvent(e) {
53530
- $8f5a2122b0992be3$var$currentModality = "pointer";
53531
- "pointerType" in e ? e.pointerType : "mouse";
53532
- if (e.type === "mousedown" || e.type === "pointerdown") {
53533
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53534
- $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
53535
- }
53536
- }
53537
- function $8f5a2122b0992be3$var$handleClickEvent(e) {
53538
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
53539
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53540
- $8f5a2122b0992be3$var$currentModality = "virtual";
53527
+ Slots.Slot = Slot;
53528
+ var import_cloneDeep = __toESM(require_cloneDeep());
53529
+ var createIndicatorNode = (requiredIndicatorType, t, className) => {
53530
+ const indicator = requiredIndicatorType === RequiredIndicator$1.TEXT ? t("settings.required-indicator-text") : "*";
53531
+ const str = (v) => ({
53532
+ stringValue: v
53533
+ });
53534
+ const fields = {
53535
+ "aria-hidden": str("true")
53536
+ };
53537
+ if (className) {
53538
+ fields.className = str(className);
53541
53539
  }
53542
- }
53543
- function $8f5a2122b0992be3$var$handleFocusEvent(e) {
53544
- let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53545
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
53546
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
53547
- if (target === ownerWindow) {
53548
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53549
- return;
53540
+ return {
53541
+ type: Node_Type.EXTERNAL,
53542
+ id: "",
53543
+ nodes: [],
53544
+ externalData: {
53545
+ fields
53546
+ },
53547
+ textData: {
53548
+ text: indicator,
53549
+ decorations: []
53550
+ }
53551
+ };
53552
+ };
53553
+ var injectRequiredIndicator = (label, placement, indicatorNode) => {
53554
+ const result2 = (0, import_cloneDeep.default)(label);
53555
+ switch (placement) {
53556
+ case RequiredIndicatorPlacement$1.BEFORE_FIELD_TITLE:
53557
+ const firstNode = result2?.nodes.find(Boolean);
53558
+ if (firstNode) {
53559
+ firstNode.nodes ?? (firstNode.nodes = []);
53560
+ firstNode.nodes.unshift(indicatorNode);
53561
+ }
53562
+ break;
53563
+ case RequiredIndicatorPlacement$1.AFTER_FIELD_TITLE:
53564
+ const lastNode = result2?.nodes?.findLast(Boolean);
53565
+ if (lastNode) {
53566
+ lastNode.nodes ?? (lastNode.nodes = []);
53567
+ lastNode.nodes.push(indicatorNode);
53568
+ }
53569
+ break;
53550
53570
  }
53551
- if (target === ownerDocument || !e.isTrusted) return;
53552
- if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
53553
- $8f5a2122b0992be3$var$currentModality = "virtual";
53554
- $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
53571
+ return result2;
53572
+ };
53573
+ var stopLinkEventPropagation = (event) => {
53574
+ if (event.target instanceof Element && event.target.closest("a")) {
53575
+ event.stopPropagation();
53555
53576
  }
53556
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53557
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53558
- }
53559
- function $8f5a2122b0992be3$var$handleWindowBlur() {
53560
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53561
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53562
- }
53563
- function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
53564
- if (typeof window === "undefined" || typeof document === "undefined") return;
53565
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53566
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53567
- if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
53568
- let focus = windowObject.HTMLElement.prototype.focus;
53569
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53570
- configurable: true,
53571
- writable: true,
53572
- value: function() {
53573
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53574
- focus.apply(this, arguments);
53577
+ };
53578
+ var LINK_EVENT_HANDLERS = {
53579
+ onPointerDown: stopLinkEventPropagation,
53580
+ onMouseDown: stopLinkEventPropagation,
53581
+ onClick: stopLinkEventPropagation
53582
+ };
53583
+ var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
53584
+ const { requiredIndicatorHidden = false, leadingElement } = internal;
53585
+ const fieldProps = useFieldPropsV2();
53586
+ const { label, required = false, disabled = false, requiredIndicatorType = RequiredIndicator$1.ASTERISK, requiredIndicatorPlacement = RequiredIndicatorPlacement$1.AFTER_FIELD_TITLE } = fieldProps;
53587
+ const { t } = useTranslation2();
53588
+ const { language } = useConfig();
53589
+ const labelWithIndicator = useMemo(() => {
53590
+ if (!required || requiredIndicatorHidden || !label) {
53591
+ return label;
53575
53592
  }
53593
+ const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
53594
+ return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
53595
+ }, [
53596
+ required,
53597
+ requiredIndicatorHidden,
53598
+ label,
53599
+ requiredIndicatorType,
53600
+ requiredIndicatorPlacement,
53601
+ t,
53602
+ requiredClassName
53603
+ ]);
53604
+ return /* @__PURE__ */ React178.createElement("div", {
53605
+ className,
53606
+ ...disabled ? {} : LINK_EVENT_HANDLERS
53607
+ }, leadingElement, children({
53608
+ content: labelWithIndicator,
53609
+ locale: language,
53610
+ htmlAttributesPlugin
53611
+ }));
53612
+ };
53613
+ var SelectionIndicator = ({ className, ...internal }) => {
53614
+ const state = internal;
53615
+ return /* @__PURE__ */ React178.createElement("div", {
53616
+ "aria-hidden": "true",
53617
+ className: typeof className === "function" ? className(state) : className
53576
53618
  });
53577
- documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53578
- documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53579
- documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53580
- windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53581
- windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53582
- if (typeof PointerEvent !== "undefined") {
53583
- documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53584
- documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53585
- documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53586
- }
53587
- windowObject.addEventListener("beforeunload", () => {
53588
- $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
53589
- }, {
53590
- once: true
53591
- });
53592
- $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
53593
- focus
53594
- });
53595
- }
53596
- var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
53597
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53598
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53599
- if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
53600
- if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
53601
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53602
- configurable: true,
53603
- writable: true,
53604
- value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
53619
+ };
53620
+
53621
+ // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
53622
+ var Checkbox = ({ children }) => {
53623
+ const { id: id6, FieldLayout } = useFieldPropsV2();
53624
+ const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
53625
+ const descriptionElement = findChildOfType(children, Checkbox.Description);
53626
+ const errorElement = findChildOfType(children, Checkbox.Error);
53627
+ return /* @__PURE__ */ React178.createElement(FieldLayout, {
53628
+ fieldId: id6,
53629
+ renderLabel: () => null,
53630
+ renderInput: () => checkboxElement,
53631
+ renderDescription: () => /* @__PURE__ */ React178.createElement(React178.Fragment, null, errorElement, descriptionElement)
53605
53632
  });
53606
- documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53607
- documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53608
- documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53609
- windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53610
- windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53611
- if (typeof PointerEvent !== "undefined") {
53612
- documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53613
- documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53614
- documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53615
- }
53616
- $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
53617
53633
  };
53618
- function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
53619
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53620
- let loadListener;
53621
- if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53622
- else {
53623
- loadListener = () => {
53624
- $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53625
- };
53626
- documentObject.addEventListener("DOMContentLoaded", loadListener);
53627
- }
53628
- return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
53629
- }
53630
- if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
53631
- function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
53632
- return $8f5a2122b0992be3$var$currentModality !== "pointer";
53633
- }
53634
- var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
53635
- "checkbox",
53636
- "radio",
53637
- "range",
53638
- "color",
53639
- "file",
53640
- "image",
53641
- "button",
53642
- "submit",
53643
- "reset"
53644
- ]);
53645
- function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
53646
- let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
53647
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53648
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
53649
- const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
53650
- const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
53651
- const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
53652
- const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
53653
- let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
53654
- isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
53655
- return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
53656
- }
53657
- function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
53658
- $8f5a2122b0992be3$var$setupGlobalFocusEvents();
53659
- (useEffect)(() => {
53660
- if (opts?.enabled === false) return;
53661
- let handler = (modality, e) => {
53662
- if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
53663
- fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
53664
- };
53665
- $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
53666
- return () => {
53667
- $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
53668
- };
53669
- }, deps);
53670
- }
53634
+ var CheckboxContainer = ({ children, className }) => {
53635
+ const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
53636
+ const { inputId, ariaDescribedBy } = useFieldAttributes();
53637
+ const ref = useRef(null);
53638
+ useFocusFieldEvent(() => {
53639
+ ref.current?.focus({
53640
+ preventScroll: true
53641
+ });
53642
+ }, id6);
53643
+ useKeepPrehydrationValue(ref);
53644
+ const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
53645
+ const inputElement = findChildOfType(children, CheckboxContainer.Input);
53646
+ const handleChange = useCallback((isSelected) => {
53647
+ onChange(isSelected);
53648
+ }, [
53649
+ onChange
53650
+ ]);
53651
+ return /* @__PURE__ */ React178.createElement(CheckboxField, {
53652
+ id: inputId,
53653
+ "aria-describedby": ariaDescribedBy,
53654
+ isSelected: Boolean(value),
53655
+ onChange: handleChange,
53656
+ isDisabled: disabled,
53657
+ isReadOnly: readOnly,
53658
+ isRequired: required,
53659
+ isInvalid: hasError,
53660
+ onBlur,
53661
+ onFocus
53662
+ }, /* @__PURE__ */ React178.createElement(CheckboxButton, {
53663
+ ref,
53664
+ className
53665
+ }, ({ isSelected, isHovered, isFocused }) => {
53666
+ const input = applyInternalProps(inputElement, {
53667
+ isSelected,
53668
+ isHovered,
53669
+ isFocused
53670
+ });
53671
+ return labelElement ? applyInternalProps(labelElement, {
53672
+ leadingElement: input
53673
+ }) : input;
53674
+ }));
53675
+ };
53676
+ CheckboxContainer.RichTextLabel = RichTextLabel;
53677
+ CheckboxContainer.Input = SelectionIndicator;
53678
+ Checkbox.Checkbox = CheckboxContainer;
53679
+ Checkbox.Description = Description;
53680
+ Checkbox.Error = Error2;
53671
53681
 
53672
- // ../../node_modules/react-aria/dist/private/utils/chain.mjs
53673
- function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
53674
- return (...args) => {
53675
- for (let callback of callbacks) if (typeof callback === "function") callback(...args);
53676
- };
53677
- }
53678
- var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
53679
- if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
53680
- $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
53681
- });
53682
- function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
53683
- if (idA === idB) return idA;
53684
- let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
53685
- if (setIdsA) {
53686
- setIdsA.forEach((ref) => ref.current = idB);
53687
- return idB;
53688
- }
53689
- let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
53690
- if (setIdsB) {
53691
- setIdsB.forEach((ref) => ref.current = idA);
53692
- return idA;
53682
+ // ../../node_modules/ts-debounce/dist/src/index.esm.js
53683
+ function r(r3, e, n) {
53684
+ var i, t, o;
53685
+ void 0 === n && (n = {});
53686
+ var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
53687
+ function f() {
53688
+ if (void 0 !== c) {
53689
+ var r4 = Date.now() - v;
53690
+ if (r4 + e >= c) return c - r4;
53691
+ }
53692
+ return e;
53693
53693
  }
53694
- return idB;
53695
- }
53696
-
53697
- // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
53698
- function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
53699
- if (refs.length === 1 && refs[0]) return refs[0];
53700
- return (value) => {
53701
- let hasCleanup = false;
53702
- const cleanups = refs.map((ref) => {
53703
- const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
53704
- hasCleanup || (hasCleanup = typeof cleanup == "function");
53705
- return cleanup;
53694
+ var d = function() {
53695
+ var e2 = [].slice.call(arguments), n2 = this;
53696
+ return new Promise(function(i2, t2) {
53697
+ var c2 = a2 && void 0 === o;
53698
+ if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
53699
+ if (o = void 0, v = Date.now(), !a2) {
53700
+ var i3 = r3.apply(n2, e2);
53701
+ u && u(i3), l.forEach(function(r4) {
53702
+ return (0, r4.resolve)(i3);
53703
+ }), l = [];
53704
+ }
53705
+ }, f()), c2) {
53706
+ var d2 = r3.apply(n2, e2);
53707
+ return u && u(d2), i2(d2);
53708
+ }
53709
+ l.push({ resolve: i2, reject: t2 });
53706
53710
  });
53707
- if (hasCleanup) return () => {
53708
- cleanups.forEach((cleanup, i) => {
53709
- if (typeof cleanup === "function") cleanup();
53710
- else $4064df0d6f9620e1$var$setRef(refs[i], null);
53711
- });
53712
- };
53713
53711
  };
53714
- }
53715
- function $4064df0d6f9620e1$var$setRef(ref, value) {
53716
- if (typeof ref === "function") return ref(value);
53717
- else if (ref != null) ref.current = value;
53712
+ return d.cancel = function(r4) {
53713
+ void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
53714
+ return (0, e2.reject)(r4);
53715
+ }), l = [];
53716
+ }, d;
53718
53717
  }
53719
53718
 
53720
- // ../../node_modules/clsx/dist/clsx.mjs
53721
- function r2(e) {
53722
- var t, f, n = "";
53723
- if ("string" == typeof e || "number" == typeof e) n += e;
53724
- else if ("object" == typeof e) if (Array.isArray(e)) {
53725
- var o = e.length;
53726
- for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
53727
- } else for (f in e) e[f] && (n && (n += " "), n += f);
53728
- return n;
53729
- }
53730
- function clsx() {
53731
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
53732
- return n;
53733
- }
53734
- var clsx_default = clsx;
53719
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
53720
+ var OTHER_ID = "Other";
53721
+ var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
53722
+ var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
53723
+ var getOtherLabel = (addOtherLabel, t) => {
53724
+ const otherLabelDefault = t?.("add-other.default-other-option-label");
53725
+ return addOtherLabel || otherLabelDefault || OTHER_ID;
53726
+ };
53727
+ var getOtherValue = (value, addOtherLabel) => {
53728
+ const addedSymbolsLength = 2;
53729
+ const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
53730
+ const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
53731
+ return otherItem.slice(otherLabelLength);
53732
+ };
53733
+ var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
53735
53734
 
53736
- // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
53737
- function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
53738
- let result2 = {
53739
- ...args[0]
53740
- };
53741
- for (let i = 1; i < args.length; i++) {
53742
- let props2 = args[i];
53743
- for (let key in props2) {
53744
- let a2 = result2[key];
53745
- let b = props2[key];
53746
- if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
53747
- key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
53748
- 65 && key.charCodeAt(2) <= /* 'Z' */
53749
- 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
53750
- else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
53751
- else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
53752
- else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
53753
- else result2[key] = b !== void 0 ? b : a2;
53735
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
53736
+ var CheckboxGroup = ({ children, className }) => {
53737
+ const props2 = useFieldPropsV2();
53738
+ const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
53739
+ const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
53740
+ const groupRef = useRef(null);
53741
+ useKeepPrehydrationValue(groupRef);
53742
+ const labelElement = findChildOfType(children, CheckboxGroup.Label);
53743
+ const optionsElement = findChildOfType(children, CheckboxGroup.Options);
53744
+ const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
53745
+ const errorElement = findChildOfType(children, CheckboxGroup.Error);
53746
+ const _value = useMemo(() => value || [], [
53747
+ value
53748
+ ]);
53749
+ const handleChange = useCallback((newValue) => {
53750
+ onChange?.(newValue);
53751
+ }, [
53752
+ onChange
53753
+ ]);
53754
+ return /* @__PURE__ */ React178.createElement(FieldLayout, {
53755
+ fieldId: id6,
53756
+ renderLabel: () => labelElement,
53757
+ renderInput: () => /* @__PURE__ */ React178.createElement(FieldsetHeadless, {
53758
+ id: inputId,
53759
+ ariaLabelledBy: labelId,
53760
+ ariaDescribedBy,
53761
+ required,
53762
+ onBlur,
53763
+ onFocus
53764
+ }, /* @__PURE__ */ React178.createElement(CheckboxGroup$1, {
53765
+ ref: groupRef,
53766
+ className,
53767
+ "aria-labelledby": labelId,
53768
+ value: _value,
53769
+ onChange: handleChange,
53770
+ isDisabled: disabled,
53771
+ isRequired: required,
53772
+ isInvalid: hasError
53773
+ }, optionsElement)),
53774
+ renderDescription: () => /* @__PURE__ */ React178.createElement(React178.Fragment, null, errorElement, descriptionElement)
53775
+ });
53776
+ };
53777
+ var Options = ({ children, className }) => {
53778
+ const props2 = useFieldPropsV2();
53779
+ const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53780
+ const { t } = useTranslation2();
53781
+ const optionElement = findChildOfType(children, Options.Option);
53782
+ const otherLabel = getOtherLabel(addOtherLabel, t);
53783
+ return /* @__PURE__ */ React178.createElement("div", {
53784
+ className,
53785
+ "data-columns": numberOfColumns
53786
+ }, options?.map((option2, index2) => {
53787
+ const checkboxValue = option2.value ?? option2.label;
53788
+ return applyInternalProps(optionElement, {
53789
+ key: option2.id || option2.label,
53790
+ value: checkboxValue,
53791
+ label: option2.label,
53792
+ isFirst: index2 === 0,
53793
+ fieldId: id6
53794
+ });
53795
+ }), addOther && applyInternalProps(optionElement, {
53796
+ key: OTHER_ID,
53797
+ value: OTHER_ID,
53798
+ label: otherLabel,
53799
+ isOther: true
53800
+ }));
53801
+ };
53802
+ var OptionLabel = ({ className, ...internal }) => {
53803
+ const { label } = internal;
53804
+ return /* @__PURE__ */ React178.createElement("span", {
53805
+ className
53806
+ }, label);
53807
+ };
53808
+ var Checkbox2 = ({ children, className, ...internal }) => {
53809
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53810
+ const props2 = useFieldPropsV2();
53811
+ const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53812
+ const checkboxRef = useRef(null);
53813
+ useFocusFieldEvent(() => {
53814
+ if (isFirst) {
53815
+ checkboxRef.current?.focus({
53816
+ preventScroll: true
53817
+ });
53754
53818
  }
53755
- }
53756
- return result2;
53757
- }
53758
- function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
53759
- let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
53760
- const onBlur = (useCallback)((e) => {
53761
- if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
53762
- if (onBlurProp) onBlurProp(e);
53763
- if (onFocusChange) onFocusChange(false);
53764
- return true;
53819
+ }, fieldId);
53820
+ const labelElement = findChildOfType(children, Checkbox2.Label);
53821
+ const inputElement = findChildOfType(children, Checkbox2.Input);
53822
+ const _value = useMemo(() => fieldValue || [], [
53823
+ fieldValue
53824
+ ]);
53825
+ const actualValue = useMemo(() => {
53826
+ if (isOther) {
53827
+ return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53765
53828
  }
53829
+ return value;
53766
53830
  }, [
53767
- onBlurProp,
53768
- onFocusChange
53831
+ isOther,
53832
+ _value,
53833
+ label,
53834
+ value
53769
53835
  ]);
53770
- const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
53771
- const onFocus = (useCallback)((e) => {
53772
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53773
- const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53774
- const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53775
- if (eventTarget === e.currentTarget && eventTarget === activeElement) {
53776
- if (onFocusProp) onFocusProp(e);
53777
- if (onFocusChange) onFocusChange(true);
53778
- onSyntheticFocus(e);
53836
+ const handleOtherCheckboxChange = useCallback((isSelected) => {
53837
+ if (!isOther) {
53838
+ return;
53779
53839
  }
53840
+ const optionsValues = getOptionsValues(options || []);
53841
+ const removedOther = _value.filter((val) => optionsValues.includes(val));
53842
+ const newValue = isSelected ? [
53843
+ ...removedOther,
53844
+ label
53845
+ ] : removedOther;
53846
+ onChange?.(newValue);
53780
53847
  }, [
53781
- onFocusChange,
53782
- onFocusProp,
53783
- onSyntheticFocus
53848
+ isOther,
53849
+ label,
53850
+ onChange,
53851
+ options,
53852
+ _value
53784
53853
  ]);
53785
- return {
53786
- focusProps: {
53787
- onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
53788
- onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
53789
- }
53790
- };
53791
- }
53792
- function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
53793
- const objRef = (useRef)(null);
53794
- const cleanupRef = (useRef)(void 0);
53795
- const refEffect = (useCallback)((instance) => {
53796
- if (typeof ref === "function") {
53797
- const refCallback = ref;
53798
- const refCleanup = refCallback(instance);
53799
- return () => {
53800
- if (typeof refCleanup === "function") refCleanup();
53801
- else refCallback(null);
53802
- };
53803
- } else if (ref) {
53804
- ref.current = instance;
53805
- return () => {
53806
- ref.current = null;
53807
- };
53854
+ return /* @__PURE__ */ React178.createElement(CheckboxField, {
53855
+ value: actualValue,
53856
+ onChange: isOther ? handleOtherCheckboxChange : void 0,
53857
+ isDisabled: disabled,
53858
+ isReadOnly: readOnly,
53859
+ isInvalid: hasError
53860
+ }, /* @__PURE__ */ React178.createElement(CheckboxButton, {
53861
+ ref: checkboxRef,
53862
+ className,
53863
+ "data-hook": `checkbox-${label}`
53864
+ }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178.createElement(React178.Fragment, null, applyInternalProps(inputElement, {
53865
+ isSelected,
53866
+ isHovered,
53867
+ isFocused
53868
+ }), applyInternalProps(labelElement, {
53869
+ label
53870
+ }))));
53871
+ };
53872
+ Checkbox2.Label = OptionLabel;
53873
+ Checkbox2.Input = SelectionIndicator;
53874
+ var Option = ({ children, ...internal }) => {
53875
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53876
+ const props2 = useFieldPropsV2();
53877
+ const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53878
+ const checkboxElement = findChildOfType(children, Checkbox2);
53879
+ const otherInputElement = findChildOfType(children, OtherInput);
53880
+ const _value = useMemo(() => fieldValue || [], [
53881
+ fieldValue
53882
+ ]);
53883
+ const isOtherSelected = useMemo(() => {
53884
+ if (!isOther) {
53885
+ return false;
53808
53886
  }
53887
+ const optionsValues = getOptionsValues(options || []);
53888
+ return getIsOtherOptionSelected(_value, optionsValues);
53809
53889
  }, [
53810
- ref
53890
+ isOther,
53891
+ _value,
53892
+ options
53811
53893
  ]);
53812
- return (useMemo)(
53813
- () => ({
53814
- get current() {
53815
- return objRef.current;
53816
- },
53817
- set current(value) {
53818
- objRef.current = value;
53819
- if (cleanupRef.current) {
53820
- cleanupRef.current();
53821
- cleanupRef.current = void 0;
53822
- }
53823
- if (value != null) cleanupRef.current = refEffect(value);
53824
- }
53825
- }),
53826
- // oxlint-disable-next-line react/react-compiler
53827
- [
53828
- refEffect
53829
- ]
53830
- );
53831
- }
53832
- var $fe16bffc7a557bf0$var$useEarlyEffect = (React178)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
53833
- function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
53834
- const ref = (useRef)(null);
53835
- $fe16bffc7a557bf0$var$useEarlyEffect(() => {
53836
- ref.current = fn;
53894
+ return /* @__PURE__ */ React178.createElement(React178.Fragment, null, applyInternalProps(checkboxElement, {
53895
+ value,
53896
+ label,
53897
+ isFirst,
53898
+ isOther,
53899
+ fieldId
53900
+ }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53901
+ fieldValue: _value,
53902
+ onChange,
53903
+ label,
53904
+ placeholder: addOtherPlaceholder,
53905
+ maxLength: otherInputCharacterLimit,
53906
+ disabled,
53907
+ readOnly,
53908
+ hasError,
53909
+ ariaLabel: label,
53910
+ addOtherLabel: label,
53911
+ options
53912
+ }));
53913
+ };
53914
+ var OtherInput = ({ className, inputClassName, ...internal }) => {
53915
+ const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53916
+ const [otherValue, setOtherValue] = useState(() => {
53917
+ const optionsValues = getOptionsValues(options || []);
53918
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53919
+ return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53920
+ });
53921
+ useEffect(() => {
53922
+ const optionsValues = getOptionsValues(options || []);
53923
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53924
+ setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53837
53925
  }, [
53838
- fn
53926
+ fieldValue,
53927
+ options,
53928
+ addOtherLabel
53839
53929
  ]);
53840
- return (useCallback)((...args) => {
53841
- const f = ref.current;
53842
- return f?.(...args);
53843
- }, []);
53844
- }
53845
- function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
53846
- let globalListeners = (useRef)(/* @__PURE__ */ new Map());
53847
- let addGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
53848
- let fn = options?.once ? (...args) => {
53849
- globalListeners.current.delete(listener);
53850
- listener(...args);
53851
- } : listener;
53852
- globalListeners.current.set(listener, {
53853
- type,
53854
- eventTarget,
53855
- fn,
53856
- options
53857
- });
53858
- eventTarget.addEventListener(type, fn, options);
53859
- }, []);
53860
- let removeGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
53861
- let fn = globalListeners.current.get(listener)?.fn || listener;
53862
- eventTarget.removeEventListener(type, fn, options);
53863
- globalListeners.current.delete(listener);
53864
- }, []);
53865
- let removeAllGlobalListeners = (useCallback)(() => {
53866
- globalListeners.current.forEach((value, key) => {
53867
- removeGlobalListener(value.eventTarget, value.type, key, value.options);
53868
- });
53930
+ const debouncedHandleChange = useMemo(() => {
53931
+ return r((input) => {
53932
+ const optionsValues = getOptionsValues(options || []);
53933
+ const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53934
+ const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53935
+ const newValue = [
53936
+ ...removedOther,
53937
+ _otherValue
53938
+ ];
53939
+ onChange(newValue);
53940
+ }, 500);
53869
53941
  }, [
53870
- removeGlobalListener
53942
+ onChange,
53943
+ options,
53944
+ fieldValue,
53945
+ addOtherLabel,
53946
+ label
53871
53947
  ]);
53872
- (useEffect)(() => {
53873
- return removeAllGlobalListeners;
53948
+ const handleInputChange = useCallback((input) => {
53949
+ setOtherValue(input);
53950
+ debouncedHandleChange(input);
53874
53951
  }, [
53875
- removeAllGlobalListeners
53952
+ debouncedHandleChange
53876
53953
  ]);
53877
- return {
53878
- addGlobalListener,
53879
- removeGlobalListener,
53880
- removeAllGlobalListeners
53881
- };
53882
- }
53883
-
53884
- // ../../node_modules/@internationalized/date/dist/private/utils.mjs
53885
- function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
53886
- return amount - numerator * Math.floor(amount / numerator);
53887
- }
53888
-
53889
- // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
53890
- var $93635573935797de$var$EPOCH = 1721426;
53891
- function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
53892
- year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
53893
- let y1 = year - 1;
53894
- let monthOffset = -2;
53895
- if (month <= 2) monthOffset = 0;
53896
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
53897
- return $93635573935797de$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);
53898
- }
53899
- function $93635573935797de$export$553d7fa8e3805fc0(year) {
53900
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
53901
- }
53902
- function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
53903
- return era === "BC" ? 1 - year : year;
53904
- }
53905
- function $93635573935797de$export$4475b7e617eb123c(year) {
53906
- let era = "AD";
53907
- if (year <= 0) {
53908
- era = "BC";
53909
- year = 1 - year;
53910
- }
53911
- return [
53912
- era,
53913
- year
53914
- ];
53915
- }
53916
- var $93635573935797de$var$daysInMonth = {
53917
- standard: [
53918
- 31,
53919
- 28,
53920
- 31,
53921
- 30,
53922
- 31,
53923
- 30,
53924
- 31,
53925
- 31,
53926
- 30,
53927
- 31,
53928
- 30,
53929
- 31
53930
- ],
53931
- leapyear: [
53932
- 31,
53933
- 29,
53934
- 31,
53935
- 30,
53936
- 31,
53937
- 30,
53938
- 31,
53939
- 31,
53940
- 30,
53941
- 31,
53942
- 30,
53943
- 31
53944
- ]
53945
- };
53946
- var $93635573935797de$export$80ee6245ec4f29ec = class {
53947
- fromJulianDay(jd) {
53948
- let jd0 = jd;
53949
- let depoch = jd0 - $93635573935797de$var$EPOCH;
53950
- let quadricent = Math.floor(depoch / 146097);
53951
- let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
53952
- let cent = Math.floor(dqc / 36524);
53953
- let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
53954
- let quad = Math.floor(dcent / 1461);
53955
- let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
53956
- let yindex = Math.floor(dquad / 365);
53957
- let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
53958
- let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
53959
- let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
53960
- let leapAdj = 2;
53961
- if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
53962
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
53963
- let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
53964
- let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
53965
- return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
53966
- }
53967
- toJulianDay(date) {
53968
- return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
53969
- }
53970
- getDaysInMonth(date) {
53971
- return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
53972
- }
53973
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53974
- getMonthsInYear(date) {
53975
- return 12;
53976
- }
53977
- getDaysInYear(date) {
53978
- return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
53979
- }
53980
- getMaximumMonthsInYear() {
53981
- return 12;
53982
- }
53983
- getMaximumDaysInMonth() {
53984
- return 31;
53985
- }
53986
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53987
- getYearsInEra(date) {
53988
- return 9999;
53989
- }
53990
- getEras() {
53991
- return [
53992
- "BC",
53993
- "AD"
53994
- ];
53995
- }
53996
- isInverseEra(date) {
53997
- return date.era === "BC";
53998
- }
53999
- balanceDate(date) {
54000
- if (date.year <= 0) {
54001
- date.era = date.era === "BC" ? "AD" : "BC";
54002
- date.year = 1 - date.year;
54003
- }
54004
- }
54005
- constructor() {
54006
- this.identifier = "gregory";
54007
- }
53954
+ return /* @__PURE__ */ React178.createElement(TextField, {
53955
+ "aria-label": ariaLabel,
53956
+ value: otherValue,
53957
+ onChange: handleInputChange,
53958
+ isDisabled: disabled,
53959
+ isReadOnly: readOnly,
53960
+ isInvalid: hasError,
53961
+ className
53962
+ }, /* @__PURE__ */ React178.createElement(Input, {
53963
+ className: inputClassName,
53964
+ placeholder,
53965
+ maxLength,
53966
+ "aria-label": ariaLabel
53967
+ }));
54008
53968
  };
53969
+ CheckboxGroup.Label = Label;
53970
+ CheckboxGroup.Options = Options;
53971
+ Options.Option = Option;
53972
+ Option.Checkbox = Checkbox2;
53973
+ Option.OtherInput = OtherInput;
53974
+ CheckboxGroup.Description = Description;
53975
+ CheckboxGroup.Error = Error2;
54009
53976
 
54010
- // ../../node_modules/@internationalized/date/dist/private/queries.mjs
54011
- function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
54012
- return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
54013
- }
54014
- function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
54015
- return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
54016
- }
54017
- function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
54018
- return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
54019
- }
54020
- function $ad063034c8620db8$var$timeToMs(a2) {
54021
- return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
54022
- }
54023
- var $ad063034c8620db8$var$localTimeZone = null;
54024
- var $ad063034c8620db8$var$localTimeZoneOverride = false;
54025
- function $ad063034c8620db8$export$aa8b41735afcabd2() {
54026
- if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
54027
- return $ad063034c8620db8$var$localTimeZone;
54028
- }
54029
- function $ad063034c8620db8$export$6ab69b273755230b() {
54030
- return $ad063034c8620db8$var$localTimeZoneOverride;
54031
- }
54032
-
54033
- // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
54034
- function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
54035
- date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54036
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
54037
- return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
54038
- }
54039
- function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
54040
- let date = /* @__PURE__ */ new Date();
54041
- date.setUTCHours(hour, minute, second, millisecond);
54042
- date.setUTCFullYear(year, month - 1, day);
54043
- return date.getTime();
54044
- }
54045
- function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
54046
- if (timeZone === "UTC") return 0;
54047
- if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
54048
- let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
54049
- let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
54050
- return utc2 - Math.floor(ms / 1e3) * 1e3;
54051
- }
54052
- var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
54053
- function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
54054
- let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
54055
- if (!formatter) {
54056
- formatter = new Intl.DateTimeFormat("en-US", {
54057
- timeZone,
54058
- hour12: false,
54059
- era: "short",
54060
- year: "numeric",
54061
- month: "numeric",
54062
- day: "numeric",
54063
- hour: "numeric",
54064
- minute: "numeric",
54065
- second: "numeric"
54066
- });
54067
- $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
54068
- }
54069
- let parts = formatter.formatToParts(new Date(ms));
54070
- let namedParts = {};
54071
- for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
54072
- return {
54073
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
54074
- year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
54075
- month: +namedParts.month,
54076
- day: +namedParts.day,
54077
- hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
54078
- minute: +namedParts.minute,
54079
- second: +namedParts.second
54080
- };
54081
- }
54082
- var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
54083
- function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
54084
- let found = earlier === later ? [
54085
- earlier
54086
- ] : [
54087
- earlier,
54088
- later
54089
- ];
54090
- return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
54091
- }
54092
- function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
54093
- let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
54094
- 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;
54095
- }
54096
- function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
54097
- let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
54098
- if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54099
- if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
54100
- dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
54101
- let date2 = /* @__PURE__ */ new Date();
54102
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
54103
- date2.setFullYear(year, dateTime.month - 1, dateTime.day);
54104
- date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
54105
- return date2.getTime();
54106
- }
54107
- let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54108
- let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54109
- let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54110
- let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
54111
- if (valid.length === 1) return valid[0];
54112
- if (valid.length > 1) switch (disambiguation) {
54113
- // 'compatible' means 'earlier' for "fall back" transitions
54114
- case "compatible":
54115
- case "earlier":
54116
- return valid[0];
54117
- case "later":
54118
- return valid[valid.length - 1];
54119
- case "reject":
54120
- throw new RangeError("Multiple possible absolute times found");
54121
- }
54122
- switch (disambiguation) {
54123
- case "earlier":
54124
- return Math.min(ms - offsetBefore, ms - offsetAfter);
54125
- // 'compatible' means 'later' for "spring forward" transitions
54126
- case "compatible":
54127
- case "later":
54128
- return Math.max(ms - offsetBefore, ms - offsetAfter);
54129
- case "reject":
54130
- throw new RangeError("No such absolute time found");
54131
- }
54132
- }
54133
- function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
54134
- return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
54135
- }
54136
- function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
54137
- let hour = 0, minute = 0, second = 0, millisecond = 0;
54138
- if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
54139
- else if ("hour" in date && !time) return date;
54140
- if (time) ({ hour, minute, second, millisecond } = time);
54141
- return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
54142
- }
54143
- function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
54144
- if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
54145
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
54146
- let copy = date.copy();
54147
- copy.calendar = calendar;
54148
- copy.era = calendarDate.era;
54149
- copy.year = calendarDate.year;
54150
- copy.month = calendarDate.month;
54151
- copy.day = calendarDate.day;
54152
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
54153
- return copy;
54154
- }
54155
-
54156
- // ../../node_modules/@internationalized/date/dist/private/manipulation.mjs
54157
- function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
54158
- let mutableDate = date.copy();
54159
- let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
54160
- $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
54161
- if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
54162
- mutableDate.month += duration.months || 0;
54163
- $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
54164
- $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
54165
- mutableDate.day += (duration.weeks || 0) * 7;
54166
- mutableDate.day += duration.days || 0;
54167
- mutableDate.day += days;
54168
- $435a2ceaa8778ed8$var$balanceDay(mutableDate);
54169
- if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
54170
- if (mutableDate.year < 1) {
54171
- mutableDate.year = 1;
54172
- mutableDate.month = 1;
54173
- mutableDate.day = 1;
54174
- }
54175
- let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
54176
- if (mutableDate.year > maxYear) {
54177
- let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
54178
- mutableDate.year = maxYear;
54179
- mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
54180
- mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
54181
- }
54182
- if (mutableDate.month < 1) {
54183
- mutableDate.month = 1;
54184
- mutableDate.day = 1;
54185
- }
54186
- let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
54187
- if (mutableDate.month > maxMonth) {
54188
- mutableDate.month = maxMonth;
54189
- mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
53977
+ // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53978
+ function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53979
+ if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53980
+ preventScroll: true
53981
+ });
53982
+ else {
53983
+ let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53984
+ element.focus();
53985
+ $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
54190
53986
  }
54191
- mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
54192
- return mutableDate;
54193
- }
54194
- function $435a2ceaa8778ed8$var$addYears(date, years) {
54195
- if (date.calendar.isInverseEra?.(date)) years = -years;
54196
- date.year += years;
54197
53987
  }
54198
- function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
54199
- while (date.month < 1) {
54200
- $435a2ceaa8778ed8$var$addYears(date, -1);
54201
- date.month += date.calendar.getMonthsInYear(date);
54202
- }
54203
- let monthsInYear = 0;
54204
- while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
54205
- date.month -= monthsInYear;
54206
- $435a2ceaa8778ed8$var$addYears(date, 1);
53988
+ var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53989
+ function $1969ac565cfec8d0$var$supportsPreventScroll() {
53990
+ if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53991
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
53992
+ try {
53993
+ let focusElem = document.createElement("div");
53994
+ focusElem.focus({
53995
+ get preventScroll() {
53996
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
53997
+ return true;
53998
+ }
53999
+ });
54000
+ } catch {
54001
+ }
54207
54002
  }
54003
+ return $1969ac565cfec8d0$var$supportsPreventScrollCached;
54208
54004
  }
54209
- function $435a2ceaa8778ed8$var$balanceDay(date) {
54210
- while (date.day < 1) {
54211
- date.month--;
54212
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54213
- date.day += date.calendar.getDaysInMonth(date);
54214
- }
54215
- while (date.day > date.calendar.getDaysInMonth(date)) {
54216
- date.day -= date.calendar.getDaysInMonth(date);
54217
- date.month++;
54218
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54005
+ function $1969ac565cfec8d0$var$getScrollableElements(element) {
54006
+ let parent = element.parentNode;
54007
+ let scrollableElements = [];
54008
+ let rootScrollingElement = document.scrollingElement || document.documentElement;
54009
+ while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
54010
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
54011
+ element: parent,
54012
+ scrollTop: parent.scrollTop,
54013
+ scrollLeft: parent.scrollLeft
54014
+ });
54015
+ parent = parent.parentNode;
54219
54016
  }
54017
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
54018
+ element: rootScrollingElement,
54019
+ scrollTop: rootScrollingElement.scrollTop,
54020
+ scrollLeft: rootScrollingElement.scrollLeft
54021
+ });
54022
+ return scrollableElements;
54220
54023
  }
54221
- function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
54222
- date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
54223
- date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
54224
- }
54225
- function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
54226
- if (date.calendar.constrainDate) date.calendar.constrainDate(date);
54227
- date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
54228
- $435a2ceaa8778ed8$var$constrainMonthDay(date);
54229
- }
54230
- function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
54231
- let inverseDuration = {};
54232
- for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
54233
- return inverseDuration;
54234
- }
54235
- function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
54236
- return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54024
+ function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
54025
+ for (let { element, scrollTop, scrollLeft } of scrollableElements) {
54026
+ element.scrollTop = scrollTop;
54027
+ element.scrollLeft = scrollLeft;
54028
+ }
54237
54029
  }
54238
- function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
54239
- let mutableDate = date.copy();
54240
- if (fields.era != null) mutableDate.era = fields.era;
54241
- if (fields.year != null) mutableDate.year = fields.year;
54242
- if (fields.month != null) mutableDate.month = fields.month;
54243
- if (fields.day != null) mutableDate.day = fields.day;
54244
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
54245
- return mutableDate;
54030
+
54031
+ // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
54032
+ var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
54033
+ if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
54034
+ if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
54035
+ return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
54036
+ };
54037
+ var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
54038
+ let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
54039
+ return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
54040
+ };
54041
+ function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
54042
+ return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
54246
54043
  }
54247
- function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
54248
- let mutableValue = value.copy();
54249
- if (fields.hour != null) mutableValue.hour = fields.hour;
54250
- if (fields.minute != null) mutableValue.minute = fields.minute;
54251
- if (fields.second != null) mutableValue.second = fields.second;
54252
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
54253
- $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
54254
- return mutableValue;
54044
+ function $d447af545b77c9f1$var$isWindow(value) {
54045
+ return typeof value === "object" && value != null && "window" in value && value.window === value;
54255
54046
  }
54256
- function $435a2ceaa8778ed8$var$balanceTime(time) {
54257
- time.second += Math.floor(time.millisecond / 1e3);
54258
- time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
54259
- time.minute += Math.floor(time.second / 60);
54260
- time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
54261
- time.hour += Math.floor(time.minute / 60);
54262
- time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
54263
- let days = Math.floor(time.hour / 24);
54264
- time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
54265
- return days;
54047
+ function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
54048
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
54266
54049
  }
54267
- function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
54268
- time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
54269
- time.second = Math.max(0, Math.min(time.second, 59));
54270
- time.minute = Math.max(0, Math.min(time.minute, 59));
54271
- time.hour = Math.max(0, Math.min(time.hour, 23));
54050
+ function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
54051
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
54272
54052
  }
54273
- function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
54274
- let result2 = a2 % b;
54275
- if (result2 < 0) result2 += b;
54276
- return result2;
54053
+
54054
+ // ../../node_modules/react-stately/dist/private/flags/flags.mjs
54055
+ var $6a20a7989e6c817a$var$_shadowDOM = false;
54056
+ function $6a20a7989e6c817a$export$98658e8c59125e6a() {
54057
+ return $6a20a7989e6c817a$var$_shadowDOM;
54277
54058
  }
54278
- function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
54279
- time.hour += duration.hours || 0;
54280
- time.minute += duration.minutes || 0;
54281
- time.second += duration.seconds || 0;
54282
- time.millisecond += duration.milliseconds || 0;
54283
- return $435a2ceaa8778ed8$var$balanceTime(time);
54059
+
54060
+ // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
54061
+ function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
54062
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
54063
+ if (!node || !otherNode) return false;
54064
+ let currentNode = otherNode;
54065
+ while (currentNode !== null) {
54066
+ if (currentNode === node) return true;
54067
+ if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
54068
+ currentNode = currentNode.assignedSlot.parentNode;
54069
+ else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
54070
+ currentNode = currentNode.host;
54071
+ else currentNode = currentNode.parentNode;
54072
+ }
54073
+ return false;
54284
54074
  }
54285
- function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
54286
- let res = time.copy();
54287
- $435a2ceaa8778ed8$var$addTimeFields(res, duration);
54288
- return res;
54075
+ var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
54076
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
54077
+ let activeElement = doc.activeElement;
54078
+ while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
54079
+ return activeElement;
54080
+ };
54081
+ function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
54082
+ if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
54083
+ if ("composedPath" in event) return event.composedPath()[0] ?? null;
54084
+ else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
54085
+ }
54086
+ return event.target;
54289
54087
  }
54290
- function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
54291
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54088
+ var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178).useLayoutEffect : () => {
54089
+ };
54090
+ function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
54091
+ let event = nativeEvent;
54092
+ event.nativeEvent = nativeEvent;
54093
+ event.isDefaultPrevented = () => event.defaultPrevented;
54094
+ event.isPropagationStopped = () => event.cancelBubble;
54095
+ event.persist = () => {
54096
+ };
54097
+ return event;
54292
54098
  }
54293
- function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
54294
- let mutable = value.copy();
54295
- switch (field) {
54296
- case "era": {
54297
- let eras = value.calendar.getEras();
54298
- let eraIndex = eras.indexOf(value.era);
54299
- if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
54300
- eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
54301
- mutable.era = eras[eraIndex];
54302
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54303
- break;
54304
- }
54305
- case "year":
54306
- if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
54307
- mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
54308
- if (mutable.year === -Infinity) mutable.year = 1;
54309
- if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
54310
- break;
54311
- case "month":
54312
- mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
54313
- break;
54314
- case "day":
54315
- mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
54316
- break;
54317
- default:
54318
- throw new Error("Unsupported field " + field);
54319
- }
54320
- if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
54321
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54322
- return mutable;
54099
+ function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
54100
+ Object.defineProperty(event, "target", {
54101
+ value: target
54102
+ });
54103
+ Object.defineProperty(event, "currentTarget", {
54104
+ value: target
54105
+ });
54323
54106
  }
54324
- function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
54325
- let mutable = value.copy();
54326
- switch (field) {
54327
- case "hour": {
54328
- let hours = value.hour;
54329
- let min4 = 0;
54330
- let max4 = 23;
54331
- if (options?.hourCycle === 12) {
54332
- let isPM = hours >= 12;
54333
- min4 = isPM ? 12 : 0;
54334
- max4 = isPM ? 23 : 11;
54107
+ function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
54108
+ let stateRef = (useRef)({
54109
+ isFocused: false,
54110
+ observer: null
54111
+ });
54112
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
54113
+ const state = stateRef.current;
54114
+ return () => {
54115
+ if (state.observer) {
54116
+ state.observer.disconnect();
54117
+ state.observer = null;
54335
54118
  }
54336
- mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
54337
- break;
54119
+ };
54120
+ }, []);
54121
+ return (useCallback)((e) => {
54122
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54123
+ if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
54124
+ stateRef.current.isFocused = true;
54125
+ let target = eventTarget;
54126
+ let onBlurHandler = (e2) => {
54127
+ stateRef.current.isFocused = false;
54128
+ if (target.disabled) {
54129
+ let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
54130
+ onBlur?.(event);
54131
+ }
54132
+ if (stateRef.current.observer) {
54133
+ stateRef.current.observer.disconnect();
54134
+ stateRef.current.observer = null;
54135
+ }
54136
+ };
54137
+ target.addEventListener("focusout", onBlurHandler, {
54138
+ once: true
54139
+ });
54140
+ stateRef.current.observer = new MutationObserver(() => {
54141
+ if (stateRef.current.isFocused && target.disabled) {
54142
+ stateRef.current.observer?.disconnect();
54143
+ let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54144
+ target.dispatchEvent(new FocusEvent("blur", {
54145
+ relatedTarget: relatedTargetEl
54146
+ }));
54147
+ target.dispatchEvent(new FocusEvent("focusout", {
54148
+ bubbles: true,
54149
+ relatedTarget: relatedTargetEl
54150
+ }));
54151
+ }
54152
+ });
54153
+ stateRef.current.observer.observe(target, {
54154
+ attributes: true,
54155
+ attributeFilter: [
54156
+ "disabled"
54157
+ ]
54158
+ });
54338
54159
  }
54339
- case "minute":
54340
- mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
54341
- break;
54342
- case "second":
54343
- mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
54344
- break;
54345
- case "millisecond":
54346
- mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
54347
- break;
54348
- default:
54349
- throw new Error("Unsupported field " + field);
54350
- }
54351
- return mutable;
54352
- }
54353
- function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
54354
- if (round) {
54355
- value += Math.sign(amount);
54356
- if (value < min4) value = max4;
54357
- let div = Math.abs(amount);
54358
- if (amount > 0) value = Math.ceil(value / div) * div;
54359
- else value = Math.floor(value / div) * div;
54360
- if (value > max4) value = min4;
54361
- } else {
54362
- value += amount;
54363
- if (value < min4) value = max4 - (min4 - value - 1);
54364
- else if (value > max4) value = min4 + (value - max4 - 1);
54365
- }
54366
- return value;
54160
+ }, [
54161
+ onBlur
54162
+ ]);
54367
54163
  }
54368
54164
 
54369
- // ../../node_modules/@internationalized/date/dist/private/string.mjs
54370
- var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
54371
- var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
54372
- var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
54373
- function $58246871e4652552$export$c9698ec7f05a07e1(value) {
54374
- let m = value.match($58246871e4652552$var$TIME_RE);
54375
- if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
54376
- return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
54377
- }
54378
- function $58246871e4652552$export$6b862160d295c8e(value) {
54379
- let m = value.match($58246871e4652552$var$DATE_RE);
54380
- if (!m) {
54381
- if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
54382
- throw new Error("Invalid ISO 8601 date string: " + value);
54383
- }
54384
- let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
54385
- date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
54386
- return date;
54387
- }
54388
- function $58246871e4652552$var$parseNumber(value, min4, max4) {
54389
- let val = Number(value);
54390
- if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
54391
- return val;
54392
- }
54393
- function $58246871e4652552$export$f59dee82248f5ad4(time) {
54394
- return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
54395
- }
54396
- function $58246871e4652552$export$60dfd74aa96791bd(date) {
54397
- let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54398
- let year;
54399
- if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
54400
- else year = String(gregorianDate.year).padStart(4, "0");
54401
- return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
54165
+ // ../../node_modules/react-aria/dist/private/utils/platform.mjs
54166
+ function $2add3ce32c6007eb$var$testUserAgent(re) {
54167
+ if (typeof window === "undefined" || window.navigator == null) return false;
54168
+ let brands = window.navigator["userAgentData"]?.brands;
54169
+ return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
54402
54170
  }
54403
- function $58246871e4652552$export$4223de14708adc63(date) {
54404
- return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
54171
+ function $2add3ce32c6007eb$var$testPlatform(re) {
54172
+ return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
54405
54173
  }
54406
-
54407
- // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
54408
- function $2aaf608024c21ca1$var$shiftArgs(args) {
54409
- let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
54410
- let era;
54411
- if (typeof args[0] === "string") era = args.shift();
54412
- else {
54413
- let eras = calendar.getEras();
54414
- era = eras[eras.length - 1];
54415
- }
54416
- let year = args.shift();
54417
- let month = args.shift();
54418
- let day = args.shift();
54419
- return [
54420
- calendar,
54421
- era,
54422
- year,
54423
- month,
54424
- day
54425
- ];
54174
+ function $2add3ce32c6007eb$var$cached(fn) {
54175
+ let res = null;
54176
+ return () => {
54177
+ if (res == null) res = fn();
54178
+ return res;
54179
+ };
54426
54180
  }
54427
- var _type;
54428
- var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
54429
- constructor(...args) {
54430
- // This prevents TypeScript from allowing other types with the same fields to match.
54431
- // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
54432
- // If that behavior is desired, use the AnyCalendarDate interface instead.
54433
- // @ts-ignore
54434
- __privateAdd(this, _type);
54435
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54436
- this.calendar = calendar;
54437
- this.era = era;
54438
- this.year = year;
54439
- this.month = month;
54440
- this.day = day;
54441
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54442
- }
54443
- /** Returns a copy of this date. */
54444
- copy() {
54445
- if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
54446
- else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
54447
- }
54448
- /** Returns a new `CalendarDate` with the given duration added to it. */
54449
- add(duration) {
54450
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54451
- }
54452
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */
54453
- subtract(duration) {
54454
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54455
- }
54456
- /**
54457
- * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
54458
- * will be constrained accordingly.
54459
- */
54460
- set(fields) {
54461
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
54462
- }
54463
- /**
54464
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
54465
- * When the resulting value reaches the limits of the field, it wraps around.
54466
- */
54467
- cycle(field, amount, options) {
54468
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54469
- }
54470
- /**
54471
- * Converts the date to a native JavaScript Date object, with the time set to midnight in the
54472
- * given time zone.
54473
- */
54474
- toDate(timeZone) {
54475
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
54476
- }
54477
- /** Converts the date to an ISO 8601 formatted string. */
54478
- toString() {
54479
- return ($58246871e4652552$export$60dfd74aa96791bd)(this);
54480
- }
54481
- /**
54482
- * Compares this date with another. A negative result indicates that this date is before the given
54483
- * one, and a positive date indicates that it is after.
54484
- */
54485
- compare(b) {
54486
- return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54181
+ var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
54182
+ return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
54183
+ });
54184
+ var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
54185
+ return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
54186
+ });
54187
+ var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
54188
+ return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
54189
+ $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
54190
+ });
54191
+ var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
54192
+ return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
54193
+ });
54194
+ var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
54195
+ return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
54196
+ });
54197
+ var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
54198
+ return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
54199
+ });
54200
+ var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
54201
+ return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
54202
+ });
54203
+ var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
54204
+ return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
54205
+ });
54206
+
54207
+ // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
54208
+ function $b5c62b033c25b96d$export$60278871457622de(event) {
54209
+ if (event.pointerType === "" && event.isTrusted) return true;
54210
+ if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
54211
+ return event.detail === 0 && !event.pointerType;
54212
+ }
54213
+ function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
54214
+ let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
54215
+ if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
54216
+ if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
54217
+ else ctrlKey = true;
54487
54218
  }
54219
+ let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
54220
+ keyIdentifier: "Enter",
54221
+ metaKey,
54222
+ ctrlKey,
54223
+ altKey,
54224
+ shiftKey
54225
+ }) : new MouseEvent("click", {
54226
+ metaKey,
54227
+ ctrlKey,
54228
+ altKey,
54229
+ shiftKey,
54230
+ detail: 1,
54231
+ bubbles: true,
54232
+ cancelable: true
54233
+ });
54234
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
54235
+ ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
54236
+ target.dispatchEvent(event);
54237
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54238
+ }
54239
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54240
+ var $8f5a2122b0992be3$var$currentModality = null;
54241
+ var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
54242
+ var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
54243
+ var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54244
+ var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54245
+ var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
54246
+ Tab: true,
54247
+ Escape: true
54488
54248
  };
54489
- _type = new WeakMap();
54490
- var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
54491
- var _type2;
54492
- var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
54493
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
54494
- // This prevents TypeScript from allowing other types with the same fields to match.
54495
- // @ts-ignore
54496
- __privateAdd(this, _type2);
54497
- this.hour = hour;
54498
- this.minute = minute;
54499
- this.second = second;
54500
- this.millisecond = millisecond;
54501
- ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
54502
- }
54503
- /** Returns a copy of this time. */
54504
- copy() {
54505
- return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
54249
+ function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
54250
+ for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
54251
+ }
54252
+ function $8f5a2122b0992be3$var$isValidKey(e) {
54253
+ return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
54254
+ }
54255
+ function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
54256
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54257
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
54258
+ $8f5a2122b0992be3$var$currentModality = "keyboard";
54259
+ $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
54506
54260
  }
54507
- /** Returns a new `Time` with the given duration added to it. */
54508
- add(duration) {
54509
- return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
54261
+ }
54262
+ function $8f5a2122b0992be3$var$handlePointerEvent(e) {
54263
+ $8f5a2122b0992be3$var$currentModality = "pointer";
54264
+ "pointerType" in e ? e.pointerType : "mouse";
54265
+ if (e.type === "mousedown" || e.type === "pointerdown") {
54266
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54267
+ $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
54510
54268
  }
54511
- /** Returns a new `Time` with the given duration subtracted from it. */
54512
- subtract(duration) {
54513
- return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
54269
+ }
54270
+ function $8f5a2122b0992be3$var$handleClickEvent(e) {
54271
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
54272
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54273
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54514
54274
  }
54515
- /**
54516
- * Returns a new `Time` with the given fields set to the provided values. Other fields will be
54517
- * constrained accordingly.
54518
- */
54519
- set(fields) {
54520
- return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
54275
+ }
54276
+ function $8f5a2122b0992be3$var$handleFocusEvent(e) {
54277
+ let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54278
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
54279
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
54280
+ if (target === ownerWindow) {
54281
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54282
+ return;
54521
54283
  }
54522
- /**
54523
- * Returns a new `Time` with the given field adjusted by a specified amount.
54524
- * When the resulting value reaches the limits of the field, it wraps around.
54525
- */
54526
- cycle(field, amount, options) {
54527
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54284
+ if (target === ownerDocument || !e.isTrusted) return;
54285
+ if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
54286
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54287
+ $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
54528
54288
  }
54529
- /** Converts the time to an ISO 8601 formatted string. */
54530
- toString() {
54531
- return ($58246871e4652552$export$f59dee82248f5ad4)(this);
54289
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54290
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54291
+ }
54292
+ function $8f5a2122b0992be3$var$handleWindowBlur() {
54293
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54294
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54295
+ }
54296
+ function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
54297
+ if (typeof window === "undefined" || typeof document === "undefined") return;
54298
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54299
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54300
+ if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
54301
+ let focus = windowObject.HTMLElement.prototype.focus;
54302
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54303
+ configurable: true,
54304
+ writable: true,
54305
+ value: function() {
54306
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54307
+ focus.apply(this, arguments);
54308
+ }
54309
+ });
54310
+ documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54311
+ documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54312
+ documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54313
+ windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54314
+ windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54315
+ if (typeof PointerEvent !== "undefined") {
54316
+ documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54317
+ documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54318
+ documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54532
54319
  }
54533
- /**
54534
- * Compares this time with another. A negative result indicates that this time is before the given
54535
- * one, and a positive time indicates that it is after.
54536
- */
54537
- compare(b) {
54538
- return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
54320
+ windowObject.addEventListener("beforeunload", () => {
54321
+ $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
54322
+ }, {
54323
+ once: true
54324
+ });
54325
+ $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
54326
+ focus
54327
+ });
54328
+ }
54329
+ var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
54330
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54331
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54332
+ if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
54333
+ if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
54334
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54335
+ configurable: true,
54336
+ writable: true,
54337
+ value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
54338
+ });
54339
+ documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54340
+ documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54341
+ documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54342
+ windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54343
+ windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54344
+ if (typeof PointerEvent !== "undefined") {
54345
+ documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54346
+ documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54347
+ documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54539
54348
  }
54349
+ $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
54540
54350
  };
54541
- _type2 = new WeakMap();
54542
- var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
54543
- var _type3;
54544
- var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
54545
- constructor(...args) {
54546
- // This prevents TypeScript from allowing other types with the same fields to match.
54547
- // @ts-ignore
54548
- __privateAdd(this, _type3);
54549
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54550
- this.calendar = calendar;
54551
- this.era = era;
54552
- this.year = year;
54553
- this.month = month;
54554
- this.day = day;
54555
- this.hour = args.shift() || 0;
54556
- this.minute = args.shift() || 0;
54557
- this.second = args.shift() || 0;
54558
- this.millisecond = args.shift() || 0;
54559
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54560
- }
54561
- /** Returns a copy of this date. */
54562
- copy() {
54563
- if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54564
- else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54565
- }
54566
- /** Returns a new `CalendarDateTime` with the given duration added to it. */
54567
- add(duration) {
54568
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54351
+ function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
54352
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54353
+ let loadListener;
54354
+ if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54355
+ else {
54356
+ loadListener = () => {
54357
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54358
+ };
54359
+ documentObject.addEventListener("DOMContentLoaded", loadListener);
54569
54360
  }
54570
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
54571
- subtract(duration) {
54572
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54361
+ return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
54362
+ }
54363
+ if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
54364
+ function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
54365
+ return $8f5a2122b0992be3$var$currentModality !== "pointer";
54366
+ }
54367
+ var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
54368
+ "checkbox",
54369
+ "radio",
54370
+ "range",
54371
+ "color",
54372
+ "file",
54373
+ "image",
54374
+ "button",
54375
+ "submit",
54376
+ "reset"
54377
+ ]);
54378
+ function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
54379
+ let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
54380
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54381
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
54382
+ const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
54383
+ const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
54384
+ const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
54385
+ const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
54386
+ let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
54387
+ isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
54388
+ return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
54389
+ }
54390
+ function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
54391
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents();
54392
+ (useEffect)(() => {
54393
+ if (opts?.enabled === false) return;
54394
+ let handler = (modality, e) => {
54395
+ if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
54396
+ fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
54397
+ };
54398
+ $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
54399
+ return () => {
54400
+ $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
54401
+ };
54402
+ }, deps);
54403
+ }
54404
+
54405
+ // ../../node_modules/react-aria/dist/private/utils/chain.mjs
54406
+ function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
54407
+ return (...args) => {
54408
+ for (let callback of callbacks) if (typeof callback === "function") callback(...args);
54409
+ };
54410
+ }
54411
+ var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
54412
+ if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
54413
+ $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
54414
+ });
54415
+ function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
54416
+ if (idA === idB) return idA;
54417
+ let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
54418
+ if (setIdsA) {
54419
+ setIdsA.forEach((ref) => ref.current = idB);
54420
+ return idB;
54573
54421
  }
54574
- /**
54575
- * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
54576
- * will be constrained accordingly.
54577
- */
54578
- set(fields) {
54579
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
54422
+ let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
54423
+ if (setIdsB) {
54424
+ setIdsB.forEach((ref) => ref.current = idA);
54425
+ return idA;
54580
54426
  }
54581
- /**
54582
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
54583
- * When the resulting value reaches the limits of the field, it wraps around.
54584
- */
54585
- cycle(field, amount, options) {
54586
- switch (field) {
54587
- case "era":
54588
- case "year":
54589
- case "month":
54590
- case "day":
54591
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54592
- default:
54593
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54427
+ return idB;
54428
+ }
54429
+
54430
+ // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
54431
+ function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
54432
+ if (refs.length === 1 && refs[0]) return refs[0];
54433
+ return (value) => {
54434
+ let hasCleanup = false;
54435
+ const cleanups = refs.map((ref) => {
54436
+ const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
54437
+ hasCleanup || (hasCleanup = typeof cleanup == "function");
54438
+ return cleanup;
54439
+ });
54440
+ if (hasCleanup) return () => {
54441
+ cleanups.forEach((cleanup, i) => {
54442
+ if (typeof cleanup === "function") cleanup();
54443
+ else $4064df0d6f9620e1$var$setRef(refs[i], null);
54444
+ });
54445
+ };
54446
+ };
54447
+ }
54448
+ function $4064df0d6f9620e1$var$setRef(ref, value) {
54449
+ if (typeof ref === "function") return ref(value);
54450
+ else if (ref != null) ref.current = value;
54451
+ }
54452
+
54453
+ // ../../node_modules/clsx/dist/clsx.mjs
54454
+ function r2(e) {
54455
+ var t, f, n = "";
54456
+ if ("string" == typeof e || "number" == typeof e) n += e;
54457
+ else if ("object" == typeof e) if (Array.isArray(e)) {
54458
+ var o = e.length;
54459
+ for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
54460
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
54461
+ return n;
54462
+ }
54463
+ function clsx() {
54464
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
54465
+ return n;
54466
+ }
54467
+ var clsx_default = clsx;
54468
+
54469
+ // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
54470
+ function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
54471
+ let result2 = {
54472
+ ...args[0]
54473
+ };
54474
+ for (let i = 1; i < args.length; i++) {
54475
+ let props2 = args[i];
54476
+ for (let key in props2) {
54477
+ let a2 = result2[key];
54478
+ let b = props2[key];
54479
+ if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
54480
+ key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
54481
+ 65 && key.charCodeAt(2) <= /* 'Z' */
54482
+ 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
54483
+ else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
54484
+ else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
54485
+ else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
54486
+ else result2[key] = b !== void 0 ? b : a2;
54594
54487
  }
54595
54488
  }
54596
- /** Converts the date to a native JavaScript Date object in the given time zone. */
54597
- toDate(timeZone, disambiguation) {
54598
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
54599
- }
54600
- /** Converts the date to an ISO 8601 formatted string. */
54601
- toString() {
54602
- return ($58246871e4652552$export$4223de14708adc63)(this);
54603
- }
54604
- /**
54605
- * Compares this date with another. A negative result indicates that this date is before the given
54606
- * one, and a positive date indicates that it is after.
54607
- */
54608
- compare(b) {
54609
- let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54610
- if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
54611
- return res;
54612
- }
54613
- };
54614
- _type3 = new WeakMap();
54615
- var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
54489
+ return result2;
54490
+ }
54491
+ function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
54492
+ let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
54493
+ const onBlur = (useCallback)((e) => {
54494
+ if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
54495
+ if (onBlurProp) onBlurProp(e);
54496
+ if (onFocusChange) onFocusChange(false);
54497
+ return true;
54498
+ }
54499
+ }, [
54500
+ onBlurProp,
54501
+ onFocusChange
54502
+ ]);
54503
+ const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
54504
+ const onFocus = (useCallback)((e) => {
54505
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54506
+ const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54507
+ const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54508
+ if (eventTarget === e.currentTarget && eventTarget === activeElement) {
54509
+ if (onFocusProp) onFocusProp(e);
54510
+ if (onFocusChange) onFocusChange(true);
54511
+ onSyntheticFocus(e);
54512
+ }
54513
+ }, [
54514
+ onFocusChange,
54515
+ onFocusProp,
54516
+ onSyntheticFocus
54517
+ ]);
54518
+ return {
54519
+ focusProps: {
54520
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
54521
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
54522
+ }
54523
+ };
54524
+ }
54525
+ function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
54526
+ const objRef = (useRef)(null);
54527
+ const cleanupRef = (useRef)(void 0);
54528
+ const refEffect = (useCallback)((instance) => {
54529
+ if (typeof ref === "function") {
54530
+ const refCallback = ref;
54531
+ const refCleanup = refCallback(instance);
54532
+ return () => {
54533
+ if (typeof refCleanup === "function") refCleanup();
54534
+ else refCallback(null);
54535
+ };
54536
+ } else if (ref) {
54537
+ ref.current = instance;
54538
+ return () => {
54539
+ ref.current = null;
54540
+ };
54541
+ }
54542
+ }, [
54543
+ ref
54544
+ ]);
54545
+ return (useMemo)(
54546
+ () => ({
54547
+ get current() {
54548
+ return objRef.current;
54549
+ },
54550
+ set current(value) {
54551
+ objRef.current = value;
54552
+ if (cleanupRef.current) {
54553
+ cleanupRef.current();
54554
+ cleanupRef.current = void 0;
54555
+ }
54556
+ if (value != null) cleanupRef.current = refEffect(value);
54557
+ }
54558
+ }),
54559
+ // oxlint-disable-next-line react/react-compiler
54560
+ [
54561
+ refEffect
54562
+ ]
54563
+ );
54564
+ }
54565
+ var $fe16bffc7a557bf0$var$useEarlyEffect = (React178)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
54566
+ function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
54567
+ const ref = (useRef)(null);
54568
+ $fe16bffc7a557bf0$var$useEarlyEffect(() => {
54569
+ ref.current = fn;
54570
+ }, [
54571
+ fn
54572
+ ]);
54573
+ return (useCallback)((...args) => {
54574
+ const f = ref.current;
54575
+ return f?.(...args);
54576
+ }, []);
54577
+ }
54578
+ function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
54579
+ let globalListeners = (useRef)(/* @__PURE__ */ new Map());
54580
+ let addGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
54581
+ let fn = options?.once ? (...args) => {
54582
+ globalListeners.current.delete(listener);
54583
+ listener(...args);
54584
+ } : listener;
54585
+ globalListeners.current.set(listener, {
54586
+ type,
54587
+ eventTarget,
54588
+ fn,
54589
+ options
54590
+ });
54591
+ eventTarget.addEventListener(type, fn, options);
54592
+ }, []);
54593
+ let removeGlobalListener = (useCallback)((eventTarget, type, listener, options) => {
54594
+ let fn = globalListeners.current.get(listener)?.fn || listener;
54595
+ eventTarget.removeEventListener(type, fn, options);
54596
+ globalListeners.current.delete(listener);
54597
+ }, []);
54598
+ let removeAllGlobalListeners = (useCallback)(() => {
54599
+ globalListeners.current.forEach((value, key) => {
54600
+ removeGlobalListener(value.eventTarget, value.type, key, value.options);
54601
+ });
54602
+ }, [
54603
+ removeGlobalListener
54604
+ ]);
54605
+ (useEffect)(() => {
54606
+ return removeAllGlobalListeners;
54607
+ }, [
54608
+ removeAllGlobalListeners
54609
+ ]);
54610
+ return {
54611
+ addGlobalListener,
54612
+ removeGlobalListener,
54613
+ removeAllGlobalListeners
54614
+ };
54615
+ }
54616
54616
  function $2c9edc598a03d523$export$420e68273165f4ec(props2) {
54617
54617
  let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props2;
54618
54618
  let state = (useRef)({