1import { 2 require_jsx_runtime 3} from "/node_modules/.vite/deps/chunk-OT5EQO2H.js?v=08590ad1"; 4import { 5 require_react_dom 6} from "/node_modules/.vite/deps/chunk-TH7NCS4R.js?v=08590ad1"; 7import { 8 require_react 9} from "/node_modules/.vite/deps/chunk-OU5AQDZK.js?v=08590ad1"; 10import { 11 __publicField, 12 __toESM 13} from "/node_modules/.vite/deps/chunk-EWTE5DHJ.js?v=08590ad1"; 14
vendor: 523 bytes, lines 15-29
15// node_modules/clsx/dist/clsx.mjs 16function r(e) { 17 var t, f, n = ""; 18 if ("string" == typeof e || "number" == typeof e) n += e; 19 else if ("object" == typeof e) if (Array.isArray(e)) { 20 var o = e.length; 21 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 22 } else for (f in e) e[f] && (n && (n += " "), n += f); 23 return n; 24} 25function clsx() { 26 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 27 return n; 28} 29
vendor: 97 bytes, lines 30-32
30// node_modules/react-datepicker/dist/index.es.js 31var import_react3 = __toESM(require_react()); 32
vendor: 594 bytes, lines 33-49
33// node_modules/date-fns/constants.js 34var daysInYear = 365.2425; 35var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3; 36var minTime = -maxTime; 37var millisecondsInWeek = 6048e5; 38var millisecondsInDay = 864e5; 39var millisecondsInMinute = 6e4; 40var millisecondsInHour = 36e5; 41var millisecondsInSecond = 1e3; 42var secondsInHour = 3600; 43var secondsInDay = secondsInHour * 24; 44var secondsInWeek = secondsInDay * 7; 45var secondsInYear = secondsInDay * daysInYear; 46var secondsInMonth = secondsInYear / 12; 47var secondsInQuarter = secondsInMonth * 3; 48var constructFromSymbol = Symbol.for("constructDateFrom"); 49
vendor: 343 bytes, lines 50-58
50// node_modules/date-fns/constructFrom.js 51function constructFrom(date, value) { 52 if (typeof date === "function") return date(value); 53 if (date && typeof date === "object" && constructFromSymbol in date) 54 return date[constructFromSymbol](value); 55 if (date instanceof Date) return new date.constructor(value); 56 return new Date(value); 57} 58
vendor: 130 bytes, lines 59-63
59// node_modules/date-fns/toDate.js 60function toDate(argument, context) { 61 return constructFrom(context || argument, argument); 62} 63
vendor: 335 bytes, lines 64-72
64// node_modules/date-fns/addDays.js 65function addDays(date, amount, options) { 66 const _date = toDate(date, options == null ? void 0 : options.in); 67 if (isNaN(amount)) return constructFrom((options == null ? void 0 : options.in) || date, NaN); 68 if (!amount) return _date; 69 _date.setDate(_date.getDate() + amount); 70 return _date; 71} 72
vendor: 772 bytes, lines 73-95
73// node_modules/date-fns/addMonths.js 74function addMonths(date, amount, options) { 75 const _date = toDate(date, options == null ? void 0 : options.in); 76 if (isNaN(amount)) return constructFrom((options == null ? void 0 : options.in) || date, NaN); 77 if (!amount) { 78 return _date; 79 } 80 const dayOfMonth = _date.getDate(); 81 const endOfDesiredMonth = constructFrom((options == null ? void 0 : options.in) || date, _date.getTime()); 82 endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0); 83 const daysInMonth = endOfDesiredMonth.getDate(); 84 if (dayOfMonth >= daysInMonth) { 85 return endOfDesiredMonth; 86 } else { 87 _date.setFullYear( 88 endOfDesiredMonth.getFullYear(), 89 endOfDesiredMonth.getMonth(), 90 dayOfMonth 91 ); 92 return _date; 93 } 94} 95
vendor: 194 bytes, lines 96-100
96// node_modules/date-fns/addMilliseconds.js 97function addMilliseconds(date, amount, options) { 98 return constructFrom((options == null ? void 0 : options.in) || date, +toDate(date) + amount); 99} 100
vendor: 153 bytes, lines 101-105
101// node_modules/date-fns/addHours.js 102function addHours(date, amount, options) { 103 return addMilliseconds(date, amount * millisecondsInHour, options); 104} 105
vendor: 132 bytes, lines 106-111
106// node_modules/date-fns/_lib/defaultOptions.js 107var defaultOptions = {}; 108function getDefaultOptions() { 109 return defaultOptions; 110} 111
vendor: 749 bytes, lines 112-124
112// node_modules/date-fns/startOfWeek.js 113function startOfWeek(date, options) { 114 var _a2, _b, _c, _d; 115 const defaultOptions2 = getDefaultOptions(); 116 const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0; 117 const _date = toDate(date, options == null ? void 0 : options.in); 118 const day = _date.getDay(); 119 const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; 120 _date.setDate(_date.getDate() - diff); 121 _date.setHours(0, 0, 0, 0); 122 return _date; 123} 124
vendor: 148 bytes, lines 125-129
125// node_modules/date-fns/startOfISOWeek.js 126function startOfISOWeek(date, options) { 127 return startOfWeek(date, { ...options, weekStartsOn: 1 }); 128} 129
vendor: 851 bytes, lines 130-150
130// node_modules/date-fns/getISOWeekYear.js 131function getISOWeekYear(date, options) { 132 const _date = toDate(date, options == null ? void 0 : options.in); 133 const year = _date.getFullYear(); 134 const fourthOfJanuaryOfNextYear = constructFrom(_date, 0); 135 fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); 136 fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); 137 const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear); 138 const fourthOfJanuaryOfThisYear = constructFrom(_date, 0); 139 fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); 140 fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); 141 const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear); 142 if (_date.getTime() >= startOfNextYear.getTime()) { 143 return year + 1; 144 } else if (_date.getTime() >= startOfThisYear.getTime()) { 145 return year; 146 } else { 147 return year - 1; 148 } 149} 150
vendor: 454 bytes, lines 151-168
151// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js 152function getTimezoneOffsetInMilliseconds(date) { 153 const _date = toDate(date); 154 const utcDate = new Date( 155 Date.UTC( 156 _date.getFullYear(), 157 _date.getMonth(), 158 _date.getDate(), 159 _date.getHours(), 160 _date.getMinutes(), 161 _date.getSeconds(), 162 _date.getMilliseconds() 163 ) 164 ); 165 utcDate.setUTCFullYear(_date.getFullYear()); 166 return +date - +utcDate; 167} 168
vendor: 244 bytes, lines 169-177
169// node_modules/date-fns/_lib/normalizeDates.js 170function normalizeDates(context, ...dates) { 171 const normalize = constructFrom.bind( 172 null, 173 context || dates.find((date) => typeof date === "object") 174 ); 175 return dates.map(normalize); 176} 177
vendor: 194 bytes, lines 178-184
178// node_modules/date-fns/startOfDay.js 179function startOfDay(date, options) { 180 const _date = toDate(date, options == null ? void 0 : options.in); 181 _date.setHours(0, 0, 0, 0); 182 return _date; 183} 184
vendor: 633 bytes, lines 185-198
185// node_modules/date-fns/differenceInCalendarDays.js 186function differenceInCalendarDays(laterDate, earlierDate, options) { 187 const [laterDate_, earlierDate_] = normalizeDates( 188 options == null ? void 0 : options.in, 189 laterDate, 190 earlierDate 191 ); 192 const laterStartOfDay = startOfDay(laterDate_); 193 const earlierStartOfDay = startOfDay(earlierDate_); 194 const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay); 195 const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay); 196 return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay); 197} 198
vendor: 359 bytes, lines 199-207
199// node_modules/date-fns/startOfISOWeekYear.js 200function startOfISOWeekYear(date, options) { 201 const year = getISOWeekYear(date, options); 202 const fourthOfJanuary = constructFrom((options == null ? void 0 : options.in) || date, 0); 203 fourthOfJanuary.setFullYear(year, 0, 4); 204 fourthOfJanuary.setHours(0, 0, 0, 0); 205 return startOfISOWeek(fourthOfJanuary); 206} 207
vendor: 238 bytes, lines 208-214
208// node_modules/date-fns/addMinutes.js 209function addMinutes(date, amount, options) { 210 const _date = toDate(date, options == null ? void 0 : options.in); 211 _date.setTime(_date.getTime() + amount * millisecondsInMinute); 212 return _date; 213} 214
vendor: 136 bytes, lines 215-219
215// node_modules/date-fns/addQuarters.js 216function addQuarters(date, amount, options) { 217 return addMonths(date, amount * 3, options); 218} 219
vendor: 142 bytes, lines 220-224
220// node_modules/date-fns/addSeconds.js 221function addSeconds(date, amount, options) { 222 return addMilliseconds(date, amount * 1e3, options); 223} 224
vendor: 128 bytes, lines 225-229
225// node_modules/date-fns/addWeeks.js 226function addWeeks(date, amount, options) { 227 return addDays(date, amount * 7, options); 228} 229
vendor: 131 bytes, lines 230-234
230// node_modules/date-fns/addYears.js 231function addYears(date, amount, options) { 232 return addMonths(date, amount * 12, options); 233} 234
vendor: 420 bytes, lines 235-247
235// node_modules/date-fns/max.js 236function max(dates, options) { 237 let result; 238 let context = options == null ? void 0 : options.in; 239 dates.forEach((date) => { 240 if (!context && typeof date === "object") 241 context = constructFrom.bind(null, date); 242 const date_ = toDate(date, context); 243 if (!result || result < date_ || isNaN(+date_)) result = date_; 244 }); 245 return constructFrom(context, result || NaN); 246} 247
vendor: 420 bytes, lines 248-260
248// node_modules/date-fns/min.js 249function min(dates, options) { 250 let result; 251 let context = options == null ? void 0 : options.in; 252 dates.forEach((date) => { 253 if (!context && typeof date === "object") 254 context = constructFrom.bind(null, date); 255 const date_ = toDate(date, context); 256 if (!result || result > date_ || isNaN(+date_)) result = date_; 257 }); 258 return constructFrom(context, result || NaN); 259} 260
vendor: 285 bytes, lines 261-270
261// node_modules/date-fns/isSameDay.js 262function isSameDay(laterDate, earlierDate, options) { 263 const [dateLeft_, dateRight_] = normalizeDates( 264 options == null ? void 0 : options.in, 265 laterDate, 266 earlierDate 267 ); 268 return +startOfDay(dateLeft_) === +startOfDay(dateRight_); 269} 270
vendor: 185 bytes, lines 271-275
271// node_modules/date-fns/isDate.js 272function isDate(value) { 273 return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]"; 274} 275
vendor: 143 bytes, lines 276-280
276// node_modules/date-fns/isValid.js 277function isValid(date) { 278 return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date))); 279} 280
vendor: 444 bytes, lines 281-292
281// node_modules/date-fns/differenceInCalendarMonths.js 282function differenceInCalendarMonths(laterDate, earlierDate, options) { 283 const [laterDate_, earlierDate_] = normalizeDates( 284 options == null ? void 0 : options.in, 285 laterDate, 286 earlierDate 287 ); 288 const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); 289 const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth(); 290 return yearsDiff * 12 + monthsDiff; 291} 292
vendor: 222 bytes, lines 293-299
293// node_modules/date-fns/getQuarter.js 294function getQuarter(date, options) { 295 const _date = toDate(date, options == null ? void 0 : options.in); 296 const quarter = Math.trunc(_date.getMonth() / 3) + 1; 297 return quarter; 298} 299
vendor: 453 bytes, lines 300-311
300// node_modules/date-fns/differenceInCalendarQuarters.js 301function differenceInCalendarQuarters(laterDate, earlierDate, options) { 302 const [laterDate_, earlierDate_] = normalizeDates( 303 options == null ? void 0 : options.in, 304 laterDate, 305 earlierDate 306 ); 307 const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear(); 308 const quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_); 309 return yearsDiff * 4 + quartersDiff; 310} 311
vendor: 323 bytes, lines 312-321
312// node_modules/date-fns/differenceInCalendarYears.js 313function differenceInCalendarYears(laterDate, earlierDate, options) { 314 const [laterDate_, earlierDate_] = normalizeDates( 315 options == null ? void 0 : options.in, 316 laterDate, 317 earlierDate 318 ); 319 return laterDate_.getFullYear() - earlierDate_.getFullYear(); 320} 321
vendor: 1,146 bytes, lines 322-346
322// node_modules/date-fns/differenceInDays.js 323function differenceInDays(laterDate, earlierDate, options) { 324 const [laterDate_, earlierDate_] = normalizeDates( 325 options == null ? void 0 : options.in, 326 laterDate, 327 earlierDate 328 ); 329 const sign = compareLocalAsc(laterDate_, earlierDate_); 330 const difference = Math.abs( 331 differenceInCalendarDays(laterDate_, earlierDate_) 332 ); 333 laterDate_.setDate(laterDate_.getDate() - sign * difference); 334 const isLastDayNotFull = Number( 335 compareLocalAsc(laterDate_, earlierDate_) === -sign 336 ); 337 const result = sign * (difference - isLastDayNotFull); 338 return result === 0 ? 0 : result; 339} 340function compareLocalAsc(laterDate, earlierDate) { 341 const diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds(); 342 if (diff < 0) return -1; 343 if (diff > 0) return 1; 344 return diff; 345} 346
vendor: 195 bytes, lines 347-353
347// node_modules/date-fns/endOfDay.js 348function endOfDay(date, options) { 349 const _date = toDate(date, options == null ? void 0 : options.in); 350 _date.setHours(23, 59, 59, 999); 351 return _date; 352} 353
vendor: 289 bytes, lines 354-362
354// node_modules/date-fns/endOfMonth.js 355function endOfMonth(date, options) { 356 const _date = toDate(date, options == null ? void 0 : options.in); 357 const month = _date.getMonth(); 358 _date.setFullYear(_date.getFullYear(), month + 1, 0); 359 _date.setHours(23, 59, 59, 999); 360 return _date; 361} 362
vendor: 320 bytes, lines 363-372
363// node_modules/date-fns/startOfQuarter.js 364function startOfQuarter(date, options) { 365 const _date = toDate(date, options == null ? void 0 : options.in); 366 const currentMonth = _date.getMonth(); 367 const month = currentMonth - currentMonth % 3; 368 _date.setMonth(month, 1); 369 _date.setHours(0, 0, 0, 0); 370 return _date; 371} 372
vendor: 218 bytes, lines 373-380
373// node_modules/date-fns/startOfMonth.js 374function startOfMonth(date, options) { 375 const _date = toDate(date, options == null ? void 0 : options.in); 376 _date.setDate(1); 377 _date.setHours(0, 0, 0, 0); 378 return _date; 379} 380
vendor: 270 bytes, lines 381-389
381// node_modules/date-fns/endOfYear.js 382function endOfYear(date, options) { 383 const _date = toDate(date, options == null ? void 0 : options.in); 384 const year = _date.getFullYear(); 385 _date.setFullYear(year + 1, 0, 0); 386 _date.setHours(23, 59, 59, 999); 387 return _date; 388} 389
vendor: 244 bytes, lines 390-397
390// node_modules/date-fns/startOfYear.js 391function startOfYear(date, options) { 392 const date_ = toDate(date, options == null ? void 0 : options.in); 393 date_.setFullYear(date_.getFullYear(), 0, 1); 394 date_.setHours(0, 0, 0, 0); 395 return date_; 396} 397
vendor: 757 bytes, lines 398-410
398// node_modules/date-fns/endOfWeek.js 399function endOfWeek(date, options) { 400 var _a2, _b, _c, _d; 401 const defaultOptions2 = getDefaultOptions(); 402 const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0; 403 const _date = toDate(date, options == null ? void 0 : options.in); 404 const day = _date.getDay(); 405 const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); 406 _date.setDate(_date.getDate() + diff); 407 _date.setHours(23, 59, 59, 999); 408 return _date; 409} 410
vendor: 1,821 bytes, lines 411-494
411// node_modules/date-fns/locale/en-US/_lib/formatDistance.js 412var formatDistanceLocale = { 413 lessThanXSeconds: { 414 one: "less than a second", 415 other: "less than {{count}} seconds" 416 }, 417 xSeconds: { 418 one: "1 second", 419 other: "{{count}} seconds" 420 }, 421 halfAMinute: "half a minute", 422 lessThanXMinutes: { 423 one: "less than a minute", 424 other: "less than {{count}} minutes" 425 }, 426 xMinutes: { 427 one: "1 minute", 428 other: "{{count}} minutes" 429 }, 430 aboutXHours: { 431 one: "about 1 hour", 432 other: "about {{count}} hours" 433 }, 434 xHours: { 435 one: "1 hour", 436 other: "{{count}} hours" 437 }, 438 xDays: { 439 one: "1 day", 440 other: "{{count}} days" 441 }, 442 aboutXWeeks: { 443 one: "about 1 week", 444 other: "about {{count}} weeks" 445 }, 446 xWeeks: { 447 one: "1 week", 448 other: "{{count}} weeks" 449 }, 450 aboutXMonths: { 451 one: "about 1 month", 452 other: "about {{count}} months" 453 }, 454 xMonths: { 455 one: "1 month", 456 other: "{{count}} months" 457 }, 458 aboutXYears: { 459 one: "about 1 year", 460 other: "about {{count}} years" 461 }, 462 xYears: { 463 one: "1 year", 464 other: "{{count}} years" 465 }, 466 overXYears: { 467 one: "over 1 year", 468 other: "over {{count}} years" 469 }, 470 almostXYears: { 471 one: "almost 1 year", 472 other: "almost {{count}} years" 473 } 474}; 475var formatDistance = (token, count2, options) => { 476 let result; 477 const tokenValue = formatDistanceLocale[token]; 478 if (typeof tokenValue === "string") { 479 result = tokenValue; 480 } else if (count2 === 1) { 481 result = tokenValue.one; 482 } else { 483 result = tokenValue.other.replace("{{count}}", count2.toString()); 484 } 485 if (options == null ? void 0 : options.addSuffix) { 486 if (options.comparison && options.comparison > 0) { 487 return "in " + result; 488 } else { 489 return result + " ago"; 490 } 491 } 492 return result; 493}; 494
vendor: 303 bytes, lines 495-503
495// node_modules/date-fns/locale/_lib/buildFormatLongFn.js 496function buildFormatLongFn(args) { 497 return (options = {}) => { 498 const width = options.width ? String(options.width) : args.defaultWidth; 499 const format2 = args.formats[width] || args.formats[args.defaultWidth]; 500 return format2; 501 }; 502} 503
vendor: 729 bytes, lines 504-537
504// node_modules/date-fns/locale/en-US/_lib/formatLong.js 505var dateFormats = { 506 full: "EEEE, MMMM do, y", 507 long: "MMMM do, y", 508 medium: "MMM d, y", 509 short: "MM/dd/yyyy" 510}; 511var timeFormats = { 512 full: "h:mm:ss a zzzz", 513 long: "h:mm:ss a z", 514 medium: "h:mm:ss a", 515 short: "h:mm a" 516}; 517var dateTimeFormats = { 518 full: "{{date}} 'at' {{time}}", 519 long: "{{date}} 'at' {{time}}", 520 medium: "{{date}}, {{time}}", 521 short: "{{date}}, {{time}}" 522}; 523var formatLong = { 524 date: buildFormatLongFn({ 525 formats: dateFormats, 526 defaultWidth: "full" 527 }), 528 time: buildFormatLongFn({ 529 formats: timeFormats, 530 defaultWidth: "full" 531 }), 532 dateTime: buildFormatLongFn({ 533 formats: dateTimeFormats, 534 defaultWidth: "full" 535 }) 536}; 537
vendor: 346 bytes, lines 538-548
538// node_modules/date-fns/locale/en-US/_lib/formatRelative.js 539var formatRelativeLocale = { 540 lastWeek: "'last' eeee 'at' p", 541 yesterday: "'yesterday at' p", 542 today: "'today at' p", 543 tomorrow: "'tomorrow at' p", 544 nextWeek: "eeee 'at' p", 545 other: "P" 546}; 547var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token]; 548
vendor: 941 bytes, lines 549-567
549// node_modules/date-fns/locale/_lib/buildLocalizeFn.js 550function buildLocalizeFn(args) { 551 return (value, options) => { 552 const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone"; 553 let valuesArray; 554 if (context === "formatting" && args.formattingValues) { 555 const defaultWidth = args.defaultFormattingWidth || args.defaultWidth; 556 const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth; 557 valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; 558 } else { 559 const defaultWidth = args.defaultWidth; 560 const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth; 561 valuesArray = args.values[width] || args.values[defaultWidth]; 562 } 563 const index3 = args.argumentCallback ? args.argumentCallback(value) : value; 564 return valuesArray[index3]; 565 }; 566} 567
vendor: 3,241 bytes, lines 568-729
568// node_modules/date-fns/locale/en-US/_lib/localize.js 569var eraValues = { 570 narrow: ["B", "A"], 571 abbreviated: ["BC", "AD"], 572 wide: ["Before Christ", "Anno Domini"] 573}; 574var quarterValues = { 575 narrow: ["1", "2", "3", "4"], 576 abbreviated: ["Q1", "Q2", "Q3", "Q4"], 577 wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] 578}; 579var monthValues = { 580 narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], 581 abbreviated: [ 582 "Jan", 583 "Feb", 584 "Mar", 585 "Apr", 586 "May", 587 "Jun", 588 "Jul", 589 "Aug", 590 "Sep", 591 "Oct", 592 "Nov", 593 "Dec" 594 ], 595 wide: [ 596 "January", 597 "February", 598 "March", 599 "April", 600 "May", 601 "June", 602 "July", 603 "August", 604 "September", 605 "October", 606 "November", 607 "December" 608 ] 609}; 610var dayValues = { 611 narrow: ["S", "M", "T", "W", "T", "F", "S"], 612 short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], 613 abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 614 wide: [ 615 "Sunday", 616 "Monday", 617 "Tuesday", 618 "Wednesday", 619 "Thursday", 620 "Friday", 621 "Saturday" 622 ] 623}; 624var dayPeriodValues = { 625 narrow: { 626 am: "a", 627 pm: "p", 628 midnight: "mi", 629 noon: "n", 630 morning: "morning", 631 afternoon: "afternoon", 632 evening: "evening", 633 night: "night" 634 }, 635 abbreviated: { 636 am: "AM", 637 pm: "PM", 638 midnight: "midnight", 639 noon: "noon", 640 morning: "morning", 641 afternoon: "afternoon", 642 evening: "evening", 643 night: "night" 644 }, 645 wide: { 646 am: "a.m.", 647 pm: "p.m.", 648 midnight: "midnight", 649 noon: "noon", 650 morning: "morning", 651 afternoon: "afternoon", 652 evening: "evening", 653 night: "night" 654 } 655}; 656var formattingDayPeriodValues = { 657 narrow: { 658 am: "a", 659 pm: "p", 660 midnight: "mi", 661 noon: "n", 662 morning: "in the morning", 663 afternoon: "in the afternoon", 664 evening: "in the evening", 665 night: "at night" 666 }, 667 abbreviated: { 668 am: "AM", 669 pm: "PM", 670 midnight: "midnight", 671 noon: "noon", 672 morning: "in the morning", 673 afternoon: "in the afternoon", 674 evening: "in the evening", 675 night: "at night" 676 }, 677 wide: { 678 am: "a.m.", 679 pm: "p.m.", 680 midnight: "midnight", 681 noon: "noon", 682 morning: "in the morning", 683 afternoon: "in the afternoon", 684 evening: "in the evening", 685 night: "at night" 686 } 687}; 688var ordinalNumber = (dirtyNumber, _options) => { 689 const number = Number(dirtyNumber); 690 const rem100 = number % 100; 691 if (rem100 > 20 || rem100 < 10) { 692 switch (rem100 % 10) { 693 case 1: 694 return number + "st"; 695 case 2: 696 return number + "nd"; 697 case 3: 698 return number + "rd"; 699 } 700 } 701 return number + "th"; 702}; 703var localize = { 704 ordinalNumber, 705 era: buildLocalizeFn({ 706 values: eraValues, 707 defaultWidth: "wide" 708 }), 709 quarter: buildLocalizeFn({ 710 values: quarterValues, 711 defaultWidth: "wide", 712 argumentCallback: (quarter) => quarter - 1 713 }), 714 month: buildLocalizeFn({ 715 values: monthValues, 716 defaultWidth: "wide" 717 }), 718 day: buildLocalizeFn({ 719 values: dayValues, 720 defaultWidth: "wide" 721 }), 722 dayPeriod: buildLocalizeFn({ 723 values: dayPeriodValues, 724 defaultWidth: "wide", 725 formattingValues: formattingDayPeriodValues, 726 defaultFormattingWidth: "wide" 727 }) 728}; 729
vendor: 1,435 bytes, lines 730-771
730// node_modules/date-fns/locale/_lib/buildMatchFn.js 731function buildMatchFn(args) { 732 return (string, options = {}) => { 733 const width = options.width; 734 const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; 735 const matchResult = string.match(matchPattern); 736 if (!matchResult) { 737 return null; 738 } 739 const matchedString = matchResult[0]; 740 const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; 741 const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : ( 742 // [TODO] -- I challenge you to fix the type 743 findKey(parsePatterns, (pattern) => pattern.test(matchedString)) 744 ); 745 let value; 746 value = args.valueCallback ? args.valueCallback(key) : key; 747 value = options.valueCallback ? ( 748 // [TODO] -- I challenge you to fix the type 749 options.valueCallback(value) 750 ) : value; 751 const rest = string.slice(matchedString.length); 752 return { value, rest }; 753 }; 754} 755function findKey(object, predicate) { 756 for (const key in object) { 757 if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) { 758 return key; 759 } 760 } 761 return void 0; 762} 763function findIndex(array, predicate) { 764 for (let key = 0; key < array.length; key++) { 765 if (predicate(array[key])) { 766 return key; 767 } 768 } 769 return void 0; 770} 771
vendor: 613 bytes, lines 772-786
772// node_modules/date-fns/locale/_lib/buildMatchPatternFn.js 773function buildMatchPatternFn(args) { 774 return (string, options = {}) => { 775 const matchResult = string.match(args.matchPattern); 776 if (!matchResult) return null; 777 const matchedString = matchResult[0]; 778 const parseResult = string.match(args.parsePattern); 779 if (!parseResult) return null; 780 let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; 781 value = options.valueCallback ? options.valueCallback(value) : value; 782 const rest = string.slice(matchedString.length); 783 return { value, rest }; 784 }; 785} 786
vendor: 3,003 bytes, lines 787-905
787// node_modules/date-fns/locale/en-US/_lib/match.js 788var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; 789var parseOrdinalNumberPattern = /\d+/i; 790var matchEraPatterns = { 791 narrow: /^(b|a)/i, 792 abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, 793 wide: /^(before christ|before common era|anno domini|common era)/i 794}; 795var parseEraPatterns = { 796 any: [/^b/i, /^(a|c)/i] 797}; 798var matchQuarterPatterns = { 799 narrow: /^[1234]/i, 800 abbreviated: /^q[1234]/i, 801 wide: /^[1234](th|st|nd|rd)? quarter/i 802}; 803var parseQuarterPatterns = { 804 any: [/1/i, /2/i, /3/i, /4/i] 805}; 806var matchMonthPatterns = { 807 narrow: /^[jfmasond]/i, 808 abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, 809 wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i 810}; 811var parseMonthPatterns = { 812 narrow: [ 813 /^j/i, 814 /^f/i, 815 /^m/i, 816 /^a/i, 817 /^m/i, 818 /^j/i, 819 /^j/i, 820 /^a/i, 821 /^s/i, 822 /^o/i, 823 /^n/i, 824 /^d/i 825 ], 826 any: [ 827 /^ja/i, 828 /^f/i, 829 /^mar/i, 830 /^ap/i, 831 /^may/i, 832 /^jun/i, 833 /^jul/i, 834 /^au/i, 835 /^s/i, 836 /^o/i, 837 /^n/i, 838 /^d/i 839 ] 840}; 841var matchDayPatterns = { 842 narrow: /^[smtwf]/i, 843 short: /^(su|mo|tu|we|th|fr|sa)/i, 844 abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, 845 wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i 846}; 847var parseDayPatterns = { 848 narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], 849 any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] 850}; 851var matchDayPeriodPatterns = { 852 narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, 853 any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i 854}; 855var parseDayPeriodPatterns = { 856 any: { 857 am: /^a/i, 858 pm: /^p/i, 859 midnight: /^mi/i, 860 noon: /^no/i, 861 morning: /morning/i, 862 afternoon: /afternoon/i, 863 evening: /evening/i, 864 night: /night/i 865 } 866}; 867var match = { 868 ordinalNumber: buildMatchPatternFn({ 869 matchPattern: matchOrdinalNumberPattern, 870 parsePattern: parseOrdinalNumberPattern, 871 valueCallback: (value) => parseInt(value, 10) 872 }), 873 era: buildMatchFn({ 874 matchPatterns: matchEraPatterns, 875 defaultMatchWidth: "wide", 876 parsePatterns: parseEraPatterns, 877 defaultParseWidth: "any" 878 }), 879 quarter: buildMatchFn({ 880 matchPatterns: matchQuarterPatterns, 881 defaultMatchWidth: "wide", 882 parsePatterns: parseQuarterPatterns, 883 defaultParseWidth: "any", 884 valueCallback: (index3) => index3 + 1 885 }), 886 month: buildMatchFn({ 887 matchPatterns: matchMonthPatterns, 888 defaultMatchWidth: "wide", 889 parsePatterns: parseMonthPatterns, 890 defaultParseWidth: "any" 891 }), 892 day: buildMatchFn({ 893 matchPatterns: matchDayPatterns, 894 defaultMatchWidth: "wide", 895 parsePatterns: parseDayPatterns, 896 defaultParseWidth: "any" 897 }), 898 dayPeriod: buildMatchFn({ 899 matchPatterns: matchDayPeriodPatterns, 900 defaultMatchWidth: "any", 901 parsePatterns: parseDayPeriodPatterns, 902 defaultParseWidth: "any" 903 }) 904}; 905
vendor: 213 bytes, lines 906-919
906// node_modules/date-fns/locale/en-US.js 907var enUS = { 908 code: "en-US", 909 formatDistance, 910 formatLong, 911 formatRelative, 912 localize, 913 match, 914 options: { 915 weekStartsOn: 0, 916 firstWeekContainsDate: 1 917 } 918}; 919
vendor: 270 bytes, lines 920-927
920// node_modules/date-fns/getDayOfYear.js 921function getDayOfYear(date, options) { 922 const _date = toDate(date, options == null ? void 0 : options.in); 923 const diff = differenceInCalendarDays(_date, startOfYear(_date)); 924 const dayOfYear = diff + 1; 925 return dayOfYear; 926} 927
vendor: 268 bytes, lines 928-934
928// node_modules/date-fns/getISOWeek.js 929function getISOWeek(date, options) { 930 const _date = toDate(date, options == null ? void 0 : options.in); 931 const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date); 932 return Math.round(diff / millisecondsInWeek) + 1; 933} 934
vendor: 1,358 bytes, lines 935-958
935// node_modules/date-fns/getWeekYear.js 936function getWeekYear(date, options) { 937 var _a2, _b, _c, _d; 938 const _date = toDate(date, options == null ? void 0 : options.in); 939 const year = _date.getFullYear(); 940 const defaultOptions2 = getDefaultOptions(); 941 const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1; 942 const firstWeekOfNextYear = constructFrom((options == null ? void 0 : options.in) || date, 0); 943 firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); 944 firstWeekOfNextYear.setHours(0, 0, 0, 0); 945 const startOfNextYear = startOfWeek(firstWeekOfNextYear, options); 946 const firstWeekOfThisYear = constructFrom((options == null ? void 0 : options.in) || date, 0); 947 firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); 948 firstWeekOfThisYear.setHours(0, 0, 0, 0); 949 const startOfThisYear = startOfWeek(firstWeekOfThisYear, options); 950 if (+_date >= +startOfNextYear) { 951 return year + 1; 952 } else if (+_date >= +startOfThisYear) { 953 return year; 954 } else { 955 return year - 1; 956 } 957} 958
vendor: 836 bytes, lines 959-971
959// node_modules/date-fns/startOfWeekYear.js 960function startOfWeekYear(date, options) { 961 var _a2, _b, _c, _d; 962 const defaultOptions2 = getDefaultOptions(); 963 const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1; 964 const year = getWeekYear(date, options); 965 const firstWeek = constructFrom((options == null ? void 0 : options.in) || date, 0); 966 firstWeek.setFullYear(year, 0, firstWeekContainsDate); 967 firstWeek.setHours(0, 0, 0, 0); 968 const _date = startOfWeek(firstWeek, options); 969 return _date; 970} 971
vendor: 274 bytes, lines 972-978
972// node_modules/date-fns/getWeek.js 973function getWeek(date, options) { 974 const _date = toDate(date, options == null ? void 0 : options.in); 975 const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options); 976 return Math.round(diff / millisecondsInWeek) + 1; 977} 978
vendor: 237 bytes, lines 979-985
979// node_modules/date-fns/_lib/addLeadingZeros.js 980function addLeadingZeros(number, targetLength) { 981 const sign = number < 0 ? "-" : ""; 982 const output = Math.abs(number).toString().padStart(targetLength, "0"); 983 return sign + output; 984} 985
vendor: 1,686 bytes, lines 986-1045
986// node_modules/date-fns/_lib/format/lightFormatters.js 987var lightFormatters = { 988 // Year 989 y(date, token) { 990 const signedYear = date.getFullYear(); 991 const year = signedYear > 0 ? signedYear : 1 - signedYear; 992 return addLeadingZeros(token === "yy" ? year % 100 : year, token.length); 993 }, 994 // Month 995 M(date, token) { 996 const month = date.getMonth(); 997 return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2); 998 }, 999 // Day of the month 1000 d(date, token) { 1001 return addLeadingZeros(date.getDate(), token.length); 1002 }, 1003 // AM or PM 1004 a(date, token) { 1005 const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am"; 1006 switch (token) { 1007 case "a": 1008 case "aa": 1009 return dayPeriodEnumValue.toUpperCase(); 1010 case "aaa": 1011 return dayPeriodEnumValue; 1012 case "aaaaa": 1013 return dayPeriodEnumValue[0]; 1014 case "aaaa": 1015 default: 1016 return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; 1017 } 1018 }, 1019 // Hour [1-12] 1020 h(date, token) { 1021 return addLeadingZeros(date.getHours() % 12 || 12, token.length); 1022 }, 1023 // Hour [0-23] 1024 H(date, token) { 1025 return addLeadingZeros(date.getHours(), token.length); 1026 }, 1027 // Minute 1028 m(date, token) { 1029 return addLeadingZeros(date.getMinutes(), token.length); 1030 }, 1031 // Second 1032 s(date, token) { 1033 return addLeadingZeros(date.getSeconds(), token.length); 1034 }, 1035 // Fraction of second 1036 S(date, token) { 1037 const numberOfDigits = token.length; 1038 const milliseconds = date.getMilliseconds(); 1039 const fractionalSeconds = Math.trunc( 1040 milliseconds * Math.pow(10, numberOfDigits - 3) 1041 ); 1042 return addLeadingZeros(fractionalSeconds, token.length); 1043 } 1044}; 1045
vendor: 19,233 bytes, lines 1046-1691
1046// node_modules/date-fns/_lib/format/formatters.js 1047var dayPeriodEnum = { 1048 am: "am", 1049 pm: "pm", 1050 midnight: "midnight", 1051 noon: "noon", 1052 morning: "morning", 1053 afternoon: "afternoon", 1054 evening: "evening", 1055 night: "night" 1056}; 1057var formatters = { 1058 // Era 1059 G: function(date, token, localize2) { 1060 const era = date.getFullYear() > 0 ? 1 : 0; 1061 switch (token) { 1062 // AD, BC 1063 case "G": 1064 case "GG": 1065 case "GGG": 1066 return localize2.era(era, { width: "abbreviated" }); 1067 // A, B 1068 case "GGGGG": 1069 return localize2.era(era, { width: "narrow" }); 1070 // Anno Domini, Before Christ 1071 case "GGGG": 1072 default: 1073 return localize2.era(era, { width: "wide" }); 1074 } 1075 }, 1076 // Year 1077 y: function(date, token, localize2) { 1078 if (token === "yo") { 1079 const signedYear = date.getFullYear(); 1080 const year = signedYear > 0 ? signedYear : 1 - signedYear; 1081 return localize2.ordinalNumber(year, { unit: "year" }); 1082 } 1083 return lightFormatters.y(date, token); 1084 }, 1085 // Local week-numbering year 1086 Y: function(date, token, localize2, options) { 1087 const signedWeekYear = getWeekYear(date, options); 1088 const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; 1089 if (token === "YY") { 1090 const twoDigitYear = weekYear % 100; 1091 return addLeadingZeros(twoDigitYear, 2); 1092 } 1093 if (token === "Yo") { 1094 return localize2.ordinalNumber(weekYear, { unit: "year" }); 1095 } 1096 return addLeadingZeros(weekYear, token.length); 1097 }, 1098 // ISO week-numbering year 1099 R: function(date, token) { 1100 const isoWeekYear = getISOWeekYear(date); 1101 return addLeadingZeros(isoWeekYear, token.length); 1102 }, 1103 // Extended year. This is a single number designating the year of this calendar system. 1104 // The main difference between `y` and `u` localizers are B.C. years: 1105 // | Year | `y` | `u` | 1106 // |------|-----|-----| 1107 // | AC 1 | 1 | 1 | 1108 // | BC 1 | 1 | 0 | 1109 // | BC 2 | 2 | -1 | 1110 // Also `yy` always returns the last two digits of a year, 1111 // while `uu` pads single digit years to 2 characters and returns other years unchanged. 1112 u: function(date, token) { 1113 const year = date.getFullYear(); 1114 return addLeadingZeros(year, token.length); 1115 }, 1116 // Quarter 1117 Q: function(date, token, localize2) { 1118 const quarter = Math.ceil((date.getMonth() + 1) / 3); 1119 switch (token) { 1120 // 1, 2, 3, 4 1121 case "Q": 1122 return String(quarter); 1123 // 01, 02, 03, 04 1124 case "QQ": 1125 return addLeadingZeros(quarter, 2); 1126 // 1st, 2nd, 3rd, 4th 1127 case "Qo": 1128 return localize2.ordinalNumber(quarter, { unit: "quarter" }); 1129 // Q1, Q2, Q3, Q4 1130 case "QQQ": 1131 return localize2.quarter(quarter, { 1132 width: "abbreviated", 1133 context: "formatting" 1134 }); 1135 // 1, 2, 3, 4 (narrow quarter; could be not numerical) 1136 case "QQQQQ": 1137 return localize2.quarter(quarter, { 1138 width: "narrow", 1139 context: "formatting" 1140 }); 1141 // 1st quarter, 2nd quarter, ... 1142 case "QQQQ": 1143 default: 1144 return localize2.quarter(quarter, { 1145 width: "wide", 1146 context: "formatting" 1147 }); 1148 } 1149 }, 1150 // Stand-alone quarter 1151 q: function(date, token, localize2) { 1152 const quarter = Math.ceil((date.getMonth() + 1) / 3); 1153 switch (token) { 1154 // 1, 2, 3, 4 1155 case "q": 1156 return String(quarter); 1157 // 01, 02, 03, 04 1158 case "qq": 1159 return addLeadingZeros(quarter, 2); 1160 // 1st, 2nd, 3rd, 4th 1161 case "qo": 1162 return localize2.ordinalNumber(quarter, { unit: "quarter" }); 1163 // Q1, Q2, Q3, Q4 1164 case "qqq": 1165 return localize2.quarter(quarter, { 1166 width: "abbreviated", 1167 context: "standalone" 1168 }); 1169 // 1, 2, 3, 4 (narrow quarter; could be not numerical) 1170 case "qqqqq": 1171 return localize2.quarter(quarter, { 1172 width: "narrow", 1173 context: "standalone" 1174 }); 1175 // 1st quarter, 2nd quarter, ... 1176 case "qqqq": 1177 default: 1178 return localize2.quarter(quarter, { 1179 width: "wide", 1180 context: "standalone" 1181 }); 1182 } 1183 }, 1184 // Month 1185 M: function(date, token, localize2) { 1186 const month = date.getMonth(); 1187 switch (token) { 1188 case "M": 1189 case "MM": 1190 return lightFormatters.M(date, token); 1191 // 1st, 2nd, ..., 12th 1192 case "Mo": 1193 return localize2.ordinalNumber(month + 1, { unit: "month" }); 1194 // Jan, Feb, ..., Dec 1195 case "MMM": 1196 return localize2.month(month, { 1197 width: "abbreviated", 1198 context: "formatting" 1199 }); 1200 // J, F, ..., D 1201 case "MMMMM": 1202 return localize2.month(month, { 1203 width: "narrow", 1204 context: "formatting" 1205 }); 1206 // January, February, ..., December 1207 case "MMMM": 1208 default: 1209 return localize2.month(month, { width: "wide", context: "formatting" }); 1210 } 1211 }, 1212 // Stand-alone month 1213 L: function(date, token, localize2) { 1214 const month = date.getMonth(); 1215 switch (token) { 1216 // 1, 2, ..., 12 1217 case "L": 1218 return String(month + 1); 1219 // 01, 02, ..., 12 1220 case "LL": 1221 return addLeadingZeros(month + 1, 2); 1222 // 1st, 2nd, ..., 12th 1223 case "Lo": 1224 return localize2.ordinalNumber(month + 1, { unit: "month" }); 1225 // Jan, Feb, ..., Dec 1226 case "LLL": 1227 return localize2.month(month, { 1228 width: "abbreviated", 1229 context: "standalone" 1230 }); 1231 // J, F, ..., D 1232 case "LLLLL": 1233 return localize2.month(month, { 1234 width: "narrow", 1235 context: "standalone" 1236 }); 1237 // January, February, ..., December 1238 case "LLLL": 1239 default: 1240 return localize2.month(month, { width: "wide", context: "standalone" }); 1241 } 1242 }, 1243 // Local week of year 1244 w: function(date, token, localize2, options) { 1245 const week = getWeek(date, options); 1246 if (token === "wo") { 1247 return localize2.ordinalNumber(week, { unit: "week" }); 1248 } 1249 return addLeadingZeros(week, token.length); 1250 }, 1251 // ISO week of year 1252 I: function(date, token, localize2) { 1253 const isoWeek = getISOWeek(date); 1254 if (token === "Io") { 1255 return localize2.ordinalNumber(isoWeek, { unit: "week" }); 1256 } 1257 return addLeadingZeros(isoWeek, token.length); 1258 }, 1259 // Day of the month 1260 d: function(date, token, localize2) { 1261 if (token === "do") { 1262 return localize2.ordinalNumber(date.getDate(), { unit: "date" }); 1263 } 1264 return lightFormatters.d(date, token); 1265 }, 1266 // Day of year 1267 D: function(date, token, localize2) { 1268 const dayOfYear = getDayOfYear(date); 1269 if (token === "Do") { 1270 return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" }); 1271 } 1272 return addLeadingZeros(dayOfYear, token.length); 1273 }, 1274 // Day of week 1275 E: function(date, token, localize2) { 1276 const dayOfWeek = date.getDay(); 1277 switch (token) { 1278 // Tue 1279 case "E": 1280 case "EE": 1281 case "EEE": 1282 return localize2.day(dayOfWeek, { 1283 width: "abbreviated", 1284 context: "formatting" 1285 }); 1286 // T 1287 case "EEEEE": 1288 return localize2.day(dayOfWeek, { 1289 width: "narrow", 1290 context: "formatting" 1291 }); 1292 // Tu 1293 case "EEEEEE": 1294 return localize2.day(dayOfWeek, { 1295 width: "short", 1296 context: "formatting" 1297 }); 1298 // Tuesday 1299 case "EEEE": 1300 default: 1301 return localize2.day(dayOfWeek, { 1302 width: "wide", 1303 context: "formatting" 1304 }); 1305 } 1306 }, 1307 // Local day of week 1308 e: function(date, token, localize2, options) { 1309 const dayOfWeek = date.getDay(); 1310 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; 1311 switch (token) { 1312 // Numerical value (Nth day of week with current locale or weekStartsOn) 1313 case "e": 1314 return String(localDayOfWeek); 1315 // Padded numerical value 1316 case "ee": 1317 return addLeadingZeros(localDayOfWeek, 2); 1318 // 1st, 2nd, ..., 7th 1319 case "eo": 1320 return localize2.ordinalNumber(localDayOfWeek, { unit: "day" }); 1321 case "eee": 1322 return localize2.day(dayOfWeek, { 1323 width: "abbreviated", 1324 context: "formatting" 1325 }); 1326 // T 1327 case "eeeee": 1328 return localize2.day(dayOfWeek, { 1329 width: "narrow", 1330 context: "formatting" 1331 }); 1332 // Tu 1333 case "eeeeee": 1334 return localize2.day(dayOfWeek, { 1335 width: "short", 1336 context: "formatting" 1337 }); 1338 // Tuesday 1339 case "eeee": 1340 default: 1341 return localize2.day(dayOfWeek, { 1342 width: "wide", 1343 context: "formatting" 1344 }); 1345 } 1346 }, 1347 // Stand-alone local day of week 1348 c: function(date, token, localize2, options) { 1349 const dayOfWeek = date.getDay(); 1350 const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; 1351 switch (token) { 1352 // Numerical value (same as in `e`) 1353 case "c": 1354 return String(localDayOfWeek); 1355 // Padded numerical value 1356 case "cc": 1357 return addLeadingZeros(localDayOfWeek, token.length); 1358 // 1st, 2nd, ..., 7th 1359 case "co": 1360 return localize2.ordinalNumber(localDayOfWeek, { unit: "day" }); 1361 case "ccc": 1362 return localize2.day(dayOfWeek, { 1363 width: "abbreviated", 1364 context: "standalone" 1365 }); 1366 // T 1367 case "ccccc": 1368 return localize2.day(dayOfWeek, { 1369 width: "narrow", 1370 context: "standalone" 1371 }); 1372 // Tu 1373 case "cccccc": 1374 return localize2.day(dayOfWeek, { 1375 width: "short", 1376 context: "standalone" 1377 }); 1378 // Tuesday 1379 case "cccc": 1380 default: 1381 return localize2.day(dayOfWeek, { 1382 width: "wide", 1383 context: "standalone" 1384 }); 1385 } 1386 }, 1387 // ISO day of week 1388 i: function(date, token, localize2) { 1389 const dayOfWeek = date.getDay(); 1390 const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; 1391 switch (token) { 1392 // 2 1393 case "i": 1394 return String(isoDayOfWeek); 1395 // 02 1396 case "ii": 1397 return addLeadingZeros(isoDayOfWeek, token.length); 1398 // 2nd 1399 case "io": 1400 return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" }); 1401 // Tue 1402 case "iii": 1403 return localize2.day(dayOfWeek, { 1404 width: "abbreviated", 1405 context: "formatting" 1406 }); 1407 // T 1408 case "iiiii": 1409 return localize2.day(dayOfWeek, { 1410 width: "narrow", 1411 context: "formatting" 1412 }); 1413 // Tu 1414 case "iiiiii": 1415 return localize2.day(dayOfWeek, { 1416 width: "short", 1417 context: "formatting" 1418 }); 1419 // Tuesday 1420 case "iiii": 1421 default: 1422 return localize2.day(dayOfWeek, { 1423 width: "wide", 1424 context: "formatting" 1425 }); 1426 } 1427 }, 1428 // AM or PM 1429 a: function(date, token, localize2) { 1430 const hours = date.getHours(); 1431 const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; 1432 switch (token) { 1433 case "a": 1434 case "aa": 1435 return localize2.dayPeriod(dayPeriodEnumValue, { 1436 width: "abbreviated", 1437 context: "formatting" 1438 }); 1439 case "aaa": 1440 return localize2.dayPeriod(dayPeriodEnumValue, { 1441 width: "abbreviated", 1442 context: "formatting" 1443 }).toLowerCase(); 1444 case "aaaaa": 1445 return localize2.dayPeriod(dayPeriodEnumValue, { 1446 width: "narrow", 1447 context: "formatting" 1448 }); 1449 case "aaaa": 1450 default: 1451 return localize2.dayPeriod(dayPeriodEnumValue, { 1452 width: "wide", 1453 context: "formatting" 1454 }); 1455 } 1456 }, 1457 // AM, PM, midnight, noon 1458 b: function(date, token, localize2) { 1459 const hours = date.getHours(); 1460 let dayPeriodEnumValue; 1461 if (hours === 12) { 1462 dayPeriodEnumValue = dayPeriodEnum.noon; 1463 } else if (hours === 0) { 1464 dayPeriodEnumValue = dayPeriodEnum.midnight; 1465 } else { 1466 dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; 1467 } 1468 switch (token) { 1469 case "b": 1470 case "bb": 1471 return localize2.dayPeriod(dayPeriodEnumValue, { 1472 width: "abbreviated", 1473 context: "formatting" 1474 }); 1475 case "bbb": 1476 return localize2.dayPeriod(dayPeriodEnumValue, { 1477 width: "abbreviated", 1478 context: "formatting" 1479 }).toLowerCase(); 1480 case "bbbbb": 1481 return localize2.dayPeriod(dayPeriodEnumValue, { 1482 width: "narrow", 1483 context: "formatting" 1484 }); 1485 case "bbbb": 1486 default: 1487 return localize2.dayPeriod(dayPeriodEnumValue, { 1488 width: "wide", 1489 context: "formatting" 1490 }); 1491 } 1492 }, 1493 // in the morning, in the afternoon, in the evening, at night 1494 B: function(date, token, localize2) { 1495 const hours = date.getHours(); 1496 let dayPeriodEnumValue; 1497 if (hours >= 17) { 1498 dayPeriodEnumValue = dayPeriodEnum.evening; 1499 } else if (hours >= 12) { 1500 dayPeriodEnumValue = dayPeriodEnum.afternoon; 1501 } else if (hours >= 4) { 1502 dayPeriodEnumValue = dayPeriodEnum.morning; 1503 } else { 1504 dayPeriodEnumValue = dayPeriodEnum.night; 1505 } 1506 switch (token) { 1507 case "B": 1508 case "BB": 1509 case "BBB": 1510 return localize2.dayPeriod(dayPeriodEnumValue, { 1511 width: "abbreviated", 1512 context: "formatting" 1513 }); 1514 case "BBBBB": 1515 return localize2.dayPeriod(dayPeriodEnumValue, { 1516 width: "narrow", 1517 context: "formatting" 1518 }); 1519 case "BBBB": 1520 default: 1521 return localize2.dayPeriod(dayPeriodEnumValue, { 1522 width: "wide", 1523 context: "formatting" 1524 }); 1525 } 1526 }, 1527 // Hour [1-12] 1528 h: function(date, token, localize2) { 1529 if (token === "ho") { 1530 let hours = date.getHours() % 12; 1531 if (hours === 0) hours = 12; 1532 return localize2.ordinalNumber(hours, { unit: "hour" }); 1533 } 1534 return lightFormatters.h(date, token); 1535 }, 1536 // Hour [0-23] 1537 H: function(date, token, localize2) { 1538 if (token === "Ho") { 1539 return localize2.ordinalNumber(date.getHours(), { unit: "hour" }); 1540 } 1541 return lightFormatters.H(date, token); 1542 }, 1543 // Hour [0-11] 1544 K: function(date, token, localize2) { 1545 const hours = date.getHours() % 12; 1546 if (token === "Ko") { 1547 return localize2.ordinalNumber(hours, { unit: "hour" }); 1548 } 1549 return addLeadingZeros(hours, token.length); 1550 }, 1551 // Hour [1-24] 1552 k: function(date, token, localize2) { 1553 let hours = date.getHours(); 1554 if (hours === 0) hours = 24; 1555 if (token === "ko") { 1556 return localize2.ordinalNumber(hours, { unit: "hour" }); 1557 } 1558 return addLeadingZeros(hours, token.length); 1559 }, 1560 // Minute 1561 m: function(date, token, localize2) { 1562 if (token === "mo") { 1563 return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" }); 1564 } 1565 return lightFormatters.m(date, token); 1566 }, 1567 // Second 1568 s: function(date, token, localize2) { 1569 if (token === "so") { 1570 return localize2.ordinalNumber(date.getSeconds(), { unit: "second" }); 1571 } 1572 return lightFormatters.s(date, token); 1573 }, 1574 // Fraction of second 1575 S: function(date, token) { 1576 return lightFormatters.S(date, token); 1577 }, 1578 // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) 1579 X: function(date, token, _localize) { 1580 const timezoneOffset = date.getTimezoneOffset(); 1581 if (timezoneOffset === 0) { 1582 return "Z"; 1583 } 1584 switch (token) { 1585 // Hours and optional minutes 1586 case "X": 1587 return formatTimezoneWithOptionalMinutes(timezoneOffset); 1588 // Hours, minutes and optional seconds without `:` delimiter 1589 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets 1590 // so this token always has the same output as `XX` 1591 case "XXXX": 1592 case "XX": 1593 return formatTimezone(timezoneOffset); 1594 // Hours, minutes and optional seconds with `:` delimiter 1595 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets 1596 // so this token always has the same output as `XXX` 1597 case "XXXXX": 1598 case "XXX": 1599 // Hours and minutes with `:` delimiter 1600 default: 1601 return formatTimezone(timezoneOffset, ":"); 1602 } 1603 }, 1604 // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) 1605 x: function(date, token, _localize) { 1606 const timezoneOffset = date.getTimezoneOffset(); 1607 switch (token) { 1608 // Hours and optional minutes 1609 case "x": 1610 return formatTimezoneWithOptionalMinutes(timezoneOffset); 1611 // Hours, minutes and optional seconds without `:` delimiter 1612 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets 1613 // so this token always has the same output as `xx` 1614 case "xxxx": 1615 case "xx": 1616 return formatTimezone(timezoneOffset); 1617 // Hours, minutes and optional seconds with `:` delimiter 1618 // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets 1619 // so this token always has the same output as `xxx` 1620 case "xxxxx": 1621 case "xxx": 1622 // Hours and minutes with `:` delimiter 1623 default: 1624 return formatTimezone(timezoneOffset, ":"); 1625 } 1626 }, 1627 // Timezone (GMT) 1628 O: function(date, token, _localize) { 1629 const timezoneOffset = date.getTimezoneOffset(); 1630 switch (token) { 1631 // Short 1632 case "O": 1633 case "OO": 1634 case "OOO": 1635 return "GMT" + formatTimezoneShort(timezoneOffset, ":"); 1636 // Long 1637 case "OOOO": 1638 default: 1639 return "GMT" + formatTimezone(timezoneOffset, ":"); 1640 } 1641 }, 1642 // Timezone (specific non-location) 1643 z: function(date, token, _localize) { 1644 const timezoneOffset = date.getTimezoneOffset(); 1645 switch (token) { 1646 // Short 1647 case "z": 1648 case "zz": 1649 case "zzz": 1650 return "GMT" + formatTimezoneShort(timezoneOffset, ":"); 1651 // Long 1652 case "zzzz": 1653 default: 1654 return "GMT" + formatTimezone(timezoneOffset, ":"); 1655 } 1656 }, 1657 // Seconds timestamp 1658 t: function(date, token, _localize) { 1659 const timestamp = Math.trunc(+date / 1e3); 1660 return addLeadingZeros(timestamp, token.length); 1661 }, 1662 // Milliseconds timestamp 1663 T: function(date, token, _localize) { 1664 return addLeadingZeros(+date, token.length); 1665 } 1666}; 1667function formatTimezoneShort(offset4, delimiter = "") { 1668 const sign = offset4 > 0 ? "-" : "+"; 1669 const absOffset = Math.abs(offset4); 1670 const hours = Math.trunc(absOffset / 60); 1671 const minutes = absOffset % 60; 1672 if (minutes === 0) { 1673 return sign + String(hours); 1674 } 1675 return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); 1676} 1677function formatTimezoneWithOptionalMinutes(offset4, delimiter) { 1678 if (offset4 % 60 === 0) { 1679 const sign = offset4 > 0 ? "-" : "+"; 1680 return sign + addLeadingZeros(Math.abs(offset4) / 60, 2); 1681 } 1682 return formatTimezone(offset4, delimiter); 1683} 1684function formatTimezone(offset4, delimiter = "") { 1685 const sign = offset4 > 0 ? "-" : "+"; 1686 const absOffset = Math.abs(offset4); 1687 const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2); 1688 const minutes = addLeadingZeros(absOffset % 60, 2); 1689 return sign + hours + delimiter + minutes; 1690} 1691
vendor: 1,710 bytes, lines 1692-1748
1692// node_modules/date-fns/_lib/format/longFormatters.js 1693var dateLongFormatter = (pattern, formatLong2) => { 1694 switch (pattern) { 1695 case "P": 1696 return formatLong2.date({ width: "short" }); 1697 case "PP": 1698 return formatLong2.date({ width: "medium" }); 1699 case "PPP": 1700 return formatLong2.date({ width: "long" }); 1701 case "PPPP": 1702 default: 1703 return formatLong2.date({ width: "full" }); 1704 } 1705}; 1706var timeLongFormatter = (pattern, formatLong2) => { 1707 switch (pattern) { 1708 case "p": 1709 return formatLong2.time({ width: "short" }); 1710 case "pp": 1711 return formatLong2.time({ width: "medium" }); 1712 case "ppp": 1713 return formatLong2.time({ width: "long" }); 1714 case "pppp": 1715 default: 1716 return formatLong2.time({ width: "full" }); 1717 } 1718}; 1719var dateTimeLongFormatter = (pattern, formatLong2) => { 1720 const matchResult = pattern.match(/(P+)(p+)?/) || []; 1721 const datePattern = matchResult[1]; 1722 const timePattern = matchResult[2]; 1723 if (!timePattern) { 1724 return dateLongFormatter(pattern, formatLong2); 1725 } 1726 let dateTimeFormat; 1727 switch (datePattern) { 1728 case "P": 1729 dateTimeFormat = formatLong2.dateTime({ width: "short" }); 1730 break; 1731 case "PP": 1732 dateTimeFormat = formatLong2.dateTime({ width: "medium" }); 1733 break; 1734 case "PPP": 1735 dateTimeFormat = formatLong2.dateTime({ width: "long" }); 1736 break; 1737 case "PPPP": 1738 default: 1739 dateTimeFormat = formatLong2.dateTime({ width: "full" }); 1740 break; 1741 } 1742 return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2)); 1743}; 1744var longFormatters = { 1745 p: timeLongFormatter, 1746 P: dateTimeLongFormatter 1747}; 1748
vendor: 858 bytes, lines 1749-1768
1749// node_modules/date-fns/_lib/protectedTokens.js 1750var dayOfYearTokenRE = /^D+$/; 1751var weekYearTokenRE = /^Y+$/; 1752var throwTokens = ["D", "DD", "YY", "YYYY"]; 1753function isProtectedDayOfYearToken(token) { 1754 return dayOfYearTokenRE.test(token); 1755} 1756function isProtectedWeekYearToken(token) { 1757 return weekYearTokenRE.test(token); 1758} 1759function warnOrThrowProtectedError(token, format2, input) { 1760 const _message = message(token, format2, input); 1761 console.warn(_message); 1762 if (throwTokens.includes(token)) throw new RangeError(_message); 1763} 1764function message(token, format2, input) { 1765 const subject = token[0] === "Y" ? "years" : "days of the month"; 1766 return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; 1767} 1768
vendor: 3,319 bytes, lines 1769-1835
1769// node_modules/date-fns/format.js 1770var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; 1771var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; 1772var escapedStringRegExp = /^'([^]*?)'?$/; 1773var doubleQuoteRegExp = /''/g; 1774var unescapedLatinCharacterRegExp = /[a-zA-Z]/; 1775function format(date, formatStr, options) { 1776 var _a2, _b, _c, _d, _e, _f, _g, _h; 1777 const defaultOptions2 = getDefaultOptions(); 1778 const locale = (options == null ? void 0 : options.locale) ?? defaultOptions2.locale ?? enUS; 1779 const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1; 1780 const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_f = (_e = options == null ? void 0 : options.locale) == null ? void 0 : _e.options) == null ? void 0 : _f.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_h = (_g = defaultOptions2.locale) == null ? void 0 : _g.options) == null ? void 0 : _h.weekStartsOn) ?? 0; 1781 const originalDate = toDate(date, options == null ? void 0 : options.in); 1782 if (!isValid(originalDate)) { 1783 throw new RangeError("Invalid time value"); 1784 } 1785 let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => { 1786 const firstCharacter = substring[0]; 1787 if (firstCharacter === "p" || firstCharacter === "P") { 1788 const longFormatter = longFormatters[firstCharacter]; 1789 return longFormatter(substring, locale.formatLong); 1790 } 1791 return substring; 1792 }).join("").match(formattingTokensRegExp).map((substring) => { 1793 if (substring === "''") { 1794 return { isToken: false, value: "'" }; 1795 } 1796 const firstCharacter = substring[0]; 1797 if (firstCharacter === "'") { 1798 return { isToken: false, value: cleanEscapedString(substring) }; 1799 } 1800 if (formatters[firstCharacter]) { 1801 return { isToken: true, value: substring }; 1802 } 1803 if (firstCharacter.match(unescapedLatinCharacterRegExp)) { 1804 throw new RangeError( 1805 "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`" 1806 ); 1807 } 1808 return { isToken: false, value: substring }; 1809 }); 1810 if (locale.localize.preprocessor) { 1811 parts = locale.localize.preprocessor(originalDate, parts); 1812 } 1813 const formatterOptions = { 1814 firstWeekContainsDate, 1815 weekStartsOn, 1816 locale 1817 }; 1818 return parts.map((part) => { 1819 if (!part.isToken) return part.value; 1820 const token = part.value; 1821 if (!(options == null ? void 0 : options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token) || !(options == null ? void 0 : options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) { 1822 warnOrThrowProtectedError(token, formatStr, String(date)); 1823 } 1824 const formatter = formatters[token[0]]; 1825 return formatter(originalDate, token, locale.localize, formatterOptions); 1826 }).join(""); 1827} 1828function cleanEscapedString(input) { 1829 const matched = input.match(escapedStringRegExp); 1830 if (!matched) { 1831 return input; 1832 } 1833 return matched[1].replace(doubleQuoteRegExp, "'"); 1834} 1835
vendor: 145 bytes, lines 1836-1840
1836// node_modules/date-fns/getDate.js 1837function getDate(date, options) { 1838 return toDate(date, options == null ? void 0 : options.in).getDate(); 1839} 1840
vendor: 142 bytes, lines 1841-1845
1841// node_modules/date-fns/getDay.js 1842function getDay(date, options) { 1843 return toDate(date, options == null ? void 0 : options.in).getDay(); 1844} 1845
vendor: 414 bytes, lines 1846-1856
1846// node_modules/date-fns/getDaysInMonth.js 1847function getDaysInMonth(date, options) { 1848 const _date = toDate(date, options == null ? void 0 : options.in); 1849 const year = _date.getFullYear(); 1850 const monthIndex = _date.getMonth(); 1851 const lastDayOfMonth2 = constructFrom(_date, 0); 1852 lastDayOfMonth2.setFullYear(year, monthIndex + 1, 0); 1853 lastDayOfMonth2.setHours(0, 0, 0, 0); 1854 return lastDayOfMonth2.getDate(); 1855} 1856
vendor: 130 bytes, lines 1857-1861
1857// node_modules/date-fns/getDefaultOptions.js 1858function getDefaultOptions2() { 1859 return Object.assign({}, getDefaultOptions()); 1860} 1861
vendor: 148 bytes, lines 1862-1866
1862// node_modules/date-fns/getHours.js 1863function getHours(date, options) { 1864 return toDate(date, options == null ? void 0 : options.in).getHours(); 1865} 1866
vendor: 183 bytes, lines 1867-1872
1867// node_modules/date-fns/getISODay.js 1868function getISODay(date, options) { 1869 const day = toDate(date, options == null ? void 0 : options.in).getDay(); 1870 return day === 0 ? 7 : day; 1871} 1872
vendor: 154 bytes, lines 1873-1877
1873// node_modules/date-fns/getMinutes.js 1874function getMinutes(date, options) { 1875 return toDate(date, options == null ? void 0 : options.in).getMinutes(); 1876} 1877
vendor: 148 bytes, lines 1878-1882
1878// node_modules/date-fns/getMonth.js 1879function getMonth(date, options) { 1880 return toDate(date, options == null ? void 0 : options.in).getMonth(); 1881} 1882
vendor: 106 bytes, lines 1883-1887
1883// node_modules/date-fns/getSeconds.js 1884function getSeconds(date) { 1885 return toDate(date).getSeconds(); 1886} 1887
vendor: 88 bytes, lines 1888-1892
1888// node_modules/date-fns/getTime.js 1889function getTime(date) { 1890 return +toDate(date); 1891} 1892
vendor: 149 bytes, lines 1893-1897
1893// node_modules/date-fns/getYear.js 1894function getYear(date, options) { 1895 return toDate(date, options == null ? void 0 : options.in).getFullYear(); 1896} 1897
vendor: 128 bytes, lines 1898-1902
1898// node_modules/date-fns/isAfter.js 1899function isAfter(date, dateToCompare) { 1900 return +toDate(date) > +toDate(dateToCompare); 1901} 1902
vendor: 130 bytes, lines 1903-1907
1903// node_modules/date-fns/isBefore.js 1904function isBefore(date, dateToCompare) { 1905 return +toDate(date) < +toDate(dateToCompare); 1906} 1907
vendor: 130 bytes, lines 1908-1912
1908// node_modules/date-fns/isEqual.js 1909function isEqual(leftDate, rightDate) { 1910 return +toDate(leftDate) === +toDate(rightDate); 1911} 1912
vendor: 566 bytes, lines 1913-1929
1913// node_modules/date-fns/transpose.js 1914function transpose(date, constructor) { 1915 const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0); 1916 date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); 1917 date_.setHours( 1918 date.getHours(), 1919 date.getMinutes(), 1920 date.getSeconds(), 1921 date.getMilliseconds() 1922 ); 1923 return date_; 1924} 1925function isConstructor(constructor) { 1926 var _a2; 1927 return typeof constructor === "function" && ((_a2 = constructor.prototype) == null ? void 0 : _a2.constructor) === constructor; 1928} 1929
vendor: 1,144 bytes, lines 1930-1970
1930// node_modules/date-fns/parse/_lib/Setter.js 1931var TIMEZONE_UNIT_PRIORITY = 10; 1932var Setter = class { 1933 constructor() { 1934 __publicField(this, "subPriority", 0); 1935 } 1936 validate(_utcDate, _options) { 1937 return true; 1938 } 1939}; 1940var ValueSetter = class extends Setter { 1941 constructor(value, validateValue, setValue, priority, subPriority) { 1942 super(); 1943 this.value = value; 1944 this.validateValue = validateValue; 1945 this.setValue = setValue; 1946 this.priority = priority; 1947 if (subPriority) { 1948 this.subPriority = subPriority; 1949 } 1950 } 1951 validate(date, options) { 1952 return this.validateValue(date, this.value, options); 1953 } 1954 set(date, flags, options) { 1955 return this.setValue(date, flags, this.value, options); 1956 } 1957}; 1958var DateTimezoneSetter = class extends Setter { 1959 constructor(context, reference) { 1960 super(); 1961 __publicField(this, "priority", TIMEZONE_UNIT_PRIORITY); 1962 __publicField(this, "subPriority", -1); 1963 this.context = context || ((date) => constructFrom(reference, date)); 1964 } 1965 set(date, flags) { 1966 if (flags.timestampIsSet) return date; 1967 return constructFrom(date, transpose(date, this.context)); 1968 } 1969}; 1970
vendor: 487 bytes, lines 1971-1993
1971// node_modules/date-fns/parse/_lib/Parser.js 1972var Parser = class { 1973 run(dateString, token, match2, options) { 1974 const result = this.parse(dateString, token, match2, options); 1975 if (!result) { 1976 return null; 1977 } 1978 return { 1979 setter: new ValueSetter( 1980 result.value, 1981 this.validate, 1982 this.set, 1983 this.priority, 1984 this.subPriority 1985 ), 1986 rest: result.rest 1987 }; 1988 } 1989 validate(_utcDate, _value, _options) { 1990 return true; 1991 } 1992}; 1993
vendor: 964 bytes, lines 1994-2024
1994// node_modules/date-fns/parse/_lib/parsers/EraParser.js 1995var EraParser = class extends Parser { 1996 constructor() { 1997 super(...arguments); 1998 __publicField(this, "priority", 140); 1999 __publicField(this, "incompatibleTokens", ["R", "u", "t", "T"]); 2000 } 2001 parse(dateString, token, match2) { 2002 switch (token) { 2003 // AD, BC 2004 case "G": 2005 case "GG": 2006 case "GGG": 2007 return match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" }); 2008 // A, B 2009 case "GGGGG": 2010 return match2.era(dateString, { width: "narrow" }); 2011 // Anno Domini, Before Christ 2012 case "GGGG": 2013 default: 2014 return match2.era(dateString, { width: "wide" }) || match2.era(dateString, { width: "abbreviated" }) || match2.era(dateString, { width: "narrow" }); 2015 } 2016 } 2017 set(date, flags, value) { 2018 flags.era = value; 2019 date.setFullYear(value, 0, 1); 2020 date.setHours(0, 0, 0, 0); 2021 return date; 2022 } 2023}; 2024
vendor: 1,209 bytes, lines 2025-2072
2025// node_modules/date-fns/parse/_lib/constants.js 2026var numericPatterns = { 2027 month: /^(1[0-2]|0?\d)/, 2028 // 0 to 12 2029 date: /^(3[0-1]|[0-2]?\d)/, 2030 // 0 to 31 2031 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, 2032 // 0 to 366 2033 week: /^(5[0-3]|[0-4]?\d)/, 2034 // 0 to 53 2035 hour23h: /^(2[0-3]|[0-1]?\d)/, 2036 // 0 to 23 2037 hour24h: /^(2[0-4]|[0-1]?\d)/, 2038 // 0 to 24 2039 hour11h: /^(1[0-1]|0?\d)/, 2040 // 0 to 11 2041 hour12h: /^(1[0-2]|0?\d)/, 2042 // 0 to 12 2043 minute: /^[0-5]?\d/, 2044 // 0 to 59 2045 second: /^[0-5]?\d/, 2046 // 0 to 59 2047 singleDigit: /^\d/, 2048 // 0 to 9 2049 twoDigits: /^\d{1,2}/, 2050 // 0 to 99 2051 threeDigits: /^\d{1,3}/, 2052 // 0 to 999 2053 fourDigits: /^\d{1,4}/, 2054 // 0 to 9999 2055 anyDigitsSigned: /^-?\d+/, 2056 singleDigitSigned: /^-?\d/, 2057 // 0 to 9, -0 to -9 2058 twoDigitsSigned: /^-?\d{1,2}/, 2059 // 0 to 99, -0 to -99 2060 threeDigitsSigned: /^-?\d{1,3}/, 2061 // 0 to 999, -0 to -999 2062 fourDigitsSigned: /^-?\d{1,4}/ 2063 // 0 to 9999, -0 to -9999 2064}; 2065var timezonePatterns = { 2066 basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/, 2067 basic: /^([+-])(\d{2})(\d{2})|Z/, 2068 basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/, 2069 extended: /^([+-])(\d{2}):(\d{2})|Z/, 2070 extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/ 2071}; 2072
vendor: 3,262 bytes, lines 2073-2178
2073// node_modules/date-fns/parse/_lib/utils.js 2074function mapValue(parseFnResult, mapFn) { 2075 if (!parseFnResult) { 2076 return parseFnResult; 2077 } 2078 return { 2079 value: mapFn(parseFnResult.value), 2080 rest: parseFnResult.rest 2081 }; 2082} 2083function parseNumericPattern(pattern, dateString) { 2084 const matchResult = dateString.match(pattern); 2085 if (!matchResult) { 2086 return null; 2087 } 2088 return { 2089 value: parseInt(matchResult[0], 10), 2090 rest: dateString.slice(matchResult[0].length) 2091 }; 2092} 2093function parseTimezonePattern(pattern, dateString) { 2094 const matchResult = dateString.match(pattern); 2095 if (!matchResult) { 2096 return null; 2097 } 2098 if (matchResult[0] === "Z") { 2099 return { 2100 value: 0, 2101 rest: dateString.slice(1) 2102 }; 2103 } 2104 const sign = matchResult[1] === "+" ? 1 : -1; 2105 const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0; 2106 const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0; 2107 const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0; 2108 return { 2109 value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond), 2110 rest: dateString.slice(matchResult[0].length) 2111 }; 2112} 2113function parseAnyDigitsSigned(dateString) { 2114 return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString); 2115} 2116function parseNDigits(n, dateString) { 2117 switch (n) { 2118 case 1: 2119 return parseNumericPattern(numericPatterns.singleDigit, dateString); 2120 case 2: 2121 return parseNumericPattern(numericPatterns.twoDigits, dateString); 2122 case 3: 2123 return parseNumericPattern(numericPatterns.threeDigits, dateString); 2124 case 4: 2125 return parseNumericPattern(numericPatterns.fourDigits, dateString); 2126 default: 2127 return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString); 2128 } 2129} 2130function parseNDigitsSigned(n, dateString) { 2131 switch (n) { 2132 case 1: 2133 return parseNumericPattern(numericPatterns.singleDigitSigned, dateString); 2134 case 2: 2135 return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString); 2136 case 3: 2137 return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString); 2138 case 4: 2139 return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString); 2140 default: 2141 return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString); 2142 } 2143} 2144function dayPeriodEnumToHours(dayPeriod) { 2145 switch (dayPeriod) { 2146 case "morning": 2147 return 4; 2148 case "evening": 2149 return 17; 2150 case "pm": 2151 case "noon": 2152 case "afternoon": 2153 return 12; 2154 case "am": 2155 case "midnight": 2156 case "night": 2157 default: 2158 return 0; 2159 } 2160} 2161function normalizeTwoDigitYear(twoDigitYear, currentYear) { 2162 const isCommonEra = currentYear > 0; 2163 const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear; 2164 let result; 2165 if (absCurrentYear <= 50) { 2166 result = twoDigitYear || 100; 2167 } else { 2168 const rangeEnd = absCurrentYear + 50; 2169 const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100; 2170 const isPreviousCentury = twoDigitYear >= rangeEnd % 100; 2171 result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0); 2172 } 2173 return isCommonEra ? result : 1 - result; 2174} 2175function isLeapYearIndex(year) { 2176 return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; 2177} 2178
vendor: 1,373 bytes, lines 2179-2225
2179// node_modules/date-fns/parse/_lib/parsers/YearParser.js 2180var YearParser = class extends Parser { 2181 constructor() { 2182 super(...arguments); 2183 __publicField(this, "priority", 130); 2184 __publicField(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]); 2185 } 2186 parse(dateString, token, match2) { 2187 const valueCallback = (year) => ({ 2188 year, 2189 isTwoDigitYear: token === "yy" 2190 }); 2191 switch (token) { 2192 case "y": 2193 return mapValue(parseNDigits(4, dateString), valueCallback); 2194 case "yo": 2195 return mapValue( 2196 match2.ordinalNumber(dateString, { 2197 unit: "year" 2198 }), 2199 valueCallback 2200 ); 2201 default: 2202 return mapValue(parseNDigits(token.length, dateString), valueCallback); 2203 } 2204 } 2205 validate(_date, value) { 2206 return value.isTwoDigitYear || value.year > 0; 2207 } 2208 set(date, flags, value) { 2209 const currentYear = date.getFullYear(); 2210 if (value.isTwoDigitYear) { 2211 const normalizedTwoDigitYear = normalizeTwoDigitYear( 2212 value.year, 2213 currentYear 2214 ); 2215 date.setFullYear(normalizedTwoDigitYear, 0, 1); 2216 date.setHours(0, 0, 0, 0); 2217 return date; 2218 } 2219 const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; 2220 date.setFullYear(year, 0, 1); 2221 date.setHours(0, 0, 0, 0); 2222 return date; 2223 } 2224}; 2225
vendor: 1,639 bytes, lines 2226-2290
2226// node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js 2227var LocalWeekYearParser = class extends Parser { 2228 constructor() { 2229 super(...arguments); 2230 __publicField(this, "priority", 130); 2231 __publicField(this, "incompatibleTokens", [ 2232 "y", 2233 "R", 2234 "u", 2235 "Q", 2236 "q", 2237 "M", 2238 "L", 2239 "I", 2240 "d", 2241 "D", 2242 "i", 2243 "t", 2244 "T" 2245 ]); 2246 } 2247 parse(dateString, token, match2) { 2248 const valueCallback = (year) => ({ 2249 year, 2250 isTwoDigitYear: token === "YY" 2251 }); 2252 switch (token) { 2253 case "Y": 2254 return mapValue(parseNDigits(4, dateString), valueCallback); 2255 case "Yo": 2256 return mapValue( 2257 match2.ordinalNumber(dateString, { 2258 unit: "year" 2259 }), 2260 valueCallback 2261 ); 2262 default: 2263 return mapValue(parseNDigits(token.length, dateString), valueCallback); 2264 } 2265 } 2266 validate(_date, value) { 2267 return value.isTwoDigitYear || value.year > 0; 2268 } 2269 set(date, flags, value, options) { 2270 const currentYear = getWeekYear(date, options); 2271 if (value.isTwoDigitYear) { 2272 const normalizedTwoDigitYear = normalizeTwoDigitYear( 2273 value.year, 2274 currentYear 2275 ); 2276 date.setFullYear( 2277 normalizedTwoDigitYear, 2278 0, 2279 options.firstWeekContainsDate 2280 ); 2281 date.setHours(0, 0, 0, 0); 2282 return startOfWeek(date, options); 2283 } 2284 const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year; 2285 date.setFullYear(year, 0, options.firstWeekContainsDate); 2286 date.setHours(0, 0, 0, 0); 2287 return startOfWeek(date, options); 2288 } 2289}; 2290
vendor: 811 bytes, lines 2291-2327
2291// node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js 2292var ISOWeekYearParser = class extends Parser { 2293 constructor() { 2294 super(...arguments); 2295 __publicField(this, "priority", 130); 2296 __publicField(this, "incompatibleTokens", [ 2297 "G", 2298 "y", 2299 "Y", 2300 "u", 2301 "Q", 2302 "q", 2303 "M", 2304 "L", 2305 "w", 2306 "d", 2307 "D", 2308 "e", 2309 "c", 2310 "t", 2311 "T" 2312 ]); 2313 } 2314 parse(dateString, token) { 2315 if (token === "R") { 2316 return parseNDigitsSigned(4, dateString); 2317 } 2318 return parseNDigitsSigned(token.length, dateString); 2319 } 2320 set(date, _flags, value) { 2321 const firstWeekOfYear = constructFrom(date, 0); 2322 firstWeekOfYear.setFullYear(value, 0, 4); 2323 firstWeekOfYear.setHours(0, 0, 0, 0); 2324 return startOfISOWeek(firstWeekOfYear); 2325 } 2326}; 2327
vendor: 596 bytes, lines 2328-2347
2328// node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js 2329var ExtendedYearParser = class extends Parser { 2330 constructor() { 2331 super(...arguments); 2332 __publicField(this, "priority", 130); 2333 __publicField(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]); 2334 } 2335 parse(dateString, token) { 2336 if (token === "u") { 2337 return parseNDigitsSigned(4, dateString); 2338 } 2339 return parseNDigitsSigned(token.length, dateString); 2340 } 2341 set(date, _flags, value) { 2342 date.setFullYear(value, 0, 1); 2343 date.setHours(0, 0, 0, 0); 2344 return date; 2345 } 2346}; 2347
vendor: 1,740 bytes, lines 2348-2418
2348// node_modules/date-fns/parse/_lib/parsers/QuarterParser.js 2349var QuarterParser = class extends Parser { 2350 constructor() { 2351 super(...arguments); 2352 __publicField(this, "priority", 120); 2353 __publicField(this, "incompatibleTokens", [ 2354 "Y", 2355 "R", 2356 "q", 2357 "M", 2358 "L", 2359 "w", 2360 "I", 2361 "d", 2362 "D", 2363 "i", 2364 "e", 2365 "c", 2366 "t", 2367 "T" 2368 ]); 2369 } 2370 parse(dateString, token, match2) { 2371 switch (token) { 2372 // 1, 2, 3, 4 2373 case "Q": 2374 case "QQ": 2375 return parseNDigits(token.length, dateString); 2376 // 1st, 2nd, 3rd, 4th 2377 case "Qo": 2378 return match2.ordinalNumber(dateString, { unit: "quarter" }); 2379 // Q1, Q2, Q3, Q4 2380 case "QQQ": 2381 return match2.quarter(dateString, { 2382 width: "abbreviated", 2383 context: "formatting" 2384 }) || match2.quarter(dateString, { 2385 width: "narrow", 2386 context: "formatting" 2387 }); 2388 // 1, 2, 3, 4 (narrow quarter; could be not numerical) 2389 case "QQQQQ": 2390 return match2.quarter(dateString, { 2391 width: "narrow", 2392 context: "formatting" 2393 }); 2394 // 1st quarter, 2nd quarter, ... 2395 case "QQQQ": 2396 default: 2397 return match2.quarter(dateString, { 2398 width: "wide", 2399 context: "formatting" 2400 }) || match2.quarter(dateString, { 2401 width: "abbreviated", 2402 context: "formatting" 2403 }) || match2.quarter(dateString, { 2404 width: "narrow", 2405 context: "formatting" 2406 }); 2407 } 2408 } 2409 validate(_date, value) { 2410 return value >= 1 && value <= 4; 2411 } 2412 set(date, _flags, value) { 2413 date.setMonth((value - 1) * 3, 1); 2414 date.setHours(0, 0, 0, 0); 2415 return date; 2416 } 2417}; 2418
vendor: 1,760 bytes, lines 2419-2489
2419// node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js 2420var StandAloneQuarterParser = class extends Parser { 2421 constructor() { 2422 super(...arguments); 2423 __publicField(this, "priority", 120); 2424 __publicField(this, "incompatibleTokens", [ 2425 "Y", 2426 "R", 2427 "Q", 2428 "M", 2429 "L", 2430 "w", 2431 "I", 2432 "d", 2433 "D", 2434 "i", 2435 "e", 2436 "c", 2437 "t", 2438 "T" 2439 ]); 2440 } 2441 parse(dateString, token, match2) { 2442 switch (token) { 2443 // 1, 2, 3, 4 2444 case "q": 2445 case "qq": 2446 return parseNDigits(token.length, dateString); 2447 // 1st, 2nd, 3rd, 4th 2448 case "qo": 2449 return match2.ordinalNumber(dateString, { unit: "quarter" }); 2450 // Q1, Q2, Q3, Q4 2451 case "qqq": 2452 return match2.quarter(dateString, { 2453 width: "abbreviated", 2454 context: "standalone" 2455 }) || match2.quarter(dateString, { 2456 width: "narrow", 2457 context: "standalone" 2458 }); 2459 // 1, 2, 3, 4 (narrow quarter; could be not numerical) 2460 case "qqqqq": 2461 return match2.quarter(dateString, { 2462 width: "narrow", 2463 context: "standalone" 2464 }); 2465 // 1st quarter, 2nd quarter, ... 2466 case "qqqq": 2467 default: 2468 return match2.quarter(dateString, { 2469 width: "wide", 2470 context: "standalone" 2471 }) || match2.quarter(dateString, { 2472 width: "abbreviated", 2473 context: "standalone" 2474 }) || match2.quarter(dateString, { 2475 width: "narrow", 2476 context: "standalone" 2477 }); 2478 } 2479 } 2480 validate(_date, value) { 2481 return value >= 1 && value <= 4; 2482 } 2483 set(date, _flags, value) { 2484 date.setMonth((value - 1) * 3, 1); 2485 date.setHours(0, 0, 0, 0); 2486 return date; 2487 } 2488}; 2489
vendor: 1,880 bytes, lines 2490-2561
2490// node_modules/date-fns/parse/_lib/parsers/MonthParser.js 2491var MonthParser = class extends Parser { 2492 constructor() { 2493 super(...arguments); 2494 __publicField(this, "incompatibleTokens", [ 2495 "Y", 2496 "R", 2497 "q", 2498 "Q", 2499 "L", 2500 "w", 2501 "I", 2502 "D", 2503 "i", 2504 "e", 2505 "c", 2506 "t", 2507 "T" 2508 ]); 2509 __publicField(this, "priority", 110); 2510 } 2511 parse(dateString, token, match2) { 2512 const valueCallback = (value) => value - 1; 2513 switch (token) { 2514 // 1, 2, ..., 12 2515 case "M": 2516 return mapValue( 2517 parseNumericPattern(numericPatterns.month, dateString), 2518 valueCallback 2519 ); 2520 // 01, 02, ..., 12 2521 case "MM": 2522 return mapValue(parseNDigits(2, dateString), valueCallback); 2523 // 1st, 2nd, ..., 12th 2524 case "Mo": 2525 return mapValue( 2526 match2.ordinalNumber(dateString, { 2527 unit: "month" 2528 }), 2529 valueCallback 2530 ); 2531 // Jan, Feb, ..., Dec 2532 case "MMM": 2533 return match2.month(dateString, { 2534 width: "abbreviated", 2535 context: "formatting" 2536 }) || match2.month(dateString, { width: "narrow", context: "formatting" }); 2537 // J, F, ..., D 2538 case "MMMMM": 2539 return match2.month(dateString, { 2540 width: "narrow", 2541 context: "formatting" 2542 }); 2543 // January, February, ..., December 2544 case "MMMM": 2545 default: 2546 return match2.month(dateString, { width: "wide", context: "formatting" }) || match2.month(dateString, { 2547 width: "abbreviated", 2548 context: "formatting" 2549 }) || match2.month(dateString, { width: "narrow", context: "formatting" }); 2550 } 2551 } 2552 validate(_date, value) { 2553 return value >= 0 && value <= 11; 2554 } 2555 set(date, _flags, value) { 2556 date.setMonth(value, 1); 2557 date.setHours(0, 0, 0, 0); 2558 return date; 2559 } 2560}; 2561
vendor: 1,900 bytes, lines 2562-2633
2562// node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js 2563var StandAloneMonthParser = class extends Parser { 2564 constructor() { 2565 super(...arguments); 2566 __publicField(this, "priority", 110); 2567 __publicField(this, "incompatibleTokens", [ 2568 "Y", 2569 "R", 2570 "q", 2571 "Q", 2572 "M", 2573 "w", 2574 "I", 2575 "D", 2576 "i", 2577 "e", 2578 "c", 2579 "t", 2580 "T" 2581 ]); 2582 } 2583 parse(dateString, token, match2) { 2584 const valueCallback = (value) => value - 1; 2585 switch (token) { 2586 // 1, 2, ..., 12 2587 case "L": 2588 return mapValue( 2589 parseNumericPattern(numericPatterns.month, dateString), 2590 valueCallback 2591 ); 2592 // 01, 02, ..., 12 2593 case "LL": 2594 return mapValue(parseNDigits(2, dateString), valueCallback); 2595 // 1st, 2nd, ..., 12th 2596 case "Lo": 2597 return mapValue( 2598 match2.ordinalNumber(dateString, { 2599 unit: "month" 2600 }), 2601 valueCallback 2602 ); 2603 // Jan, Feb, ..., Dec 2604 case "LLL": 2605 return match2.month(dateString, { 2606 width: "abbreviated", 2607 context: "standalone" 2608 }) || match2.month(dateString, { width: "narrow", context: "standalone" }); 2609 // J, F, ..., D 2610 case "LLLLL": 2611 return match2.month(dateString, { 2612 width: "narrow", 2613 context: "standalone" 2614 }); 2615 // January, February, ..., December 2616 case "LLLL": 2617 default: 2618 return match2.month(dateString, { width: "wide", context: "standalone" }) || match2.month(dateString, { 2619 width: "abbreviated", 2620 context: "standalone" 2621 }) || match2.month(dateString, { width: "narrow", context: "standalone" }); 2622 } 2623 } 2624 validate(_date, value) { 2625 return value >= 0 && value <= 11; 2626 } 2627 set(date, _flags, value) { 2628 date.setMonth(value, 1); 2629 date.setHours(0, 0, 0, 0); 2630 return date; 2631 } 2632}; 2633
vendor: 303 bytes, lines 2634-2641
2634// node_modules/date-fns/setWeek.js 2635function setWeek(date, week, options) { 2636 const date_ = toDate(date, options == null ? void 0 : options.in); 2637 const diff = getWeek(date_, options) - week; 2638 date_.setDate(date_.getDate() - diff * 7); 2639 return toDate(date_, options == null ? void 0 : options.in); 2640} 2641
vendor: 882 bytes, lines 2642-2680
2642// node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js 2643var LocalWeekParser = class extends Parser { 2644 constructor() { 2645 super(...arguments); 2646 __publicField(this, "priority", 100); 2647 __publicField(this, "incompatibleTokens", [ 2648 "y", 2649 "R", 2650 "u", 2651 "q", 2652 "Q", 2653 "M", 2654 "L", 2655 "I", 2656 "d", 2657 "D", 2658 "i", 2659 "t", 2660 "T" 2661 ]); 2662 } 2663 parse(dateString, token, match2) { 2664 switch (token) { 2665 case "w": 2666 return parseNumericPattern(numericPatterns.week, dateString); 2667 case "wo": 2668 return match2.ordinalNumber(dateString, { unit: "week" }); 2669 default: 2670 return parseNDigits(token.length, dateString); 2671 } 2672 } 2673 validate(_date, value) { 2674 return value >= 1 && value <= 53; 2675 } 2676 set(date, _flags, value, options) { 2677 return startOfWeek(setWeek(date, value, options), options); 2678 } 2679}; 2680
vendor: 265 bytes, lines 2681-2688
2681// node_modules/date-fns/setISOWeek.js 2682function setISOWeek(date, week, options) { 2683 const _date = toDate(date, options == null ? void 0 : options.in); 2684 const diff = getISOWeek(_date, options) - week; 2685 _date.setDate(_date.getDate() - diff * 7); 2686 return _date; 2687} 2688
vendor: 868 bytes, lines 2689-2728
2689// node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js 2690var ISOWeekParser = class extends Parser { 2691 constructor() { 2692 super(...arguments); 2693 __publicField(this, "priority", 100); 2694 __publicField(this, "incompatibleTokens", [ 2695 "y", 2696 "Y", 2697 "u", 2698 "q", 2699 "Q", 2700 "M", 2701 "L", 2702 "w", 2703 "d", 2704 "D", 2705 "e", 2706 "c", 2707 "t", 2708 "T" 2709 ]); 2710 } 2711 parse(dateString, token, match2) { 2712 switch (token) { 2713 case "I": 2714 return parseNumericPattern(numericPatterns.week, dateString); 2715 case "Io": 2716 return match2.ordinalNumber(dateString, { unit: "week" }); 2717 default: 2718 return parseNDigits(token.length, dateString); 2719 } 2720 } 2721 validate(_date, value) { 2722 return value >= 1 && value <= 53; 2723 } 2724 set(date, _flags, value) { 2725 return startOfISOWeek(setISOWeek(date, value)); 2726 } 2727}; 2728
vendor: 1,327 bytes, lines 2729-2791
2729// node_modules/date-fns/parse/_lib/parsers/DateParser.js 2730var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 2731var DAYS_IN_MONTH_LEAP_YEAR = [ 2732 31, 2733 29, 2734 31, 2735 30, 2736 31, 2737 30, 2738 31, 2739 31, 2740 30, 2741 31, 2742 30, 2743 31 2744]; 2745var DateParser = class extends Parser { 2746 constructor() { 2747 super(...arguments); 2748 __publicField(this, "priority", 90); 2749 __publicField(this, "subPriority", 1); 2750 __publicField(this, "incompatibleTokens", [ 2751 "Y", 2752 "R", 2753 "q", 2754 "Q", 2755 "w", 2756 "I", 2757 "D", 2758 "i", 2759 "e", 2760 "c", 2761 "t", 2762 "T" 2763 ]); 2764 } 2765 parse(dateString, token, match2) { 2766 switch (token) { 2767 case "d": 2768 return parseNumericPattern(numericPatterns.date, dateString); 2769 case "do": 2770 return match2.ordinalNumber(dateString, { unit: "date" }); 2771 default: 2772 return parseNDigits(token.length, dateString); 2773 } 2774 } 2775 validate(date, value) { 2776 const year = date.getFullYear(); 2777 const isLeapYear2 = isLeapYearIndex(year); 2778 const month = date.getMonth(); 2779 if (isLeapYear2) { 2780 return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]; 2781 } else { 2782 return value >= 1 && value <= DAYS_IN_MONTH[month]; 2783 } 2784 } 2785 set(date, _flags, value) { 2786 date.setDate(value); 2787 date.setHours(0, 0, 0, 0); 2788 return date; 2789 } 2790}; 2791
vendor: 1,141 bytes, lines 2792-2842
2792// node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js 2793var DayOfYearParser = class extends Parser { 2794 constructor() { 2795 super(...arguments); 2796 __publicField(this, "priority", 90); 2797 __publicField(this, "subpriority", 1); 2798 __publicField(this, "incompatibleTokens", [ 2799 "Y", 2800 "R", 2801 "q", 2802 "Q", 2803 "M", 2804 "L", 2805 "w", 2806 "I", 2807 "d", 2808 "E", 2809 "i", 2810 "e", 2811 "c", 2812 "t", 2813 "T" 2814 ]); 2815 } 2816 parse(dateString, token, match2) { 2817 switch (token) { 2818 case "D": 2819 case "DD": 2820 return parseNumericPattern(numericPatterns.dayOfYear, dateString); 2821 case "Do": 2822 return match2.ordinalNumber(dateString, { unit: "date" }); 2823 default: 2824 return parseNDigits(token.length, dateString); 2825 } 2826 } 2827 validate(date, value) { 2828 const year = date.getFullYear(); 2829 const isLeapYear2 = isLeapYearIndex(year); 2830 if (isLeapYear2) { 2831 return value >= 1 && value <= 366; 2832 } else { 2833 return value >= 1 && value <= 365; 2834 } 2835 } 2836 set(date, _flags, value) { 2837 date.setMonth(0, value); 2838 date.setHours(0, 0, 0, 0); 2839 return date; 2840 } 2841}; 2842
vendor: 861 bytes, lines 2843-2856
2843// node_modules/date-fns/setDay.js 2844function setDay(date, day, options) { 2845 var _a2, _b, _c, _d; 2846 const defaultOptions2 = getDefaultOptions(); 2847 const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0; 2848 const date_ = toDate(date, options == null ? void 0 : options.in); 2849 const currentDay = date_.getDay(); 2850 const remainder = day % 7; 2851 const dayIndex = (remainder + 7) % 7; 2852 const delta = 7 - weekStartsOn; 2853 const diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7; 2854 return addDays(date_, diff, options); 2855} 2856
vendor: 1,554 bytes, lines 2857-2901
2857// node_modules/date-fns/parse/_lib/parsers/DayParser.js 2858var DayParser = class extends Parser { 2859 constructor() { 2860 super(...arguments); 2861 __publicField(this, "priority", 90); 2862 __publicField(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]); 2863 } 2864 parse(dateString, token, match2) { 2865 switch (token) { 2866 // Tue 2867 case "E": 2868 case "EE": 2869 case "EEE": 2870 return match2.day(dateString, { 2871 width: "abbreviated", 2872 context: "formatting" 2873 }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2874 // T 2875 case "EEEEE": 2876 return match2.day(dateString, { 2877 width: "narrow", 2878 context: "formatting" 2879 }); 2880 // Tu 2881 case "EEEEEE": 2882 return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2883 // Tuesday 2884 case "EEEE": 2885 default: 2886 return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, { 2887 width: "abbreviated", 2888 context: "formatting" 2889 }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2890 } 2891 } 2892 validate(_date, value) { 2893 return value >= 0 && value <= 6; 2894 } 2895 set(date, _flags, value, options) { 2896 date = setDay(date, value, options); 2897 date.setHours(0, 0, 0, 0); 2898 return date; 2899 } 2900}; 2901
vendor: 2,154 bytes, lines 2902-2976
2902// node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js 2903var LocalDayParser = class extends Parser { 2904 constructor() { 2905 super(...arguments); 2906 __publicField(this, "priority", 90); 2907 __publicField(this, "incompatibleTokens", [ 2908 "y", 2909 "R", 2910 "u", 2911 "q", 2912 "Q", 2913 "M", 2914 "L", 2915 "I", 2916 "d", 2917 "D", 2918 "E", 2919 "i", 2920 "c", 2921 "t", 2922 "T" 2923 ]); 2924 } 2925 parse(dateString, token, match2, options) { 2926 const valueCallback = (value) => { 2927 const wholeWeekDays = Math.floor((value - 1) / 7) * 7; 2928 return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; 2929 }; 2930 switch (token) { 2931 // 3 2932 case "e": 2933 case "ee": 2934 return mapValue(parseNDigits(token.length, dateString), valueCallback); 2935 // 3rd 2936 case "eo": 2937 return mapValue( 2938 match2.ordinalNumber(dateString, { 2939 unit: "day" 2940 }), 2941 valueCallback 2942 ); 2943 // Tue 2944 case "eee": 2945 return match2.day(dateString, { 2946 width: "abbreviated", 2947 context: "formatting" 2948 }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2949 // T 2950 case "eeeee": 2951 return match2.day(dateString, { 2952 width: "narrow", 2953 context: "formatting" 2954 }); 2955 // Tu 2956 case "eeeeee": 2957 return match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2958 // Tuesday 2959 case "eeee": 2960 default: 2961 return match2.day(dateString, { width: "wide", context: "formatting" }) || match2.day(dateString, { 2962 width: "abbreviated", 2963 context: "formatting" 2964 }) || match2.day(dateString, { width: "short", context: "formatting" }) || match2.day(dateString, { width: "narrow", context: "formatting" }); 2965 } 2966 } 2967 validate(_date, value) { 2968 return value >= 0 && value <= 6; 2969 } 2970 set(date, _flags, value, options) { 2971 date = setDay(date, value, options); 2972 date.setHours(0, 0, 0, 0); 2973 return date; 2974 } 2975}; 2976
vendor: 2,174 bytes, lines 2977-3051
2977// node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js 2978var StandAloneLocalDayParser = class extends Parser { 2979 constructor() { 2980 super(...arguments); 2981 __publicField(this, "priority", 90); 2982 __publicField(this, "incompatibleTokens", [ 2983 "y", 2984 "R", 2985 "u", 2986 "q", 2987 "Q", 2988 "M", 2989 "L", 2990 "I", 2991 "d", 2992 "D", 2993 "E", 2994 "i", 2995 "e", 2996 "t", 2997 "T" 2998 ]); 2999 } 3000 parse(dateString, token, match2, options) { 3001 const valueCallback = (value) => { 3002 const wholeWeekDays = Math.floor((value - 1) / 7) * 7; 3003 return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays; 3004 }; 3005 switch (token) { 3006 // 3 3007 case "c": 3008 case "cc": 3009 return mapValue(parseNDigits(token.length, dateString), valueCallback); 3010 // 3rd 3011 case "co": 3012 return mapValue( 3013 match2.ordinalNumber(dateString, { 3014 unit: "day" 3015 }), 3016 valueCallback 3017 ); 3018 // Tue 3019 case "ccc": 3020 return match2.day(dateString, { 3021 width: "abbreviated", 3022 context: "standalone" 3023 }) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" }); 3024 // T 3025 case "ccccc": 3026 return match2.day(dateString, { 3027 width: "narrow", 3028 context: "standalone" 3029 }); 3030 // Tu 3031 case "cccccc": 3032 return match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" }); 3033 // Tuesday 3034 case "cccc": 3035 default: 3036 return match2.day(dateString, { width: "wide", context: "standalone" }) || match2.day(dateString, { 3037 width: "abbreviated", 3038 context: "standalone" 3039 }) || match2.day(dateString, { width: "short", context: "standalone" }) || match2.day(dateString, { width: "narrow", context: "standalone" }); 3040 } 3041 } 3042 validate(_date, value) { 3043 return value >= 0 && value <= 6; 3044 } 3045 set(date, _flags, value, options) { 3046 date = setDay(date, value, options); 3047 date.setHours(0, 0, 0, 0); 3048 return date; 3049 } 3050}; 3051
vendor: 272 bytes, lines 3052-3059
3052// node_modules/date-fns/setISODay.js 3053function setISODay(date, day, options) { 3054 const date_ = toDate(date, options == null ? void 0 : options.in); 3055 const currentDay = getISODay(date_, options); 3056 const diff = day - currentDay; 3057 return addDays(date_, diff, options); 3058} 3059
vendor: 2,441 bytes, lines 3060-3164
3060// node_modules/date-fns/parse/_lib/parsers/ISODayParser.js 3061var ISODayParser = class extends Parser { 3062 constructor() { 3063 super(...arguments); 3064 __publicField(this, "priority", 90); 3065 __publicField(this, "incompatibleTokens", [ 3066 "y", 3067 "Y", 3068 "u", 3069 "q", 3070 "Q", 3071 "M", 3072 "L", 3073 "w", 3074 "d", 3075 "D", 3076 "E", 3077 "e", 3078 "c", 3079 "t", 3080 "T" 3081 ]); 3082 } 3083 parse(dateString, token, match2) { 3084 const valueCallback = (value) => { 3085 if (value === 0) { 3086 return 7; 3087 } 3088 return value; 3089 }; 3090 switch (token) { 3091 // 2 3092 case "i": 3093 case "ii": 3094 return parseNDigits(token.length, dateString); 3095 // 2nd 3096 case "io": 3097 return match2.ordinalNumber(dateString, { unit: "day" }); 3098 // Tue 3099 case "iii": 3100 return mapValue( 3101 match2.day(dateString, { 3102 width: "abbreviated", 3103 context: "formatting" 3104 }) || match2.day(dateString, { 3105 width: "short", 3106 context: "formatting" 3107 }) || match2.day(dateString, { 3108 width: "narrow", 3109 context: "formatting" 3110 }), 3111 valueCallback 3112 ); 3113 // T 3114 case "iiiii": 3115 return mapValue( 3116 match2.day(dateString, { 3117 width: "narrow", 3118 context: "formatting" 3119 }), 3120 valueCallback 3121 ); 3122 // Tu 3123 case "iiiiii": 3124 return mapValue( 3125 match2.day(dateString, { 3126 width: "short", 3127 context: "formatting" 3128 }) || match2.day(dateString, { 3129 width: "narrow", 3130 context: "formatting" 3131 }), 3132 valueCallback 3133 ); 3134 // Tuesday 3135 case "iiii": 3136 default: 3137 return mapValue( 3138 match2.day(dateString, { 3139 width: "wide", 3140 context: "formatting" 3141 }) || match2.day(dateString, { 3142 width: "abbreviated", 3143 context: "formatting" 3144 }) || match2.day(dateString, { 3145 width: "short", 3146 context: "formatting" 3147 }) || match2.day(dateString, { 3148 width: "narrow", 3149 context: "formatting" 3150 }), 3151 valueCallback 3152 ); 3153 } 3154 } 3155 validate(_date, value) { 3156 return value >= 1 && value <= 7; 3157 } 3158 set(date, _flags, value) { 3159 date = setISODay(date, value); 3160 date.setHours(0, 0, 0, 0); 3161 return date; 3162 } 3163}; 3164
vendor: 1,220 bytes, lines 3165-3208
3165// node_modules/date-fns/parse/_lib/parsers/AMPMParser.js 3166var AMPMParser = class extends Parser { 3167 constructor() { 3168 super(...arguments); 3169 __publicField(this, "priority", 80); 3170 __publicField(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]); 3171 } 3172 parse(dateString, token, match2) { 3173 switch (token) { 3174 case "a": 3175 case "aa": 3176 case "aaa": 3177 return match2.dayPeriod(dateString, { 3178 width: "abbreviated", 3179 context: "formatting" 3180 }) || match2.dayPeriod(dateString, { 3181 width: "narrow", 3182 context: "formatting" 3183 }); 3184 case "aaaaa": 3185 return match2.dayPeriod(dateString, { 3186 width: "narrow", 3187 context: "formatting" 3188 }); 3189 case "aaaa": 3190 default: 3191 return match2.dayPeriod(dateString, { 3192 width: "wide", 3193 context: "formatting" 3194 }) || match2.dayPeriod(dateString, { 3195 width: "abbreviated", 3196 context: "formatting" 3197 }) || match2.dayPeriod(dateString, { 3198 width: "narrow", 3199 context: "formatting" 3200 }); 3201 } 3202 } 3203 set(date, _flags, value) { 3204 date.setHours(dayPeriodEnumToHours(value), 0, 0, 0); 3205 return date; 3206 } 3207}; 3208
vendor: 1,236 bytes, lines 3209-3252
3209// node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js 3210var AMPMMidnightParser = class extends Parser { 3211 constructor() { 3212 super(...arguments); 3213 __publicField(this, "priority", 80); 3214 __publicField(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]); 3215 } 3216 parse(dateString, token, match2) { 3217 switch (token) { 3218 case "b": 3219 case "bb": 3220 case "bbb": 3221 return match2.dayPeriod(dateString, { 3222 width: "abbreviated", 3223 context: "formatting" 3224 }) || match2.dayPeriod(dateString, { 3225 width: "narrow", 3226 context: "formatting" 3227 }); 3228 case "bbbbb": 3229 return match2.dayPeriod(dateString, { 3230 width: "narrow", 3231 context: "formatting" 3232 }); 3233 case "bbbb": 3234 default: 3235 return match2.dayPeriod(dateString, { 3236 width: "wide", 3237 context: "formatting" 3238 }) || match2.dayPeriod(dateString, { 3239 width: "abbreviated", 3240 context: "formatting" 3241 }) || match2.dayPeriod(dateString, { 3242 width: "narrow", 3243 context: "formatting" 3244 }); 3245 } 3246 } 3247 set(date, _flags, value) { 3248 date.setHours(dayPeriodEnumToHours(value), 0, 0, 0); 3249 return date; 3250 } 3251}; 3252
vendor: 1,220 bytes, lines 3253-3296
3253// node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js 3254var DayPeriodParser = class extends Parser { 3255 constructor() { 3256 super(...arguments); 3257 __publicField(this, "priority", 80); 3258 __publicField(this, "incompatibleTokens", ["a", "b", "t", "T"]); 3259 } 3260 parse(dateString, token, match2) { 3261 switch (token) { 3262 case "B": 3263 case "BB": 3264 case "BBB": 3265 return match2.dayPeriod(dateString, { 3266 width: "abbreviated", 3267 context: "formatting" 3268 }) || match2.dayPeriod(dateString, { 3269 width: "narrow", 3270 context: "formatting" 3271 }); 3272 case "BBBBB": 3273 return match2.dayPeriod(dateString, { 3274 width: "narrow", 3275 context: "formatting" 3276 }); 3277 case "BBBB": 3278 default: 3279 return match2.dayPeriod(dateString, { 3280 width: "wide", 3281 context: "formatting" 3282 }) || match2.dayPeriod(dateString, { 3283 width: "abbreviated", 3284 context: "formatting" 3285 }) || match2.dayPeriod(dateString, { 3286 width: "narrow", 3287 context: "formatting" 3288 }); 3289 } 3290 } 3291 set(date, _flags, value) { 3292 date.setHours(dayPeriodEnumToHours(value), 0, 0, 0); 3293 return date; 3294 } 3295}; 3296
vendor: 945 bytes, lines 3297-3329
3297// node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js 3298var Hour1to12Parser = class extends Parser { 3299 constructor() { 3300 super(...arguments); 3301 __publicField(this, "priority", 70); 3302 __publicField(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]); 3303 } 3304 parse(dateString, token, match2) { 3305 switch (token) { 3306 case "h": 3307 return parseNumericPattern(numericPatterns.hour12h, dateString); 3308 case "ho": 3309 return match2.ordinalNumber(dateString, { unit: "hour" }); 3310 default: 3311 return parseNDigits(token.length, dateString); 3312 } 3313 } 3314 validate(_date, value) { 3315 return value >= 1 && value <= 12; 3316 } 3317 set(date, _flags, value) { 3318 const isPM = date.getHours() >= 12; 3319 if (isPM && value < 12) { 3320 date.setHours(value + 12, 0, 0, 0); 3321 } else if (!isPM && value === 12) { 3322 date.setHours(0, 0, 0, 0); 3323 } else { 3324 date.setHours(value, 0, 0, 0); 3325 } 3326 return date; 3327 } 3328}; 3329
vendor: 749 bytes, lines 3330-3355
3330// node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js 3331var Hour0to23Parser = class extends Parser { 3332 constructor() { 3333 super(...arguments); 3334 __publicField(this, "priority", 70); 3335 __publicField(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]); 3336 } 3337 parse(dateString, token, match2) { 3338 switch (token) { 3339 case "H": 3340 return parseNumericPattern(numericPatterns.hour23h, dateString); 3341 case "Ho": 3342 return match2.ordinalNumber(dateString, { unit: "hour" }); 3343 default: 3344 return parseNDigits(token.length, dateString); 3345 } 3346 } 3347 validate(_date, value) { 3348 return value >= 0 && value <= 23; 3349 } 3350 set(date, _flags, value) { 3351 date.setHours(value, 0, 0, 0); 3352 return date; 3353 } 3354}; 3355
vendor: 872 bytes, lines 3356-3386
3356// node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js 3357var Hour0To11Parser = class extends Parser { 3358 constructor() { 3359 super(...arguments); 3360 __publicField(this, "priority", 70); 3361 __publicField(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]); 3362 } 3363 parse(dateString, token, match2) { 3364 switch (token) { 3365 case "K": 3366 return parseNumericPattern(numericPatterns.hour11h, dateString); 3367 case "Ko": 3368 return match2.ordinalNumber(dateString, { unit: "hour" }); 3369 default: 3370 return parseNDigits(token.length, dateString); 3371 } 3372 } 3373 validate(_date, value) { 3374 return value >= 0 && value <= 11; 3375 } 3376 set(date, _flags, value) { 3377 const isPM = date.getHours() >= 12; 3378 if (isPM && value < 12) { 3379 date.setHours(value + 12, 0, 0, 0); 3380 } else { 3381 date.setHours(value, 0, 0, 0); 3382 } 3383 return date; 3384 } 3385}; 3386
vendor: 801 bytes, lines 3387-3413
3387// node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js 3388var Hour1To24Parser = class extends Parser { 3389 constructor() { 3390 super(...arguments); 3391 __publicField(this, "priority", 70); 3392 __publicField(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]); 3393 } 3394 parse(dateString, token, match2) { 3395 switch (token) { 3396 case "k": 3397 return parseNumericPattern(numericPatterns.hour24h, dateString); 3398 case "ko": 3399 return match2.ordinalNumber(dateString, { unit: "hour" }); 3400 default: 3401 return parseNDigits(token.length, dateString); 3402 } 3403 } 3404 validate(_date, value) { 3405 return value >= 1 && value <= 24; 3406 } 3407 set(date, _flags, value) { 3408 const hours = value <= 24 ? value % 24 : value; 3409 date.setHours(hours, 0, 0, 0); 3410 return date; 3411 } 3412}; 3413
vendor: 718 bytes, lines 3414-3439
3414// node_modules/date-fns/parse/_lib/parsers/MinuteParser.js 3415var MinuteParser = class extends Parser { 3416 constructor() { 3417 super(...arguments); 3418 __publicField(this, "priority", 60); 3419 __publicField(this, "incompatibleTokens", ["t", "T"]); 3420 } 3421 parse(dateString, token, match2) { 3422 switch (token) { 3423 case "m": 3424 return parseNumericPattern(numericPatterns.minute, dateString); 3425 case "mo": 3426 return match2.ordinalNumber(dateString, { unit: "minute" }); 3427 default: 3428 return parseNDigits(token.length, dateString); 3429 } 3430 } 3431 validate(_date, value) { 3432 return value >= 0 && value <= 59; 3433 } 3434 set(date, _flags, value) { 3435 date.setMinutes(value, 0, 0); 3436 return date; 3437 } 3438}; 3439
vendor: 715 bytes, lines 3440-3465
3440// node_modules/date-fns/parse/_lib/parsers/SecondParser.js 3441var SecondParser = class extends Parser { 3442 constructor() { 3443 super(...arguments); 3444 __publicField(this, "priority", 50); 3445 __publicField(this, "incompatibleTokens", ["t", "T"]); 3446 } 3447 parse(dateString, token, match2) { 3448 switch (token) { 3449 case "s": 3450 return parseNumericPattern(numericPatterns.second, dateString); 3451 case "so": 3452 return match2.ordinalNumber(dateString, { unit: "second" }); 3453 default: 3454 return parseNDigits(token.length, dateString); 3455 } 3456 } 3457 validate(_date, value) { 3458 return value >= 0 && value <= 59; 3459 } 3460 set(date, _flags, value) { 3461 date.setSeconds(value, 0); 3462 return date; 3463 } 3464}; 3465
vendor: 555 bytes, lines 3466-3482
3466// node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js 3467var FractionOfSecondParser = class extends Parser { 3468 constructor() { 3469 super(...arguments); 3470 __publicField(this, "priority", 30); 3471 __publicField(this, "incompatibleTokens", ["t", "T"]); 3472 } 3473 parse(dateString, token) { 3474 const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3)); 3475 return mapValue(parseNDigits(token.length, dateString), valueCallback); 3476 } 3477 set(date, _flags, value) { 3478 date.setMilliseconds(value); 3479 return date; 3480 } 3481}; 3482
vendor: 1,138 bytes, lines 3483-3522
3483// node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js 3484var ISOTimezoneWithZParser = class extends Parser { 3485 constructor() { 3486 super(...arguments); 3487 __publicField(this, "priority", 10); 3488 __publicField(this, "incompatibleTokens", ["t", "T", "x"]); 3489 } 3490 parse(dateString, token) { 3491 switch (token) { 3492 case "X": 3493 return parseTimezonePattern( 3494 timezonePatterns.basicOptionalMinutes, 3495 dateString 3496 ); 3497 case "XX": 3498 return parseTimezonePattern(timezonePatterns.basic, dateString); 3499 case "XXXX": 3500 return parseTimezonePattern( 3501 timezonePatterns.basicOptionalSeconds, 3502 dateString 3503 ); 3504 case "XXXXX": 3505 return parseTimezonePattern( 3506 timezonePatterns.extendedOptionalSeconds, 3507 dateString 3508 ); 3509 case "XXX": 3510 default: 3511 return parseTimezonePattern(timezonePatterns.extended, dateString); 3512 } 3513 } 3514 set(date, flags, value) { 3515 if (flags.timestampIsSet) return date; 3516 return constructFrom( 3517 date, 3518 date.getTime() - getTimezoneOffsetInMilliseconds(date) - value 3519 ); 3520 } 3521}; 3522
vendor: 1,128 bytes, lines 3523-3562
3523// node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js 3524var ISOTimezoneParser = class extends Parser { 3525 constructor() { 3526 super(...arguments); 3527 __publicField(this, "priority", 10); 3528 __publicField(this, "incompatibleTokens", ["t", "T", "X"]); 3529 } 3530 parse(dateString, token) { 3531 switch (token) { 3532 case "x": 3533 return parseTimezonePattern( 3534 timezonePatterns.basicOptionalMinutes, 3535 dateString 3536 ); 3537 case "xx": 3538 return parseTimezonePattern(timezonePatterns.basic, dateString); 3539 case "xxxx": 3540 return parseTimezonePattern( 3541 timezonePatterns.basicOptionalSeconds, 3542 dateString 3543 ); 3544 case "xxxxx": 3545 return parseTimezonePattern( 3546 timezonePatterns.extendedOptionalSeconds, 3547 dateString 3548 ); 3549 case "xxx": 3550 default: 3551 return parseTimezonePattern(timezonePatterns.extended, dateString); 3552 } 3553 } 3554 set(date, flags, value) { 3555 if (flags.timestampIsSet) return date; 3556 return constructFrom( 3557 date, 3558 date.getTime() - getTimezoneOffsetInMilliseconds(date) - value 3559 ); 3560 } 3561}; 3562
vendor: 443 bytes, lines 3563-3577
3563// node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js 3564var TimestampSecondsParser = class extends Parser { 3565 constructor() { 3566 super(...arguments); 3567 __publicField(this, "priority", 40); 3568 __publicField(this, "incompatibleTokens", "*"); 3569 } 3570 parse(dateString) { 3571 return parseAnyDigitsSigned(dateString); 3572 } 3573 set(date, _flags, value) { 3574 return [constructFrom(date, value * 1e3), { timestampIsSet: true }]; 3575 } 3576}; 3577
vendor: 447 bytes, lines 3578-3592
3578// node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js 3579var TimestampMillisecondsParser = class extends Parser { 3580 constructor() { 3581 super(...arguments); 3582 __publicField(this, "priority", 20); 3583 __publicField(this, "incompatibleTokens", "*"); 3584 } 3585 parse(dateString) { 3586 return parseAnyDigitsSigned(dateString); 3587 } 3588 set(date, _flags, value) { 3589 return [constructFrom(date, value), { timestampIsSet: true }]; 3590 } 3591}; 3592
vendor: 959 bytes, lines 3593-3627
3593// node_modules/date-fns/parse/_lib/parsers.js 3594var parsers = { 3595 G: new EraParser(), 3596 y: new YearParser(), 3597 Y: new LocalWeekYearParser(), 3598 R: new ISOWeekYearParser(), 3599 u: new ExtendedYearParser(), 3600 Q: new QuarterParser(), 3601 q: new StandAloneQuarterParser(), 3602 M: new MonthParser(), 3603 L: new StandAloneMonthParser(), 3604 w: new LocalWeekParser(), 3605 I: new ISOWeekParser(), 3606 d: new DateParser(), 3607 D: new DayOfYearParser(), 3608 E: new DayParser(), 3609 e: new LocalDayParser(), 3610 c: new StandAloneLocalDayParser(), 3611 i: new ISODayParser(), 3612 a: new AMPMParser(), 3613 b: new AMPMMidnightParser(), 3614 B: new DayPeriodParser(), 3615 h: new Hour1to12Parser(), 3616 H: new Hour0to23Parser(), 3617 K: new Hour0To11Parser(), 3618 k: new Hour1To24Parser(), 3619 m: new MinuteParser(), 3620 s: new SecondParser(), 3621 S: new FractionOfSecondParser(), 3622 X: new ISOTimezoneWithZParser(), 3623 x: new ISOTimezoneParser(), 3624 t: new TimestampSecondsParser(), 3625 T: new TimestampMillisecondsParser() 3626}; 3627
vendor: 5,180 bytes, lines 3628-3740
3628// node_modules/date-fns/parse.js 3629var formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; 3630var longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; 3631var escapedStringRegExp2 = /^'([^]*?)'?$/; 3632var doubleQuoteRegExp2 = /''/g; 3633var notWhitespaceRegExp = /\S/; 3634var unescapedLatinCharacterRegExp2 = /[a-zA-Z]/; 3635function parse(dateStr, formatStr, referenceDate, options) { 3636 var _a2, _b, _c, _d, _e, _f, _g, _h; 3637 const invalidDate = () => constructFrom((options == null ? void 0 : options.in) || referenceDate, NaN); 3638 const defaultOptions2 = getDefaultOptions2(); 3639 const locale = (options == null ? void 0 : options.locale) ?? defaultOptions2.locale ?? enUS; 3640 const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a2 = options == null ? void 0 : options.locale) == null ? void 0 : _a2.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1; 3641 const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_f = (_e = options == null ? void 0 : options.locale) == null ? void 0 : _e.options) == null ? void 0 : _f.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_h = (_g = defaultOptions2.locale) == null ? void 0 : _g.options) == null ? void 0 : _h.weekStartsOn) ?? 0; 3642 if (!formatStr) 3643 return dateStr ? invalidDate() : toDate(referenceDate, options == null ? void 0 : options.in); 3644 const subFnOptions = { 3645 firstWeekContainsDate, 3646 weekStartsOn, 3647 locale 3648 }; 3649 const setters = [new DateTimezoneSetter(options == null ? void 0 : options.in, referenceDate)]; 3650 const tokens = formatStr.match(longFormattingTokensRegExp2).map((substring) => { 3651 const firstCharacter = substring[0]; 3652 if (firstCharacter in longFormatters) { 3653 const longFormatter = longFormatters[firstCharacter]; 3654 return longFormatter(substring, locale.formatLong); 3655 } 3656 return substring; 3657 }).join("").match(formattingTokensRegExp2); 3658 const usedTokens = []; 3659 for (let token of tokens) { 3660 if (!(options == null ? void 0 : options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token)) { 3661 warnOrThrowProtectedError(token, formatStr, dateStr); 3662 } 3663 if (!(options == null ? void 0 : options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) { 3664 warnOrThrowProtectedError(token, formatStr, dateStr); 3665 } 3666 const firstCharacter = token[0]; 3667 const parser = parsers[firstCharacter]; 3668 if (parser) { 3669 const { incompatibleTokens } = parser; 3670 if (Array.isArray(incompatibleTokens)) { 3671 const incompatibleToken = usedTokens.find( 3672 (usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter 3673 ); 3674 if (incompatibleToken) { 3675 throw new RangeError( 3676 `The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time` 3677 ); 3678 } 3679 } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) { 3680 throw new RangeError( 3681 `The format string mustn't contain \`${token}\` and any other token at the same time` 3682 ); 3683 } 3684 usedTokens.push({ token: firstCharacter, fullToken: token }); 3685 const parseResult = parser.run( 3686 dateStr, 3687 token, 3688 locale.match, 3689 subFnOptions 3690 ); 3691 if (!parseResult) { 3692 return invalidDate(); 3693 } 3694 setters.push(parseResult.setter); 3695 dateStr = parseResult.rest; 3696 } else { 3697 if (firstCharacter.match(unescapedLatinCharacterRegExp2)) { 3698 throw new RangeError( 3699 "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`" 3700 ); 3701 } 3702 if (token === "''") { 3703 token = "'"; 3704 } else if (firstCharacter === "'") { 3705 token = cleanEscapedString2(token); 3706 } 3707 if (dateStr.indexOf(token) === 0) { 3708 dateStr = dateStr.slice(token.length); 3709 } else { 3710 return invalidDate(); 3711 } 3712 } 3713 } 3714 if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) { 3715 return invalidDate(); 3716 } 3717 const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index3, array) => array.indexOf(priority) === index3).map( 3718 (priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority) 3719 ).map((setterArray) => setterArray[0]); 3720 let date = toDate(referenceDate, options == null ? void 0 : options.in); 3721 if (isNaN(+date)) return invalidDate(); 3722 const flags = {}; 3723 for (const setter of uniquePrioritySetters) { 3724 if (!setter.validate(date, subFnOptions)) { 3725 return invalidDate(); 3726 } 3727 const result = setter.set(date, flags, subFnOptions); 3728 if (Array.isArray(result)) { 3729 date = result[0]; 3730 Object.assign(flags, result[1]); 3731 } else { 3732 date = result; 3733 } 3734 } 3735 return date; 3736} 3737function cleanEscapedString2(input) { 3738 return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'"); 3739} 3740
vendor: 350 bytes, lines 3741-3750
3741// node_modules/date-fns/isSameMonth.js 3742function isSameMonth(laterDate, earlierDate, options) { 3743 const [laterDate_, earlierDate_] = normalizeDates( 3744 options == null ? void 0 : options.in, 3745 laterDate, 3746 earlierDate 3747 ); 3748 return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth(); 3749} 3750
vendor: 301 bytes, lines 3751-3760
3751// node_modules/date-fns/isSameQuarter.js 3752function isSameQuarter(laterDate, earlierDate, options) { 3753 const [dateLeft_, dateRight_] = normalizeDates( 3754 options == null ? void 0 : options.in, 3755 laterDate, 3756 earlierDate 3757 ); 3758 return +startOfQuarter(dateLeft_) === +startOfQuarter(dateRight_); 3759} 3760
vendor: 295 bytes, lines 3761-3770
3761// node_modules/date-fns/isSameYear.js 3762function isSameYear(laterDate, earlierDate, options) { 3763 const [laterDate_, earlierDate_] = normalizeDates( 3764 options == null ? void 0 : options.in, 3765 laterDate, 3766 earlierDate 3767 ); 3768 return laterDate_.getFullYear() === earlierDate_.getFullYear(); 3769} 3770
vendor: 410 bytes, lines 3771-3780
3771// node_modules/date-fns/isWithinInterval.js 3772function isWithinInterval(date, interval, options) { 3773 const time = +toDate(date, options == null ? void 0 : options.in); 3774 const [startTime, endTime] = [ 3775 +toDate(interval.start, options == null ? void 0 : options.in), 3776 +toDate(interval.end, options == null ? void 0 : options.in) 3777 ].sort((a, b) => a - b); 3778 return time >= startTime && time <= endTime; 3779} 3780
vendor: 123 bytes, lines 3781-3785
3781// node_modules/date-fns/subDays.js 3782function subDays(date, amount, options) { 3783 return addDays(date, -amount, options); 3784} 3785
vendor: 6,231 bytes, lines 3786-3960
3786// node_modules/date-fns/parseISO.js 3787function parseISO(argument, options) { 3788 const invalidDate = () => constructFrom(options == null ? void 0 : options.in, NaN); 3789 const additionalDigits = (options == null ? void 0 : options.additionalDigits) ?? 2; 3790 const dateStrings = splitDateString(argument); 3791 let date; 3792 if (dateStrings.date) { 3793 const parseYearResult = parseYear(dateStrings.date, additionalDigits); 3794 date = parseDate(parseYearResult.restDateString, parseYearResult.year); 3795 } 3796 if (!date || isNaN(+date)) return invalidDate(); 3797 const timestamp = +date; 3798 let time = 0; 3799 let offset4; 3800 if (dateStrings.time) { 3801 time = parseTime(dateStrings.time); 3802 if (isNaN(time)) return invalidDate(); 3803 } 3804 if (dateStrings.timezone) { 3805 offset4 = parseTimezone(dateStrings.timezone); 3806 if (isNaN(offset4)) return invalidDate(); 3807 } else { 3808 const tmpDate = new Date(timestamp + time); 3809 const result = toDate(0, options == null ? void 0 : options.in); 3810 result.setFullYear( 3811 tmpDate.getUTCFullYear(), 3812 tmpDate.getUTCMonth(), 3813 tmpDate.getUTCDate() 3814 ); 3815 result.setHours( 3816 tmpDate.getUTCHours(), 3817 tmpDate.getUTCMinutes(), 3818 tmpDate.getUTCSeconds(), 3819 tmpDate.getUTCMilliseconds() 3820 ); 3821 return result; 3822 } 3823 return toDate(timestamp + time + offset4, options == null ? void 0 : options.in); 3824} 3825var patterns = { 3826 dateTimeDelimiter: /[T ]/, 3827 timeZoneDelimiter: /[Z ]/i, 3828 timezone: /([Z+-].*)$/ 3829}; 3830var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/; 3831var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/; 3832var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/; 3833function splitDateString(dateString) { 3834 const dateStrings = {}; 3835 const array = dateString.split(patterns.dateTimeDelimiter); 3836 let timeString; 3837 if (array.length > 2) { 3838 return dateStrings; 3839 } 3840 if (/:/.test(array[0])) { 3841 timeString = array[0]; 3842 } else { 3843 dateStrings.date = array[0]; 3844 timeString = array[1]; 3845 if (patterns.timeZoneDelimiter.test(dateStrings.date)) { 3846 dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]; 3847 timeString = dateString.substr( 3848 dateStrings.date.length, 3849 dateString.length 3850 ); 3851 } 3852 } 3853 if (timeString) { 3854 const token = patterns.timezone.exec(timeString); 3855 if (token) { 3856 dateStrings.time = timeString.replace(token[1], ""); 3857 dateStrings.timezone = token[1]; 3858 } else { 3859 dateStrings.time = timeString; 3860 } 3861 } 3862 return dateStrings; 3863} 3864function parseYear(dateString, additionalDigits) { 3865 const regex = new RegExp( 3866 "^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)" 3867 ); 3868 const captures = dateString.match(regex); 3869 if (!captures) return { year: NaN, restDateString: "" }; 3870 const year = captures[1] ? parseInt(captures[1]) : null; 3871 const century = captures[2] ? parseInt(captures[2]) : null; 3872 return { 3873 year: century === null ? year : century * 100, 3874 restDateString: dateString.slice((captures[1] || captures[2]).length) 3875 }; 3876} 3877function parseDate(dateString, year) { 3878 if (year === null) return /* @__PURE__ */ new Date(NaN); 3879 const captures = dateString.match(dateRegex); 3880 if (!captures) return /* @__PURE__ */ new Date(NaN); 3881 const isWeekDate = !!captures[4]; 3882 const dayOfYear = parseDateUnit(captures[1]); 3883 const month = parseDateUnit(captures[2]) - 1; 3884 const day = parseDateUnit(captures[3]); 3885 const week = parseDateUnit(captures[4]); 3886 const dayOfWeek = parseDateUnit(captures[5]) - 1; 3887 if (isWeekDate) { 3888 if (!validateWeekDate(year, week, dayOfWeek)) { 3889 return /* @__PURE__ */ new Date(NaN); 3890 } 3891 return dayOfISOWeekYear(year, week, dayOfWeek); 3892 } else { 3893 const date = /* @__PURE__ */ new Date(0); 3894 if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) { 3895 return /* @__PURE__ */ new Date(NaN); 3896 } 3897 date.setUTCFullYear(year, month, Math.max(dayOfYear, day)); 3898 return date; 3899 } 3900} 3901function parseDateUnit(value) { 3902 return value ? parseInt(value) : 1; 3903} 3904function parseTime(timeString) { 3905 const captures = timeString.match(timeRegex); 3906 if (!captures) return NaN; 3907 const hours = parseTimeUnit(captures[1]); 3908 const minutes = parseTimeUnit(captures[2]); 3909 const seconds = parseTimeUnit(captures[3]); 3910 if (!validateTime(hours, minutes, seconds)) { 3911 return NaN; 3912 } 3913 return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3; 3914} 3915function parseTimeUnit(value) { 3916 return value && parseFloat(value.replace(",", ".")) || 0; 3917} 3918function parseTimezone(timezoneString) { 3919 if (timezoneString === "Z") return 0; 3920 const captures = timezoneString.match(timezoneRegex); 3921 if (!captures) return 0; 3922 const sign = captures[1] === "+" ? -1 : 1; 3923 const hours = parseInt(captures[2]); 3924 const minutes = captures[3] && parseInt(captures[3]) || 0; 3925 if (!validateTimezone(hours, minutes)) { 3926 return NaN; 3927 } 3928 return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute); 3929} 3930function dayOfISOWeekYear(isoWeekYear, week, day) { 3931 const date = /* @__PURE__ */ new Date(0); 3932 date.setUTCFullYear(isoWeekYear, 0, 4); 3933 const fourthOfJanuaryDay = date.getUTCDay() || 7; 3934 const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay; 3935 date.setUTCDate(date.getUTCDate() + diff); 3936 return date; 3937} 3938var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 3939function isLeapYearIndex2(year) { 3940 return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0; 3941} 3942function validateDate(year, month, date) { 3943 return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28)); 3944} 3945function validateDayOfYearDate(year, dayOfYear) { 3946 return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365); 3947} 3948function validateWeekDate(_year, week, day) { 3949 return week >= 1 && week <= 53 && day >= 0 && day <= 6; 3950} 3951function validateTime(hours, minutes, seconds) { 3952 if (hours === 24) { 3953 return minutes === 0 && seconds === 0; 3954 } 3955 return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25; 3956} 3957function validateTimezone(_hours, minutes) { 3958 return minutes >= 0 && minutes <= 59; 3959} 3960
vendor: 495 bytes, lines 3961-3973
3961// node_modules/date-fns/setMonth.js 3962function setMonth(date, month, options) { 3963 const _date = toDate(date, options == null ? void 0 : options.in); 3964 const year = _date.getFullYear(); 3965 const day = _date.getDate(); 3966 const midMonth = constructFrom((options == null ? void 0 : options.in) || date, 0); 3967 midMonth.setFullYear(year, month, 15); 3968 midMonth.setHours(0, 0, 0, 0); 3969 const daysInMonth = getDaysInMonth(midMonth); 3970 _date.setMonth(month, Math.min(day, daysInMonth)); 3971 return _date; 3972} 3973
vendor: 192 bytes, lines 3974-3980
3974// node_modules/date-fns/setHours.js 3975function setHours(date, hours, options) { 3976 const _date = toDate(date, options == null ? void 0 : options.in); 3977 _date.setHours(hours); 3978 return _date; 3979} 3980
vendor: 202 bytes, lines 3981-3987
3981// node_modules/date-fns/setMinutes.js 3982function setMinutes(date, minutes, options) { 3983 const date_ = toDate(date, options == null ? void 0 : options.in); 3984 date_.setMinutes(minutes); 3985 return date_; 3986} 3987
vendor: 308 bytes, lines 3988-3995
3988// node_modules/date-fns/setQuarter.js 3989function setQuarter(date, quarter, options) { 3990 const date_ = toDate(date, options == null ? void 0 : options.in); 3991 const oldQuarter = Math.trunc(date_.getMonth() / 3) + 1; 3992 const diff = quarter - oldQuarter; 3993 return setMonth(date_, date_.getMonth() + diff * 3); 3994} 3995
vendor: 202 bytes, lines 3996-4002
3996// node_modules/date-fns/setSeconds.js 3997function setSeconds(date, seconds, options) { 3998 const _date = toDate(date, options == null ? void 0 : options.in); 3999 _date.setSeconds(seconds); 4000 return _date; 4001} 4002
vendor: 288 bytes, lines 4003-4010
4003// node_modules/date-fns/setYear.js 4004function setYear(date, year, options) { 4005 const date_ = toDate(date, options == null ? void 0 : options.in); 4006 if (isNaN(+date_)) return constructFrom((options == null ? void 0 : options.in) || date, NaN); 4007 date_.setFullYear(year); 4008 return date_; 4009} 4010
vendor: 129 bytes, lines 4011-4015
4011// node_modules/date-fns/subMonths.js 4012function subMonths(date, amount, options) { 4013 return addMonths(date, -amount, options); 4014} 4015
vendor: 135 bytes, lines 4016-4020
4016// node_modules/date-fns/subQuarters.js 4017function subQuarters(date, amount, options) { 4018 return addQuarters(date, -amount, options); 4019} 4020
vendor: 126 bytes, lines 4021-4025
4021// node_modules/date-fns/subWeeks.js 4022function subWeeks(date, amount, options) { 4023 return addWeeks(date, -amount, options); 4024} 4025
vendor: 126 bytes, lines 4026-4030
4026// node_modules/date-fns/subYears.js 4027function subYears(date, amount, options) { 4028 return addYears(date, -amount, options); 4029} 4030
vendor: 154 bytes, lines 4031-4034
4031// node_modules/@floating-ui/react/dist/floating-ui.react.mjs 4032var React2 = __toESM(require_react(), 1); 4033var import_react2 = __toESM(require_react(), 1); 4034
vendor: 5,213 bytes, lines 4035-4180
4035// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 4036function hasWindow() { 4037 return typeof window !== "undefined"; 4038} 4039function getNodeName(node) { 4040 if (isNode(node)) { 4041 return (node.nodeName || "").toLowerCase(); 4042 } 4043 return "#document"; 4044} 4045function getWindow(node) { 4046 var _node$ownerDocument; 4047 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 4048} 4049function getDocumentElement(node) { 4050 var _ref; 4051 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 4052} 4053function isNode(value) { 4054 if (!hasWindow()) { 4055 return false; 4056 } 4057 return value instanceof Node || value instanceof getWindow(value).Node; 4058} 4059function isElement(value) { 4060 if (!hasWindow()) { 4061 return false; 4062 } 4063 return value instanceof Element || value instanceof getWindow(value).Element; 4064} 4065function isHTMLElement(value) { 4066 if (!hasWindow()) { 4067 return false; 4068 } 4069 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 4070} 4071function isShadowRoot(value) { 4072 if (!hasWindow() || typeof ShadowRoot === "undefined") { 4073 return false; 4074 } 4075 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 4076} 4077function isOverflowElement(element) { 4078 const { 4079 overflow, 4080 overflowX, 4081 overflowY, 4082 display 4083 } = getComputedStyle2(element); 4084 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display); 4085} 4086function isTableElement(element) { 4087 return ["table", "td", "th"].includes(getNodeName(element)); 4088} 4089function isTopLayer(element) { 4090 return [":popover-open", ":modal"].some((selector) => { 4091 try { 4092 return element.matches(selector); 4093 } catch (e) { 4094 return false; 4095 } 4096 }); 4097} 4098function isContainingBlock(elementOrCss) { 4099 const webkit = isWebKit(); 4100 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 4101 return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value)); 4102} 4103function getContainingBlock(element) { 4104 let currentNode = getParentNode(element); 4105 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 4106 if (isContainingBlock(currentNode)) { 4107 return currentNode; 4108 } else if (isTopLayer(currentNode)) { 4109 return null; 4110 } 4111 currentNode = getParentNode(currentNode); 4112 } 4113 return null; 4114} 4115function isWebKit() { 4116 if (typeof CSS === "undefined" || !CSS.supports) return false; 4117 return CSS.supports("-webkit-backdrop-filter", "none"); 4118} 4119function isLastTraversableNode(node) { 4120 return ["html", "body", "#document"].includes(getNodeName(node)); 4121} 4122function getComputedStyle2(element) { 4123 return getWindow(element).getComputedStyle(element); 4124} 4125function getNodeScroll(element) { 4126 if (isElement(element)) { 4127 return { 4128 scrollLeft: element.scrollLeft, 4129 scrollTop: element.scrollTop 4130 }; 4131 } 4132 return { 4133 scrollLeft: element.scrollX, 4134 scrollTop: element.scrollY 4135 }; 4136} 4137function getParentNode(node) { 4138 if (getNodeName(node) === "html") { 4139 return node; 4140 } 4141 const result = ( 4142 // Step into the shadow DOM of the parent of a slotted node. 4143 node.assignedSlot || // DOM Element detected. 4144 node.parentNode || // ShadowRoot detected. 4145 isShadowRoot(node) && node.host || // Fallback. 4146 getDocumentElement(node) 4147 ); 4148 return isShadowRoot(result) ? result.host : result; 4149} 4150function getNearestOverflowAncestor(node) { 4151 const parentNode = getParentNode(node); 4152 if (isLastTraversableNode(parentNode)) { 4153 return node.ownerDocument ? node.ownerDocument.body : node.body; 4154 } 4155 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 4156 return parentNode; 4157 } 4158 return getNearestOverflowAncestor(parentNode); 4159} 4160function getOverflowAncestors(node, list, traverseIframes) { 4161 var _node$ownerDocument2; 4162 if (list === void 0) { 4163 list = []; 4164 } 4165 if (traverseIframes === void 0) { 4166 traverseIframes = true; 4167 } 4168 const scrollableAncestor = getNearestOverflowAncestor(node); 4169 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 4170 const win = getWindow(scrollableAncestor); 4171 if (isBody) { 4172 const frameElement = getFrameElement(win); 4173 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 4174 } 4175 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 4176} 4177function getFrameElement(win) { 4178 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 4179} 4180
vendor: 391 bytes, lines 4181-4196
4181// node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs 4182function getPlatform() { 4183 const uaData = navigator.userAgentData; 4184 if (uaData != null && uaData.platform) { 4185 return uaData.platform; 4186 } 4187 return navigator.platform; 4188} 4189function isSafari() { 4190 return /apple/i.test(navigator.vendor); 4191} 4192function stopEvent(event) { 4193 event.preventDefault(); 4194 event.stopPropagation(); 4195} 4196
vendor: 3,646 bytes, lines 4197-4329
4197// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 4198var sides = ["top", "right", "bottom", "left"]; 4199var alignments = ["start", "end"]; 4200var placements = sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []); 4201var min2 = Math.min; 4202var max2 = Math.max; 4203var round = Math.round; 4204var floor = Math.floor; 4205var createCoords = (v) => ({ 4206 x: v, 4207 y: v 4208}); 4209var oppositeSideMap = { 4210 left: "right", 4211 right: "left", 4212 bottom: "top", 4213 top: "bottom" 4214}; 4215var oppositeAlignmentMap = { 4216 start: "end", 4217 end: "start" 4218}; 4219function clamp(start, value, end) { 4220 return max2(start, min2(value, end)); 4221} 4222function evaluate(value, param) { 4223 return typeof value === "function" ? value(param) : value; 4224} 4225function getSide(placement) { 4226 return placement.split("-")[0]; 4227} 4228function getAlignment(placement) { 4229 return placement.split("-")[1]; 4230} 4231function getOppositeAxis(axis) { 4232 return axis === "x" ? "y" : "x"; 4233} 4234function getAxisLength(axis) { 4235 return axis === "y" ? "height" : "width"; 4236} 4237function getSideAxis(placement) { 4238 return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x"; 4239} 4240function getAlignmentAxis(placement) { 4241 return getOppositeAxis(getSideAxis(placement)); 4242} 4243function getAlignmentSides(placement, rects, rtl) { 4244 if (rtl === void 0) { 4245 rtl = false; 4246 } 4247 const alignment = getAlignment(placement); 4248 const alignmentAxis = getAlignmentAxis(placement); 4249 const length = getAxisLength(alignmentAxis); 4250 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 4251 if (rects.reference[length] > rects.floating[length]) { 4252 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 4253 } 4254 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 4255} 4256function getExpandedPlacements(placement) { 4257 const oppositePlacement = getOppositePlacement(placement); 4258 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 4259} 4260function getOppositeAlignmentPlacement(placement) { 4261 return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]); 4262} 4263function getSideList(side, isStart, rtl) { 4264 const lr = ["left", "right"]; 4265 const rl = ["right", "left"]; 4266 const tb = ["top", "bottom"]; 4267 const bt = ["bottom", "top"]; 4268 switch (side) { 4269 case "top": 4270 case "bottom": 4271 if (rtl) return isStart ? rl : lr; 4272 return isStart ? lr : rl; 4273 case "left": 4274 case "right": 4275 return isStart ? tb : bt; 4276 default: 4277 return []; 4278 } 4279} 4280function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 4281 const alignment = getAlignment(placement); 4282 let list = getSideList(getSide(placement), direction === "start", rtl); 4283 if (alignment) { 4284 list = list.map((side) => side + "-" + alignment); 4285 if (flipAlignment) { 4286 list = list.concat(list.map(getOppositeAlignmentPlacement)); 4287 } 4288 } 4289 return list; 4290} 4291function getOppositePlacement(placement) { 4292 return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]); 4293} 4294function expandPaddingObject(padding) { 4295 return { 4296 top: 0, 4297 right: 0, 4298 bottom: 0, 4299 left: 0, 4300 ...padding 4301 }; 4302} 4303function getPaddingObject(padding) { 4304 return typeof padding !== "number" ? expandPaddingObject(padding) : { 4305 top: padding, 4306 right: padding, 4307 bottom: padding, 4308 left: padding 4309 }; 4310} 4311function rectToClientRect(rect) { 4312 const { 4313 x, 4314 y, 4315 width, 4316 height 4317 } = rect; 4318 return { 4319 width, 4320 height, 4321 top: y, 4322 left: x, 4323 right: x + width, 4324 bottom: y + height, 4325 x, 4326 y 4327 }; 4328} 4329
vendor: 123 bytes, lines 4330-4332
4330// node_modules/@floating-ui/react/dist/floating-ui.react.mjs 4331var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 4332
vendor: 1,174 bytes, lines 4333-4346
4333// node_modules/tabbable/dist/index.esm.js 4334var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"]; 4335var candidateSelector = candidateSelectors.join(","); 4336var NoElement = typeof Element === "undefined"; 4337var matches = NoElement ? function() { 4338} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 4339var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { 4340 var _element$getRootNode; 4341 return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); 4342} : function(element) { 4343 return element === null || element === void 0 ? void 0 : element.ownerDocument; 4344}; 4345var focusableCandidateSelector = candidateSelectors.concat("iframe").join(","); 4346
vendor: 112 bytes, lines 4347-4349
4347// node_modules/@floating-ui/react/dist/floating-ui.react.mjs 4348var ReactDOM2 = __toESM(require_react_dom(), 1); 4349
vendor: 14,219 bytes, lines 4350-4778
4350// node_modules/@floating-ui/core/dist/floating-ui.core.mjs 4351function computeCoordsFromPlacement(_ref, placement, rtl) { 4352 let { 4353 reference, 4354 floating 4355 } = _ref; 4356 const sideAxis = getSideAxis(placement); 4357 const alignmentAxis = getAlignmentAxis(placement); 4358 const alignLength = getAxisLength(alignmentAxis); 4359 const side = getSide(placement); 4360 const isVertical = sideAxis === "y"; 4361 const commonX = reference.x + reference.width / 2 - floating.width / 2; 4362 const commonY = reference.y + reference.height / 2 - floating.height / 2; 4363 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 4364 let coords; 4365 switch (side) { 4366 case "top": 4367 coords = { 4368 x: commonX, 4369 y: reference.y - floating.height 4370 }; 4371 break; 4372 case "bottom": 4373 coords = { 4374 x: commonX, 4375 y: reference.y + reference.height 4376 }; 4377 break; 4378 case "right": 4379 coords = { 4380 x: reference.x + reference.width, 4381 y: commonY 4382 }; 4383 break; 4384 case "left": 4385 coords = { 4386 x: reference.x - floating.width, 4387 y: commonY 4388 }; 4389 break; 4390 default: 4391 coords = { 4392 x: reference.x, 4393 y: reference.y 4394 }; 4395 } 4396 switch (getAlignment(placement)) { 4397 case "start": 4398 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 4399 break; 4400 case "end": 4401 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 4402 break; 4403 } 4404 return coords; 4405} 4406var computePosition = async (reference, floating, config) => { 4407 const { 4408 placement = "bottom", 4409 strategy = "absolute", 4410 middleware = [], 4411 platform: platform2 4412 } = config; 4413 const validMiddleware = middleware.filter(Boolean); 4414 const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating)); 4415 let rects = await platform2.getElementRects({ 4416 reference, 4417 floating, 4418 strategy 4419 }); 4420 let { 4421 x, 4422 y 4423 } = computeCoordsFromPlacement(rects, placement, rtl); 4424 let statefulPlacement = placement; 4425 let middlewareData = {}; 4426 let resetCount = 0; 4427 for (let i = 0; i < validMiddleware.length; i++) { 4428 const { 4429 name, 4430 fn 4431 } = validMiddleware[i]; 4432 const { 4433 x: nextX, 4434 y: nextY, 4435 data, 4436 reset 4437 } = await fn({ 4438 x, 4439 y, 4440 initialPlacement: placement, 4441 placement: statefulPlacement, 4442 strategy, 4443 middlewareData, 4444 rects, 4445 platform: platform2, 4446 elements: { 4447 reference, 4448 floating 4449 } 4450 }); 4451 x = nextX != null ? nextX : x; 4452 y = nextY != null ? nextY : y; 4453 middlewareData = { 4454 ...middlewareData, 4455 [name]: { 4456 ...middlewareData[name], 4457 ...data 4458 } 4459 }; 4460 if (reset && resetCount <= 50) { 4461 resetCount++; 4462 if (typeof reset === "object") { 4463 if (reset.placement) { 4464 statefulPlacement = reset.placement; 4465 } 4466 if (reset.rects) { 4467 rects = reset.rects === true ? await platform2.getElementRects({ 4468 reference, 4469 floating, 4470 strategy 4471 }) : reset.rects; 4472 } 4473 ({ 4474 x, 4475 y 4476 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 4477 } 4478 i = -1; 4479 } 4480 } 4481 return { 4482 x, 4483 y, 4484 placement: statefulPlacement, 4485 strategy, 4486 middlewareData 4487 }; 4488}; 4489async function detectOverflow(state, options) { 4490 var _await$platform$isEle; 4491 if (options === void 0) { 4492 options = {}; 4493 } 4494 const { 4495 x, 4496 y, 4497 platform: platform2, 4498 rects, 4499 elements, 4500 strategy 4501 } = state; 4502 const { 4503 boundary = "clippingAncestors", 4504 rootBoundary = "viewport", 4505 elementContext = "floating", 4506 altBoundary = false, 4507 padding = 0 4508 } = evaluate(options, state); 4509 const paddingObject = getPaddingObject(padding); 4510 const altContext = elementContext === "floating" ? "reference" : "floating"; 4511 const element = elements[altBoundary ? altContext : elementContext]; 4512 const clippingClientRect = rectToClientRect(await platform2.getClippingRect({ 4513 element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), 4514 boundary, 4515 rootBoundary, 4516 strategy 4517 })); 4518 const rect = elementContext === "floating" ? { 4519 x, 4520 y, 4521 width: rects.floating.width, 4522 height: rects.floating.height 4523 } : rects.reference; 4524 const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)); 4525 const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { 4526 x: 1, 4527 y: 1 4528 } : { 4529 x: 1, 4530 y: 1 4531 }; 4532 const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ 4533 elements, 4534 rect, 4535 offsetParent, 4536 strategy 4537 }) : rect); 4538 return { 4539 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 4540 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 4541 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 4542 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 4543 }; 4544} 4545var arrow = (options) => ({ 4546 name: "arrow", 4547 options, 4548 async fn(state) { 4549 const { 4550 x, 4551 y, 4552 placement, 4553 rects, 4554 platform: platform2, 4555 elements, 4556 middlewareData 4557 } = state; 4558 const { 4559 element, 4560 padding = 0 4561 } = evaluate(options, state) || {}; 4562 if (element == null) { 4563 return {}; 4564 } 4565 const paddingObject = getPaddingObject(padding); 4566 const coords = { 4567 x, 4568 y 4569 }; 4570 const axis = getAlignmentAxis(placement); 4571 const length = getAxisLength(axis); 4572 const arrowDimensions = await platform2.getDimensions(element); 4573 const isYAxis = axis === "y"; 4574 const minProp = isYAxis ? "top" : "left"; 4575 const maxProp = isYAxis ? "bottom" : "right"; 4576 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 4577 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 4578 const startDiff = coords[axis] - rects.reference[axis]; 4579 const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element)); 4580 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 4581 if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) { 4582 clientSize = elements.floating[clientProp] || rects.floating[length]; 4583 } 4584 const centerToReference = endDiff / 2 - startDiff / 2; 4585 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 4586 const minPadding = min2(paddingObject[minProp], largestPossiblePadding); 4587 const maxPadding = min2(paddingObject[maxProp], largestPossiblePadding); 4588 const min$1 = minPadding; 4589 const max3 = clientSize - arrowDimensions[length] - maxPadding; 4590 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 4591 const offset4 = clamp(min$1, center, max3); 4592 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 4593 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max3 : 0; 4594 return { 4595 [axis]: coords[axis] + alignmentOffset, 4596 data: { 4597 [axis]: offset4, 4598 centerOffset: center - offset4 - alignmentOffset, 4599 ...shouldAddOffset && { 4600 alignmentOffset 4601 } 4602 }, 4603 reset: shouldAddOffset 4604 }; 4605 } 4606}); 4607var flip = function(options) { 4608 if (options === void 0) { 4609 options = {}; 4610 } 4611 return { 4612 name: "flip", 4613 options, 4614 async fn(state) { 4615 var _middlewareData$arrow, _middlewareData$flip; 4616 const { 4617 placement, 4618 middlewareData, 4619 rects, 4620 initialPlacement, 4621 platform: platform2, 4622 elements 4623 } = state; 4624 const { 4625 mainAxis: checkMainAxis = true, 4626 crossAxis: checkCrossAxis = true, 4627 fallbackPlacements: specifiedFallbackPlacements, 4628 fallbackStrategy = "bestFit", 4629 fallbackAxisSideDirection = "none", 4630 flipAlignment = true, 4631 ...detectOverflowOptions 4632 } = evaluate(options, state); 4633 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 4634 return {}; 4635 } 4636 const side = getSide(placement); 4637 const initialSideAxis = getSideAxis(initialPlacement); 4638 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 4639 const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); 4640 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 4641 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 4642 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 4643 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 4644 } 4645 const placements2 = [initialPlacement, ...fallbackPlacements]; 4646 const overflow = await detectOverflow(state, detectOverflowOptions); 4647 const overflows = []; 4648 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 4649 if (checkMainAxis) { 4650 overflows.push(overflow[side]); 4651 } 4652 if (checkCrossAxis) { 4653 const sides2 = getAlignmentSides(placement, rects, rtl); 4654 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 4655 } 4656 overflowsData = [...overflowsData, { 4657 placement, 4658 overflows 4659 }]; 4660 if (!overflows.every((side2) => side2 <= 0)) { 4661 var _middlewareData$flip2, _overflowsData$filter; 4662 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 4663 const nextPlacement = placements2[nextIndex]; 4664 if (nextPlacement) { 4665 return { 4666 data: { 4667 index: nextIndex, 4668 overflows: overflowsData 4669 }, 4670 reset: { 4671 placement: nextPlacement 4672 } 4673 }; 4674 } 4675 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 4676 if (!resetPlacement) { 4677 switch (fallbackStrategy) { 4678 case "bestFit": { 4679 var _overflowsData$filter2; 4680 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 4681 if (hasFallbackAxisSideDirection) { 4682 const currentSideAxis = getSideAxis(d.placement); 4683 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 4684 // reading directions favoring greater width. 4685 currentSideAxis === "y"; 4686 } 4687 return true; 4688 }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 4689 if (placement2) { 4690 resetPlacement = placement2; 4691 } 4692 break; 4693 } 4694 case "initialPlacement": 4695 resetPlacement = initialPlacement; 4696 break; 4697 } 4698 } 4699 if (placement !== resetPlacement) { 4700 return { 4701 reset: { 4702 placement: resetPlacement 4703 } 4704 }; 4705 } 4706 } 4707 return {}; 4708 } 4709 }; 4710}; 4711async function convertValueToCoords(state, options) { 4712 const { 4713 placement, 4714 platform: platform2, 4715 elements 4716 } = state; 4717 const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); 4718 const side = getSide(placement); 4719 const alignment = getAlignment(placement); 4720 const isVertical = getSideAxis(placement) === "y"; 4721 const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1; 4722 const crossAxisMulti = rtl && isVertical ? -1 : 1; 4723 const rawValue = evaluate(options, state); 4724 let { 4725 mainAxis, 4726 crossAxis, 4727 alignmentAxis 4728 } = typeof rawValue === "number" ? { 4729 mainAxis: rawValue, 4730 crossAxis: 0, 4731 alignmentAxis: null 4732 } : { 4733 mainAxis: rawValue.mainAxis || 0, 4734 crossAxis: rawValue.crossAxis || 0, 4735 alignmentAxis: rawValue.alignmentAxis 4736 }; 4737 if (alignment && typeof alignmentAxis === "number") { 4738 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 4739 } 4740 return isVertical ? { 4741 x: crossAxis * crossAxisMulti, 4742 y: mainAxis * mainAxisMulti 4743 } : { 4744 x: mainAxis * mainAxisMulti, 4745 y: crossAxis * crossAxisMulti 4746 }; 4747} 4748var offset = function(options) { 4749 if (options === void 0) { 4750 options = 0; 4751 } 4752 return { 4753 name: "offset", 4754 options, 4755 async fn(state) { 4756 var _middlewareData$offse, _middlewareData$arrow; 4757 const { 4758 x, 4759 y, 4760 placement, 4761 middlewareData 4762 } = state; 4763 const diffCoords = await convertValueToCoords(state, options); 4764 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 4765 return {}; 4766 } 4767 return { 4768 x: x + diffCoords.x, 4769 y: y + diffCoords.y, 4770 data: { 4771 ...diffCoords, 4772 placement 4773 } 4774 }; 4775 } 4776 }; 4777}; 4778
vendor: 19,718 bytes, lines 4779-5370
4779// node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 4780function getCssDimensions(element) { 4781 const css = getComputedStyle2(element); 4782 let width = parseFloat(css.width) || 0; 4783 let height = parseFloat(css.height) || 0; 4784 const hasOffset = isHTMLElement(element); 4785 const offsetWidth = hasOffset ? element.offsetWidth : width; 4786 const offsetHeight = hasOffset ? element.offsetHeight : height; 4787 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 4788 if (shouldFallback) { 4789 width = offsetWidth; 4790 height = offsetHeight; 4791 } 4792 return { 4793 width, 4794 height, 4795 $: shouldFallback 4796 }; 4797} 4798function unwrapElement(element) { 4799 return !isElement(element) ? element.contextElement : element; 4800} 4801function getScale(element) { 4802 const domElement = unwrapElement(element); 4803 if (!isHTMLElement(domElement)) { 4804 return createCoords(1); 4805 } 4806 const rect = domElement.getBoundingClientRect(); 4807 const { 4808 width, 4809 height, 4810 $ 4811 } = getCssDimensions(domElement); 4812 let x = ($ ? round(rect.width) : rect.width) / width; 4813 let y = ($ ? round(rect.height) : rect.height) / height; 4814 if (!x || !Number.isFinite(x)) { 4815 x = 1; 4816 } 4817 if (!y || !Number.isFinite(y)) { 4818 y = 1; 4819 } 4820 return { 4821 x, 4822 y 4823 }; 4824} 4825var noOffsets = createCoords(0); 4826function getVisualOffsets(element) { 4827 const win = getWindow(element); 4828 if (!isWebKit() || !win.visualViewport) { 4829 return noOffsets; 4830 } 4831 return { 4832 x: win.visualViewport.offsetLeft, 4833 y: win.visualViewport.offsetTop 4834 }; 4835} 4836function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 4837 if (isFixed === void 0) { 4838 isFixed = false; 4839 } 4840 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 4841 return false; 4842 } 4843 return isFixed; 4844} 4845function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 4846 if (includeScale === void 0) { 4847 includeScale = false; 4848 } 4849 if (isFixedStrategy === void 0) { 4850 isFixedStrategy = false; 4851 } 4852 const clientRect = element.getBoundingClientRect(); 4853 const domElement = unwrapElement(element); 4854 let scale = createCoords(1); 4855 if (includeScale) { 4856 if (offsetParent) { 4857 if (isElement(offsetParent)) { 4858 scale = getScale(offsetParent); 4859 } 4860 } else { 4861 scale = getScale(element); 4862 } 4863 } 4864 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 4865 let x = (clientRect.left + visualOffsets.x) / scale.x; 4866 let y = (clientRect.top + visualOffsets.y) / scale.y; 4867 let width = clientRect.width / scale.x; 4868 let height = clientRect.height / scale.y; 4869 if (domElement) { 4870 const win = getWindow(domElement); 4871 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 4872 let currentWin = win; 4873 let currentIFrame = getFrameElement(currentWin); 4874 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 4875 const iframeScale = getScale(currentIFrame); 4876 const iframeRect = currentIFrame.getBoundingClientRect(); 4877 const css = getComputedStyle2(currentIFrame); 4878 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 4879 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 4880 x *= iframeScale.x; 4881 y *= iframeScale.y; 4882 width *= iframeScale.x; 4883 height *= iframeScale.y; 4884 x += left; 4885 y += top; 4886 currentWin = getWindow(currentIFrame); 4887 currentIFrame = getFrameElement(currentWin); 4888 } 4889 } 4890 return rectToClientRect({ 4891 width, 4892 height, 4893 x, 4894 y 4895 }); 4896} 4897function getWindowScrollBarX(element, rect) { 4898 const leftScroll = getNodeScroll(element).scrollLeft; 4899 if (!rect) { 4900 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 4901 } 4902 return rect.left + leftScroll; 4903} 4904function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) { 4905 if (ignoreScrollbarX === void 0) { 4906 ignoreScrollbarX = false; 4907 } 4908 const htmlRect = documentElement.getBoundingClientRect(); 4909 const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : ( 4910 // RTL <body> scrollbar. 4911 getWindowScrollBarX(documentElement, htmlRect) 4912 )); 4913 const y = htmlRect.top + scroll.scrollTop; 4914 return { 4915 x, 4916 y 4917 }; 4918} 4919function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 4920 let { 4921 elements, 4922 rect, 4923 offsetParent, 4924 strategy 4925 } = _ref; 4926 const isFixed = strategy === "fixed"; 4927 const documentElement = getDocumentElement(offsetParent); 4928 const topLayer = elements ? isTopLayer(elements.floating) : false; 4929 if (offsetParent === documentElement || topLayer && isFixed) { 4930 return rect; 4931 } 4932 let scroll = { 4933 scrollLeft: 0, 4934 scrollTop: 0 4935 }; 4936 let scale = createCoords(1); 4937 const offsets = createCoords(0); 4938 const isOffsetParentAnElement = isHTMLElement(offsetParent); 4939 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 4940 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 4941 scroll = getNodeScroll(offsetParent); 4942 } 4943 if (isHTMLElement(offsetParent)) { 4944 const offsetRect = getBoundingClientRect(offsetParent); 4945 scale = getScale(offsetParent); 4946 offsets.x = offsetRect.x + offsetParent.clientLeft; 4947 offsets.y = offsetRect.y + offsetParent.clientTop; 4948 } 4949 } 4950 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0); 4951 return { 4952 width: rect.width * scale.x, 4953 height: rect.height * scale.y, 4954 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 4955 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 4956 }; 4957} 4958function getClientRects(element) { 4959 return Array.from(element.getClientRects()); 4960} 4961function getDocumentRect(element) { 4962 const html = getDocumentElement(element); 4963 const scroll = getNodeScroll(element); 4964 const body = element.ownerDocument.body; 4965 const width = max2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 4966 const height = max2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 4967 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 4968 const y = -scroll.scrollTop; 4969 if (getComputedStyle2(body).direction === "rtl") { 4970 x += max2(html.clientWidth, body.clientWidth) - width; 4971 } 4972 return { 4973 width, 4974 height, 4975 x, 4976 y 4977 }; 4978} 4979function getViewportRect(element, strategy) { 4980 const win = getWindow(element); 4981 const html = getDocumentElement(element); 4982 const visualViewport = win.visualViewport; 4983 let width = html.clientWidth; 4984 let height = html.clientHeight; 4985 let x = 0; 4986 let y = 0; 4987 if (visualViewport) { 4988 width = visualViewport.width; 4989 height = visualViewport.height; 4990 const visualViewportBased = isWebKit(); 4991 if (!visualViewportBased || visualViewportBased && strategy === "fixed") { 4992 x = visualViewport.offsetLeft; 4993 y = visualViewport.offsetTop; 4994 } 4995 } 4996 return { 4997 width, 4998 height, 4999 x, 5000 y 5001 }; 5002} 5003function getInnerBoundingClientRect(element, strategy) { 5004 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 5005 const top = clientRect.top + element.clientTop; 5006 const left = clientRect.left + element.clientLeft; 5007 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 5008 const width = element.clientWidth * scale.x; 5009 const height = element.clientHeight * scale.y; 5010 const x = left * scale.x; 5011 const y = top * scale.y; 5012 return { 5013 width, 5014 height, 5015 x, 5016 y 5017 }; 5018} 5019function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 5020 let rect; 5021 if (clippingAncestor === "viewport") { 5022 rect = getViewportRect(element, strategy); 5023 } else if (clippingAncestor === "document") { 5024 rect = getDocumentRect(getDocumentElement(element)); 5025 } else if (isElement(clippingAncestor)) { 5026 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 5027 } else { 5028 const visualOffsets = getVisualOffsets(element); 5029 rect = { 5030 x: clippingAncestor.x - visualOffsets.x, 5031 y: clippingAncestor.y - visualOffsets.y, 5032 width: clippingAncestor.width, 5033 height: clippingAncestor.height 5034 }; 5035 } 5036 return rectToClientRect(rect); 5037} 5038function hasFixedPositionAncestor(element, stopNode) { 5039 const parentNode = getParentNode(element); 5040 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 5041 return false; 5042 } 5043 return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); 5044} 5045function getClippingElementAncestors(element, cache) { 5046 const cachedResult = cache.get(element); 5047 if (cachedResult) { 5048 return cachedResult; 5049 } 5050 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 5051 let currentContainingBlockComputedStyle = null; 5052 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 5053 let currentNode = elementIsFixed ? getParentNode(element) : element; 5054 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 5055 const computedStyle = getComputedStyle2(currentNode); 5056 const currentNodeIsContaining = isContainingBlock(currentNode); 5057 if (!currentNodeIsContaining && computedStyle.position === "fixed") { 5058 currentContainingBlockComputedStyle = null; 5059 } 5060 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 5061 if (shouldDropCurrentNode) { 5062 result = result.filter((ancestor) => ancestor !== currentNode); 5063 } else { 5064 currentContainingBlockComputedStyle = computedStyle; 5065 } 5066 currentNode = getParentNode(currentNode); 5067 } 5068 cache.set(element, result); 5069 return result; 5070} 5071function getClippingRect(_ref) { 5072 let { 5073 element, 5074 boundary, 5075 rootBoundary, 5076 strategy 5077 } = _ref; 5078 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 5079 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 5080 const firstClippingAncestor = clippingAncestors[0]; 5081 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 5082 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 5083 accRect.top = max2(rect.top, accRect.top); 5084 accRect.right = min2(rect.right, accRect.right); 5085 accRect.bottom = min2(rect.bottom, accRect.bottom); 5086 accRect.left = max2(rect.left, accRect.left); 5087 return accRect; 5088 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 5089 return { 5090 width: clippingRect.right - clippingRect.left, 5091 height: clippingRect.bottom - clippingRect.top, 5092 x: clippingRect.left, 5093 y: clippingRect.top 5094 }; 5095} 5096function getDimensions(element) { 5097 const { 5098 width, 5099 height 5100 } = getCssDimensions(element); 5101 return { 5102 width, 5103 height 5104 }; 5105} 5106function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 5107 const isOffsetParentAnElement = isHTMLElement(offsetParent); 5108 const documentElement = getDocumentElement(offsetParent); 5109 const isFixed = strategy === "fixed"; 5110 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 5111 let scroll = { 5112 scrollLeft: 0, 5113 scrollTop: 0 5114 }; 5115 const offsets = createCoords(0); 5116 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 5117 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 5118 scroll = getNodeScroll(offsetParent); 5119 } 5120 if (isOffsetParentAnElement) { 5121 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 5122 offsets.x = offsetRect.x + offsetParent.clientLeft; 5123 offsets.y = offsetRect.y + offsetParent.clientTop; 5124 } else if (documentElement) { 5125 offsets.x = getWindowScrollBarX(documentElement); 5126 } 5127 } 5128 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 5129 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 5130 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 5131 return { 5132 x, 5133 y, 5134 width: rect.width, 5135 height: rect.height 5136 }; 5137} 5138function isStaticPositioned(element) { 5139 return getComputedStyle2(element).position === "static"; 5140} 5141function getTrueOffsetParent(element, polyfill) { 5142 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 5143 return null; 5144 } 5145 if (polyfill) { 5146 return polyfill(element); 5147 } 5148 let rawOffsetParent = element.offsetParent; 5149 if (getDocumentElement(element) === rawOffsetParent) { 5150 rawOffsetParent = rawOffsetParent.ownerDocument.body; 5151 } 5152 return rawOffsetParent; 5153} 5154function getOffsetParent(element, polyfill) { 5155 const win = getWindow(element); 5156 if (isTopLayer(element)) { 5157 return win; 5158 } 5159 if (!isHTMLElement(element)) { 5160 let svgOffsetParent = getParentNode(element); 5161 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 5162 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 5163 return svgOffsetParent; 5164 } 5165 svgOffsetParent = getParentNode(svgOffsetParent); 5166 } 5167 return win; 5168 } 5169 let offsetParent = getTrueOffsetParent(element, polyfill); 5170 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 5171 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 5172 } 5173 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 5174 return win; 5175 } 5176 return offsetParent || getContainingBlock(element) || win; 5177} 5178var getElementRects = async function(data) { 5179 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 5180 const getDimensionsFn = this.getDimensions; 5181 const floatingDimensions = await getDimensionsFn(data.floating); 5182 return { 5183 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 5184 floating: { 5185 x: 0, 5186 y: 0, 5187 width: floatingDimensions.width, 5188 height: floatingDimensions.height 5189 } 5190 }; 5191}; 5192function isRTL(element) { 5193 return getComputedStyle2(element).direction === "rtl"; 5194} 5195var platform = { 5196 convertOffsetParentRelativeRectToViewportRelativeRect, 5197 getDocumentElement, 5198 getClippingRect, 5199 getOffsetParent, 5200 getElementRects, 5201 getClientRects, 5202 getDimensions, 5203 getScale, 5204 isElement, 5205 isRTL 5206}; 5207function rectsAreEqual(a, b) { 5208 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 5209} 5210function observeMove(element, onMove) { 5211 let io = null; 5212 let timeoutId; 5213 const root = getDocumentElement(element); 5214 function cleanup2() { 5215 var _io; 5216 clearTimeout(timeoutId); 5217 (_io = io) == null || _io.disconnect(); 5218 io = null; 5219 } 5220 function refresh(skip, threshold) { 5221 if (skip === void 0) { 5222 skip = false; 5223 } 5224 if (threshold === void 0) { 5225 threshold = 1; 5226 } 5227 cleanup2(); 5228 const elementRectForRootMargin = element.getBoundingClientRect(); 5229 const { 5230 left, 5231 top, 5232 width, 5233 height 5234 } = elementRectForRootMargin; 5235 if (!skip) { 5236 onMove(); 5237 } 5238 if (!width || !height) { 5239 return; 5240 } 5241 const insetTop = floor(top); 5242 const insetRight = floor(root.clientWidth - (left + width)); 5243 const insetBottom = floor(root.clientHeight - (top + height)); 5244 const insetLeft = floor(left); 5245 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 5246 const options = { 5247 rootMargin, 5248 threshold: max2(0, min2(1, threshold)) || 1 5249 }; 5250 let isFirstUpdate = true; 5251 function handleObserve(entries) { 5252 const ratio = entries[0].intersectionRatio; 5253 if (ratio !== threshold) { 5254 if (!isFirstUpdate) { 5255 return refresh(); 5256 } 5257 if (!ratio) { 5258 timeoutId = setTimeout(() => { 5259 refresh(false, 1e-7); 5260 }, 1e3); 5261 } else { 5262 refresh(false, ratio); 5263 } 5264 } 5265 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 5266 refresh(); 5267 } 5268 isFirstUpdate = false; 5269 } 5270 try { 5271 io = new IntersectionObserver(handleObserve, { 5272 ...options, 5273 // Handle <iframe>s 5274 root: root.ownerDocument 5275 }); 5276 } catch (e) { 5277 io = new IntersectionObserver(handleObserve, options); 5278 } 5279 io.observe(element); 5280 } 5281 refresh(true); 5282 return cleanup2; 5283} 5284function autoUpdate(reference, floating, update, options) { 5285 if (options === void 0) { 5286 options = {}; 5287 } 5288 const { 5289 ancestorScroll = true, 5290 ancestorResize = true, 5291 elementResize = typeof ResizeObserver === "function", 5292 layoutShift = typeof IntersectionObserver === "function", 5293 animationFrame = false 5294 } = options; 5295 const referenceEl = unwrapElement(reference); 5296 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : []; 5297 ancestors.forEach((ancestor) => { 5298 ancestorScroll && ancestor.addEventListener("scroll", update, { 5299 passive: true 5300 }); 5301 ancestorResize && ancestor.addEventListener("resize", update); 5302 }); 5303 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; 5304 let reobserveFrame = -1; 5305 let resizeObserver = null; 5306 if (elementResize) { 5307 resizeObserver = new ResizeObserver((_ref) => { 5308 let [firstEntry] = _ref; 5309 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 5310 resizeObserver.unobserve(floating); 5311 cancelAnimationFrame(reobserveFrame); 5312 reobserveFrame = requestAnimationFrame(() => { 5313 var _resizeObserver; 5314 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 5315 }); 5316 } 5317 update(); 5318 }); 5319 if (referenceEl && !animationFrame) { 5320 resizeObserver.observe(referenceEl); 5321 } 5322 resizeObserver.observe(floating); 5323 } 5324 let frameId; 5325 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 5326 if (animationFrame) { 5327 frameLoop(); 5328 } 5329 function frameLoop() { 5330 const nextRefRect = getBoundingClientRect(reference); 5331 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 5332 update(); 5333 } 5334 prevRefRect = nextRefRect; 5335 frameId = requestAnimationFrame(frameLoop); 5336 } 5337 update(); 5338 return () => { 5339 var _resizeObserver2; 5340 ancestors.forEach((ancestor) => { 5341 ancestorScroll && ancestor.removeEventListener("scroll", update); 5342 ancestorResize && ancestor.removeEventListener("resize", update); 5343 }); 5344 cleanupIo == null || cleanupIo(); 5345 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 5346 resizeObserver = null; 5347 if (animationFrame) { 5348 cancelAnimationFrame(frameId); 5349 } 5350 }; 5351} 5352var offset2 = offset; 5353var flip2 = flip; 5354var arrow2 = arrow; 5355var computePosition2 = (reference, floating, options) => { 5356 const cache = /* @__PURE__ */ new Map(); 5357 const mergedOptions = { 5358 platform, 5359 ...options 5360 }; 5361 const platformWithCache = { 5362 ...mergedOptions.platform, 5363 _c: cache 5364 }; 5365 return computePosition(reference, floating, { 5366 ...mergedOptions, 5367 platform: platformWithCache 5368 }); 5369}; 5370
vendor: 7,240 bytes, lines 5371-5635
5371// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 5372var React = __toESM(require_react(), 1); 5373var import_react = __toESM(require_react(), 1); 5374var ReactDOM = __toESM(require_react_dom(), 1); 5375var index = typeof document !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect; 5376function deepEqual(a, b) { 5377 if (a === b) { 5378 return true; 5379 } 5380 if (typeof a !== typeof b) { 5381 return false; 5382 } 5383 if (typeof a === "function" && a.toString() === b.toString()) { 5384 return true; 5385 } 5386 let length; 5387 let i; 5388 let keys; 5389 if (a && b && typeof a === "object") { 5390 if (Array.isArray(a)) { 5391 length = a.length; 5392 if (length !== b.length) return false; 5393 for (i = length; i-- !== 0; ) { 5394 if (!deepEqual(a[i], b[i])) { 5395 return false; 5396 } 5397 } 5398 return true; 5399 } 5400 keys = Object.keys(a); 5401 length = keys.length; 5402 if (length !== Object.keys(b).length) { 5403 return false; 5404 } 5405 for (i = length; i-- !== 0; ) { 5406 if (!{}.hasOwnProperty.call(b, keys[i])) { 5407 return false; 5408 } 5409 } 5410 for (i = length; i-- !== 0; ) { 5411 const key = keys[i]; 5412 if (key === "_owner" && a.$$typeof) { 5413 continue; 5414 } 5415 if (!deepEqual(a[key], b[key])) { 5416 return false; 5417 } 5418 } 5419 return true; 5420 } 5421 return a !== a && b !== b; 5422} 5423function getDPR(element) { 5424 if (typeof window === "undefined") { 5425 return 1; 5426 } 5427 const win = element.ownerDocument.defaultView || window; 5428 return win.devicePixelRatio || 1; 5429} 5430function roundByDPR(element, value) { 5431 const dpr = getDPR(element); 5432 return Math.round(value * dpr) / dpr; 5433} 5434function useLatestRef(value) { 5435 const ref = React.useRef(value); 5436 index(() => { 5437 ref.current = value; 5438 }); 5439 return ref; 5440} 5441function useFloating(options) { 5442 if (options === void 0) { 5443 options = {}; 5444 } 5445 const { 5446 placement = "bottom", 5447 strategy = "absolute", 5448 middleware = [], 5449 platform: platform2, 5450 elements: { 5451 reference: externalReference, 5452 floating: externalFloating 5453 } = {}, 5454 transform = true, 5455 whileElementsMounted, 5456 open 5457 } = options; 5458 const [data, setData] = React.useState({ 5459 x: 0, 5460 y: 0, 5461 strategy, 5462 placement, 5463 middlewareData: {}, 5464 isPositioned: false 5465 }); 5466 const [latestMiddleware, setLatestMiddleware] = React.useState(middleware); 5467 if (!deepEqual(latestMiddleware, middleware)) { 5468 setLatestMiddleware(middleware); 5469 } 5470 const [_reference, _setReference] = React.useState(null); 5471 const [_floating, _setFloating] = React.useState(null); 5472 const setReference = React.useCallback((node) => { 5473 if (node !== referenceRef.current) { 5474 referenceRef.current = node; 5475 _setReference(node); 5476 } 5477 }, []); 5478 const setFloating = React.useCallback((node) => { 5479 if (node !== floatingRef.current) { 5480 floatingRef.current = node; 5481 _setFloating(node); 5482 } 5483 }, []); 5484 const referenceEl = externalReference || _reference; 5485 const floatingEl = externalFloating || _floating; 5486 const referenceRef = React.useRef(null); 5487 const floatingRef = React.useRef(null); 5488 const dataRef = React.useRef(data); 5489 const hasWhileElementsMounted = whileElementsMounted != null; 5490 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 5491 const platformRef = useLatestRef(platform2); 5492 const openRef = useLatestRef(open); 5493 const update = React.useCallback(() => { 5494 if (!referenceRef.current || !floatingRef.current) { 5495 return; 5496 } 5497 const config = { 5498 placement, 5499 strategy, 5500 middleware: latestMiddleware 5501 }; 5502 if (platformRef.current) { 5503 config.platform = platformRef.current; 5504 } 5505 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 5506 const fullData = { 5507 ...data2, 5508 // The floating element's position may be recomputed while it's closed 5509 // but still mounted (such as when transitioning out). To ensure 5510 // `isPositioned` will be `false` initially on the next open, avoid 5511 // setting it to `true` when `open === false` (must be specified). 5512 isPositioned: openRef.current !== false 5513 }; 5514 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 5515 dataRef.current = fullData; 5516 ReactDOM.flushSync(() => { 5517 setData(fullData); 5518 }); 5519 } 5520 }); 5521 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 5522 index(() => { 5523 if (open === false && dataRef.current.isPositioned) { 5524 dataRef.current.isPositioned = false; 5525 setData((data2) => ({ 5526 ...data2, 5527 isPositioned: false 5528 })); 5529 } 5530 }, [open]); 5531 const isMountedRef = React.useRef(false); 5532 index(() => { 5533 isMountedRef.current = true; 5534 return () => { 5535 isMountedRef.current = false; 5536 }; 5537 }, []); 5538 index(() => { 5539 if (referenceEl) referenceRef.current = referenceEl; 5540 if (floatingEl) floatingRef.current = floatingEl; 5541 if (referenceEl && floatingEl) { 5542 if (whileElementsMountedRef.current) { 5543 return whileElementsMountedRef.current(referenceEl, floatingEl, update); 5544 } 5545 update(); 5546 } 5547 }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]); 5548 const refs = React.useMemo(() => ({ 5549 reference: referenceRef, 5550 floating: floatingRef, 5551 setReference, 5552 setFloating 5553 }), [setReference, setFloating]); 5554 const elements = React.useMemo(() => ({ 5555 reference: referenceEl, 5556 floating: floatingEl 5557 }), [referenceEl, floatingEl]); 5558 const floatingStyles = React.useMemo(() => { 5559 const initialStyles = { 5560 position: strategy, 5561 left: 0, 5562 top: 0 5563 }; 5564 if (!elements.floating) { 5565 return initialStyles; 5566 } 5567 const x = roundByDPR(elements.floating, data.x); 5568 const y = roundByDPR(elements.floating, data.y); 5569 if (transform) { 5570 return { 5571 ...initialStyles, 5572 transform: "translate(" + x + "px, " + y + "px)", 5573 ...getDPR(elements.floating) >= 1.5 && { 5574 willChange: "transform" 5575 } 5576 }; 5577 } 5578 return { 5579 position: strategy, 5580 left: x, 5581 top: y 5582 }; 5583 }, [strategy, transform, elements.floating, data.x, data.y]); 5584 return React.useMemo(() => ({ 5585 ...data, 5586 update, 5587 refs, 5588 elements, 5589 floatingStyles 5590 }), [data, update, refs, elements, floatingStyles]); 5591} 5592var arrow$1 = (options) => { 5593 function isRef(value) { 5594 return {}.hasOwnProperty.call(value, "current"); 5595 } 5596 return { 5597 name: "arrow", 5598 options, 5599 fn(state) { 5600 const { 5601 element, 5602 padding 5603 } = typeof options === "function" ? options(state) : options; 5604 if (element && isRef(element)) { 5605 if (element.current != null) { 5606 return arrow2({ 5607 element: element.current, 5608 padding 5609 }).fn(state); 5610 } 5611 return {}; 5612 } 5613 if (element) { 5614 return arrow2({ 5615 element, 5616 padding 5617 }).fn(state); 5618 } 5619 return {}; 5620 } 5621 }; 5622}; 5623var offset3 = (options, deps) => ({ 5624 ...offset2(options), 5625 options: [options, deps] 5626}); 5627var flip3 = (options, deps) => ({ 5628 ...flip2(options), 5629 options: [options, deps] 5630}); 5631var arrow3 = (options, deps) => ({ 5632 ...arrow$1(options), 5633 options: [options, deps] 5634}); 5635
vendor: 31,540 bytes, lines 5636-6647
5636// node_modules/@floating-ui/react/dist/floating-ui.react.mjs 5637function useMergeRefs(refs) { 5638 const cleanupRef = React2.useRef(void 0); 5639 const refEffect = React2.useCallback((instance) => { 5640 const cleanups = refs.map((ref) => { 5641 if (ref == null) { 5642 return; 5643 } 5644 if (typeof ref === "function") { 5645 const refCallback = ref; 5646 const refCleanup = refCallback(instance); 5647 return typeof refCleanup === "function" ? refCleanup : () => { 5648 refCallback(null); 5649 }; 5650 } 5651 ref.current = instance; 5652 return () => { 5653 ref.current = null; 5654 }; 5655 }); 5656 return () => { 5657 cleanups.forEach((refCleanup) => refCleanup == null ? void 0 : refCleanup()); 5658 }; 5659 }, refs); 5660 return React2.useMemo(() => { 5661 if (refs.every((ref) => ref == null)) { 5662 return null; 5663 } 5664 return (value) => { 5665 if (cleanupRef.current) { 5666 cleanupRef.current(); 5667 cleanupRef.current = void 0; 5668 } 5669 if (value != null) { 5670 cleanupRef.current = refEffect(value); 5671 } 5672 }; 5673 }, refs); 5674} 5675var SafeReact = { 5676 ...React2 5677}; 5678var useInsertionEffect = SafeReact.useInsertionEffect; 5679var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn()); 5680function useEffectEvent(callback) { 5681 const ref = React2.useRef(() => { 5682 if (true) { 5683 throw new Error("Cannot call an event handler while rendering."); 5684 } 5685 }); 5686 useSafeInsertionEffect(() => { 5687 ref.current = callback; 5688 }); 5689 return React2.useCallback(function() { 5690 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 5691 args[_key] = arguments[_key]; 5692 } 5693 return ref.current == null ? void 0 : ref.current(...args); 5694 }, []); 5695} 5696var ARROW_UP = "ArrowUp"; 5697var ARROW_DOWN = "ArrowDown"; 5698var ARROW_LEFT = "ArrowLeft"; 5699var ARROW_RIGHT = "ArrowRight"; 5700function isDifferentRow(index3, cols, prevRow) { 5701 return Math.floor(index3 / cols) !== prevRow; 5702} 5703function isIndexOutOfBounds(listRef, index3) { 5704 return index3 < 0 || index3 >= listRef.current.length; 5705} 5706function getMinIndex(listRef, disabledIndices) { 5707 return findNonDisabledIndex(listRef, { 5708 disabledIndices 5709 }); 5710} 5711function getMaxIndex(listRef, disabledIndices) { 5712 return findNonDisabledIndex(listRef, { 5713 decrement: true, 5714 startingIndex: listRef.current.length, 5715 disabledIndices 5716 }); 5717} 5718function findNonDisabledIndex(listRef, _temp) { 5719 let { 5720 startingIndex = -1, 5721 decrement = false, 5722 disabledIndices, 5723 amount = 1 5724 } = _temp === void 0 ? {} : _temp; 5725 const list = listRef.current; 5726 let index3 = startingIndex; 5727 do { 5728 index3 += decrement ? -amount : amount; 5729 } while (index3 >= 0 && index3 <= list.length - 1 && isDisabled(list, index3, disabledIndices)); 5730 return index3; 5731} 5732function getGridNavigatedIndex(elementsRef, _ref) { 5733 let { 5734 event, 5735 orientation, 5736 loop, 5737 rtl, 5738 cols, 5739 disabledIndices, 5740 minIndex, 5741 maxIndex, 5742 prevIndex, 5743 stopEvent: stop = false 5744 } = _ref; 5745 let nextIndex = prevIndex; 5746 if (event.key === ARROW_UP) { 5747 stop && stopEvent(event); 5748 if (prevIndex === -1) { 5749 nextIndex = maxIndex; 5750 } else { 5751 nextIndex = findNonDisabledIndex(elementsRef, { 5752 startingIndex: nextIndex, 5753 amount: cols, 5754 decrement: true, 5755 disabledIndices 5756 }); 5757 if (loop && (prevIndex - cols < minIndex || nextIndex < 0)) { 5758 const col = prevIndex % cols; 5759 const maxCol = maxIndex % cols; 5760 const offset4 = maxIndex - (maxCol - col); 5761 if (maxCol === col) { 5762 nextIndex = maxIndex; 5763 } else { 5764 nextIndex = maxCol > col ? offset4 : offset4 - cols; 5765 } 5766 } 5767 } 5768 if (isIndexOutOfBounds(elementsRef, nextIndex)) { 5769 nextIndex = prevIndex; 5770 } 5771 } 5772 if (event.key === ARROW_DOWN) { 5773 stop && stopEvent(event); 5774 if (prevIndex === -1) { 5775 nextIndex = minIndex; 5776 } else { 5777 nextIndex = findNonDisabledIndex(elementsRef, { 5778 startingIndex: prevIndex, 5779 amount: cols, 5780 disabledIndices 5781 }); 5782 if (loop && prevIndex + cols > maxIndex) { 5783 nextIndex = findNonDisabledIndex(elementsRef, { 5784 startingIndex: prevIndex % cols - cols, 5785 amount: cols, 5786 disabledIndices 5787 }); 5788 } 5789 } 5790 if (isIndexOutOfBounds(elementsRef, nextIndex)) { 5791 nextIndex = prevIndex; 5792 } 5793 } 5794 if (orientation === "both") { 5795 const prevRow = floor(prevIndex / cols); 5796 if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) { 5797 stop && stopEvent(event); 5798 if (prevIndex % cols !== cols - 1) { 5799 nextIndex = findNonDisabledIndex(elementsRef, { 5800 startingIndex: prevIndex, 5801 disabledIndices 5802 }); 5803 if (loop && isDifferentRow(nextIndex, cols, prevRow)) { 5804 nextIndex = findNonDisabledIndex(elementsRef, { 5805 startingIndex: prevIndex - prevIndex % cols - 1, 5806 disabledIndices 5807 }); 5808 } 5809 } else if (loop) { 5810 nextIndex = findNonDisabledIndex(elementsRef, { 5811 startingIndex: prevIndex - prevIndex % cols - 1, 5812 disabledIndices 5813 }); 5814 } 5815 if (isDifferentRow(nextIndex, cols, prevRow)) { 5816 nextIndex = prevIndex; 5817 } 5818 } 5819 if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) { 5820 stop && stopEvent(event); 5821 if (prevIndex % cols !== 0) { 5822 nextIndex = findNonDisabledIndex(elementsRef, { 5823 startingIndex: prevIndex, 5824 decrement: true, 5825 disabledIndices 5826 }); 5827 if (loop && isDifferentRow(nextIndex, cols, prevRow)) { 5828 nextIndex = findNonDisabledIndex(elementsRef, { 5829 startingIndex: prevIndex + (cols - prevIndex % cols), 5830 decrement: true, 5831 disabledIndices 5832 }); 5833 } 5834 } else if (loop) { 5835 nextIndex = findNonDisabledIndex(elementsRef, { 5836 startingIndex: prevIndex + (cols - prevIndex % cols), 5837 decrement: true, 5838 disabledIndices 5839 }); 5840 } 5841 if (isDifferentRow(nextIndex, cols, prevRow)) { 5842 nextIndex = prevIndex; 5843 } 5844 } 5845 const lastRow = floor(maxIndex / cols) === prevRow; 5846 if (isIndexOutOfBounds(elementsRef, nextIndex)) { 5847 if (loop && lastRow) { 5848 nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledIndex(elementsRef, { 5849 startingIndex: prevIndex - prevIndex % cols - 1, 5850 disabledIndices 5851 }); 5852 } else { 5853 nextIndex = prevIndex; 5854 } 5855 } 5856 } 5857 return nextIndex; 5858} 5859function buildCellMap(sizes, cols, dense) { 5860 const cellMap = []; 5861 let startIndex = 0; 5862 sizes.forEach((_ref2, index3) => { 5863 let { 5864 width, 5865 height 5866 } = _ref2; 5867 if (width > cols) { 5868 if (true) { 5869 throw new Error("[Floating UI]: Invalid grid - item width at index " + index3 + " is greater than grid columns"); 5870 } 5871 } 5872 let itemPlaced = false; 5873 if (dense) { 5874 startIndex = 0; 5875 } 5876 while (!itemPlaced) { 5877 const targetCells = []; 5878 for (let i = 0; i < width; i++) { 5879 for (let j = 0; j < height; j++) { 5880 targetCells.push(startIndex + i + j * cols); 5881 } 5882 } 5883 if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) { 5884 targetCells.forEach((cell) => { 5885 cellMap[cell] = index3; 5886 }); 5887 itemPlaced = true; 5888 } else { 5889 startIndex++; 5890 } 5891 } 5892 }); 5893 return [...cellMap]; 5894} 5895function getCellIndexOfCorner(index3, sizes, cellMap, cols, corner) { 5896 if (index3 === -1) return -1; 5897 const firstCellIndex = cellMap.indexOf(index3); 5898 const sizeItem = sizes[index3]; 5899 switch (corner) { 5900 case "tl": 5901 return firstCellIndex; 5902 case "tr": 5903 if (!sizeItem) { 5904 return firstCellIndex; 5905 } 5906 return firstCellIndex + sizeItem.width - 1; 5907 case "bl": 5908 if (!sizeItem) { 5909 return firstCellIndex; 5910 } 5911 return firstCellIndex + (sizeItem.height - 1) * cols; 5912 case "br": 5913 return cellMap.lastIndexOf(index3); 5914 } 5915} 5916function getCellIndices(indices, cellMap) { 5917 return cellMap.flatMap((index3, cellIndex) => indices.includes(index3) ? [cellIndex] : []); 5918} 5919function isDisabled(list, index3, disabledIndices) { 5920 if (disabledIndices) { 5921 return disabledIndices.includes(index3); 5922 } 5923 const element = list[index3]; 5924 return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"; 5925} 5926var index2 = typeof document !== "undefined" ? import_react2.useLayoutEffect : import_react2.useEffect; 5927function sortByDocumentPosition(a, b) { 5928 const position = a.compareDocumentPosition(b); 5929 if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) { 5930 return -1; 5931 } 5932 if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) { 5933 return 1; 5934 } 5935 return 0; 5936} 5937var FloatingListContext = React2.createContext({ 5938 register: () => { 5939 }, 5940 unregister: () => { 5941 }, 5942 map: /* @__PURE__ */ new Map(), 5943 elementsRef: { 5944 current: [] 5945 } 5946}); 5947function FloatingList(props) { 5948 const { 5949 children, 5950 elementsRef, 5951 labelsRef 5952 } = props; 5953 const [nodes, setNodes] = React2.useState(() => /* @__PURE__ */ new Set()); 5954 const register = React2.useCallback((node) => { 5955 setNodes((prevSet) => new Set(prevSet).add(node)); 5956 }, []); 5957 const unregister = React2.useCallback((node) => { 5958 setNodes((prevSet) => { 5959 const set = new Set(prevSet); 5960 set.delete(node); 5961 return set; 5962 }); 5963 }, []); 5964 const map = React2.useMemo(() => { 5965 const newMap = /* @__PURE__ */ new Map(); 5966 const sortedNodes = Array.from(nodes.keys()).sort(sortByDocumentPosition); 5967 sortedNodes.forEach((node, index3) => { 5968 newMap.set(node, index3); 5969 }); 5970 return newMap; 5971 }, [nodes]); 5972 return (0, import_jsx_runtime.jsx)(FloatingListContext.Provider, { 5973 value: React2.useMemo(() => ({ 5974 register, 5975 unregister, 5976 map, 5977 elementsRef, 5978 labelsRef 5979 }), [register, unregister, map, elementsRef, labelsRef]), 5980 children 5981 }); 5982} 5983function useListItem(props) { 5984 if (props === void 0) { 5985 props = {}; 5986 } 5987 const { 5988 label 5989 } = props; 5990 const { 5991 register, 5992 unregister, 5993 map, 5994 elementsRef, 5995 labelsRef 5996 } = React2.useContext(FloatingListContext); 5997 const [index$1, setIndex] = React2.useState(null); 5998 const componentRef = React2.useRef(null); 5999 const ref = React2.useCallback((node) => { 6000 componentRef.current = node; 6001 if (index$1 !== null) { 6002 elementsRef.current[index$1] = node; 6003 if (labelsRef) { 6004 var _node$textContent; 6005 const isLabelDefined = label !== void 0; 6006 labelsRef.current[index$1] = isLabelDefined ? label : (_node$textContent = node == null ? void 0 : node.textContent) != null ? _node$textContent : null; 6007 } 6008 } 6009 }, [index$1, elementsRef, labelsRef, label]); 6010 index2(() => { 6011 const node = componentRef.current; 6012 if (node) { 6013 register(node); 6014 return () => { 6015 unregister(node); 6016 }; 6017 } 6018 }, [register, unregister]); 6019 index2(() => { 6020 const index3 = componentRef.current ? map.get(componentRef.current) : null; 6021 if (index3 != null) { 6022 setIndex(index3); 6023 } 6024 }, [map]); 6025 return React2.useMemo(() => ({ 6026 ref, 6027 index: index$1 == null ? -1 : index$1 6028 }), [index$1, ref]); 6029} 6030function renderJsx(render, computedProps) { 6031 if (typeof render === "function") { 6032 return render(computedProps); 6033 } 6034 if (render) { 6035 return React2.cloneElement(render, computedProps); 6036 } 6037 return (0, import_jsx_runtime.jsx)("div", { 6038 ...computedProps 6039 }); 6040} 6041var CompositeContext = React2.createContext({ 6042 activeIndex: 0, 6043 onNavigate: () => { 6044 } 6045}); 6046var horizontalKeys = [ARROW_LEFT, ARROW_RIGHT]; 6047var verticalKeys = [ARROW_UP, ARROW_DOWN]; 6048var allKeys = [...horizontalKeys, ...verticalKeys]; 6049var Composite = React2.forwardRef(function Composite2(props, forwardedRef) { 6050 const { 6051 render, 6052 orientation = "both", 6053 loop = true, 6054 rtl = false, 6055 cols = 1, 6056 disabledIndices, 6057 activeIndex: externalActiveIndex, 6058 onNavigate: externalSetActiveIndex, 6059 itemSizes, 6060 dense = false, 6061 ...domProps 6062 } = props; 6063 const [internalActiveIndex, internalSetActiveIndex] = React2.useState(0); 6064 const activeIndex = externalActiveIndex != null ? externalActiveIndex : internalActiveIndex; 6065 const onNavigate = useEffectEvent(externalSetActiveIndex != null ? externalSetActiveIndex : internalSetActiveIndex); 6066 const elementsRef = React2.useRef([]); 6067 const renderElementProps = render && typeof render !== "function" ? render.props : {}; 6068 const contextValue = React2.useMemo(() => ({ 6069 activeIndex, 6070 onNavigate 6071 }), [activeIndex, onNavigate]); 6072 const isGrid = cols > 1; 6073 function handleKeyDown(event) { 6074 if (!allKeys.includes(event.key)) return; 6075 let nextIndex = activeIndex; 6076 const minIndex = getMinIndex(elementsRef, disabledIndices); 6077 const maxIndex = getMaxIndex(elementsRef, disabledIndices); 6078 const horizontalEndKey = rtl ? ARROW_LEFT : ARROW_RIGHT; 6079 const horizontalStartKey = rtl ? ARROW_RIGHT : ARROW_LEFT; 6080 if (isGrid) { 6081 const sizes = itemSizes || Array.from({ 6082 length: elementsRef.current.length 6083 }, () => ({ 6084 width: 1, 6085 height: 1 6086 })); 6087 const cellMap = buildCellMap(sizes, cols, dense); 6088 const minGridIndex = cellMap.findIndex((index3) => index3 != null && !isDisabled(elementsRef.current, index3, disabledIndices)); 6089 const maxGridIndex = cellMap.reduce((foundIndex, index3, cellIndex) => index3 != null && !isDisabled(elementsRef.current, index3, disabledIndices) ? cellIndex : foundIndex, -1); 6090 const maybeNextIndex = cellMap[getGridNavigatedIndex({ 6091 current: cellMap.map((itemIndex) => itemIndex ? elementsRef.current[itemIndex] : null) 6092 }, { 6093 event, 6094 orientation, 6095 loop, 6096 rtl, 6097 cols, 6098 // treat undefined (empty grid spaces) as disabled indices so we 6099 // don't end up in them 6100 disabledIndices: getCellIndices([...disabledIndices || elementsRef.current.map((_, index3) => isDisabled(elementsRef.current, index3) ? index3 : void 0), void 0], cellMap), 6101 minIndex: minGridIndex, 6102 maxIndex: maxGridIndex, 6103 prevIndex: getCellIndexOfCorner( 6104 activeIndex > maxIndex ? minIndex : activeIndex, 6105 sizes, 6106 cellMap, 6107 cols, 6108 // use a corner matching the edge closest to the direction we're 6109 // moving in so we don't end up in the same item. Prefer 6110 // top/left over bottom/right. 6111 event.key === ARROW_DOWN ? "bl" : event.key === horizontalEndKey ? "tr" : "tl" 6112 ) 6113 })]; 6114 if (maybeNextIndex != null) { 6115 nextIndex = maybeNextIndex; 6116 } 6117 } 6118 const toEndKeys = { 6119 horizontal: [horizontalEndKey], 6120 vertical: [ARROW_DOWN], 6121 both: [horizontalEndKey, ARROW_DOWN] 6122 }[orientation]; 6123 const toStartKeys = { 6124 horizontal: [horizontalStartKey], 6125 vertical: [ARROW_UP], 6126 both: [horizontalStartKey, ARROW_UP] 6127 }[orientation]; 6128 const preventedKeys = isGrid ? allKeys : { 6129 horizontal: horizontalKeys, 6130 vertical: verticalKeys, 6131 both: allKeys 6132 }[orientation]; 6133 if (nextIndex === activeIndex && [...toEndKeys, ...toStartKeys].includes(event.key)) { 6134 if (loop && nextIndex === maxIndex && toEndKeys.includes(event.key)) { 6135 nextIndex = minIndex; 6136 } else if (loop && nextIndex === minIndex && toStartKeys.includes(event.key)) { 6137 nextIndex = maxIndex; 6138 } else { 6139 nextIndex = findNonDisabledIndex(elementsRef, { 6140 startingIndex: nextIndex, 6141 decrement: toStartKeys.includes(event.key), 6142 disabledIndices 6143 }); 6144 } 6145 } 6146 if (nextIndex !== activeIndex && !isIndexOutOfBounds(elementsRef, nextIndex)) { 6147 var _elementsRef$current$; 6148 event.stopPropagation(); 6149 if (preventedKeys.includes(event.key)) { 6150 event.preventDefault(); 6151 } 6152 onNavigate(nextIndex); 6153 (_elementsRef$current$ = elementsRef.current[nextIndex]) == null || _elementsRef$current$.focus(); 6154 } 6155 } 6156 const computedProps = { 6157 ...domProps, 6158 ...renderElementProps, 6159 ref: forwardedRef, 6160 "aria-orientation": orientation === "both" ? void 0 : orientation, 6161 onKeyDown(e) { 6162 domProps.onKeyDown == null || domProps.onKeyDown(e); 6163 renderElementProps.onKeyDown == null || renderElementProps.onKeyDown(e); 6164 handleKeyDown(e); 6165 } 6166 }; 6167 return (0, import_jsx_runtime.jsx)(CompositeContext.Provider, { 6168 value: contextValue, 6169 children: (0, import_jsx_runtime.jsx)(FloatingList, { 6170 elementsRef, 6171 children: renderJsx(render, computedProps) 6172 }) 6173 }); 6174}); 6175var CompositeItem = React2.forwardRef(function CompositeItem2(props, forwardedRef) { 6176 const { 6177 render, 6178 ...domProps 6179 } = props; 6180 const renderElementProps = render && typeof render !== "function" ? render.props : {}; 6181 const { 6182 activeIndex, 6183 onNavigate 6184 } = React2.useContext(CompositeContext); 6185 const { 6186 ref, 6187 index: index3 6188 } = useListItem(); 6189 const mergedRef = useMergeRefs([ref, forwardedRef, renderElementProps.ref]); 6190 const isActive = activeIndex === index3; 6191 const computedProps = { 6192 ...domProps, 6193 ...renderElementProps, 6194 ref: mergedRef, 6195 tabIndex: isActive ? 0 : -1, 6196 "data-active": isActive ? "" : void 0, 6197 onFocus(e) { 6198 domProps.onFocus == null || domProps.onFocus(e); 6199 renderElementProps.onFocus == null || renderElementProps.onFocus(e); 6200 onNavigate(index3); 6201 } 6202 }; 6203 return renderJsx(render, computedProps); 6204}); 6205var serverHandoffComplete = false; 6206var count = 0; 6207var genId = () => ( 6208 // Ensure the id is unique with multiple independent versions of Floating UI 6209 // on <React 18 6210 "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++ 6211); 6212function useFloatingId() { 6213 const [id, setId] = React2.useState(() => serverHandoffComplete ? genId() : void 0); 6214 index2(() => { 6215 if (id == null) { 6216 setId(genId()); 6217 } 6218 }, []); 6219 React2.useEffect(() => { 6220 serverHandoffComplete = true; 6221 }, []); 6222 return id; 6223} 6224var useReactId = SafeReact.useId; 6225var useId = useReactId || useFloatingId; 6226var devMessageSet; 6227if (true) { 6228 devMessageSet = /* @__PURE__ */ new Set(); 6229} 6230function warn() { 6231 var _devMessageSet; 6232 for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) { 6233 messages[_key] = arguments[_key]; 6234 } 6235 const message2 = "Floating UI: " + messages.join(" "); 6236 if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(message2))) { 6237 var _devMessageSet2; 6238 (_devMessageSet2 = devMessageSet) == null || _devMessageSet2.add(message2); 6239 console.warn(message2); 6240 } 6241} 6242function error() { 6243 var _devMessageSet3; 6244 for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 6245 messages[_key2] = arguments[_key2]; 6246 } 6247 const message2 = "Floating UI: " + messages.join(" "); 6248 if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message2))) { 6249 var _devMessageSet4; 6250 (_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message2); 6251 console.error(message2); 6252 } 6253} 6254var FloatingArrow = React2.forwardRef(function FloatingArrow2(props, ref) { 6255 const { 6256 context: { 6257 placement, 6258 elements: { 6259 floating 6260 }, 6261 middlewareData: { 6262 arrow: arrow4, 6263 shift: shift4 6264 } 6265 }, 6266 width = 14, 6267 height = 7, 6268 tipRadius = 0, 6269 strokeWidth = 0, 6270 staticOffset, 6271 stroke, 6272 d, 6273 style: { 6274 transform, 6275 ...restStyle 6276 } = {}, 6277 ...rest 6278 } = props; 6279 if (true) { 6280 if (!ref) { 6281 warn("The `ref` prop is required for `FloatingArrow`."); 6282 } 6283 } 6284 const clipPathId = useId(); 6285 const [isRTL2, setIsRTL] = React2.useState(false); 6286 index2(() => { 6287 if (!floating) return; 6288 const isRTL3 = getComputedStyle2(floating).direction === "rtl"; 6289 if (isRTL3) { 6290 setIsRTL(true); 6291 } 6292 }, [floating]); 6293 if (!floating) { 6294 return null; 6295 } 6296 const [side, alignment] = placement.split("-"); 6297 const isVerticalSide = side === "top" || side === "bottom"; 6298 let computedStaticOffset = staticOffset; 6299 if (isVerticalSide && shift4 != null && shift4.x || !isVerticalSide && shift4 != null && shift4.y) { 6300 computedStaticOffset = null; 6301 } 6302 const computedStrokeWidth = strokeWidth * 2; 6303 const halfStrokeWidth = computedStrokeWidth / 2; 6304 const svgX = width / 2 * (tipRadius / -8 + 1); 6305 const svgY = height / 2 * tipRadius / 4; 6306 const isCustomShape = !!d; 6307 const yOffsetProp = computedStaticOffset && alignment === "end" ? "bottom" : "top"; 6308 let xOffsetProp = computedStaticOffset && alignment === "end" ? "right" : "left"; 6309 if (computedStaticOffset && isRTL2) { 6310 xOffsetProp = alignment === "end" ? "left" : "right"; 6311 } 6312 const arrowX = (arrow4 == null ? void 0 : arrow4.x) != null ? computedStaticOffset || arrow4.x : ""; 6313 const arrowY = (arrow4 == null ? void 0 : arrow4.y) != null ? computedStaticOffset || arrow4.y : ""; 6314 const dValue = d || "M0,0" + (" H" + width) + (" L" + (width - svgX) + "," + (height - svgY)) + (" Q" + width / 2 + "," + height + " " + svgX + "," + (height - svgY)) + " Z"; 6315 const rotation = { 6316 top: isCustomShape ? "rotate(180deg)" : "", 6317 left: isCustomShape ? "rotate(90deg)" : "rotate(-90deg)", 6318 bottom: isCustomShape ? "" : "rotate(180deg)", 6319 right: isCustomShape ? "rotate(-90deg)" : "rotate(90deg)" 6320 }[side]; 6321 return (0, import_jsx_runtime.jsxs)("svg", { 6322 ...rest, 6323 "aria-hidden": true, 6324 ref, 6325 width: isCustomShape ? width : width + computedStrokeWidth, 6326 height: width, 6327 viewBox: "0 0 " + width + " " + (height > width ? height : width), 6328 style: { 6329 position: "absolute", 6330 pointerEvents: "none", 6331 [xOffsetProp]: arrowX, 6332 [yOffsetProp]: arrowY, 6333 [side]: isVerticalSide || isCustomShape ? "100%" : "calc(100% - " + computedStrokeWidth / 2 + "px)", 6334 transform: [rotation, transform].filter((t) => !!t).join(" "), 6335 ...restStyle 6336 }, 6337 children: [computedStrokeWidth > 0 && (0, import_jsx_runtime.jsx)("path", { 6338 clipPath: "url(#" + clipPathId + ")", 6339 fill: "none", 6340 stroke, 6341 strokeWidth: computedStrokeWidth + (d ? 0 : 1), 6342 d: dValue 6343 }), (0, import_jsx_runtime.jsx)("path", { 6344 stroke: computedStrokeWidth && !d ? rest.fill : "none", 6345 d: dValue 6346 }), (0, import_jsx_runtime.jsx)("clipPath", { 6347 id: clipPathId, 6348 children: (0, import_jsx_runtime.jsx)("rect", { 6349 x: -halfStrokeWidth, 6350 y: halfStrokeWidth * (isCustomShape ? -1 : 1), 6351 width: width + computedStrokeWidth, 6352 height: width 6353 }) 6354 })] 6355 }); 6356}); 6357function createPubSub() { 6358 const map = /* @__PURE__ */ new Map(); 6359 return { 6360 emit(event, data) { 6361 var _map$get; 6362 (_map$get = map.get(event)) == null || _map$get.forEach((handler) => handler(data)); 6363 }, 6364 on(event, listener) { 6365 map.set(event, [...map.get(event) || [], listener]); 6366 }, 6367 off(event, listener) { 6368 var _map$get2; 6369 map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter((l) => l !== listener)) || []); 6370 } 6371 }; 6372} 6373var FloatingNodeContext = React2.createContext(null); 6374var FloatingTreeContext = React2.createContext(null); 6375var useFloatingParentNodeId = () => { 6376 var _React$useContext; 6377 return ((_React$useContext = React2.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null; 6378}; 6379var useFloatingTree = () => React2.useContext(FloatingTreeContext); 6380function createAttribute(name) { 6381 return "data-floating-ui-" + name; 6382} 6383var safePolygonIdentifier = createAttribute("safe-polygon"); 6384var NOOP = () => { 6385}; 6386var FloatingDelayGroupContext = React2.createContext({ 6387 delay: 0, 6388 initialDelay: 0, 6389 timeoutMs: 0, 6390 currentId: null, 6391 setCurrentId: NOOP, 6392 setState: NOOP, 6393 isInstantPhase: false 6394}); 6395var HIDDEN_STYLES = { 6396 border: 0, 6397 clip: "rect(0 0 0 0)", 6398 height: "1px", 6399 margin: "-1px", 6400 overflow: "hidden", 6401 padding: 0, 6402 position: "fixed", 6403 whiteSpace: "nowrap", 6404 width: "1px", 6405 top: 0, 6406 left: 0 6407}; 6408var FocusGuard = React2.forwardRef(function FocusGuard2(props, ref) { 6409 const [role, setRole] = React2.useState(); 6410 index2(() => { 6411 if (isSafari()) { 6412 setRole("button"); 6413 } 6414 }, []); 6415 const restProps = { 6416 ref, 6417 tabIndex: 0, 6418 // Role is only for VoiceOver 6419 role, 6420 "aria-hidden": role ? void 0 : true, 6421 [createAttribute("focus-guard")]: "", 6422 style: HIDDEN_STYLES 6423 }; 6424 return (0, import_jsx_runtime.jsx)("span", { 6425 ...props, 6426 ...restProps 6427 }); 6428}); 6429var PortalContext = React2.createContext(null); 6430var attr = createAttribute("portal"); 6431var VisuallyHiddenDismiss = React2.forwardRef(function VisuallyHiddenDismiss2(props, ref) { 6432 return (0, import_jsx_runtime.jsx)("button", { 6433 ...props, 6434 type: "button", 6435 ref, 6436 tabIndex: -1, 6437 style: HIDDEN_STYLES 6438 }); 6439}); 6440var lockCount = 0; 6441function enableScrollLock() { 6442 const isIOS = /iP(hone|ad|od)|iOS/.test(getPlatform()); 6443 const bodyStyle = document.body.style; 6444 const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft; 6445 const paddingProp = scrollbarX ? "paddingLeft" : "paddingRight"; 6446 const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; 6447 const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX; 6448 const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY; 6449 bodyStyle.overflow = "hidden"; 6450 if (scrollbarWidth) { 6451 bodyStyle[paddingProp] = scrollbarWidth + "px"; 6452 } 6453 if (isIOS) { 6454 var _window$visualViewpor, _window$visualViewpor2; 6455 const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0; 6456 const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0; 6457 Object.assign(bodyStyle, { 6458 position: "fixed", 6459 top: -(scrollY - Math.floor(offsetTop)) + "px", 6460 left: -(scrollX - Math.floor(offsetLeft)) + "px", 6461 right: "0" 6462 }); 6463 } 6464 return () => { 6465 Object.assign(bodyStyle, { 6466 overflow: "", 6467 [paddingProp]: "" 6468 }); 6469 if (isIOS) { 6470 Object.assign(bodyStyle, { 6471 position: "", 6472 top: "", 6473 left: "", 6474 right: "" 6475 }); 6476 window.scrollTo(scrollX, scrollY); 6477 } 6478 }; 6479} 6480var cleanup = () => { 6481}; 6482var FloatingOverlay = React2.forwardRef(function FloatingOverlay2(props, ref) { 6483 const { 6484 lockScroll = false, 6485 ...rest 6486 } = props; 6487 index2(() => { 6488 if (!lockScroll) return; 6489 lockCount++; 6490 if (lockCount === 1) { 6491 cleanup = enableScrollLock(); 6492 } 6493 return () => { 6494 lockCount--; 6495 if (lockCount === 0) { 6496 cleanup(); 6497 } 6498 }; 6499 }, [lockScroll]); 6500 return (0, import_jsx_runtime.jsx)("div", { 6501 ref, 6502 ...rest, 6503 style: { 6504 position: "fixed", 6505 overflow: "auto", 6506 top: 0, 6507 right: 0, 6508 bottom: 0, 6509 left: 0, 6510 ...rest.style 6511 } 6512 }); 6513}); 6514function useFloatingRootContext(options) { 6515 const { 6516 open = false, 6517 onOpenChange: onOpenChangeProp, 6518 elements: elementsProp 6519 } = options; 6520 const floatingId = useId(); 6521 const dataRef = React2.useRef({}); 6522 const [events] = React2.useState(() => createPubSub()); 6523 const nested = useFloatingParentNodeId() != null; 6524 if (true) { 6525 const optionDomReference = elementsProp.reference; 6526 if (optionDomReference && !isElement(optionDomReference)) { 6527 error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead."); 6528 } 6529 } 6530 const [positionReference, setPositionReference] = React2.useState(elementsProp.reference); 6531 const onOpenChange = useEffectEvent((open2, event, reason) => { 6532 dataRef.current.openEvent = open2 ? event : void 0; 6533 events.emit("openchange", { 6534 open: open2, 6535 event, 6536 reason, 6537 nested 6538 }); 6539 onOpenChangeProp == null || onOpenChangeProp(open2, event, reason); 6540 }); 6541 const refs = React2.useMemo(() => ({ 6542 setPositionReference 6543 }), []); 6544 const elements = React2.useMemo(() => ({ 6545 reference: positionReference || elementsProp.reference || null, 6546 floating: elementsProp.floating || null, 6547 domReference: elementsProp.reference 6548 }), [positionReference, elementsProp.reference, elementsProp.floating]); 6549 return React2.useMemo(() => ({ 6550 dataRef, 6551 open, 6552 onOpenChange, 6553 elements, 6554 events, 6555 floatingId, 6556 refs 6557 }), [open, onOpenChange, elements, events, floatingId, refs]); 6558} 6559function useFloating2(options) { 6560 if (options === void 0) { 6561 options = {}; 6562 } 6563 const { 6564 nodeId 6565 } = options; 6566 const internalRootContext = useFloatingRootContext({ 6567 ...options, 6568 elements: { 6569 reference: null, 6570 floating: null, 6571 ...options.elements 6572 } 6573 }); 6574 const rootContext = options.rootContext || internalRootContext; 6575 const computedElements = rootContext.elements; 6576 const [_domReference, setDomReference] = React2.useState(null); 6577 const [positionReference, _setPositionReference] = React2.useState(null); 6578 const optionDomReference = computedElements == null ? void 0 : computedElements.domReference; 6579 const domReference = optionDomReference || _domReference; 6580 const domReferenceRef = React2.useRef(null); 6581 const tree = useFloatingTree(); 6582 index2(() => { 6583 if (domReference) { 6584 domReferenceRef.current = domReference; 6585 } 6586 }, [domReference]); 6587 const position = useFloating({ 6588 ...options, 6589 elements: { 6590 ...computedElements, 6591 ...positionReference && { 6592 reference: positionReference 6593 } 6594 } 6595 }); 6596 const setPositionReference = React2.useCallback((node) => { 6597 const computedPositionReference = isElement(node) ? { 6598 getBoundingClientRect: () => node.getBoundingClientRect(), 6599 contextElement: node 6600 } : node; 6601 _setPositionReference(computedPositionReference); 6602 position.refs.setReference(computedPositionReference); 6603 }, [position.refs]); 6604 const setReference = React2.useCallback((node) => { 6605 if (isElement(node) || node === null) { 6606 domReferenceRef.current = node; 6607 setDomReference(node); 6608 } 6609 if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to 6610 // `null` to support `positionReference` + an unstable `reference` 6611 // callback ref. 6612 node !== null && !isElement(node)) { 6613 position.refs.setReference(node); 6614 } 6615 }, [position.refs]); 6616 const refs = React2.useMemo(() => ({ 6617 ...position.refs, 6618 setReference, 6619 setPositionReference, 6620 domReference: domReferenceRef 6621 }), [position.refs, setReference, setPositionReference]); 6622 const elements = React2.useMemo(() => ({ 6623 ...position.elements, 6624 domReference 6625 }), [position.elements, domReference]); 6626 const context = React2.useMemo(() => ({ 6627 ...position, 6628 ...rootContext, 6629 refs, 6630 elements, 6631 nodeId 6632 }), [position, refs, elements, nodeId, rootContext]); 6633 index2(() => { 6634 rootContext.dataRef.current.floatingContext = context; 6635 const node = tree == null ? void 0 : tree.nodesRef.current.find((node2) => node2.id === nodeId); 6636 if (node) { 6637 node.context = context; 6638 } 6639 }); 6640 return React2.useMemo(() => ({ 6641 ...position, 6642 context, 6643 refs, 6644 elements 6645 }), [position, refs, elements, context]); 6646} 6647
vendor: 197,927 bytes, lines 6648-10811
6648// node_modules/react-datepicker/dist/index.es.js 6649var import_react_dom3 = __toESM(require_react_dom()); 6650var _extendStatics = function extendStatics(d, b) { 6651 _extendStatics = Object.setPrototypeOf || { 6652 __proto__: [] 6653 } instanceof Array && function(d2, b2) { 6654 d2.__proto__ = b2; 6655 } || function(d2, b2) { 6656 for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; 6657 }; 6658 return _extendStatics(d, b); 6659}; 6660function __extends(d, b) { 6661 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 6662 _extendStatics(d, b); 6663 function __() { 6664 this.constructor = d; 6665 } 6666 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6667} 6668var _assign = function __assign() { 6669 _assign = Object.assign || function __assign2(t) { 6670 for (var s, i = 1, n = arguments.length; i < n; i++) { 6671 s = arguments[i]; 6672 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 6673 } 6674 return t; 6675 }; 6676 return _assign.apply(this, arguments); 6677}; 6678function __spreadArray(to, from, pack) { 6679 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 6680 if (ar || !(i in from)) { 6681 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 6682 ar[i] = from[i]; 6683 } 6684 } 6685 return to.concat(ar || Array.prototype.slice.call(from)); 6686} 6687var CalendarContainer = function(_a2) { 6688 var _b = _a2.showTimeSelectOnly, showTimeSelectOnly = _b === void 0 ? false : _b, _c = _a2.showTime, showTime = _c === void 0 ? false : _c, className = _a2.className, children = _a2.children; 6689 var ariaLabel = showTimeSelectOnly ? "Choose Time" : "Choose Date".concat(showTime ? " and Time" : ""); 6690 return import_react3.default.createElement("div", { className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children); 6691}; 6692var useDetectClickOutside = function(onClickOutside, ignoreClass) { 6693 var ref = (0, import_react3.useRef)(null); 6694 var onClickOutsideRef = (0, import_react3.useRef)(onClickOutside); 6695 onClickOutsideRef.current = onClickOutside; 6696 var handleClickOutside = (0, import_react3.useCallback)(function(event) { 6697 var _a2; 6698 var target = event.composed && event.composedPath && event.composedPath().find(function(eventTarget) { 6699 return eventTarget instanceof Node; 6700 }) || event.target; 6701 if (ref.current && !ref.current.contains(target)) { 6702 if (!(ignoreClass && target instanceof HTMLElement && target.classList.contains(ignoreClass))) { 6703 (_a2 = onClickOutsideRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(onClickOutsideRef, event); 6704 } 6705 } 6706 }, [ignoreClass]); 6707 (0, import_react3.useEffect)(function() { 6708 document.addEventListener("mousedown", handleClickOutside); 6709 return function() { 6710 document.removeEventListener("mousedown", handleClickOutside); 6711 }; 6712 }, [handleClickOutside]); 6713 return ref; 6714}; 6715var ClickOutsideWrapper = function(_a2) { 6716 var children = _a2.children, onClickOutside = _a2.onClickOutside, className = _a2.className, containerRef = _a2.containerRef, style = _a2.style, ignoreClass = _a2.ignoreClass; 6717 var detectRef = useDetectClickOutside(onClickOutside, ignoreClass); 6718 return import_react3.default.createElement("div", { className, style, ref: function(node) { 6719 detectRef.current = node; 6720 if (containerRef) { 6721 containerRef.current = node; 6722 } 6723 } }, children); 6724}; 6725var KeyType; 6726(function(KeyType2) { 6727 KeyType2["ArrowUp"] = "ArrowUp"; 6728 KeyType2["ArrowDown"] = "ArrowDown"; 6729 KeyType2["ArrowLeft"] = "ArrowLeft"; 6730 KeyType2["ArrowRight"] = "ArrowRight"; 6731 KeyType2["PageUp"] = "PageUp"; 6732 KeyType2["PageDown"] = "PageDown"; 6733 KeyType2["Home"] = "Home"; 6734 KeyType2["End"] = "End"; 6735 KeyType2["Enter"] = "Enter"; 6736 KeyType2["Space"] = " "; 6737 KeyType2["Tab"] = "Tab"; 6738 KeyType2["Escape"] = "Escape"; 6739 KeyType2["Backspace"] = "Backspace"; 6740 KeyType2["X"] = "x"; 6741})(KeyType || (KeyType = {})); 6742function getLocaleScope() { 6743 var scope = typeof window !== "undefined" ? window : globalThis; 6744 return scope; 6745} 6746var DEFAULT_YEAR_ITEM_NUMBER = 12; 6747function newDate(value) { 6748 if (value == null) { 6749 return /* @__PURE__ */ new Date(); 6750 } 6751 var d = typeof value === "string" ? parseISO(value) : toDate(value); 6752 return isValid2(d) ? d : /* @__PURE__ */ new Date(); 6753} 6754function parseDate2(value, dateFormat, locale, strictParsing, refDate) { 6755 if (refDate === void 0) { 6756 refDate = newDate(); 6757 } 6758 var localeObject = getLocaleObject(locale) || getLocaleObject(getDefaultLocale()); 6759 var formats = Array.isArray(dateFormat) ? dateFormat : [dateFormat]; 6760 for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) { 6761 var format_1 = formats_1[_i]; 6762 var parsedDate = parse(value, format_1, refDate, { 6763 locale: localeObject, 6764 useAdditionalWeekYearTokens: true, 6765 useAdditionalDayOfYearTokens: true 6766 }); 6767 if (isValid2(parsedDate) && (!strictParsing || value === formatDate(parsedDate, format_1, locale))) { 6768 return parsedDate; 6769 } 6770 } 6771 return null; 6772} 6773function isValid2(date, minDate) { 6774 return isValid(date) && !isBefore(date, /* @__PURE__ */ new Date("1/1/1800")); 6775} 6776function formatDate(date, formatStr, locale) { 6777 if (locale === "en") { 6778 return format(date, formatStr, { 6779 useAdditionalWeekYearTokens: true, 6780 useAdditionalDayOfYearTokens: true 6781 }); 6782 } 6783 var localeObj = locale ? getLocaleObject(locale) : void 0; 6784 if (locale && !localeObj) { 6785 console.warn('A locale object was not found for the provided string ["'.concat(locale, '"].')); 6786 } 6787 localeObj = localeObj || getLocaleObject(getDefaultLocale()); 6788 return format(date, formatStr, { 6789 locale: localeObj, 6790 useAdditionalWeekYearTokens: true, 6791 useAdditionalDayOfYearTokens: true 6792 }); 6793} 6794function safeDateFormat(date, _a2) { 6795 var dateFormat = _a2.dateFormat, locale = _a2.locale; 6796 var formatStr = Array.isArray(dateFormat) && dateFormat.length > 0 ? dateFormat[0] : dateFormat; 6797 return date && formatDate(date, formatStr, locale) || ""; 6798} 6799function safeDateRangeFormat(startDate, endDate, props) { 6800 if (!startDate) { 6801 return ""; 6802 } 6803 var formattedStartDate = safeDateFormat(startDate, props); 6804 var formattedEndDate = endDate ? safeDateFormat(endDate, props) : ""; 6805 return "".concat(formattedStartDate, " - ").concat(formattedEndDate); 6806} 6807function safeMultipleDatesFormat(dates, props) { 6808 if (!(dates === null || dates === void 0 ? void 0 : dates.length)) { 6809 return ""; 6810 } 6811 var formattedFirstDate = dates[0] ? safeDateFormat(dates[0], props) : ""; 6812 if (dates.length === 1) { 6813 return formattedFirstDate; 6814 } 6815 if (dates.length === 2 && dates[1]) { 6816 var formattedSecondDate = safeDateFormat(dates[1], props); 6817 return "".concat(formattedFirstDate, ", ").concat(formattedSecondDate); 6818 } 6819 var extraDatesCount = dates.length - 1; 6820 return "".concat(formattedFirstDate, " (+").concat(extraDatesCount, ")"); 6821} 6822function setTime(date, _a2) { 6823 var _b = _a2.hour, hour = _b === void 0 ? 0 : _b, _c = _a2.minute, minute = _c === void 0 ? 0 : _c, _d = _a2.second, second = _d === void 0 ? 0 : _d; 6824 return setHours(setMinutes(setSeconds(date, second), minute), hour); 6825} 6826function getWeek2(date) { 6827 return getISOWeek(date); 6828} 6829function getDayOfWeekCode(day, locale) { 6830 return formatDate(day, "ddd", locale); 6831} 6832function getStartOfDay(date) { 6833 return startOfDay(date); 6834} 6835function getStartOfWeek(date, locale, calendarStartDay) { 6836 var localeObj = locale ? getLocaleObject(locale) : getLocaleObject(getDefaultLocale()); 6837 return startOfWeek(date, { 6838 locale: localeObj, 6839 weekStartsOn: calendarStartDay 6840 }); 6841} 6842function getStartOfMonth(date) { 6843 return startOfMonth(date); 6844} 6845function getStartOfYear(date) { 6846 return startOfYear(date); 6847} 6848function getStartOfQuarter(date) { 6849 return startOfQuarter(date); 6850} 6851function getStartOfToday() { 6852 return startOfDay(newDate()); 6853} 6854function getEndOfDay(date) { 6855 return endOfDay(date); 6856} 6857function getEndOfWeek(date) { 6858 return endOfWeek(date); 6859} 6860function getEndOfMonth(date) { 6861 return endOfMonth(date); 6862} 6863function isSameYear2(date1, date2) { 6864 if (date1 && date2) { 6865 return isSameYear(date1, date2); 6866 } else { 6867 return !date1 && !date2; 6868 } 6869} 6870function isSameMonth2(date1, date2) { 6871 if (date1 && date2) { 6872 return isSameMonth(date1, date2); 6873 } else { 6874 return !date1 && !date2; 6875 } 6876} 6877function isSameQuarter2(date1, date2) { 6878 if (date1 && date2) { 6879 return isSameQuarter(date1, date2); 6880 } else { 6881 return !date1 && !date2; 6882 } 6883} 6884function isSameDay2(date1, date2) { 6885 if (date1 && date2) { 6886 return isSameDay(date1, date2); 6887 } else { 6888 return !date1 && !date2; 6889 } 6890} 6891function isEqual2(date1, date2) { 6892 if (date1 && date2) { 6893 return isEqual(date1, date2); 6894 } else { 6895 return !date1 && !date2; 6896 } 6897} 6898function isDayInRange(day, startDate, endDate) { 6899 var valid; 6900 var start = startOfDay(startDate); 6901 var end = endOfDay(endDate); 6902 try { 6903 valid = isWithinInterval(day, { start, end }); 6904 } catch (err) { 6905 valid = false; 6906 } 6907 return valid; 6908} 6909function registerLocale(localeName, localeData) { 6910 var scope = getLocaleScope(); 6911 if (!scope.__localeData__) { 6912 scope.__localeData__ = {}; 6913 } 6914 scope.__localeData__[localeName] = localeData; 6915} 6916function setDefaultLocale(localeName) { 6917 var scope = getLocaleScope(); 6918 scope.__localeId__ = localeName; 6919} 6920function getDefaultLocale() { 6921 var scope = getLocaleScope(); 6922 return scope.__localeId__; 6923} 6924function getLocaleObject(localeSpec) { 6925 if (typeof localeSpec === "string") { 6926 var scope = getLocaleScope(); 6927 return scope.__localeData__ ? scope.__localeData__[localeSpec] : void 0; 6928 } else { 6929 return localeSpec; 6930 } 6931} 6932function getFormattedWeekdayInLocale(date, formatFunc, locale) { 6933 return formatFunc(formatDate(date, "EEEE", locale)); 6934} 6935function getWeekdayMinInLocale(date, locale) { 6936 return formatDate(date, "EEEEEE", locale); 6937} 6938function getWeekdayShortInLocale(date, locale) { 6939 return formatDate(date, "EEE", locale); 6940} 6941function getMonthInLocale(month, locale) { 6942 return formatDate(setMonth(newDate(), month), "LLLL", locale); 6943} 6944function getMonthShortInLocale(month, locale) { 6945 return formatDate(setMonth(newDate(), month), "LLL", locale); 6946} 6947function getQuarterShortInLocale(quarter, locale) { 6948 return formatDate(setQuarter(newDate(), quarter), "QQQ", locale); 6949} 6950function isDayDisabled(day, _a2) { 6951 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals, includeDates = _b.includeDates, includeDateIntervals = _b.includeDateIntervals, filterDate = _b.filterDate; 6952 return isOutOfBounds(day, { minDate, maxDate }) || excludeDates && excludeDates.some(function(excludeDate) { 6953 if (excludeDate instanceof Date) { 6954 return isSameDay2(day, excludeDate); 6955 } else { 6956 return isSameDay2(day, excludeDate.date); 6957 } 6958 }) || excludeDateIntervals && excludeDateIntervals.some(function(_a3) { 6959 var start = _a3.start, end = _a3.end; 6960 return isWithinInterval(day, { start, end }); 6961 }) || includeDates && !includeDates.some(function(includeDate) { 6962 return isSameDay2(day, includeDate); 6963 }) || includeDateIntervals && !includeDateIntervals.some(function(_a3) { 6964 var start = _a3.start, end = _a3.end; 6965 return isWithinInterval(day, { start, end }); 6966 }) || filterDate && !filterDate(newDate(day)) || false; 6967} 6968function isDayExcluded(day, _a2) { 6969 var _b = _a2 === void 0 ? {} : _a2, excludeDates = _b.excludeDates, excludeDateIntervals = _b.excludeDateIntervals; 6970 if (excludeDateIntervals && excludeDateIntervals.length > 0) { 6971 return excludeDateIntervals.some(function(_a3) { 6972 var start = _a3.start, end = _a3.end; 6973 return isWithinInterval(day, { start, end }); 6974 }); 6975 } 6976 return excludeDates && excludeDates.some(function(excludeDate) { 6977 var _a3; 6978 if (excludeDate instanceof Date) { 6979 return isSameDay2(day, excludeDate); 6980 } else { 6981 return isSameDay2(day, (_a3 = excludeDate.date) !== null && _a3 !== void 0 ? _a3 : /* @__PURE__ */ new Date()); 6982 } 6983 }) || false; 6984} 6985function isMonthDisabled(month, _a2) { 6986 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate; 6987 return isOutOfBounds(month, { 6988 minDate: minDate ? startOfMonth(minDate) : void 0, 6989 maxDate: maxDate ? endOfMonth(maxDate) : void 0 6990 }) || (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function(excludeDate) { 6991 return isSameMonth2(month, excludeDate instanceof Date ? excludeDate : excludeDate.date); 6992 })) || includeDates && !includeDates.some(function(includeDate) { 6993 return isSameMonth2(month, includeDate); 6994 }) || filterDate && !filterDate(newDate(month)) || false; 6995} 6996function isMonthInRange(startDate, endDate, m, day) { 6997 var startDateYear = getYear(startDate); 6998 var startDateMonth = getMonth(startDate); 6999 var endDateYear = getYear(endDate); 7000 var endDateMonth = getMonth(endDate); 7001 var dayYear = getYear(day); 7002 if (startDateYear === endDateYear && startDateYear === dayYear) { 7003 return startDateMonth <= m && m <= endDateMonth; 7004 } else if (startDateYear < endDateYear) { 7005 return dayYear === startDateYear && startDateMonth <= m || dayYear === endDateYear && endDateMonth >= m || dayYear < endDateYear && dayYear > startDateYear; 7006 } 7007 return false; 7008} 7009function isMonthYearDisabled(date, _a2) { 7010 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates; 7011 return isOutOfBounds(date, { minDate, maxDate }) || excludeDates && excludeDates.some(function(excludedDate) { 7012 return isSameMonth2(excludedDate instanceof Date ? excludedDate : excludedDate.date, date); 7013 }) || includeDates && !includeDates.some(function(includedDate) { 7014 return isSameMonth2(includedDate, date); 7015 }) || false; 7016} 7017function isQuarterDisabled(quarter, _a2) { 7018 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate; 7019 return isOutOfBounds(quarter, { minDate, maxDate }) || (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function(excludeDate) { 7020 return isSameQuarter2(quarter, excludeDate instanceof Date ? excludeDate : excludeDate.date); 7021 })) || includeDates && !includeDates.some(function(includeDate) { 7022 return isSameQuarter2(quarter, includeDate); 7023 }) || filterDate && !filterDate(newDate(quarter)) || false; 7024} 7025function isYearInRange(year, start, end) { 7026 if (!start || !end) 7027 return false; 7028 if (!isValid(start) || !isValid(end)) 7029 return false; 7030 var startYear = getYear(start); 7031 var endYear = getYear(end); 7032 return startYear <= year && endYear >= year; 7033} 7034function isYearDisabled(year, _a2) { 7035 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates, filterDate = _b.filterDate; 7036 var date = new Date(year, 0, 1); 7037 return isOutOfBounds(date, { 7038 minDate: minDate ? startOfYear(minDate) : void 0, 7039 maxDate: maxDate ? endOfYear(maxDate) : void 0 7040 }) || (excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.some(function(excludeDate) { 7041 return isSameYear2(date, excludeDate instanceof Date ? excludeDate : excludeDate.date); 7042 })) || includeDates && !includeDates.some(function(includeDate) { 7043 return isSameYear2(date, includeDate); 7044 }) || filterDate && !filterDate(newDate(date)) || false; 7045} 7046function isQuarterInRange(startDate, endDate, q, day) { 7047 var startDateYear = getYear(startDate); 7048 var startDateQuarter = getQuarter(startDate); 7049 var endDateYear = getYear(endDate); 7050 var endDateQuarter = getQuarter(endDate); 7051 var dayYear = getYear(day); 7052 if (startDateYear === endDateYear && startDateYear === dayYear) { 7053 return startDateQuarter <= q && q <= endDateQuarter; 7054 } else if (startDateYear < endDateYear) { 7055 return dayYear === startDateYear && startDateQuarter <= q || dayYear === endDateYear && endDateQuarter >= q || dayYear < endDateYear && dayYear > startDateYear; 7056 } 7057 return false; 7058} 7059function isOutOfBounds(day, _a2) { 7060 var _b; 7061 var _c = _a2 === void 0 ? {} : _a2, minDate = _c.minDate, maxDate = _c.maxDate; 7062 return (_b = minDate && differenceInCalendarDays(day, minDate) < 0 || maxDate && differenceInCalendarDays(day, maxDate) > 0) !== null && _b !== void 0 ? _b : false; 7063} 7064function isTimeInList(time, times) { 7065 return times.some(function(listTime) { 7066 return getHours(listTime) === getHours(time) && getMinutes(listTime) === getMinutes(time) && getSeconds(listTime) === getSeconds(time); 7067 }); 7068} 7069function isTimeDisabled(time, _a2) { 7070 var _b = _a2 === void 0 ? {} : _a2, excludeTimes = _b.excludeTimes, includeTimes = _b.includeTimes, filterTime = _b.filterTime; 7071 return excludeTimes && isTimeInList(time, excludeTimes) || includeTimes && !isTimeInList(time, includeTimes) || filterTime && !filterTime(time) || false; 7072} 7073function isTimeInDisabledRange(time, _a2) { 7074 var minTime2 = _a2.minTime, maxTime2 = _a2.maxTime; 7075 if (!minTime2 || !maxTime2) { 7076 throw new Error("Both minTime and maxTime props required"); 7077 } 7078 var baseTime = newDate(); 7079 baseTime = setHours(baseTime, getHours(time)); 7080 baseTime = setMinutes(baseTime, getMinutes(time)); 7081 baseTime = setSeconds(baseTime, getSeconds(time)); 7082 var min3 = newDate(); 7083 min3 = setHours(min3, getHours(minTime2)); 7084 min3 = setMinutes(min3, getMinutes(minTime2)); 7085 min3 = setSeconds(min3, getSeconds(minTime2)); 7086 var max3 = newDate(); 7087 max3 = setHours(max3, getHours(maxTime2)); 7088 max3 = setMinutes(max3, getMinutes(maxTime2)); 7089 max3 = setSeconds(max3, getSeconds(maxTime2)); 7090 var valid; 7091 try { 7092 valid = !isWithinInterval(baseTime, { start: min3, end: max3 }); 7093 } catch (err) { 7094 valid = false; 7095 } 7096 return valid; 7097} 7098function monthDisabledBefore(day, _a2) { 7099 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, includeDates = _b.includeDates; 7100 var previousMonth = subMonths(day, 1); 7101 return minDate && differenceInCalendarMonths(minDate, previousMonth) > 0 || includeDates && includeDates.every(function(includeDate) { 7102 return differenceInCalendarMonths(includeDate, previousMonth) > 0; 7103 }) || false; 7104} 7105function monthDisabledAfter(day, _a2) { 7106 var _b = _a2 === void 0 ? {} : _a2, maxDate = _b.maxDate, includeDates = _b.includeDates; 7107 var nextMonth = addMonths(day, 1); 7108 return maxDate && differenceInCalendarMonths(nextMonth, maxDate) > 0 || includeDates && includeDates.every(function(includeDate) { 7109 return differenceInCalendarMonths(nextMonth, includeDate) > 0; 7110 }) || false; 7111} 7112function quarterDisabledBefore(date, _a2) { 7113 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, includeDates = _b.includeDates; 7114 var firstDateOfYear = startOfYear(date); 7115 var previousQuarter = subQuarters(firstDateOfYear, 1); 7116 return minDate && differenceInCalendarQuarters(minDate, previousQuarter) > 0 || includeDates && includeDates.every(function(includeDate) { 7117 return differenceInCalendarQuarters(includeDate, previousQuarter) > 0; 7118 }) || false; 7119} 7120function quarterDisabledAfter(date, _a2) { 7121 var _b = _a2 === void 0 ? {} : _a2, maxDate = _b.maxDate, includeDates = _b.includeDates; 7122 var lastDateOfYear = endOfYear(date); 7123 var nextQuarter = addQuarters(lastDateOfYear, 1); 7124 return maxDate && differenceInCalendarQuarters(nextQuarter, maxDate) > 0 || includeDates && includeDates.every(function(includeDate) { 7125 return differenceInCalendarQuarters(nextQuarter, includeDate) > 0; 7126 }) || false; 7127} 7128function yearDisabledBefore(day, _a2) { 7129 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, includeDates = _b.includeDates; 7130 var previousYear = subYears(day, 1); 7131 return minDate && differenceInCalendarYears(minDate, previousYear) > 0 || includeDates && includeDates.every(function(includeDate) { 7132 return differenceInCalendarYears(includeDate, previousYear) > 0; 7133 }) || false; 7134} 7135function yearsDisabledBefore(day, _a2) { 7136 var _b = _a2 === void 0 ? {} : _a2, minDate = _b.minDate, _c = _b.yearItemNumber, yearItemNumber = _c === void 0 ? DEFAULT_YEAR_ITEM_NUMBER : _c; 7137 var previousYear = getStartOfYear(subYears(day, yearItemNumber)); 7138 var endPeriod = getYearsPeriod(previousYear, yearItemNumber).endPeriod; 7139 var minDateYear = minDate && getYear(minDate); 7140 return minDateYear && minDateYear > endPeriod || false; 7141} 7142function yearDisabledAfter(day, _a2) { 7143 var _b = _a2 === void 0 ? {} : _a2, maxDate = _b.maxDate, includeDates = _b.includeDates; 7144 var nextYear = addYears(day, 1); 7145 return maxDate && differenceInCalendarYears(nextYear, maxDate) > 0 || includeDates && includeDates.every(function(includeDate) { 7146 return differenceInCalendarYears(nextYear, includeDate) > 0; 7147 }) || false; 7148} 7149function yearsDisabledAfter(day, _a2) { 7150 var _b = _a2 === void 0 ? {} : _a2, maxDate = _b.maxDate, _c = _b.yearItemNumber, yearItemNumber = _c === void 0 ? DEFAULT_YEAR_ITEM_NUMBER : _c; 7151 var nextYear = addYears(day, yearItemNumber); 7152 var startPeriod = getYearsPeriod(nextYear, yearItemNumber).startPeriod; 7153 var maxDateYear = maxDate && getYear(maxDate); 7154 return maxDateYear && maxDateYear < startPeriod || false; 7155} 7156function getEffectiveMinDate(_a2) { 7157 var minDate = _a2.minDate, includeDates = _a2.includeDates; 7158 if (includeDates && minDate) { 7159 var minDates = includeDates.filter(function(includeDate) { 7160 return differenceInCalendarDays(includeDate, minDate) >= 0; 7161 }); 7162 return min(minDates); 7163 } else if (includeDates) { 7164 return min(includeDates); 7165 } else { 7166 return minDate; 7167 } 7168} 7169function getEffectiveMaxDate(_a2) { 7170 var maxDate = _a2.maxDate, includeDates = _a2.includeDates; 7171 if (includeDates && maxDate) { 7172 var maxDates = includeDates.filter(function(includeDate) { 7173 return differenceInCalendarDays(includeDate, maxDate) <= 0; 7174 }); 7175 return max(maxDates); 7176 } else if (includeDates) { 7177 return max(includeDates); 7178 } else { 7179 return maxDate; 7180 } 7181} 7182function getHighLightDaysMap(highlightDates, defaultClassName) { 7183 var _a2; 7184 if (highlightDates === void 0) { 7185 highlightDates = []; 7186 } 7187 if (defaultClassName === void 0) { 7188 defaultClassName = "react-datepicker__day--highlighted"; 7189 } 7190 var dateClasses = /* @__PURE__ */ new Map(); 7191 for (var i = 0, len = highlightDates.length; i < len; i++) { 7192 var obj = highlightDates[i]; 7193 if (isDate(obj)) { 7194 var key = formatDate(obj, "MM.dd.yyyy"); 7195 var classNamesArr = dateClasses.get(key) || []; 7196 if (!classNamesArr.includes(defaultClassName)) { 7197 classNamesArr.push(defaultClassName); 7198 dateClasses.set(key, classNamesArr); 7199 } 7200 } else if (typeof obj === "object") { 7201 var keys = Object.keys(obj); 7202 var className = (_a2 = keys[0]) !== null && _a2 !== void 0 ? _a2 : ""; 7203 var arrOfDates = obj[className]; 7204 if (typeof className === "string" && Array.isArray(arrOfDates)) { 7205 for (var k = 0, len_1 = arrOfDates.length; k < len_1; k++) { 7206 var dateK = arrOfDates[k]; 7207 if (dateK) { 7208 var key = formatDate(dateK, "MM.dd.yyyy"); 7209 var classNamesArr = dateClasses.get(key) || []; 7210 if (!classNamesArr.includes(className)) { 7211 classNamesArr.push(className); 7212 dateClasses.set(key, classNamesArr); 7213 } 7214 } 7215 } 7216 } 7217 } 7218 } 7219 return dateClasses; 7220} 7221function arraysAreEqual(array1, array2) { 7222 if (array1.length !== array2.length) { 7223 return false; 7224 } 7225 return array1.every(function(value, index3) { 7226 return value === array2[index3]; 7227 }); 7228} 7229function getHolidaysMap(holidayDates, defaultClassName) { 7230 if (holidayDates === void 0) { 7231 holidayDates = []; 7232 } 7233 if (defaultClassName === void 0) { 7234 defaultClassName = "react-datepicker__day--holidays"; 7235 } 7236 var dateClasses = /* @__PURE__ */ new Map(); 7237 holidayDates.forEach(function(holiday) { 7238 var dateObj = holiday.date, holidayName = holiday.holidayName; 7239 if (!isDate(dateObj)) { 7240 return; 7241 } 7242 var key = formatDate(dateObj, "MM.dd.yyyy"); 7243 var classNamesObj = dateClasses.get(key) || { 7244 className: "", 7245 holidayNames: [] 7246 }; 7247 if ("className" in classNamesObj && classNamesObj["className"] === defaultClassName && arraysAreEqual(classNamesObj["holidayNames"], [holidayName])) { 7248 return; 7249 } 7250 classNamesObj["className"] = defaultClassName; 7251 var holidayNameArr = classNamesObj["holidayNames"]; 7252 classNamesObj["holidayNames"] = holidayNameArr ? __spreadArray(__spreadArray([], holidayNameArr, true), [holidayName], false) : [holidayName]; 7253 dateClasses.set(key, classNamesObj); 7254 }); 7255 return dateClasses; 7256} 7257function timesToInjectAfter(startOfDay2, currentTime, currentMultiplier, intervals, injectedTimes) { 7258 var l = injectedTimes.length; 7259 var times = []; 7260 for (var i = 0; i < l; i++) { 7261 var injectedTime = startOfDay2; 7262 var injectedTimeValue = injectedTimes[i]; 7263 if (injectedTimeValue) { 7264 injectedTime = addHours(injectedTime, getHours(injectedTimeValue)); 7265 injectedTime = addMinutes(injectedTime, getMinutes(injectedTimeValue)); 7266 injectedTime = addSeconds(injectedTime, getSeconds(injectedTimeValue)); 7267 } 7268 var nextTime = addMinutes(startOfDay2, (currentMultiplier + 1) * intervals); 7269 if (isAfter(injectedTime, currentTime) && isBefore(injectedTime, nextTime) && injectedTimeValue != void 0) { 7270 times.push(injectedTimeValue); 7271 } 7272 } 7273 return times; 7274} 7275function addZero(i) { 7276 return i < 10 ? "0".concat(i) : "".concat(i); 7277} 7278function getYearsPeriod(date, yearItemNumber) { 7279 if (yearItemNumber === void 0) { 7280 yearItemNumber = DEFAULT_YEAR_ITEM_NUMBER; 7281 } 7282 var endPeriod = Math.ceil(getYear(date) / yearItemNumber) * yearItemNumber; 7283 var startPeriod = endPeriod - (yearItemNumber - 1); 7284 return { startPeriod, endPeriod }; 7285} 7286function getHoursInDay(d) { 7287 var startOfDay2 = new Date(d.getFullYear(), d.getMonth(), d.getDate()); 7288 var startOfTheNextDay = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 24); 7289 return Math.round((+startOfTheNextDay - +startOfDay2) / 36e5); 7290} 7291function startOfMinute2(d) { 7292 var seconds = d.getSeconds(); 7293 var milliseconds = d.getMilliseconds(); 7294 return toDate(d.getTime() - seconds * 1e3 - milliseconds); 7295} 7296function isSameMinute2(d1, d2) { 7297 return startOfMinute2(d1).getTime() === startOfMinute2(d2).getTime(); 7298} 7299function getMidnightDate(date) { 7300 if (!isDate(date)) { 7301 throw new Error("Invalid date"); 7302 } 7303 var dateWithoutTime = new Date(date); 7304 dateWithoutTime.setHours(0, 0, 0, 0); 7305 return dateWithoutTime; 7306} 7307function isDateBefore(date, dateToCompare) { 7308 if (!isDate(date) || !isDate(dateToCompare)) { 7309 throw new Error("Invalid date received"); 7310 } 7311 var midnightDate = getMidnightDate(date); 7312 var midnightDateToCompare = getMidnightDate(dateToCompare); 7313 return isBefore(midnightDate, midnightDateToCompare); 7314} 7315function isSpaceKeyDown(event) { 7316 return event.key === KeyType.Space; 7317} 7318var InputTime = ( 7319 /** @class */ 7320 function(_super) { 7321 __extends(InputTime2, _super); 7322 function InputTime2(props) { 7323 var _this = _super.call(this, props) || this; 7324 _this.inputRef = import_react3.default.createRef(); 7325 _this.onTimeChange = function(time) { 7326 var _a2, _b; 7327 _this.setState({ time }); 7328 var propDate = _this.props.date; 7329 var isPropDateValid = propDate instanceof Date && !isNaN(+propDate); 7330 var date = isPropDateValid ? propDate : /* @__PURE__ */ new Date(); 7331 if (time === null || time === void 0 ? void 0 : time.includes(":")) { 7332 var _c = time.split(":"), hours = _c[0], minutes = _c[1]; 7333 date.setHours(Number(hours)); 7334 date.setMinutes(Number(minutes)); 7335 } 7336 (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, date); 7337 }; 7338 _this.renderTimeInput = function() { 7339 var time = _this.state.time; 7340 var _a2 = _this.props, date = _a2.date, timeString = _a2.timeString, customTimeInput = _a2.customTimeInput; 7341 if (customTimeInput) { 7342 return (0, import_react3.cloneElement)(customTimeInput, { 7343 date, 7344 value: time, 7345 onChange: _this.onTimeChange 7346 }); 7347 } 7348 return import_react3.default.createElement("input", { type: "time", className: "react-datepicker-time__input", placeholder: "Time", name: "time-input", ref: _this.inputRef, onClick: function() { 7349 var _a3; 7350 (_a3 = _this.inputRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); 7351 }, required: true, value: time, onChange: function(event) { 7352 _this.onTimeChange(event.target.value || timeString); 7353 } }); 7354 }; 7355 _this.state = { 7356 time: _this.props.timeString 7357 }; 7358 return _this; 7359 } 7360 InputTime2.getDerivedStateFromProps = function(props, state) { 7361 if (props.timeString !== state.time) { 7362 return { 7363 time: props.timeString 7364 }; 7365 } 7366 return null; 7367 }; 7368 InputTime2.prototype.render = function() { 7369 return import_react3.default.createElement( 7370 "div", 7371 { className: "react-datepicker__input-time-container" }, 7372 import_react3.default.createElement("div", { className: "react-datepicker-time__caption" }, this.props.timeInputLabel), 7373 import_react3.default.createElement( 7374 "div", 7375 { className: "react-datepicker-time__input-container" }, 7376 import_react3.default.createElement("div", { className: "react-datepicker-time__input" }, this.renderTimeInput()) 7377 ) 7378 ); 7379 }; 7380 return InputTime2; 7381 }(import_react3.Component) 7382); 7383var Day = ( 7384 /** @class */ 7385 function(_super) { 7386 __extends(Day2, _super); 7387 function Day2() { 7388 var _this = _super !== null && _super.apply(this, arguments) || this; 7389 _this.dayEl = (0, import_react3.createRef)(); 7390 _this.handleClick = function(event) { 7391 if (!_this.isDisabled() && _this.props.onClick) { 7392 _this.props.onClick(event); 7393 } 7394 }; 7395 _this.handleMouseEnter = function(event) { 7396 if (!_this.isDisabled() && _this.props.onMouseEnter) { 7397 _this.props.onMouseEnter(event); 7398 } 7399 }; 7400 _this.handleOnKeyDown = function(event) { 7401 var _a2, _b; 7402 var eventKey = event.key; 7403 if (eventKey === KeyType.Space) { 7404 event.preventDefault(); 7405 event.key = KeyType.Enter; 7406 } 7407 (_b = (_a2 = _this.props).handleOnKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 7408 }; 7409 _this.isSameDay = function(other) { 7410 return isSameDay2(_this.props.day, other); 7411 }; 7412 _this.isKeyboardSelected = function() { 7413 var _a2; 7414 if (_this.props.disabledKeyboardNavigation) { 7415 return false; 7416 } 7417 var isSelectedDate = _this.props.selectsMultiple ? (_a2 = _this.props.selectedDates) === null || _a2 === void 0 ? void 0 : _a2.some(function(date) { 7418 return _this.isSameDayOrWeek(date); 7419 }) : _this.isSameDayOrWeek(_this.props.selected); 7420 var isDisabled2 = _this.props.preSelection && _this.isDisabled(_this.props.preSelection); 7421 return !isSelectedDate && _this.isSameDayOrWeek(_this.props.preSelection) && !isDisabled2; 7422 }; 7423 _this.isDisabled = function(day) { 7424 if (day === void 0) { 7425 day = _this.props.day; 7426 } 7427 return isDayDisabled(day, { 7428 minDate: _this.props.minDate, 7429 maxDate: _this.props.maxDate, 7430 excludeDates: _this.props.excludeDates, 7431 excludeDateIntervals: _this.props.excludeDateIntervals, 7432 includeDateIntervals: _this.props.includeDateIntervals, 7433 includeDates: _this.props.includeDates, 7434 filterDate: _this.props.filterDate 7435 }); 7436 }; 7437 _this.isExcluded = function() { 7438 return isDayExcluded(_this.props.day, { 7439 excludeDates: _this.props.excludeDates, 7440 excludeDateIntervals: _this.props.excludeDateIntervals 7441 }); 7442 }; 7443 _this.isStartOfWeek = function() { 7444 return isSameDay2(_this.props.day, getStartOfWeek(_this.props.day, _this.props.locale, _this.props.calendarStartDay)); 7445 }; 7446 _this.isSameWeek = function(other) { 7447 return _this.props.showWeekPicker && isSameDay2(other, getStartOfWeek(_this.props.day, _this.props.locale, _this.props.calendarStartDay)); 7448 }; 7449 _this.isSameDayOrWeek = function(other) { 7450 return _this.isSameDay(other) || _this.isSameWeek(other); 7451 }; 7452 _this.getHighLightedClass = function() { 7453 var _a2 = _this.props, day = _a2.day, highlightDates = _a2.highlightDates; 7454 if (!highlightDates) { 7455 return false; 7456 } 7457 var dayStr = formatDate(day, "MM.dd.yyyy"); 7458 return highlightDates.get(dayStr); 7459 }; 7460 _this.getHolidaysClass = function() { 7461 var _a2; 7462 var _b = _this.props, day = _b.day, holidays = _b.holidays; 7463 if (!holidays) { 7464 return [void 0]; 7465 } 7466 var dayStr = formatDate(day, "MM.dd.yyyy"); 7467 if (holidays.has(dayStr)) { 7468 return [(_a2 = holidays.get(dayStr)) === null || _a2 === void 0 ? void 0 : _a2.className]; 7469 } 7470 return [void 0]; 7471 }; 7472 _this.isInRange = function() { 7473 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7474 if (!startDate || !endDate) { 7475 return false; 7476 } 7477 return isDayInRange(day, startDate, endDate); 7478 }; 7479 _this.isInSelectingRange = function() { 7480 var _a2; 7481 var _b = _this.props, day = _b.day, selectsStart = _b.selectsStart, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, selectsDisabledDaysInRange = _b.selectsDisabledDaysInRange, startDate = _b.startDate, endDate = _b.endDate; 7482 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 7483 if (!(selectsStart || selectsEnd || selectsRange) || !selectingDate || !selectsDisabledDaysInRange && _this.isDisabled()) { 7484 return false; 7485 } 7486 if (selectsStart && endDate && (isBefore(selectingDate, endDate) || isEqual2(selectingDate, endDate))) { 7487 return isDayInRange(day, selectingDate, endDate); 7488 } 7489 if (selectsEnd && startDate && (isAfter(selectingDate, startDate) || isEqual2(selectingDate, startDate))) { 7490 return isDayInRange(day, startDate, selectingDate); 7491 } 7492 if (selectsRange && startDate && !endDate && (isAfter(selectingDate, startDate) || isEqual2(selectingDate, startDate))) { 7493 return isDayInRange(day, startDate, selectingDate); 7494 } 7495 return false; 7496 }; 7497 _this.isSelectingRangeStart = function() { 7498 var _a2; 7499 if (!_this.isInSelectingRange()) { 7500 return false; 7501 } 7502 var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart; 7503 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 7504 if (selectsStart) { 7505 return isSameDay2(day, selectingDate); 7506 } else { 7507 return isSameDay2(day, startDate); 7508 } 7509 }; 7510 _this.isSelectingRangeEnd = function() { 7511 var _a2; 7512 if (!_this.isInSelectingRange()) { 7513 return false; 7514 } 7515 var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange; 7516 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 7517 if (selectsEnd || selectsRange) { 7518 return isSameDay2(day, selectingDate); 7519 } else { 7520 return isSameDay2(day, endDate); 7521 } 7522 }; 7523 _this.isRangeStart = function() { 7524 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7525 if (!startDate || !endDate) { 7526 return false; 7527 } 7528 return isSameDay2(startDate, day); 7529 }; 7530 _this.isRangeEnd = function() { 7531 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7532 if (!startDate || !endDate) { 7533 return false; 7534 } 7535 return isSameDay2(endDate, day); 7536 }; 7537 _this.isWeekend = function() { 7538 var weekday = getDay(_this.props.day); 7539 return weekday === 0 || weekday === 6; 7540 }; 7541 _this.isAfterMonth = function() { 7542 return _this.props.month !== void 0 && (_this.props.month + 1) % 12 === getMonth(_this.props.day); 7543 }; 7544 _this.isBeforeMonth = function() { 7545 return _this.props.month !== void 0 && (getMonth(_this.props.day) + 1) % 12 === _this.props.month; 7546 }; 7547 _this.isCurrentDay = function() { 7548 return _this.isSameDay(newDate()); 7549 }; 7550 _this.isSelected = function() { 7551 var _a2; 7552 if (_this.props.selectsMultiple) { 7553 return (_a2 = _this.props.selectedDates) === null || _a2 === void 0 ? void 0 : _a2.some(function(date) { 7554 return _this.isSameDayOrWeek(date); 7555 }); 7556 } 7557 return _this.isSameDayOrWeek(_this.props.selected); 7558 }; 7559 _this.getClassNames = function(date) { 7560 var dayClassName = _this.props.dayClassName ? _this.props.dayClassName(date) : void 0; 7561 return clsx("react-datepicker__day", dayClassName, "react-datepicker__day--" + getDayOfWeekCode(_this.props.day), { 7562 "react-datepicker__day--disabled": _this.isDisabled(), 7563 "react-datepicker__day--excluded": _this.isExcluded(), 7564 "react-datepicker__day--selected": _this.isSelected(), 7565 "react-datepicker__day--keyboard-selected": _this.isKeyboardSelected(), 7566 "react-datepicker__day--range-start": _this.isRangeStart(), 7567 "react-datepicker__day--range-end": _this.isRangeEnd(), 7568 "react-datepicker__day--in-range": _this.isInRange(), 7569 "react-datepicker__day--in-selecting-range": _this.isInSelectingRange(), 7570 "react-datepicker__day--selecting-range-start": _this.isSelectingRangeStart(), 7571 "react-datepicker__day--selecting-range-end": _this.isSelectingRangeEnd(), 7572 "react-datepicker__day--today": _this.isCurrentDay(), 7573 "react-datepicker__day--weekend": _this.isWeekend(), 7574 "react-datepicker__day--outside-month": _this.isAfterMonth() || _this.isBeforeMonth() 7575 }, _this.getHighLightedClass(), _this.getHolidaysClass()); 7576 }; 7577 _this.getAriaLabel = function() { 7578 var _a2 = _this.props, day = _a2.day, _b = _a2.ariaLabelPrefixWhenEnabled, ariaLabelPrefixWhenEnabled = _b === void 0 ? "Choose" : _b, _c = _a2.ariaLabelPrefixWhenDisabled, ariaLabelPrefixWhenDisabled = _c === void 0 ? "Not available" : _c; 7579 var prefix = _this.isDisabled() || _this.isExcluded() ? ariaLabelPrefixWhenDisabled : ariaLabelPrefixWhenEnabled; 7580 return "".concat(prefix, " ").concat(formatDate(day, "PPPP", _this.props.locale)); 7581 }; 7582 _this.getTitle = function() { 7583 var _a2 = _this.props, day = _a2.day, _b = _a2.holidays, holidays = _b === void 0 ? /* @__PURE__ */ new Map() : _b, excludeDates = _a2.excludeDates; 7584 var compareDt = formatDate(day, "MM.dd.yyyy"); 7585 var titles = []; 7586 if (holidays.has(compareDt)) { 7587 titles.push.apply(titles, holidays.get(compareDt).holidayNames); 7588 } 7589 if (_this.isExcluded()) { 7590 titles.push(excludeDates === null || excludeDates === void 0 ? void 0 : excludeDates.filter(function(excludeDate) { 7591 if (excludeDate instanceof Date) { 7592 return isSameDay2(excludeDate, day); 7593 } 7594 return isSameDay2(excludeDate === null || excludeDate === void 0 ? void 0 : excludeDate.date, day); 7595 }).map(function(excludeDate) { 7596 if (excludeDate instanceof Date) { 7597 return void 0; 7598 } 7599 return excludeDate === null || excludeDate === void 0 ? void 0 : excludeDate.message; 7600 })); 7601 } 7602 return titles.join(", "); 7603 }; 7604 _this.getTabIndex = function() { 7605 var selectedDay = _this.props.selected; 7606 var preSelectionDay = _this.props.preSelection; 7607 var tabIndex = !(_this.props.showWeekPicker && (_this.props.showWeekNumber || !_this.isStartOfWeek())) && (_this.isKeyboardSelected() || _this.isSameDay(selectedDay) && isSameDay2(preSelectionDay, selectedDay)) ? 0 : -1; 7608 return tabIndex; 7609 }; 7610 _this.handleFocusDay = function() { 7611 var _a2; 7612 _this.shouldFocusDay() && ((_a2 = _this.dayEl.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventScroll: true })); 7613 }; 7614 _this.renderDayContents = function() { 7615 if (_this.props.monthShowsDuplicateDaysEnd && _this.isAfterMonth()) 7616 return null; 7617 if (_this.props.monthShowsDuplicateDaysStart && _this.isBeforeMonth()) 7618 return null; 7619 return _this.props.renderDayContents ? _this.props.renderDayContents(getDate(_this.props.day), _this.props.day) : getDate(_this.props.day); 7620 }; 7621 _this.render = function() { 7622 return ( 7623 // TODO: Use <option> instead of the "option" role to ensure accessibility across all devices. 7624 import_react3.default.createElement( 7625 "div", 7626 { ref: _this.dayEl, className: _this.getClassNames(_this.props.day), onKeyDown: _this.handleOnKeyDown, onClick: _this.handleClick, onMouseEnter: !_this.props.usePointerEvent ? _this.handleMouseEnter : void 0, onPointerEnter: _this.props.usePointerEvent ? _this.handleMouseEnter : void 0, tabIndex: _this.getTabIndex(), "aria-label": _this.getAriaLabel(), role: "option", title: _this.getTitle(), "aria-disabled": _this.isDisabled(), "aria-current": _this.isCurrentDay() ? "date" : void 0, "aria-selected": _this.isSelected() || _this.isInRange() }, 7627 _this.renderDayContents(), 7628 _this.getTitle() !== "" && import_react3.default.createElement("span", { className: "overlay" }, _this.getTitle()) 7629 ) 7630 ); 7631 }; 7632 return _this; 7633 } 7634 Day2.prototype.componentDidMount = function() { 7635 this.handleFocusDay(); 7636 }; 7637 Day2.prototype.componentDidUpdate = function() { 7638 this.handleFocusDay(); 7639 }; 7640 Day2.prototype.shouldFocusDay = function() { 7641 var shouldFocusDay = false; 7642 if (this.getTabIndex() === 0 && this.isSameDay(this.props.preSelection)) { 7643 if (!document.activeElement || document.activeElement === document.body) { 7644 shouldFocusDay = true; 7645 } 7646 if (this.props.inline && !this.props.shouldFocusDayInline) { 7647 shouldFocusDay = false; 7648 } 7649 if (this.isDayActiveElement()) { 7650 shouldFocusDay = true; 7651 } 7652 if (this.isDuplicateDay()) { 7653 shouldFocusDay = false; 7654 } 7655 } 7656 return shouldFocusDay; 7657 }; 7658 Day2.prototype.isDayActiveElement = function() { 7659 var _a2, _b, _c; 7660 return ((_b = (_a2 = this.props.containerRef) === null || _a2 === void 0 ? void 0 : _a2.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement)) && ((_c = document.activeElement) === null || _c === void 0 ? void 0 : _c.classList.contains("react-datepicker__day")); 7661 }; 7662 Day2.prototype.isDuplicateDay = function() { 7663 return ( 7664 //day is one of the non rendered duplicate days 7665 this.props.monthShowsDuplicateDaysEnd && this.isAfterMonth() || this.props.monthShowsDuplicateDaysStart && this.isBeforeMonth() 7666 ); 7667 }; 7668 return Day2; 7669 }(import_react3.Component) 7670); 7671var WeekNumber = ( 7672 /** @class */ 7673 function(_super) { 7674 __extends(WeekNumber2, _super); 7675 function WeekNumber2() { 7676 var _this = _super !== null && _super.apply(this, arguments) || this; 7677 _this.weekNumberEl = (0, import_react3.createRef)(); 7678 _this.handleClick = function(event) { 7679 if (_this.props.onClick) { 7680 _this.props.onClick(event); 7681 } 7682 }; 7683 _this.handleOnKeyDown = function(event) { 7684 var _a2, _b; 7685 var eventKey = event.key; 7686 if (eventKey === KeyType.Space) { 7687 event.preventDefault(); 7688 event.key = KeyType.Enter; 7689 } 7690 (_b = (_a2 = _this.props).handleOnKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 7691 }; 7692 _this.isKeyboardSelected = function() { 7693 return !_this.props.disabledKeyboardNavigation && !isSameDay2(_this.props.date, _this.props.selected) && isSameDay2(_this.props.date, _this.props.preSelection); 7694 }; 7695 _this.getTabIndex = function() { 7696 return _this.props.showWeekPicker && _this.props.showWeekNumber && (_this.isKeyboardSelected() || isSameDay2(_this.props.date, _this.props.selected) && isSameDay2(_this.props.preSelection, _this.props.selected)) ? 0 : -1; 7697 }; 7698 _this.handleFocusWeekNumber = function(prevProps) { 7699 var shouldFocusWeekNumber = false; 7700 if (_this.getTabIndex() === 0 && !(prevProps === null || prevProps === void 0 ? void 0 : prevProps.isInputFocused) && isSameDay2(_this.props.date, _this.props.preSelection)) { 7701 if (!document.activeElement || document.activeElement === document.body) { 7702 shouldFocusWeekNumber = true; 7703 } 7704 if (_this.props.inline && !_this.props.shouldFocusDayInline) { 7705 shouldFocusWeekNumber = false; 7706 } 7707 if (_this.props.containerRef && _this.props.containerRef.current && _this.props.containerRef.current.contains(document.activeElement) && document.activeElement && document.activeElement.classList.contains("react-datepicker__week-number")) { 7708 shouldFocusWeekNumber = true; 7709 } 7710 } 7711 shouldFocusWeekNumber && _this.weekNumberEl.current && _this.weekNumberEl.current.focus({ preventScroll: true }); 7712 }; 7713 return _this; 7714 } 7715 Object.defineProperty(WeekNumber2, "defaultProps", { 7716 get: function() { 7717 return { 7718 ariaLabelPrefix: "week " 7719 }; 7720 }, 7721 enumerable: false, 7722 configurable: true 7723 }); 7724 WeekNumber2.prototype.componentDidMount = function() { 7725 this.handleFocusWeekNumber(); 7726 }; 7727 WeekNumber2.prototype.componentDidUpdate = function(prevProps) { 7728 this.handleFocusWeekNumber(prevProps); 7729 }; 7730 WeekNumber2.prototype.render = function() { 7731 var _a2 = this.props, weekNumber = _a2.weekNumber, isWeekDisabled = _a2.isWeekDisabled, _b = _a2.ariaLabelPrefix, ariaLabelPrefix = _b === void 0 ? WeekNumber2.defaultProps.ariaLabelPrefix : _b, onClick = _a2.onClick; 7732 var weekNumberClasses = { 7733 "react-datepicker__week-number": true, 7734 "react-datepicker__week-number--clickable": !!onClick && !isWeekDisabled, 7735 "react-datepicker__week-number--selected": !!onClick && isSameDay2(this.props.date, this.props.selected) 7736 }; 7737 return import_react3.default.createElement("div", { ref: this.weekNumberEl, className: clsx(weekNumberClasses), "aria-label": "".concat(ariaLabelPrefix, " ").concat(this.props.weekNumber), onClick: this.handleClick, onKeyDown: this.handleOnKeyDown, tabIndex: this.getTabIndex() }, weekNumber); 7738 }; 7739 return WeekNumber2; 7740 }(import_react3.Component) 7741); 7742var Week = ( 7743 /** @class */ 7744 function(_super) { 7745 __extends(Week2, _super); 7746 function Week2() { 7747 var _this = _super !== null && _super.apply(this, arguments) || this; 7748 _this.isDisabled = function(day) { 7749 return isDayDisabled(day, { 7750 minDate: _this.props.minDate, 7751 maxDate: _this.props.maxDate, 7752 excludeDates: _this.props.excludeDates, 7753 excludeDateIntervals: _this.props.excludeDateIntervals, 7754 includeDateIntervals: _this.props.includeDateIntervals, 7755 includeDates: _this.props.includeDates, 7756 filterDate: _this.props.filterDate 7757 }); 7758 }; 7759 _this.handleDayClick = function(day, event) { 7760 if (_this.props.onDayClick) { 7761 _this.props.onDayClick(day, event); 7762 } 7763 }; 7764 _this.handleDayMouseEnter = function(day) { 7765 if (_this.props.onDayMouseEnter) { 7766 _this.props.onDayMouseEnter(day); 7767 } 7768 }; 7769 _this.handleWeekClick = function(day, weekNumber, event) { 7770 var _a2, _b, _c; 7771 var enabledWeekDay = new Date(day); 7772 for (var i = 0; i < 7; i++) { 7773 var processingDay = new Date(day); 7774 processingDay.setDate(processingDay.getDate() + i); 7775 var isEnabled = !_this.isDisabled(processingDay); 7776 if (isEnabled) { 7777 enabledWeekDay = processingDay; 7778 break; 7779 } 7780 } 7781 if (typeof _this.props.onWeekSelect === "function") { 7782 _this.props.onWeekSelect(enabledWeekDay, weekNumber, event); 7783 } 7784 if (_this.props.showWeekPicker) { 7785 _this.handleDayClick(enabledWeekDay, event); 7786 } 7787 if ((_a2 = _this.props.shouldCloseOnSelect) !== null && _a2 !== void 0 ? _a2 : Week2.defaultProps.shouldCloseOnSelect) { 7788 (_c = (_b = _this.props).setOpen) === null || _c === void 0 ? void 0 : _c.call(_b, false); 7789 } 7790 }; 7791 _this.formatWeekNumber = function(date) { 7792 if (_this.props.formatWeekNumber) { 7793 return _this.props.formatWeekNumber(date); 7794 } 7795 return getWeek2(date); 7796 }; 7797 _this.isWeekDisabled = function() { 7798 var startOfWeek2 = _this.startOfWeek(); 7799 var endOfWeek2 = addDays(startOfWeek2, 6); 7800 var processingDate = new Date(startOfWeek2); 7801 while (processingDate <= endOfWeek2) { 7802 if (!_this.isDisabled(processingDate)) 7803 return false; 7804 processingDate = addDays(processingDate, 1); 7805 } 7806 return true; 7807 }; 7808 _this.renderDays = function() { 7809 var startOfWeek2 = _this.startOfWeek(); 7810 var days = []; 7811 var weekNumber = _this.formatWeekNumber(startOfWeek2); 7812 if (_this.props.showWeekNumber) { 7813 var onClickAction = _this.props.onWeekSelect || _this.props.showWeekPicker ? _this.handleWeekClick.bind(_this, startOfWeek2, weekNumber) : void 0; 7814 days.push(import_react3.default.createElement(WeekNumber, _assign({ key: "W" }, Week2.defaultProps, _this.props, { weekNumber, isWeekDisabled: _this.isWeekDisabled(), date: startOfWeek2, onClick: onClickAction }))); 7815 } 7816 return days.concat([0, 1, 2, 3, 4, 5, 6].map(function(offset4) { 7817 var day = addDays(startOfWeek2, offset4); 7818 return import_react3.default.createElement(Day, _assign({}, Week2.defaultProps, _this.props, { ariaLabelPrefixWhenEnabled: _this.props.chooseDayAriaLabelPrefix, ariaLabelPrefixWhenDisabled: _this.props.disabledDayAriaLabelPrefix, key: day.valueOf(), day, onClick: _this.handleDayClick.bind(_this, day), onMouseEnter: _this.handleDayMouseEnter.bind(_this, day) })); 7819 })); 7820 }; 7821 _this.startOfWeek = function() { 7822 return getStartOfWeek(_this.props.day, _this.props.locale, _this.props.calendarStartDay); 7823 }; 7824 _this.isKeyboardSelected = function() { 7825 return !_this.props.disabledKeyboardNavigation && !isSameDay2(_this.startOfWeek(), _this.props.selected) && isSameDay2(_this.startOfWeek(), _this.props.preSelection); 7826 }; 7827 return _this; 7828 } 7829 Object.defineProperty(Week2, "defaultProps", { 7830 get: function() { 7831 return { 7832 shouldCloseOnSelect: true 7833 }; 7834 }, 7835 enumerable: false, 7836 configurable: true 7837 }); 7838 Week2.prototype.render = function() { 7839 var weekNumberClasses = { 7840 "react-datepicker__week": true, 7841 "react-datepicker__week--selected": isSameDay2(this.startOfWeek(), this.props.selected), 7842 "react-datepicker__week--keyboard-selected": this.isKeyboardSelected() 7843 }; 7844 return import_react3.default.createElement("div", { className: clsx(weekNumberClasses) }, this.renderDays()); 7845 }; 7846 return Week2; 7847 }(import_react3.Component) 7848); 7849var _a; 7850var FIXED_HEIGHT_STANDARD_WEEK_COUNT = 6; 7851var MONTH_COLUMNS_LAYOUT = { 7852 TWO_COLUMNS: "two_columns", 7853 THREE_COLUMNS: "three_columns", 7854 FOUR_COLUMNS: "four_columns" 7855}; 7856var MONTH_COLUMNS = (_a = {}, _a[MONTH_COLUMNS_LAYOUT.TWO_COLUMNS] = { 7857 grid: [ 7858 [0, 1], 7859 [2, 3], 7860 [4, 5], 7861 [6, 7], 7862 [8, 9], 7863 [10, 11] 7864 ], 7865 verticalNavigationOffset: 2 7866}, _a[MONTH_COLUMNS_LAYOUT.THREE_COLUMNS] = { 7867 grid: [ 7868 [0, 1, 2], 7869 [3, 4, 5], 7870 [6, 7, 8], 7871 [9, 10, 11] 7872 ], 7873 verticalNavigationOffset: 3 7874}, _a[MONTH_COLUMNS_LAYOUT.FOUR_COLUMNS] = { 7875 grid: [ 7876 [0, 1, 2, 3], 7877 [4, 5, 6, 7], 7878 [8, 9, 10, 11] 7879 ], 7880 verticalNavigationOffset: 4 7881}, _a); 7882var MONTH_NAVIGATION_HORIZONTAL_OFFSET = 1; 7883function getMonthColumnsLayout(showFourColumnMonthYearPicker, showTwoColumnMonthYearPicker) { 7884 if (showFourColumnMonthYearPicker) { 7885 return MONTH_COLUMNS_LAYOUT.FOUR_COLUMNS; 7886 } 7887 if (showTwoColumnMonthYearPicker) { 7888 return MONTH_COLUMNS_LAYOUT.TWO_COLUMNS; 7889 } 7890 return MONTH_COLUMNS_LAYOUT.THREE_COLUMNS; 7891} 7892var Month = ( 7893 /** @class */ 7894 function(_super) { 7895 __extends(Month2, _super); 7896 function Month2() { 7897 var _this = _super !== null && _super.apply(this, arguments) || this; 7898 _this.MONTH_REFS = __spreadArray([], Array(12), true).map(function() { 7899 return (0, import_react3.createRef)(); 7900 }); 7901 _this.QUARTER_REFS = __spreadArray([], Array(4), true).map(function() { 7902 return (0, import_react3.createRef)(); 7903 }); 7904 _this.isDisabled = function(day) { 7905 return isDayDisabled(day, { 7906 minDate: _this.props.minDate, 7907 maxDate: _this.props.maxDate, 7908 excludeDates: _this.props.excludeDates, 7909 excludeDateIntervals: _this.props.excludeDateIntervals, 7910 includeDateIntervals: _this.props.includeDateIntervals, 7911 includeDates: _this.props.includeDates, 7912 filterDate: _this.props.filterDate 7913 }); 7914 }; 7915 _this.isExcluded = function(day) { 7916 return isDayExcluded(day, { 7917 excludeDates: _this.props.excludeDates, 7918 excludeDateIntervals: _this.props.excludeDateIntervals 7919 }); 7920 }; 7921 _this.handleDayClick = function(day, event) { 7922 var _a2, _b; 7923 (_b = (_a2 = _this.props).onDayClick) === null || _b === void 0 ? void 0 : _b.call(_a2, day, event, _this.props.orderInDisplay); 7924 }; 7925 _this.handleDayMouseEnter = function(day) { 7926 var _a2, _b; 7927 (_b = (_a2 = _this.props).onDayMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a2, day); 7928 }; 7929 _this.handleMouseLeave = function() { 7930 var _a2, _b; 7931 (_b = (_a2 = _this.props).onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a2); 7932 }; 7933 _this.isRangeStartMonth = function(m) { 7934 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7935 if (!startDate || !endDate) { 7936 return false; 7937 } 7938 return isSameMonth2(setMonth(day, m), startDate); 7939 }; 7940 _this.isRangeStartQuarter = function(q) { 7941 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7942 if (!startDate || !endDate) { 7943 return false; 7944 } 7945 return isSameQuarter2(setQuarter(day, q), startDate); 7946 }; 7947 _this.isRangeEndMonth = function(m) { 7948 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7949 if (!startDate || !endDate) { 7950 return false; 7951 } 7952 return isSameMonth2(setMonth(day, m), endDate); 7953 }; 7954 _this.isRangeEndQuarter = function(q) { 7955 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate; 7956 if (!startDate || !endDate) { 7957 return false; 7958 } 7959 return isSameQuarter2(setQuarter(day, q), endDate); 7960 }; 7961 _this.isInSelectingRangeMonth = function(m) { 7962 var _a2; 7963 var _b = _this.props, day = _b.day, selectsStart = _b.selectsStart, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate; 7964 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 7965 if (!(selectsStart || selectsEnd || selectsRange) || !selectingDate) { 7966 return false; 7967 } 7968 if (selectsStart && endDate) { 7969 return isMonthInRange(selectingDate, endDate, m, day); 7970 } 7971 if (selectsEnd && startDate) { 7972 return isMonthInRange(startDate, selectingDate, m, day); 7973 } 7974 if (selectsRange && startDate && !endDate) { 7975 return isMonthInRange(startDate, selectingDate, m, day); 7976 } 7977 return false; 7978 }; 7979 _this.isSelectingMonthRangeStart = function(m) { 7980 var _a2; 7981 if (!_this.isInSelectingRangeMonth(m)) { 7982 return false; 7983 } 7984 var _b = _this.props, day = _b.day, startDate = _b.startDate, selectsStart = _b.selectsStart; 7985 var _month = setMonth(day, m); 7986 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 7987 if (selectsStart) { 7988 return isSameMonth2(_month, selectingDate); 7989 } else { 7990 return isSameMonth2(_month, startDate); 7991 } 7992 }; 7993 _this.isSelectingMonthRangeEnd = function(m) { 7994 var _a2; 7995 if (!_this.isInSelectingRangeMonth(m)) { 7996 return false; 7997 } 7998 var _b = _this.props, day = _b.day, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange; 7999 var _month = setMonth(day, m); 8000 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 8001 if (selectsEnd || selectsRange) { 8002 return isSameMonth2(_month, selectingDate); 8003 } else { 8004 return isSameMonth2(_month, endDate); 8005 } 8006 }; 8007 _this.isInSelectingRangeQuarter = function(q) { 8008 var _a2; 8009 var _b = _this.props, day = _b.day, selectsStart = _b.selectsStart, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange, startDate = _b.startDate, endDate = _b.endDate; 8010 var selectingDate = (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 8011 if (!(selectsStart || selectsEnd || selectsRange) || !selectingDate) { 8012 return false; 8013 } 8014 if (selectsStart && endDate) { 8015 return isQuarterInRange(selectingDate, endDate, q, day); 8016 } 8017 if (selectsEnd && startDate) { 8018 return isQuarterInRange(startDate, selectingDate, q, day); 8019 } 8020 if (selectsRange && startDate && !endDate) { 8021 return isQuarterInRange(startDate, selectingDate, q, day); 8022 } 8023 return false; 8024 }; 8025 _this.isWeekInMonth = function(startOfWeek2) { 8026 var day = _this.props.day; 8027 var endOfWeek2 = addDays(startOfWeek2, 6); 8028 return isSameMonth2(startOfWeek2, day) || isSameMonth2(endOfWeek2, day); 8029 }; 8030 _this.isCurrentMonth = function(day, m) { 8031 return getYear(day) === getYear(newDate()) && m === getMonth(newDate()); 8032 }; 8033 _this.isCurrentQuarter = function(day, q) { 8034 return getYear(day) === getYear(newDate()) && q === getQuarter(newDate()); 8035 }; 8036 _this.isSelectedMonth = function(day, m, selected) { 8037 return getMonth(selected) === m && getYear(day) === getYear(selected); 8038 }; 8039 _this.isSelectMonthInList = function(day, m, selectedDates) { 8040 return selectedDates.some(function(selectedDate) { 8041 return _this.isSelectedMonth(day, m, selectedDate); 8042 }); 8043 }; 8044 _this.isSelectedQuarter = function(day, q, selected) { 8045 return getQuarter(day) === q && getYear(day) === getYear(selected); 8046 }; 8047 _this.renderWeeks = function() { 8048 var weeks = []; 8049 var isFixedHeight = _this.props.fixedHeight; 8050 var i = 0; 8051 var breakAfterNextPush = false; 8052 var currentWeekStart = getStartOfWeek(getStartOfMonth(_this.props.day), _this.props.locale, _this.props.calendarStartDay); 8053 var isPreSelected = function(preSelection2) { 8054 return _this.props.showWeekPicker ? getStartOfWeek(preSelection2, _this.props.locale, _this.props.calendarStartDay) : _this.props.preSelection; 8055 }; 8056 var isSelected = function(selected2) { 8057 return _this.props.showWeekPicker ? getStartOfWeek(selected2, _this.props.locale, _this.props.calendarStartDay) : _this.props.selected; 8058 }; 8059 var selected = _this.props.selected ? isSelected(_this.props.selected) : void 0; 8060 var preSelection = _this.props.preSelection ? isPreSelected(_this.props.preSelection) : void 0; 8061 while (true) { 8062 weeks.push(import_react3.default.createElement(Week, _assign({}, _this.props, { ariaLabelPrefix: _this.props.weekAriaLabelPrefix, key: i, day: currentWeekStart, month: getMonth(_this.props.day), onDayClick: _this.handleDayClick, onDayMouseEnter: _this.handleDayMouseEnter, selected, preSelection, showWeekNumber: _this.props.showWeekNumbers }))); 8063 if (breakAfterNextPush) 8064 break; 8065 i++; 8066 currentWeekStart = addWeeks(currentWeekStart, 1); 8067 var isFixedAndFinalWeek = isFixedHeight && i >= FIXED_HEIGHT_STANDARD_WEEK_COUNT; 8068 var isNonFixedAndOutOfMonth = !isFixedHeight && !_this.isWeekInMonth(currentWeekStart); 8069 if (isFixedAndFinalWeek || isNonFixedAndOutOfMonth) { 8070 if (_this.props.peekNextMonth) { 8071 breakAfterNextPush = true; 8072 } else { 8073 break; 8074 } 8075 } 8076 } 8077 return weeks; 8078 }; 8079 _this.onMonthClick = function(event, m) { 8080 var _a2 = _this.isMonthDisabledForLabelDate(m), isDisabled2 = _a2.isDisabled, labelDate = _a2.labelDate; 8081 if (isDisabled2) { 8082 return; 8083 } 8084 _this.handleDayClick(getStartOfMonth(labelDate), event); 8085 }; 8086 _this.onMonthMouseEnter = function(m) { 8087 var _a2 = _this.isMonthDisabledForLabelDate(m), isDisabled2 = _a2.isDisabled, labelDate = _a2.labelDate; 8088 if (isDisabled2) { 8089 return; 8090 } 8091 _this.handleDayMouseEnter(getStartOfMonth(labelDate)); 8092 }; 8093 _this.handleMonthNavigation = function(newMonth, newDate2) { 8094 var _a2, _b, _c, _d; 8095 (_b = (_a2 = _this.props).setPreSelection) === null || _b === void 0 ? void 0 : _b.call(_a2, newDate2); 8096 (_d = (_c = _this.MONTH_REFS[newMonth]) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.focus(); 8097 }; 8098 _this.handleKeyboardNavigation = function(event, eventKey, month) { 8099 var _a2; 8100 var _b = _this.props, selected = _b.selected, preSelection = _b.preSelection, setPreSelection = _b.setPreSelection, minDate = _b.minDate, maxDate = _b.maxDate, showFourColumnMonthYearPicker = _b.showFourColumnMonthYearPicker, showTwoColumnMonthYearPicker = _b.showTwoColumnMonthYearPicker; 8101 if (!preSelection) 8102 return; 8103 var monthColumnsLayout = getMonthColumnsLayout(showFourColumnMonthYearPicker, showTwoColumnMonthYearPicker); 8104 var verticalOffset = _this.getVerticalOffset(monthColumnsLayout); 8105 var monthsGrid = (_a2 = MONTH_COLUMNS[monthColumnsLayout]) === null || _a2 === void 0 ? void 0 : _a2.grid; 8106 var calculateNewDateAndMonth = function(eventKey2, date, month2) { 8107 var _a3, _b2; 8108 var newCalculatedDate2 = date; 8109 var newCalculatedMonth2 = month2; 8110 switch (eventKey2) { 8111 case KeyType.ArrowRight: 8112 newCalculatedDate2 = addMonths(date, MONTH_NAVIGATION_HORIZONTAL_OFFSET); 8113 newCalculatedMonth2 = month2 === 11 ? 0 : month2 + MONTH_NAVIGATION_HORIZONTAL_OFFSET; 8114 break; 8115 case KeyType.ArrowLeft: 8116 newCalculatedDate2 = subMonths(date, MONTH_NAVIGATION_HORIZONTAL_OFFSET); 8117 newCalculatedMonth2 = month2 === 0 ? 11 : month2 - MONTH_NAVIGATION_HORIZONTAL_OFFSET; 8118 break; 8119 case KeyType.ArrowUp: 8120 newCalculatedDate2 = subMonths(date, verticalOffset); 8121 newCalculatedMonth2 = ((_a3 = monthsGrid === null || monthsGrid === void 0 ? void 0 : monthsGrid[0]) === null || _a3 === void 0 ? void 0 : _a3.includes(month2)) ? month2 + 12 - verticalOffset : month2 - verticalOffset; 8122 break; 8123 case KeyType.ArrowDown: 8124 newCalculatedDate2 = addMonths(date, verticalOffset); 8125 newCalculatedMonth2 = ((_b2 = monthsGrid === null || monthsGrid === void 0 ? void 0 : monthsGrid[monthsGrid.length - 1]) === null || _b2 === void 0 ? void 0 : _b2.includes(month2)) ? month2 - 12 + verticalOffset : month2 + verticalOffset; 8126 break; 8127 } 8128 return { newCalculatedDate: newCalculatedDate2, newCalculatedMonth: newCalculatedMonth2 }; 8129 }; 8130 var getNewDateAndMonth = function(eventKey2, selectedDate, month2) { 8131 var MAX_ITERATIONS = 40; 8132 var eventKeyCopy = eventKey2; 8133 var validDateFound = false; 8134 var iterations = 0; 8135 var _a3 = calculateNewDateAndMonth(eventKeyCopy, selectedDate, month2), newCalculatedDate2 = _a3.newCalculatedDate, newCalculatedMonth2 = _a3.newCalculatedMonth; 8136 while (!validDateFound) { 8137 if (iterations >= MAX_ITERATIONS) { 8138 newCalculatedDate2 = selectedDate; 8139 newCalculatedMonth2 = month2; 8140 break; 8141 } 8142 if (minDate && newCalculatedDate2 < minDate) { 8143 eventKeyCopy = KeyType.ArrowRight; 8144 var obj = calculateNewDateAndMonth(eventKeyCopy, newCalculatedDate2, newCalculatedMonth2); 8145 newCalculatedDate2 = obj.newCalculatedDate; 8146 newCalculatedMonth2 = obj.newCalculatedMonth; 8147 } 8148 if (maxDate && newCalculatedDate2 > maxDate) { 8149 eventKeyCopy = KeyType.ArrowLeft; 8150 var obj = calculateNewDateAndMonth(eventKeyCopy, newCalculatedDate2, newCalculatedMonth2); 8151 newCalculatedDate2 = obj.newCalculatedDate; 8152 newCalculatedMonth2 = obj.newCalculatedMonth; 8153 } 8154 if (isMonthYearDisabled(newCalculatedDate2, _this.props)) { 8155 var obj = calculateNewDateAndMonth(eventKeyCopy, newCalculatedDate2, newCalculatedMonth2); 8156 newCalculatedDate2 = obj.newCalculatedDate; 8157 newCalculatedMonth2 = obj.newCalculatedMonth; 8158 } else { 8159 validDateFound = true; 8160 } 8161 iterations++; 8162 } 8163 return { newCalculatedDate: newCalculatedDate2, newCalculatedMonth: newCalculatedMonth2 }; 8164 }; 8165 if (eventKey === KeyType.Enter) { 8166 if (!_this.isMonthDisabled(month)) { 8167 _this.onMonthClick(event, month); 8168 setPreSelection === null || setPreSelection === void 0 ? void 0 : setPreSelection(selected); 8169 } 8170 return; 8171 } 8172 var _c = getNewDateAndMonth(eventKey, preSelection, month), newCalculatedDate = _c.newCalculatedDate, newCalculatedMonth = _c.newCalculatedMonth; 8173 switch (eventKey) { 8174 case KeyType.ArrowRight: 8175 case KeyType.ArrowLeft: 8176 case KeyType.ArrowUp: 8177 case KeyType.ArrowDown: 8178 _this.handleMonthNavigation(newCalculatedMonth, newCalculatedDate); 8179 break; 8180 } 8181 }; 8182 _this.getVerticalOffset = function(monthColumnsLayout) { 8183 var _a2, _b; 8184 return (_b = (_a2 = MONTH_COLUMNS[monthColumnsLayout]) === null || _a2 === void 0 ? void 0 : _a2.verticalNavigationOffset) !== null && _b !== void 0 ? _b : 0; 8185 }; 8186 _this.onMonthKeyDown = function(event, month) { 8187 var _a2 = _this.props, disabledKeyboardNavigation = _a2.disabledKeyboardNavigation, handleOnMonthKeyDown = _a2.handleOnMonthKeyDown; 8188 var eventKey = event.key; 8189 if (eventKey !== KeyType.Tab) { 8190 event.preventDefault(); 8191 } 8192 if (!disabledKeyboardNavigation) { 8193 _this.handleKeyboardNavigation(event, eventKey, month); 8194 } 8195 handleOnMonthKeyDown && handleOnMonthKeyDown(event); 8196 }; 8197 _this.onQuarterClick = function(event, q) { 8198 var labelDate = setQuarter(_this.props.day, q); 8199 if (isQuarterDisabled(labelDate, _this.props)) { 8200 return; 8201 } 8202 _this.handleDayClick(getStartOfQuarter(labelDate), event); 8203 }; 8204 _this.onQuarterMouseEnter = function(q) { 8205 var labelDate = setQuarter(_this.props.day, q); 8206 if (isQuarterDisabled(labelDate, _this.props)) { 8207 return; 8208 } 8209 _this.handleDayMouseEnter(getStartOfQuarter(labelDate)); 8210 }; 8211 _this.handleQuarterNavigation = function(newQuarter, newDate2) { 8212 var _a2, _b, _c, _d; 8213 if (_this.isDisabled(newDate2) || _this.isExcluded(newDate2)) { 8214 return; 8215 } 8216 (_b = (_a2 = _this.props).setPreSelection) === null || _b === void 0 ? void 0 : _b.call(_a2, newDate2); 8217 (_d = (_c = _this.QUARTER_REFS[newQuarter - 1]) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.focus(); 8218 }; 8219 _this.onQuarterKeyDown = function(event, quarter) { 8220 var _a2, _b; 8221 var eventKey = event.key; 8222 if (!_this.props.disabledKeyboardNavigation) { 8223 switch (eventKey) { 8224 case KeyType.Enter: 8225 _this.onQuarterClick(event, quarter); 8226 (_b = (_a2 = _this.props).setPreSelection) === null || _b === void 0 ? void 0 : _b.call(_a2, _this.props.selected); 8227 break; 8228 case KeyType.ArrowRight: 8229 if (!_this.props.preSelection) { 8230 break; 8231 } 8232 _this.handleQuarterNavigation(quarter === 4 ? 1 : quarter + 1, addQuarters(_this.props.preSelection, 1)); 8233 break; 8234 case KeyType.ArrowLeft: 8235 if (!_this.props.preSelection) { 8236 break; 8237 } 8238 _this.handleQuarterNavigation(quarter === 1 ? 4 : quarter - 1, subQuarters(_this.props.preSelection, 1)); 8239 break; 8240 } 8241 } 8242 }; 8243 _this.isMonthDisabledForLabelDate = function(month) { 8244 var _a2; 8245 var _b = _this.props, day = _b.day, minDate = _b.minDate, maxDate = _b.maxDate, excludeDates = _b.excludeDates, includeDates = _b.includeDates; 8246 var labelDate = setMonth(day, month); 8247 return { 8248 isDisabled: (_a2 = (minDate || maxDate || excludeDates || includeDates) && isMonthDisabled(labelDate, _this.props)) !== null && _a2 !== void 0 ? _a2 : false, 8249 labelDate 8250 }; 8251 }; 8252 _this.isMonthDisabled = function(month) { 8253 var isDisabled2 = _this.isMonthDisabledForLabelDate(month).isDisabled; 8254 return isDisabled2; 8255 }; 8256 _this.getMonthClassNames = function(m) { 8257 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate, preSelection = _a2.preSelection, monthClassName = _a2.monthClassName; 8258 var _monthClassName = monthClassName ? monthClassName(setMonth(day, m)) : void 0; 8259 var selection = _this.getSelection(); 8260 return clsx("react-datepicker__month-text", "react-datepicker__month-".concat(m), _monthClassName, { 8261 "react-datepicker__month-text--disabled": _this.isMonthDisabled(m), 8262 "react-datepicker__month-text--selected": selection ? _this.isSelectMonthInList(day, m, selection) : void 0, 8263 "react-datepicker__month-text--keyboard-selected": !_this.props.disabledKeyboardNavigation && preSelection && _this.isSelectedMonth(day, m, preSelection) && !_this.isMonthDisabled(m), 8264 "react-datepicker__month-text--in-selecting-range": _this.isInSelectingRangeMonth(m), 8265 "react-datepicker__month-text--in-range": startDate && endDate ? isMonthInRange(startDate, endDate, m, day) : void 0, 8266 "react-datepicker__month-text--range-start": _this.isRangeStartMonth(m), 8267 "react-datepicker__month-text--range-end": _this.isRangeEndMonth(m), 8268 "react-datepicker__month-text--selecting-range-start": _this.isSelectingMonthRangeStart(m), 8269 "react-datepicker__month-text--selecting-range-end": _this.isSelectingMonthRangeEnd(m), 8270 "react-datepicker__month-text--today": _this.isCurrentMonth(day, m) 8271 }); 8272 }; 8273 _this.getTabIndex = function(m) { 8274 if (_this.props.preSelection == null) { 8275 return "-1"; 8276 } 8277 var preSelectedMonth = getMonth(_this.props.preSelection); 8278 var isPreSelectedMonthDisabled = _this.isMonthDisabledForLabelDate(preSelectedMonth).isDisabled; 8279 var tabIndex = m === preSelectedMonth && !(isPreSelectedMonthDisabled || _this.props.disabledKeyboardNavigation) ? "0" : "-1"; 8280 return tabIndex; 8281 }; 8282 _this.getQuarterTabIndex = function(q) { 8283 if (_this.props.preSelection == null) { 8284 return "-1"; 8285 } 8286 var preSelectedQuarter = getQuarter(_this.props.preSelection); 8287 var isCurrentQuarterDisabled = isQuarterDisabled(_this.props.day, _this.props); 8288 var tabIndex = q === preSelectedQuarter && !(isCurrentQuarterDisabled || _this.props.disabledKeyboardNavigation) ? "0" : "-1"; 8289 return tabIndex; 8290 }; 8291 _this.getAriaLabel = function(month) { 8292 var _a2 = _this.props, _b = _a2.chooseDayAriaLabelPrefix, chooseDayAriaLabelPrefix = _b === void 0 ? "Choose" : _b, _c = _a2.disabledDayAriaLabelPrefix, disabledDayAriaLabelPrefix = _c === void 0 ? "Not available" : _c, day = _a2.day, locale = _a2.locale; 8293 var labelDate = setMonth(day, month); 8294 var prefix = _this.isDisabled(labelDate) || _this.isExcluded(labelDate) ? disabledDayAriaLabelPrefix : chooseDayAriaLabelPrefix; 8295 return "".concat(prefix, " ").concat(formatDate(labelDate, "MMMM yyyy", locale)); 8296 }; 8297 _this.getQuarterClassNames = function(q) { 8298 var _a2 = _this.props, day = _a2.day, startDate = _a2.startDate, endDate = _a2.endDate, selected = _a2.selected, minDate = _a2.minDate, maxDate = _a2.maxDate, excludeDates = _a2.excludeDates, includeDates = _a2.includeDates, filterDate = _a2.filterDate, preSelection = _a2.preSelection, disabledKeyboardNavigation = _a2.disabledKeyboardNavigation; 8299 var isDisabled2 = (minDate || maxDate || excludeDates || includeDates || filterDate) && isQuarterDisabled(setQuarter(day, q), _this.props); 8300 return clsx("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(q), { 8301 "react-datepicker__quarter-text--disabled": isDisabled2, 8302 "react-datepicker__quarter-text--selected": selected ? _this.isSelectedQuarter(day, q, selected) : void 0, 8303 "react-datepicker__quarter-text--keyboard-selected": !disabledKeyboardNavigation && preSelection && _this.isSelectedQuarter(day, q, preSelection) && !isDisabled2, 8304 "react-datepicker__quarter-text--in-selecting-range": _this.isInSelectingRangeQuarter(q), 8305 "react-datepicker__quarter-text--in-range": startDate && endDate ? isQuarterInRange(startDate, endDate, q, day) : void 0, 8306 "react-datepicker__quarter-text--range-start": _this.isRangeStartQuarter(q), 8307 "react-datepicker__quarter-text--range-end": _this.isRangeEndQuarter(q), 8308 "react-datepicker__quarter-text--today": _this.isCurrentQuarter(day, q) 8309 }); 8310 }; 8311 _this.getMonthContent = function(m) { 8312 var _a2 = _this.props, showFullMonthYearPicker = _a2.showFullMonthYearPicker, renderMonthContent = _a2.renderMonthContent, locale = _a2.locale, day = _a2.day; 8313 var shortMonthText = getMonthShortInLocale(m, locale); 8314 var fullMonthText = getMonthInLocale(m, locale); 8315 if (renderMonthContent) { 8316 return renderMonthContent(m, shortMonthText, fullMonthText, day); 8317 } 8318 return showFullMonthYearPicker ? fullMonthText : shortMonthText; 8319 }; 8320 _this.getQuarterContent = function(q) { 8321 var _a2; 8322 var _b = _this.props, renderQuarterContent = _b.renderQuarterContent, locale = _b.locale; 8323 var shortQuarter = getQuarterShortInLocale(q, locale); 8324 return (_a2 = renderQuarterContent === null || renderQuarterContent === void 0 ? void 0 : renderQuarterContent(q, shortQuarter)) !== null && _a2 !== void 0 ? _a2 : shortQuarter; 8325 }; 8326 _this.renderMonths = function() { 8327 var _a2; 8328 var _b = _this.props, showTwoColumnMonthYearPicker = _b.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker = _b.showFourColumnMonthYearPicker, day = _b.day, selected = _b.selected; 8329 var monthColumns = (_a2 = MONTH_COLUMNS[getMonthColumnsLayout(showFourColumnMonthYearPicker, showTwoColumnMonthYearPicker)]) === null || _a2 === void 0 ? void 0 : _a2.grid; 8330 return monthColumns === null || monthColumns === void 0 ? void 0 : monthColumns.map(function(month, i) { 8331 return import_react3.default.createElement("div", { className: "react-datepicker__month-wrapper", key: i }, month.map(function(m, j) { 8332 return import_react3.default.createElement("div", { ref: _this.MONTH_REFS[m], key: j, onClick: function(event) { 8333 _this.onMonthClick(event, m); 8334 }, onKeyDown: function(event) { 8335 if (isSpaceKeyDown(event)) { 8336 event.preventDefault(); 8337 event.key = KeyType.Enter; 8338 } 8339 _this.onMonthKeyDown(event, m); 8340 }, onMouseEnter: !_this.props.usePointerEvent ? function() { 8341 return _this.onMonthMouseEnter(m); 8342 } : void 0, onPointerEnter: _this.props.usePointerEvent ? function() { 8343 return _this.onMonthMouseEnter(m); 8344 } : void 0, tabIndex: Number(_this.getTabIndex(m)), className: _this.getMonthClassNames(m), "aria-disabled": _this.isMonthDisabled(m), role: "option", "aria-label": _this.getAriaLabel(m), "aria-current": _this.isCurrentMonth(day, m) ? "date" : void 0, "aria-selected": selected ? _this.isSelectedMonth(day, m, selected) : void 0 }, _this.getMonthContent(m)); 8345 })); 8346 }); 8347 }; 8348 _this.renderQuarters = function() { 8349 var _a2 = _this.props, day = _a2.day, selected = _a2.selected; 8350 var quarters = [1, 2, 3, 4]; 8351 return import_react3.default.createElement("div", { className: "react-datepicker__quarter-wrapper" }, quarters.map(function(q, j) { 8352 return import_react3.default.createElement("div", { key: j, ref: _this.QUARTER_REFS[j], role: "option", onClick: function(event) { 8353 _this.onQuarterClick(event, q); 8354 }, onKeyDown: function(event) { 8355 _this.onQuarterKeyDown(event, q); 8356 }, onMouseEnter: !_this.props.usePointerEvent ? function() { 8357 return _this.onQuarterMouseEnter(q); 8358 } : void 0, onPointerEnter: _this.props.usePointerEvent ? function() { 8359 return _this.onQuarterMouseEnter(q); 8360 } : void 0, className: _this.getQuarterClassNames(q), "aria-selected": selected ? _this.isSelectedQuarter(day, q, selected) : void 0, tabIndex: Number(_this.getQuarterTabIndex(q)), "aria-current": _this.isCurrentQuarter(day, q) ? "date" : void 0 }, _this.getQuarterContent(q)); 8361 })); 8362 }; 8363 _this.getClassNames = function() { 8364 var _a2 = _this.props, selectingDate = _a2.selectingDate, selectsStart = _a2.selectsStart, selectsEnd = _a2.selectsEnd, showMonthYearPicker = _a2.showMonthYearPicker, showQuarterYearPicker = _a2.showQuarterYearPicker, showWeekPicker = _a2.showWeekPicker; 8365 return clsx("react-datepicker__month", { 8366 "react-datepicker__month--selecting-range": selectingDate && (selectsStart || selectsEnd) 8367 }, { "react-datepicker__monthPicker": showMonthYearPicker }, { "react-datepicker__quarterPicker": showQuarterYearPicker }, { "react-datepicker__weekPicker": showWeekPicker }); 8368 }; 8369 return _this; 8370 } 8371 Month2.prototype.getSelection = function() { 8372 var _a2 = this.props, selected = _a2.selected, selectedDates = _a2.selectedDates, selectsMultiple = _a2.selectsMultiple; 8373 if (selectsMultiple) { 8374 return selectedDates; 8375 } 8376 if (selected) { 8377 return [selected]; 8378 } 8379 return void 0; 8380 }; 8381 Month2.prototype.render = function() { 8382 var _a2 = this.props, showMonthYearPicker = _a2.showMonthYearPicker, showQuarterYearPicker = _a2.showQuarterYearPicker, day = _a2.day, _b = _a2.ariaLabelPrefix, ariaLabelPrefix = _b === void 0 ? "Month " : _b; 8383 var formattedAriaLabelPrefix = ariaLabelPrefix ? ariaLabelPrefix.trim() + " " : ""; 8384 return import_react3.default.createElement("div", { className: this.getClassNames(), onMouseLeave: !this.props.usePointerEvent ? this.handleMouseLeave : void 0, onPointerLeave: this.props.usePointerEvent ? this.handleMouseLeave : void 0, "aria-label": "".concat(formattedAriaLabelPrefix).concat(formatDate(day, "MMMM, yyyy", this.props.locale)), role: "listbox" }, showMonthYearPicker ? this.renderMonths() : showQuarterYearPicker ? this.renderQuarters() : this.renderWeeks()); 8385 }; 8386 return Month2; 8387 }(import_react3.Component) 8388); 8389var MonthDropdownOptions = ( 8390 /** @class */ 8391 function(_super) { 8392 __extends(MonthDropdownOptions2, _super); 8393 function MonthDropdownOptions2() { 8394 var _this = _super !== null && _super.apply(this, arguments) || this; 8395 _this.isSelectedMonth = function(i) { 8396 return _this.props.month === i; 8397 }; 8398 _this.renderOptions = function() { 8399 return _this.props.monthNames.map(function(month, i) { 8400 return import_react3.default.createElement( 8401 "div", 8402 { className: _this.isSelectedMonth(i) ? "react-datepicker__month-option react-datepicker__month-option--selected_month" : "react-datepicker__month-option", key: month, onClick: _this.onChange.bind(_this, i), "aria-selected": _this.isSelectedMonth(i) ? "true" : void 0 }, 8403 _this.isSelectedMonth(i) ? import_react3.default.createElement("span", { className: "react-datepicker__month-option--selected" }, "✓") : "", 8404 month 8405 ); 8406 }); 8407 }; 8408 _this.onChange = function(month) { 8409 return _this.props.onChange(month); 8410 }; 8411 _this.handleClickOutside = function() { 8412 return _this.props.onCancel(); 8413 }; 8414 return _this; 8415 } 8416 MonthDropdownOptions2.prototype.render = function() { 8417 return import_react3.default.createElement(ClickOutsideWrapper, { className: "react-datepicker__month-dropdown", onClickOutside: this.handleClickOutside }, this.renderOptions()); 8418 }; 8419 return MonthDropdownOptions2; 8420 }(import_react3.Component) 8421); 8422var MonthDropdown = ( 8423 /** @class */ 8424 function(_super) { 8425 __extends(MonthDropdown2, _super); 8426 function MonthDropdown2() { 8427 var _this = _super !== null && _super.apply(this, arguments) || this; 8428 _this.state = { 8429 dropdownVisible: false 8430 }; 8431 _this.renderSelectOptions = function(monthNames) { 8432 return monthNames.map(function(m, i) { 8433 return import_react3.default.createElement("option", { key: m, value: i }, m); 8434 }); 8435 }; 8436 _this.renderSelectMode = function(monthNames) { 8437 return import_react3.default.createElement("select", { value: _this.props.month, className: "react-datepicker__month-select", onChange: function(e) { 8438 return _this.onChange(parseInt(e.target.value)); 8439 } }, _this.renderSelectOptions(monthNames)); 8440 }; 8441 _this.renderReadView = function(visible, monthNames) { 8442 return import_react3.default.createElement( 8443 "div", 8444 { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: _this.toggleDropdown }, 8445 import_react3.default.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }), 8446 import_react3.default.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, monthNames[_this.props.month]) 8447 ); 8448 }; 8449 _this.renderDropdown = function(monthNames) { 8450 return import_react3.default.createElement(MonthDropdownOptions, _assign({ key: "dropdown" }, _this.props, { monthNames, onChange: _this.onChange, onCancel: _this.toggleDropdown })); 8451 }; 8452 _this.renderScrollMode = function(monthNames) { 8453 var dropdownVisible = _this.state.dropdownVisible; 8454 var result = [_this.renderReadView(!dropdownVisible, monthNames)]; 8455 if (dropdownVisible) { 8456 result.unshift(_this.renderDropdown(monthNames)); 8457 } 8458 return result; 8459 }; 8460 _this.onChange = function(month) { 8461 _this.toggleDropdown(); 8462 if (month !== _this.props.month) { 8463 _this.props.onChange(month); 8464 } 8465 }; 8466 _this.toggleDropdown = function() { 8467 return _this.setState({ 8468 dropdownVisible: !_this.state.dropdownVisible 8469 }); 8470 }; 8471 return _this; 8472 } 8473 MonthDropdown2.prototype.render = function() { 8474 var _this = this; 8475 var monthNames = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function(m) { 8476 return getMonthShortInLocale(m, _this.props.locale); 8477 } : function(m) { 8478 return getMonthInLocale(m, _this.props.locale); 8479 }); 8480 var renderedDropdown; 8481 switch (this.props.dropdownMode) { 8482 case "scroll": 8483 renderedDropdown = this.renderScrollMode(monthNames); 8484 break; 8485 case "select": 8486 renderedDropdown = this.renderSelectMode(monthNames); 8487 break; 8488 } 8489 return import_react3.default.createElement("div", { className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode) }, renderedDropdown); 8490 }; 8491 return MonthDropdown2; 8492 }(import_react3.Component) 8493); 8494function generateMonthYears(minDate, maxDate) { 8495 var list = []; 8496 var currDate = getStartOfMonth(minDate); 8497 var lastDate = getStartOfMonth(maxDate); 8498 while (!isAfter(currDate, lastDate)) { 8499 list.push(newDate(currDate)); 8500 currDate = addMonths(currDate, 1); 8501 } 8502 return list; 8503} 8504var MonthYearDropdownOptions = ( 8505 /** @class */ 8506 function(_super) { 8507 __extends(MonthYearDropdownOptions2, _super); 8508 function MonthYearDropdownOptions2(props) { 8509 var _this = _super.call(this, props) || this; 8510 _this.renderOptions = function() { 8511 return _this.state.monthYearsList.map(function(monthYear) { 8512 var monthYearPoint = getTime(monthYear); 8513 var isSameMonthYear = isSameYear2(_this.props.date, monthYear) && isSameMonth2(_this.props.date, monthYear); 8514 return import_react3.default.createElement( 8515 "div", 8516 { className: isSameMonthYear ? "react-datepicker__month-year-option--selected_month-year" : "react-datepicker__month-year-option", key: monthYearPoint, onClick: _this.onChange.bind(_this, monthYearPoint), "aria-selected": isSameMonthYear ? "true" : void 0 }, 8517 isSameMonthYear ? import_react3.default.createElement("span", { className: "react-datepicker__month-year-option--selected" }, "✓") : "", 8518 formatDate(monthYear, _this.props.dateFormat, _this.props.locale) 8519 ); 8520 }); 8521 }; 8522 _this.onChange = function(monthYear) { 8523 return _this.props.onChange(monthYear); 8524 }; 8525 _this.handleClickOutside = function() { 8526 _this.props.onCancel(); 8527 }; 8528 _this.state = { 8529 monthYearsList: generateMonthYears(_this.props.minDate, _this.props.maxDate) 8530 }; 8531 return _this; 8532 } 8533 MonthYearDropdownOptions2.prototype.render = function() { 8534 var dropdownClass = clsx({ 8535 "react-datepicker__month-year-dropdown": true, 8536 "react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown 8537 }); 8538 return import_react3.default.createElement(ClickOutsideWrapper, { className: dropdownClass, onClickOutside: this.handleClickOutside }, this.renderOptions()); 8539 }; 8540 return MonthYearDropdownOptions2; 8541 }(import_react3.Component) 8542); 8543var MonthYearDropdown = ( 8544 /** @class */ 8545 function(_super) { 8546 __extends(MonthYearDropdown2, _super); 8547 function MonthYearDropdown2() { 8548 var _this = _super !== null && _super.apply(this, arguments) || this; 8549 _this.state = { 8550 dropdownVisible: false 8551 }; 8552 _this.renderSelectOptions = function() { 8553 var currDate = getStartOfMonth(_this.props.minDate); 8554 var lastDate = getStartOfMonth(_this.props.maxDate); 8555 var options = []; 8556 while (!isAfter(currDate, lastDate)) { 8557 var timePoint = getTime(currDate); 8558 options.push(import_react3.default.createElement("option", { key: timePoint, value: timePoint }, formatDate(currDate, _this.props.dateFormat, _this.props.locale))); 8559 currDate = addMonths(currDate, 1); 8560 } 8561 return options; 8562 }; 8563 _this.onSelectChange = function(event) { 8564 _this.onChange(parseInt(event.target.value)); 8565 }; 8566 _this.renderSelectMode = function() { 8567 return import_react3.default.createElement("select", { value: getTime(getStartOfMonth(_this.props.date)), className: "react-datepicker__month-year-select", onChange: _this.onSelectChange }, _this.renderSelectOptions()); 8568 }; 8569 _this.renderReadView = function(visible) { 8570 var yearMonth = formatDate(_this.props.date, _this.props.dateFormat, _this.props.locale); 8571 return import_react3.default.createElement( 8572 "div", 8573 { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__month-year-read-view", onClick: _this.toggleDropdown }, 8574 import_react3.default.createElement("span", { className: "react-datepicker__month-year-read-view--down-arrow" }), 8575 import_react3.default.createElement("span", { className: "react-datepicker__month-year-read-view--selected-month-year" }, yearMonth) 8576 ); 8577 }; 8578 _this.renderDropdown = function() { 8579 return import_react3.default.createElement(MonthYearDropdownOptions, _assign({ key: "dropdown" }, _this.props, { onChange: _this.onChange, onCancel: _this.toggleDropdown })); 8580 }; 8581 _this.renderScrollMode = function() { 8582 var dropdownVisible = _this.state.dropdownVisible; 8583 var result = [_this.renderReadView(!dropdownVisible)]; 8584 if (dropdownVisible) { 8585 result.unshift(_this.renderDropdown()); 8586 } 8587 return result; 8588 }; 8589 _this.onChange = function(monthYearPoint) { 8590 _this.toggleDropdown(); 8591 var changedDate = newDate(monthYearPoint); 8592 if (isSameYear2(_this.props.date, changedDate) && isSameMonth2(_this.props.date, changedDate)) { 8593 return; 8594 } 8595 _this.props.onChange(changedDate); 8596 }; 8597 _this.toggleDropdown = function() { 8598 return _this.setState({ 8599 dropdownVisible: !_this.state.dropdownVisible 8600 }); 8601 }; 8602 return _this; 8603 } 8604 MonthYearDropdown2.prototype.render = function() { 8605 var renderedDropdown; 8606 switch (this.props.dropdownMode) { 8607 case "scroll": 8608 renderedDropdown = this.renderScrollMode(); 8609 break; 8610 case "select": 8611 renderedDropdown = this.renderSelectMode(); 8612 break; 8613 } 8614 return import_react3.default.createElement("div", { className: "react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode) }, renderedDropdown); 8615 }; 8616 return MonthYearDropdown2; 8617 }(import_react3.Component) 8618); 8619var Time = ( 8620 /** @class */ 8621 function(_super) { 8622 __extends(Time2, _super); 8623 function Time2() { 8624 var _this = _super !== null && _super.apply(this, arguments) || this; 8625 _this.state = { 8626 height: null 8627 }; 8628 _this.scrollToTheSelectedTime = function() { 8629 requestAnimationFrame(function() { 8630 var _a2, _b, _c; 8631 if (!_this.list) 8632 return; 8633 _this.list.scrollTop = (_c = _this.centerLi && Time2.calcCenterPosition(_this.props.monthRef ? _this.props.monthRef.clientHeight - ((_b = (_a2 = _this.header) === null || _a2 === void 0 ? void 0 : _a2.clientHeight) !== null && _b !== void 0 ? _b : 0) : _this.list.clientHeight, _this.centerLi)) !== null && _c !== void 0 ? _c : 0; 8634 }); 8635 }; 8636 _this.handleClick = function(time) { 8637 var _a2, _b; 8638 if ((_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || (_this.props.excludeTimes || _this.props.includeTimes || _this.props.filterTime) && isTimeDisabled(time, _this.props)) { 8639 return; 8640 } 8641 (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, time); 8642 }; 8643 _this.isSelectedTime = function(time) { 8644 return _this.props.selected && isSameMinute2(_this.props.selected, time); 8645 }; 8646 _this.isDisabledTime = function(time) { 8647 return (_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || (_this.props.excludeTimes || _this.props.includeTimes || _this.props.filterTime) && isTimeDisabled(time, _this.props); 8648 }; 8649 _this.liClasses = function(time) { 8650 var _a2; 8651 var classes = [ 8652 "react-datepicker__time-list-item", 8653 _this.props.timeClassName ? _this.props.timeClassName(time) : void 0 8654 ]; 8655 if (_this.isSelectedTime(time)) { 8656 classes.push("react-datepicker__time-list-item--selected"); 8657 } 8658 if (_this.isDisabledTime(time)) { 8659 classes.push("react-datepicker__time-list-item--disabled"); 8660 } 8661 if (_this.props.injectTimes && (getHours(time) * 3600 + getMinutes(time) * 60 + getSeconds(time)) % (((_a2 = _this.props.intervals) !== null && _a2 !== void 0 ? _a2 : Time2.defaultProps.intervals) * 60) !== 0) { 8662 classes.push("react-datepicker__time-list-item--injected"); 8663 } 8664 return classes.join(" "); 8665 }; 8666 _this.handleOnKeyDown = function(event, time) { 8667 var _a2, _b; 8668 if (event.key === KeyType.Space) { 8669 event.preventDefault(); 8670 event.key = KeyType.Enter; 8671 } 8672 if ((event.key === KeyType.ArrowUp || event.key === KeyType.ArrowLeft) && event.target instanceof HTMLElement && event.target.previousSibling) { 8673 event.preventDefault(); 8674 event.target.previousSibling instanceof HTMLElement && event.target.previousSibling.focus(); 8675 } 8676 if ((event.key === KeyType.ArrowDown || event.key === KeyType.ArrowRight) && event.target instanceof HTMLElement && event.target.nextSibling) { 8677 event.preventDefault(); 8678 event.target.nextSibling instanceof HTMLElement && event.target.nextSibling.focus(); 8679 } 8680 if (event.key === KeyType.Enter) { 8681 _this.handleClick(time); 8682 } 8683 (_b = (_a2 = _this.props).handleOnKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 8684 }; 8685 _this.renderTimes = function() { 8686 var _a2; 8687 var times = []; 8688 var format2 = typeof _this.props.format === "string" ? _this.props.format : "p"; 8689 var intervals = (_a2 = _this.props.intervals) !== null && _a2 !== void 0 ? _a2 : Time2.defaultProps.intervals; 8690 var activeDate = _this.props.selected || _this.props.openToDate || newDate(); 8691 var base = getStartOfDay(activeDate); 8692 var sortedInjectTimes = _this.props.injectTimes && _this.props.injectTimes.sort(function(a, b) { 8693 return a.getTime() - b.getTime(); 8694 }); 8695 var minutesInDay2 = 60 * getHoursInDay(activeDate); 8696 var multiplier = minutesInDay2 / intervals; 8697 for (var i = 0; i < multiplier; i++) { 8698 var currentTime = addMinutes(base, i * intervals); 8699 times.push(currentTime); 8700 if (sortedInjectTimes) { 8701 var timesToInject = timesToInjectAfter(base, currentTime, i, intervals, sortedInjectTimes); 8702 times = times.concat(timesToInject); 8703 } 8704 } 8705 var timeToFocus = times.reduce(function(prev, time) { 8706 if (time.getTime() <= activeDate.getTime()) { 8707 return time; 8708 } 8709 return prev; 8710 }, times[0]); 8711 return times.map(function(time) { 8712 return import_react3.default.createElement("li", { key: time.valueOf(), onClick: _this.handleClick.bind(_this, time), className: _this.liClasses(time), ref: function(li) { 8713 if (time === timeToFocus) { 8714 _this.centerLi = li; 8715 } 8716 }, onKeyDown: function(event) { 8717 _this.handleOnKeyDown(event, time); 8718 }, tabIndex: time === timeToFocus ? 0 : -1, role: "option", "aria-selected": _this.isSelectedTime(time) ? "true" : void 0, "aria-disabled": _this.isDisabledTime(time) ? "true" : void 0 }, formatDate(time, format2, _this.props.locale)); 8719 }); 8720 }; 8721 _this.renderTimeCaption = function() { 8722 if (_this.props.showTimeCaption === false) { 8723 return import_react3.default.createElement(import_react3.default.Fragment, null); 8724 } 8725 return import_react3.default.createElement( 8726 "div", 8727 { className: "react-datepicker__header react-datepicker__header--time ".concat(_this.props.showTimeSelectOnly ? "react-datepicker__header--time--only" : ""), ref: function(header) { 8728 _this.header = header; 8729 } }, 8730 import_react3.default.createElement("div", { className: "react-datepicker-time__header" }, _this.props.timeCaption) 8731 ); 8732 }; 8733 return _this; 8734 } 8735 Object.defineProperty(Time2, "defaultProps", { 8736 get: function() { 8737 return { 8738 intervals: 30, 8739 todayButton: null, 8740 timeCaption: "Time", 8741 showTimeCaption: true 8742 }; 8743 }, 8744 enumerable: false, 8745 configurable: true 8746 }); 8747 Time2.prototype.componentDidMount = function() { 8748 this.scrollToTheSelectedTime(); 8749 if (this.props.monthRef && this.header) { 8750 this.setState({ 8751 height: this.props.monthRef.clientHeight - this.header.clientHeight 8752 }); 8753 } 8754 }; 8755 Time2.prototype.render = function() { 8756 var _this = this; 8757 var _a2; 8758 var height = this.state.height; 8759 return import_react3.default.createElement( 8760 "div", 8761 { className: "react-datepicker__time-container ".concat(((_a2 = this.props.todayButton) !== null && _a2 !== void 0 ? _a2 : Time2.defaultProps.todayButton) ? "react-datepicker__time-container--with-today-button" : "") }, 8762 this.renderTimeCaption(), 8763 import_react3.default.createElement( 8764 "div", 8765 { className: "react-datepicker__time" }, 8766 import_react3.default.createElement( 8767 "div", 8768 { className: "react-datepicker__time-box" }, 8769 import_react3.default.createElement("ul", { className: "react-datepicker__time-list", ref: function(list) { 8770 _this.list = list; 8771 }, style: height ? { height } : {}, role: "listbox", "aria-label": this.props.timeCaption }, this.renderTimes()) 8772 ) 8773 ) 8774 ); 8775 }; 8776 Time2.calcCenterPosition = function(listHeight, centerLiRef) { 8777 return centerLiRef.offsetTop - (listHeight / 2 - centerLiRef.clientHeight / 2); 8778 }; 8779 return Time2; 8780 }(import_react3.Component) 8781); 8782var VERTICAL_NAVIGATION_OFFSET = 3; 8783var Year = ( 8784 /** @class */ 8785 function(_super) { 8786 __extends(Year2, _super); 8787 function Year2(props) { 8788 var _this = _super.call(this, props) || this; 8789 _this.YEAR_REFS = __spreadArray([], Array(_this.props.yearItemNumber), true).map(function() { 8790 return (0, import_react3.createRef)(); 8791 }); 8792 _this.isDisabled = function(date) { 8793 return isDayDisabled(date, { 8794 minDate: _this.props.minDate, 8795 maxDate: _this.props.maxDate, 8796 excludeDates: _this.props.excludeDates, 8797 includeDates: _this.props.includeDates, 8798 filterDate: _this.props.filterDate 8799 }); 8800 }; 8801 _this.isExcluded = function(date) { 8802 return isDayExcluded(date, { 8803 excludeDates: _this.props.excludeDates 8804 }); 8805 }; 8806 _this.selectingDate = function() { 8807 var _a2; 8808 return (_a2 = _this.props.selectingDate) !== null && _a2 !== void 0 ? _a2 : _this.props.preSelection; 8809 }; 8810 _this.updateFocusOnPaginate = function(refIndex) { 8811 var waitForReRender = function() { 8812 var _a2, _b; 8813 (_b = (_a2 = _this.YEAR_REFS[refIndex]) === null || _a2 === void 0 ? void 0 : _a2.current) === null || _b === void 0 ? void 0 : _b.focus(); 8814 }; 8815 window.requestAnimationFrame(waitForReRender); 8816 }; 8817 _this.handleYearClick = function(day, event) { 8818 if (_this.props.onDayClick) { 8819 _this.props.onDayClick(day, event); 8820 } 8821 }; 8822 _this.handleYearNavigation = function(newYear, newDate2) { 8823 var _a2, _b, _c, _d; 8824 var _e = _this.props, date = _e.date, yearItemNumber = _e.yearItemNumber; 8825 if (date === void 0 || yearItemNumber === void 0) { 8826 return; 8827 } 8828 var startPeriod = getYearsPeriod(date, yearItemNumber).startPeriod; 8829 if (_this.isDisabled(newDate2) || _this.isExcluded(newDate2)) { 8830 return; 8831 } 8832 (_b = (_a2 = _this.props).setPreSelection) === null || _b === void 0 ? void 0 : _b.call(_a2, newDate2); 8833 if (newYear - startPeriod < 0) { 8834 _this.updateFocusOnPaginate(yearItemNumber - (startPeriod - newYear)); 8835 } else if (newYear - startPeriod >= yearItemNumber) { 8836 _this.updateFocusOnPaginate(Math.abs(yearItemNumber - (newYear - startPeriod))); 8837 } else 8838 (_d = (_c = _this.YEAR_REFS[newYear - startPeriod]) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.focus(); 8839 }; 8840 _this.isSameDay = function(y, other) { 8841 return isSameDay2(y, other); 8842 }; 8843 _this.isCurrentYear = function(y) { 8844 return y === getYear(newDate()); 8845 }; 8846 _this.isRangeStart = function(y) { 8847 return _this.props.startDate && _this.props.endDate && isSameYear2(setYear(newDate(), y), _this.props.startDate); 8848 }; 8849 _this.isRangeEnd = function(y) { 8850 return _this.props.startDate && _this.props.endDate && isSameYear2(setYear(newDate(), y), _this.props.endDate); 8851 }; 8852 _this.isInRange = function(y) { 8853 return isYearInRange(y, _this.props.startDate, _this.props.endDate); 8854 }; 8855 _this.isInSelectingRange = function(y) { 8856 var _a2 = _this.props, selectsStart = _a2.selectsStart, selectsEnd = _a2.selectsEnd, selectsRange = _a2.selectsRange, startDate = _a2.startDate, endDate = _a2.endDate; 8857 if (!(selectsStart || selectsEnd || selectsRange) || !_this.selectingDate()) { 8858 return false; 8859 } 8860 if (selectsStart && endDate) { 8861 return isYearInRange(y, _this.selectingDate(), endDate); 8862 } 8863 if (selectsEnd && startDate) { 8864 return isYearInRange(y, startDate, _this.selectingDate()); 8865 } 8866 if (selectsRange && startDate && !endDate) { 8867 return isYearInRange(y, startDate, _this.selectingDate()); 8868 } 8869 return false; 8870 }; 8871 _this.isSelectingRangeStart = function(y) { 8872 var _a2; 8873 if (!_this.isInSelectingRange(y)) { 8874 return false; 8875 } 8876 var _b = _this.props, startDate = _b.startDate, selectsStart = _b.selectsStart; 8877 var _year = setYear(newDate(), y); 8878 if (selectsStart) { 8879 return isSameYear2(_year, (_a2 = _this.selectingDate()) !== null && _a2 !== void 0 ? _a2 : null); 8880 } 8881 return isSameYear2(_year, startDate !== null && startDate !== void 0 ? startDate : null); 8882 }; 8883 _this.isSelectingRangeEnd = function(y) { 8884 var _a2; 8885 if (!_this.isInSelectingRange(y)) { 8886 return false; 8887 } 8888 var _b = _this.props, endDate = _b.endDate, selectsEnd = _b.selectsEnd, selectsRange = _b.selectsRange; 8889 var _year = setYear(newDate(), y); 8890 if (selectsEnd || selectsRange) { 8891 return isSameYear2(_year, (_a2 = _this.selectingDate()) !== null && _a2 !== void 0 ? _a2 : null); 8892 } 8893 return isSameYear2(_year, endDate !== null && endDate !== void 0 ? endDate : null); 8894 }; 8895 _this.isKeyboardSelected = function(y) { 8896 if (_this.props.date === void 0 || _this.props.selected == null || _this.props.preSelection == null) { 8897 return; 8898 } 8899 var _a2 = _this.props, minDate = _a2.minDate, maxDate = _a2.maxDate, excludeDates = _a2.excludeDates, includeDates = _a2.includeDates, filterDate = _a2.filterDate; 8900 var date = getStartOfYear(setYear(_this.props.date, y)); 8901 var isDisabled2 = (minDate || maxDate || excludeDates || includeDates || filterDate) && isYearDisabled(y, _this.props); 8902 return !_this.props.disabledKeyboardNavigation && !_this.props.inline && !isSameDay2(date, getStartOfYear(_this.props.selected)) && isSameDay2(date, getStartOfYear(_this.props.preSelection)) && !isDisabled2; 8903 }; 8904 _this.onYearClick = function(event, y) { 8905 var date = _this.props.date; 8906 if (date === void 0) { 8907 return; 8908 } 8909 _this.handleYearClick(getStartOfYear(setYear(date, y)), event); 8910 }; 8911 _this.onYearKeyDown = function(event, y) { 8912 var _a2, _b; 8913 var key = event.key; 8914 var _c = _this.props, date = _c.date, yearItemNumber = _c.yearItemNumber, handleOnKeyDown = _c.handleOnKeyDown; 8915 if (key !== KeyType.Tab) { 8916 event.preventDefault(); 8917 } 8918 if (!_this.props.disabledKeyboardNavigation) { 8919 switch (key) { 8920 case KeyType.Enter: 8921 if (_this.props.selected == null) { 8922 break; 8923 } 8924 _this.onYearClick(event, y); 8925 (_b = (_a2 = _this.props).setPreSelection) === null || _b === void 0 ? void 0 : _b.call(_a2, _this.props.selected); 8926 break; 8927 case KeyType.ArrowRight: 8928 if (_this.props.preSelection == null) { 8929 break; 8930 } 8931 _this.handleYearNavigation(y + 1, addYears(_this.props.preSelection, 1)); 8932 break; 8933 case KeyType.ArrowLeft: 8934 if (_this.props.preSelection == null) { 8935 break; 8936 } 8937 _this.handleYearNavigation(y - 1, subYears(_this.props.preSelection, 1)); 8938 break; 8939 case KeyType.ArrowUp: { 8940 if (date === void 0 || yearItemNumber === void 0 || _this.props.preSelection == null) { 8941 break; 8942 } 8943 var startPeriod = getYearsPeriod(date, yearItemNumber).startPeriod; 8944 var offset4 = VERTICAL_NAVIGATION_OFFSET; 8945 var newYear = y - offset4; 8946 if (newYear < startPeriod) { 8947 var leftOverOffset = yearItemNumber % offset4; 8948 if (y >= startPeriod && y < startPeriod + leftOverOffset) { 8949 offset4 = leftOverOffset; 8950 } else { 8951 offset4 += leftOverOffset; 8952 } 8953 newYear = y - offset4; 8954 } 8955 _this.handleYearNavigation(newYear, subYears(_this.props.preSelection, offset4)); 8956 break; 8957 } 8958 case KeyType.ArrowDown: { 8959 if (date === void 0 || yearItemNumber === void 0 || _this.props.preSelection == null) { 8960 break; 8961 } 8962 var endPeriod = getYearsPeriod(date, yearItemNumber).endPeriod; 8963 var offset4 = VERTICAL_NAVIGATION_OFFSET; 8964 var newYear = y + offset4; 8965 if (newYear > endPeriod) { 8966 var leftOverOffset = yearItemNumber % offset4; 8967 if (y <= endPeriod && y > endPeriod - leftOverOffset) { 8968 offset4 = leftOverOffset; 8969 } else { 8970 offset4 += leftOverOffset; 8971 } 8972 newYear = y + offset4; 8973 } 8974 _this.handleYearNavigation(newYear, addYears(_this.props.preSelection, offset4)); 8975 break; 8976 } 8977 } 8978 } 8979 handleOnKeyDown && handleOnKeyDown(event); 8980 }; 8981 _this.getYearClassNames = function(y) { 8982 var _a2 = _this.props, date = _a2.date, minDate = _a2.minDate, maxDate = _a2.maxDate, selected = _a2.selected, excludeDates = _a2.excludeDates, includeDates = _a2.includeDates, filterDate = _a2.filterDate, yearClassName = _a2.yearClassName; 8983 return clsx("react-datepicker__year-text", "react-datepicker__year-".concat(y), date ? yearClassName === null || yearClassName === void 0 ? void 0 : yearClassName(setYear(date, y)) : void 0, { 8984 "react-datepicker__year-text--selected": selected ? y === getYear(selected) : void 0, 8985 "react-datepicker__year-text--disabled": (minDate || maxDate || excludeDates || includeDates || filterDate) && isYearDisabled(y, _this.props), 8986 "react-datepicker__year-text--keyboard-selected": _this.isKeyboardSelected(y), 8987 "react-datepicker__year-text--range-start": _this.isRangeStart(y), 8988 "react-datepicker__year-text--range-end": _this.isRangeEnd(y), 8989 "react-datepicker__year-text--in-range": _this.isInRange(y), 8990 "react-datepicker__year-text--in-selecting-range": _this.isInSelectingRange(y), 8991 "react-datepicker__year-text--selecting-range-start": _this.isSelectingRangeStart(y), 8992 "react-datepicker__year-text--selecting-range-end": _this.isSelectingRangeEnd(y), 8993 "react-datepicker__year-text--today": _this.isCurrentYear(y) 8994 }); 8995 }; 8996 _this.getYearTabIndex = function(y) { 8997 if (_this.props.disabledKeyboardNavigation || _this.props.preSelection == null) { 8998 return "-1"; 8999 } 9000 var preSelected = getYear(_this.props.preSelection); 9001 var isPreSelectedYearDisabled = isYearDisabled(y, _this.props); 9002 return y === preSelected && !isPreSelectedYearDisabled ? "0" : "-1"; 9003 }; 9004 _this.getYearContent = function(y) { 9005 return _this.props.renderYearContent ? _this.props.renderYearContent(y) : y; 9006 }; 9007 return _this; 9008 } 9009 Year2.prototype.render = function() { 9010 var _this = this; 9011 var yearsList = []; 9012 var _a2 = this.props, date = _a2.date, yearItemNumber = _a2.yearItemNumber, onYearMouseEnter = _a2.onYearMouseEnter, onYearMouseLeave = _a2.onYearMouseLeave; 9013 if (date === void 0) { 9014 return null; 9015 } 9016 var _b = getYearsPeriod(date, yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod; 9017 var _loop_1 = function(y2) { 9018 yearsList.push(import_react3.default.createElement("div", { ref: this_1.YEAR_REFS[y2 - startPeriod], onClick: function(event) { 9019 _this.onYearClick(event, y2); 9020 }, onKeyDown: function(event) { 9021 if (isSpaceKeyDown(event)) { 9022 event.preventDefault(); 9023 event.key = KeyType.Enter; 9024 } 9025 _this.onYearKeyDown(event, y2); 9026 }, tabIndex: Number(this_1.getYearTabIndex(y2)), className: this_1.getYearClassNames(y2), onMouseEnter: !this_1.props.usePointerEvent ? function(event) { 9027 return onYearMouseEnter(event, y2); 9028 } : void 0, onPointerEnter: this_1.props.usePointerEvent ? function(event) { 9029 return onYearMouseEnter(event, y2); 9030 } : void 0, onMouseLeave: !this_1.props.usePointerEvent ? function(event) { 9031 return onYearMouseLeave(event, y2); 9032 } : void 0, onPointerLeave: this_1.props.usePointerEvent ? function(event) { 9033 return onYearMouseLeave(event, y2); 9034 } : void 0, key: y2, "aria-current": this_1.isCurrentYear(y2) ? "date" : void 0 }, this_1.getYearContent(y2))); 9035 }; 9036 var this_1 = this; 9037 for (var y = startPeriod; y <= endPeriod; y++) { 9038 _loop_1(y); 9039 } 9040 return import_react3.default.createElement( 9041 "div", 9042 { className: "react-datepicker__year" }, 9043 import_react3.default.createElement("div", { className: "react-datepicker__year-wrapper", onMouseLeave: !this.props.usePointerEvent ? this.props.clearSelectingDate : void 0, onPointerLeave: this.props.usePointerEvent ? this.props.clearSelectingDate : void 0 }, yearsList) 9044 ); 9045 }; 9046 return Year2; 9047 }(import_react3.Component) 9048); 9049function generateYears(year, noOfYear, minDate, maxDate) { 9050 var list = []; 9051 for (var i = 0; i < 2 * noOfYear + 1; i++) { 9052 var newYear = year + noOfYear - i; 9053 var isInRange = true; 9054 if (minDate) { 9055 isInRange = getYear(minDate) <= newYear; 9056 } 9057 if (maxDate && isInRange) { 9058 isInRange = getYear(maxDate) >= newYear; 9059 } 9060 if (isInRange) { 9061 list.push(newYear); 9062 } 9063 } 9064 return list; 9065} 9066var YearDropdownOptions = ( 9067 /** @class */ 9068 function(_super) { 9069 __extends(YearDropdownOptions2, _super); 9070 function YearDropdownOptions2(props) { 9071 var _this = _super.call(this, props) || this; 9072 _this.renderOptions = function() { 9073 var selectedYear = _this.props.year; 9074 var options = _this.state.yearsList.map(function(year) { 9075 return import_react3.default.createElement( 9076 "div", 9077 { className: selectedYear === year ? "react-datepicker__year-option react-datepicker__year-option--selected_year" : "react-datepicker__year-option", key: year, onClick: _this.onChange.bind(_this, year), "aria-selected": selectedYear === year ? "true" : void 0 }, 9078 selectedYear === year ? import_react3.default.createElement("span", { className: "react-datepicker__year-option--selected" }, "✓") : "", 9079 year 9080 ); 9081 }); 9082 var minYear = _this.props.minDate ? getYear(_this.props.minDate) : null; 9083 var maxYear = _this.props.maxDate ? getYear(_this.props.maxDate) : null; 9084 if (!maxYear || !_this.state.yearsList.find(function(year) { 9085 return year === maxYear; 9086 })) { 9087 options.unshift(import_react3.default.createElement( 9088 "div", 9089 { className: "react-datepicker__year-option", key: "upcoming", onClick: _this.incrementYears }, 9090 import_react3.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming" }) 9091 )); 9092 } 9093 if (!minYear || !_this.state.yearsList.find(function(year) { 9094 return year === minYear; 9095 })) { 9096 options.push(import_react3.default.createElement( 9097 "div", 9098 { className: "react-datepicker__year-option", key: "previous", onClick: _this.decrementYears }, 9099 import_react3.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous" }) 9100 )); 9101 } 9102 return options; 9103 }; 9104 _this.onChange = function(year) { 9105 _this.props.onChange(year); 9106 }; 9107 _this.handleClickOutside = function() { 9108 _this.props.onCancel(); 9109 }; 9110 _this.shiftYears = function(amount) { 9111 var years = _this.state.yearsList.map(function(year) { 9112 return year + amount; 9113 }); 9114 _this.setState({ 9115 yearsList: years 9116 }); 9117 }; 9118 _this.incrementYears = function() { 9119 return _this.shiftYears(1); 9120 }; 9121 _this.decrementYears = function() { 9122 return _this.shiftYears(-1); 9123 }; 9124 var yearDropdownItemNumber = props.yearDropdownItemNumber, scrollableYearDropdown = props.scrollableYearDropdown; 9125 var noOfYear = yearDropdownItemNumber || (scrollableYearDropdown ? 10 : 5); 9126 _this.state = { 9127 yearsList: generateYears(_this.props.year, noOfYear, _this.props.minDate, _this.props.maxDate) 9128 }; 9129 _this.dropdownRef = (0, import_react3.createRef)(); 9130 return _this; 9131 } 9132 YearDropdownOptions2.prototype.componentDidMount = function() { 9133 var dropdownCurrent = this.dropdownRef.current; 9134 if (dropdownCurrent) { 9135 var dropdownCurrentChildren = dropdownCurrent.children ? Array.from(dropdownCurrent.children) : null; 9136 var selectedYearOptionEl = dropdownCurrentChildren ? dropdownCurrentChildren.find(function(childEl) { 9137 return childEl.ariaSelected; 9138 }) : null; 9139 dropdownCurrent.scrollTop = selectedYearOptionEl && selectedYearOptionEl instanceof HTMLElement ? selectedYearOptionEl.offsetTop + (selectedYearOptionEl.clientHeight - dropdownCurrent.clientHeight) / 2 : (dropdownCurrent.scrollHeight - dropdownCurrent.clientHeight) / 2; 9140 } 9141 }; 9142 YearDropdownOptions2.prototype.render = function() { 9143 var dropdownClass = clsx({ 9144 "react-datepicker__year-dropdown": true, 9145 "react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown 9146 }); 9147 return import_react3.default.createElement(ClickOutsideWrapper, { className: dropdownClass, containerRef: this.dropdownRef, onClickOutside: this.handleClickOutside }, this.renderOptions()); 9148 }; 9149 return YearDropdownOptions2; 9150 }(import_react3.Component) 9151); 9152var YearDropdown = ( 9153 /** @class */ 9154 function(_super) { 9155 __extends(YearDropdown2, _super); 9156 function YearDropdown2() { 9157 var _this = _super !== null && _super.apply(this, arguments) || this; 9158 _this.state = { 9159 dropdownVisible: false 9160 }; 9161 _this.renderSelectOptions = function() { 9162 var minYear = _this.props.minDate ? getYear(_this.props.minDate) : 1900; 9163 var maxYear = _this.props.maxDate ? getYear(_this.props.maxDate) : 2100; 9164 var options = []; 9165 for (var i = minYear; i <= maxYear; i++) { 9166 options.push(import_react3.default.createElement("option", { key: i, value: i }, i)); 9167 } 9168 return options; 9169 }; 9170 _this.onSelectChange = function(event) { 9171 _this.onChange(parseInt(event.target.value)); 9172 }; 9173 _this.renderSelectMode = function() { 9174 return import_react3.default.createElement("select", { value: _this.props.year, className: "react-datepicker__year-select", onChange: _this.onSelectChange }, _this.renderSelectOptions()); 9175 }; 9176 _this.renderReadView = function(visible) { 9177 return import_react3.default.createElement( 9178 "div", 9179 { key: "read", style: { visibility: visible ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function(event) { 9180 return _this.toggleDropdown(event); 9181 } }, 9182 import_react3.default.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }), 9183 import_react3.default.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, _this.props.year) 9184 ); 9185 }; 9186 _this.renderDropdown = function() { 9187 return import_react3.default.createElement(YearDropdownOptions, _assign({ key: "dropdown" }, _this.props, { onChange: _this.onChange, onCancel: _this.toggleDropdown })); 9188 }; 9189 _this.renderScrollMode = function() { 9190 var dropdownVisible = _this.state.dropdownVisible; 9191 var result = [_this.renderReadView(!dropdownVisible)]; 9192 if (dropdownVisible) { 9193 result.unshift(_this.renderDropdown()); 9194 } 9195 return result; 9196 }; 9197 _this.onChange = function(year) { 9198 _this.toggleDropdown(); 9199 if (year === _this.props.year) 9200 return; 9201 _this.props.onChange(year); 9202 }; 9203 _this.toggleDropdown = function(event) { 9204 _this.setState({ 9205 dropdownVisible: !_this.state.dropdownVisible 9206 }, function() { 9207 if (_this.props.adjustDateOnChange) { 9208 _this.handleYearChange(_this.props.date, event); 9209 } 9210 }); 9211 }; 9212 _this.handleYearChange = function(date, event) { 9213 var _a2; 9214 (_a2 = _this.onSelect) === null || _a2 === void 0 ? void 0 : _a2.call(_this, date, event); 9215 _this.setOpen(); 9216 }; 9217 _this.onSelect = function(date, event) { 9218 var _a2, _b; 9219 (_b = (_a2 = _this.props).onSelect) === null || _b === void 0 ? void 0 : _b.call(_a2, date, event); 9220 }; 9221 _this.setOpen = function() { 9222 var _a2, _b; 9223 (_b = (_a2 = _this.props).setOpen) === null || _b === void 0 ? void 0 : _b.call(_a2, true); 9224 }; 9225 return _this; 9226 } 9227 YearDropdown2.prototype.render = function() { 9228 var renderedDropdown; 9229 switch (this.props.dropdownMode) { 9230 case "scroll": 9231 renderedDropdown = this.renderScrollMode(); 9232 break; 9233 case "select": 9234 renderedDropdown = this.renderSelectMode(); 9235 break; 9236 } 9237 return import_react3.default.createElement("div", { className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode) }, renderedDropdown); 9238 }; 9239 return YearDropdown2; 9240 }(import_react3.Component) 9241); 9242var DROPDOWN_FOCUS_CLASSNAMES = [ 9243 "react-datepicker__year-select", 9244 "react-datepicker__month-select", 9245 "react-datepicker__month-year-select" 9246]; 9247var isDropdownSelect = function(element) { 9248 var classNames = (element.className || "").split(/\s+/); 9249 return DROPDOWN_FOCUS_CLASSNAMES.some(function(testClassname) { 9250 return classNames.indexOf(testClassname) >= 0; 9251 }); 9252}; 9253var Calendar = ( 9254 /** @class */ 9255 function(_super) { 9256 __extends(Calendar2, _super); 9257 function Calendar2(props) { 9258 var _this = _super.call(this, props) || this; 9259 _this.monthContainer = void 0; 9260 _this.handleClickOutside = function(event) { 9261 _this.props.onClickOutside(event); 9262 }; 9263 _this.setClickOutsideRef = function() { 9264 return _this.containerRef.current; 9265 }; 9266 _this.handleDropdownFocus = function(event) { 9267 var _a2, _b; 9268 if (isDropdownSelect(event.target)) { 9269 (_b = (_a2 = _this.props).onDropdownFocus) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 9270 } 9271 }; 9272 _this.getDateInView = function() { 9273 var _a2 = _this.props, preSelection = _a2.preSelection, selected = _a2.selected, openToDate = _a2.openToDate; 9274 var minDate = getEffectiveMinDate(_this.props); 9275 var maxDate = getEffectiveMaxDate(_this.props); 9276 var current = newDate(); 9277 var initialDate = openToDate || selected || preSelection; 9278 if (initialDate) { 9279 return initialDate; 9280 } else { 9281 if (minDate && isBefore(current, minDate)) { 9282 return minDate; 9283 } else if (maxDate && isAfter(current, maxDate)) { 9284 return maxDate; 9285 } 9286 } 9287 return current; 9288 }; 9289 _this.increaseMonth = function() { 9290 _this.setState(function(_a2) { 9291 var date = _a2.date; 9292 return { 9293 date: addMonths(date, 1) 9294 }; 9295 }, function() { 9296 return _this.handleMonthChange(_this.state.date); 9297 }); 9298 }; 9299 _this.decreaseMonth = function() { 9300 _this.setState(function(_a2) { 9301 var date = _a2.date; 9302 return { 9303 date: subMonths(date, 1) 9304 }; 9305 }, function() { 9306 return _this.handleMonthChange(_this.state.date); 9307 }); 9308 }; 9309 _this.handleDayClick = function(day, event, monthSelectedIn) { 9310 _this.props.onSelect(day, event, monthSelectedIn); 9311 _this.props.setPreSelection && _this.props.setPreSelection(day); 9312 }; 9313 _this.handleDayMouseEnter = function(day) { 9314 _this.setState({ selectingDate: day }); 9315 _this.props.onDayMouseEnter && _this.props.onDayMouseEnter(day); 9316 }; 9317 _this.handleMonthMouseLeave = function() { 9318 _this.setState({ selectingDate: void 0 }); 9319 _this.props.onMonthMouseLeave && _this.props.onMonthMouseLeave(); 9320 }; 9321 _this.handleYearMouseEnter = function(event, year) { 9322 _this.setState({ selectingDate: setYear(newDate(), year) }); 9323 !!_this.props.onYearMouseEnter && _this.props.onYearMouseEnter(event, year); 9324 }; 9325 _this.handleYearMouseLeave = function(event, year) { 9326 !!_this.props.onYearMouseLeave && _this.props.onYearMouseLeave(event, year); 9327 }; 9328 _this.handleYearChange = function(date) { 9329 var _a2, _b, _c, _d; 9330 (_b = (_a2 = _this.props).onYearChange) === null || _b === void 0 ? void 0 : _b.call(_a2, date); 9331 _this.setState({ isRenderAriaLiveMessage: true }); 9332 if (_this.props.adjustDateOnChange) { 9333 _this.props.onSelect(date); 9334 (_d = (_c = _this.props).setOpen) === null || _d === void 0 ? void 0 : _d.call(_c, true); 9335 } 9336 _this.props.setPreSelection && _this.props.setPreSelection(date); 9337 }; 9338 _this.getEnabledPreSelectionDateForMonth = function(date) { 9339 if (!isDayDisabled(date, _this.props)) { 9340 return date; 9341 } 9342 var startOfMonth2 = getStartOfMonth(date); 9343 var endOfMonth2 = getEndOfMonth(date); 9344 var totalDays = differenceInDays(endOfMonth2, startOfMonth2); 9345 var preSelectedDate = null; 9346 for (var dayIdx = 0; dayIdx <= totalDays; dayIdx++) { 9347 var processingDate = addDays(startOfMonth2, dayIdx); 9348 if (!isDayDisabled(processingDate, _this.props)) { 9349 preSelectedDate = processingDate; 9350 break; 9351 } 9352 } 9353 return preSelectedDate; 9354 }; 9355 _this.handleMonthChange = function(date) { 9356 var _a2, _b, _c; 9357 var enabledPreSelectionDate = (_a2 = _this.getEnabledPreSelectionDateForMonth(date)) !== null && _a2 !== void 0 ? _a2 : date; 9358 _this.handleCustomMonthChange(enabledPreSelectionDate); 9359 if (_this.props.adjustDateOnChange) { 9360 _this.props.onSelect(enabledPreSelectionDate); 9361 (_c = (_b = _this.props).setOpen) === null || _c === void 0 ? void 0 : _c.call(_b, true); 9362 } 9363 _this.props.setPreSelection && _this.props.setPreSelection(enabledPreSelectionDate); 9364 }; 9365 _this.handleCustomMonthChange = function(date) { 9366 var _a2, _b; 9367 (_b = (_a2 = _this.props).onMonthChange) === null || _b === void 0 ? void 0 : _b.call(_a2, date); 9368 _this.setState({ isRenderAriaLiveMessage: true }); 9369 }; 9370 _this.handleMonthYearChange = function(date) { 9371 _this.handleYearChange(date); 9372 _this.handleMonthChange(date); 9373 }; 9374 _this.changeYear = function(year) { 9375 _this.setState(function(_a2) { 9376 var date = _a2.date; 9377 return { 9378 date: setYear(date, Number(year)) 9379 }; 9380 }, function() { 9381 return _this.handleYearChange(_this.state.date); 9382 }); 9383 }; 9384 _this.changeMonth = function(month) { 9385 _this.setState(function(_a2) { 9386 var date = _a2.date; 9387 return { 9388 date: setMonth(date, Number(month)) 9389 }; 9390 }, function() { 9391 return _this.handleMonthChange(_this.state.date); 9392 }); 9393 }; 9394 _this.changeMonthYear = function(monthYear) { 9395 _this.setState(function(_a2) { 9396 var date = _a2.date; 9397 return { 9398 date: setYear(setMonth(date, getMonth(monthYear)), getYear(monthYear)) 9399 }; 9400 }, function() { 9401 return _this.handleMonthYearChange(_this.state.date); 9402 }); 9403 }; 9404 _this.header = function(date) { 9405 if (date === void 0) { 9406 date = _this.state.date; 9407 } 9408 var startOfWeek2 = getStartOfWeek(date, _this.props.locale, _this.props.calendarStartDay); 9409 var dayNames = []; 9410 if (_this.props.showWeekNumbers) { 9411 dayNames.push(import_react3.default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, _this.props.weekLabel || "#")); 9412 } 9413 return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function(offset4) { 9414 var day = addDays(startOfWeek2, offset4); 9415 var weekDayName = _this.formatWeekday(day, _this.props.locale); 9416 var weekDayClassName = _this.props.weekDayClassName ? _this.props.weekDayClassName(day) : void 0; 9417 return import_react3.default.createElement("div", { key: offset4, "aria-label": formatDate(day, "EEEE", _this.props.locale), className: clsx("react-datepicker__day-name", weekDayClassName) }, weekDayName); 9418 })); 9419 }; 9420 _this.formatWeekday = function(day, locale) { 9421 if (_this.props.formatWeekDay) { 9422 return getFormattedWeekdayInLocale(day, _this.props.formatWeekDay, locale); 9423 } 9424 return _this.props.useWeekdaysShort ? getWeekdayShortInLocale(day, locale) : getWeekdayMinInLocale(day, locale); 9425 }; 9426 _this.decreaseYear = function() { 9427 _this.setState(function(_a2) { 9428 var _b; 9429 var date = _a2.date; 9430 return { 9431 date: subYears(date, _this.props.showYearPicker ? (_b = _this.props.yearItemNumber) !== null && _b !== void 0 ? _b : Calendar2.defaultProps.yearItemNumber : 1) 9432 }; 9433 }, function() { 9434 return _this.handleYearChange(_this.state.date); 9435 }); 9436 }; 9437 _this.clearSelectingDate = function() { 9438 _this.setState({ selectingDate: void 0 }); 9439 }; 9440 _this.renderPreviousButton = function() { 9441 var _a2, _b, _c; 9442 if (_this.props.renderCustomHeader) { 9443 return; 9444 } 9445 var monthsShown = (_a2 = _this.props.monthsShown) !== null && _a2 !== void 0 ? _a2 : Calendar2.defaultProps.monthsShown; 9446 var monthsToSubtract = _this.props.showPreviousMonths ? monthsShown - 1 : 0; 9447 var monthSelectedIn = (_b = _this.props.monthSelectedIn) !== null && _b !== void 0 ? _b : monthsToSubtract; 9448 var fromMonthDate = subMonths(_this.state.date, monthSelectedIn); 9449 var allPrevDaysDisabled; 9450 switch (true) { 9451 case _this.props.showMonthYearPicker: 9452 allPrevDaysDisabled = yearDisabledBefore(_this.state.date, _this.props); 9453 break; 9454 case _this.props.showYearPicker: 9455 allPrevDaysDisabled = yearsDisabledBefore(_this.state.date, _this.props); 9456 break; 9457 case _this.props.showQuarterYearPicker: 9458 allPrevDaysDisabled = quarterDisabledBefore(_this.state.date, _this.props); 9459 break; 9460 default: 9461 allPrevDaysDisabled = monthDisabledBefore(fromMonthDate, _this.props); 9462 break; 9463 } 9464 if (!((_c = _this.props.forceShowMonthNavigation) !== null && _c !== void 0 ? _c : Calendar2.defaultProps.forceShowMonthNavigation) && !_this.props.showDisabledMonthNavigation && allPrevDaysDisabled || _this.props.showTimeSelectOnly) { 9465 return; 9466 } 9467 var iconClasses = [ 9468 "react-datepicker__navigation-icon", 9469 "react-datepicker__navigation-icon--previous" 9470 ]; 9471 var classes = [ 9472 "react-datepicker__navigation", 9473 "react-datepicker__navigation--previous" 9474 ]; 9475 var clickHandler = _this.decreaseMonth; 9476 if (_this.props.showMonthYearPicker || _this.props.showQuarterYearPicker || _this.props.showYearPicker) { 9477 clickHandler = _this.decreaseYear; 9478 } 9479 if (allPrevDaysDisabled && _this.props.showDisabledMonthNavigation) { 9480 classes.push("react-datepicker__navigation--previous--disabled"); 9481 clickHandler = void 0; 9482 } 9483 var isForYear = _this.props.showMonthYearPicker || _this.props.showQuarterYearPicker || _this.props.showYearPicker; 9484 var _d = _this.props, _e = _d.previousMonthButtonLabel, previousMonthButtonLabel = _e === void 0 ? Calendar2.defaultProps.previousMonthButtonLabel : _e, _f = _d.previousYearButtonLabel, previousYearButtonLabel = _f === void 0 ? Calendar2.defaultProps.previousYearButtonLabel : _f; 9485 var _g = _this.props, _h = _g.previousMonthAriaLabel, previousMonthAriaLabel = _h === void 0 ? typeof previousMonthButtonLabel === "string" ? previousMonthButtonLabel : "Previous Month" : _h, _j = _g.previousYearAriaLabel, previousYearAriaLabel = _j === void 0 ? typeof previousYearButtonLabel === "string" ? previousYearButtonLabel : "Previous Year" : _j; 9486 return import_react3.default.createElement( 9487 "button", 9488 { type: "button", className: classes.join(" "), onClick: clickHandler, onKeyDown: _this.props.handleOnKeyDown, "aria-label": isForYear ? previousYearAriaLabel : previousMonthAriaLabel }, 9489 import_react3.default.createElement("span", { className: iconClasses.join(" ") }, isForYear ? previousYearButtonLabel : previousMonthButtonLabel) 9490 ); 9491 }; 9492 _this.increaseYear = function() { 9493 _this.setState(function(_a2) { 9494 var _b; 9495 var date = _a2.date; 9496 return { 9497 date: addYears(date, _this.props.showYearPicker ? (_b = _this.props.yearItemNumber) !== null && _b !== void 0 ? _b : Calendar2.defaultProps.yearItemNumber : 1) 9498 }; 9499 }, function() { 9500 return _this.handleYearChange(_this.state.date); 9501 }); 9502 }; 9503 _this.renderNextButton = function() { 9504 var _a2; 9505 if (_this.props.renderCustomHeader) { 9506 return; 9507 } 9508 var allNextDaysDisabled; 9509 switch (true) { 9510 case _this.props.showMonthYearPicker: 9511 allNextDaysDisabled = yearDisabledAfter(_this.state.date, _this.props); 9512 break; 9513 case _this.props.showYearPicker: 9514 allNextDaysDisabled = yearsDisabledAfter(_this.state.date, _this.props); 9515 break; 9516 case _this.props.showQuarterYearPicker: 9517 allNextDaysDisabled = quarterDisabledAfter(_this.state.date, _this.props); 9518 break; 9519 default: 9520 allNextDaysDisabled = monthDisabledAfter(_this.state.date, _this.props); 9521 break; 9522 } 9523 if (!((_a2 = _this.props.forceShowMonthNavigation) !== null && _a2 !== void 0 ? _a2 : Calendar2.defaultProps.forceShowMonthNavigation) && !_this.props.showDisabledMonthNavigation && allNextDaysDisabled || _this.props.showTimeSelectOnly) { 9524 return; 9525 } 9526 var classes = [ 9527 "react-datepicker__navigation", 9528 "react-datepicker__navigation--next" 9529 ]; 9530 var iconClasses = [ 9531 "react-datepicker__navigation-icon", 9532 "react-datepicker__navigation-icon--next" 9533 ]; 9534 if (_this.props.showTimeSelect) { 9535 classes.push("react-datepicker__navigation--next--with-time"); 9536 } 9537 if (_this.props.todayButton) { 9538 classes.push("react-datepicker__navigation--next--with-today-button"); 9539 } 9540 var clickHandler = _this.increaseMonth; 9541 if (_this.props.showMonthYearPicker || _this.props.showQuarterYearPicker || _this.props.showYearPicker) { 9542 clickHandler = _this.increaseYear; 9543 } 9544 if (allNextDaysDisabled && _this.props.showDisabledMonthNavigation) { 9545 classes.push("react-datepicker__navigation--next--disabled"); 9546 clickHandler = void 0; 9547 } 9548 var isForYear = _this.props.showMonthYearPicker || _this.props.showQuarterYearPicker || _this.props.showYearPicker; 9549 var _b = _this.props, _c = _b.nextMonthButtonLabel, nextMonthButtonLabel = _c === void 0 ? Calendar2.defaultProps.nextMonthButtonLabel : _c, _d = _b.nextYearButtonLabel, nextYearButtonLabel = _d === void 0 ? Calendar2.defaultProps.nextYearButtonLabel : _d; 9550 var _e = _this.props, _f = _e.nextMonthAriaLabel, nextMonthAriaLabel = _f === void 0 ? typeof nextMonthButtonLabel === "string" ? nextMonthButtonLabel : "Next Month" : _f, _g = _e.nextYearAriaLabel, nextYearAriaLabel = _g === void 0 ? typeof nextYearButtonLabel === "string" ? nextYearButtonLabel : "Next Year" : _g; 9551 return import_react3.default.createElement( 9552 "button", 9553 { type: "button", className: classes.join(" "), onClick: clickHandler, onKeyDown: _this.props.handleOnKeyDown, "aria-label": isForYear ? nextYearAriaLabel : nextMonthAriaLabel }, 9554 import_react3.default.createElement("span", { className: iconClasses.join(" ") }, isForYear ? nextYearButtonLabel : nextMonthButtonLabel) 9555 ); 9556 }; 9557 _this.renderCurrentMonth = function(date) { 9558 if (date === void 0) { 9559 date = _this.state.date; 9560 } 9561 var classes = ["react-datepicker__current-month"]; 9562 if (_this.props.showYearDropdown) { 9563 classes.push("react-datepicker__current-month--hasYearDropdown"); 9564 } 9565 if (_this.props.showMonthDropdown) { 9566 classes.push("react-datepicker__current-month--hasMonthDropdown"); 9567 } 9568 if (_this.props.showMonthYearDropdown) { 9569 classes.push("react-datepicker__current-month--hasMonthYearDropdown"); 9570 } 9571 return import_react3.default.createElement("h2", { className: classes.join(" ") }, formatDate(date, _this.props.dateFormat, _this.props.locale)); 9572 }; 9573 _this.renderYearDropdown = function(overrideHide) { 9574 if (overrideHide === void 0) { 9575 overrideHide = false; 9576 } 9577 if (!_this.props.showYearDropdown || overrideHide) { 9578 return; 9579 } 9580 return import_react3.default.createElement(YearDropdown, _assign({}, Calendar2.defaultProps, _this.props, { date: _this.state.date, onChange: _this.changeYear, year: getYear(_this.state.date) })); 9581 }; 9582 _this.renderMonthDropdown = function(overrideHide) { 9583 if (overrideHide === void 0) { 9584 overrideHide = false; 9585 } 9586 if (!_this.props.showMonthDropdown || overrideHide) { 9587 return; 9588 } 9589 return import_react3.default.createElement(MonthDropdown, _assign({}, Calendar2.defaultProps, _this.props, { month: getMonth(_this.state.date), onChange: _this.changeMonth })); 9590 }; 9591 _this.renderMonthYearDropdown = function(overrideHide) { 9592 if (overrideHide === void 0) { 9593 overrideHide = false; 9594 } 9595 if (!_this.props.showMonthYearDropdown || overrideHide) { 9596 return; 9597 } 9598 return import_react3.default.createElement(MonthYearDropdown, _assign({}, Calendar2.defaultProps, _this.props, { date: _this.state.date, onChange: _this.changeMonthYear })); 9599 }; 9600 _this.handleTodayButtonClick = function(event) { 9601 _this.props.onSelect(getStartOfToday(), event); 9602 _this.props.setPreSelection && _this.props.setPreSelection(getStartOfToday()); 9603 }; 9604 _this.renderTodayButton = function() { 9605 if (!_this.props.todayButton || _this.props.showTimeSelectOnly) { 9606 return; 9607 } 9608 return import_react3.default.createElement("div", { className: "react-datepicker__today-button", onClick: _this.handleTodayButtonClick }, _this.props.todayButton); 9609 }; 9610 _this.renderDefaultHeader = function(_a2) { 9611 var monthDate = _a2.monthDate, i = _a2.i; 9612 return import_react3.default.createElement( 9613 "div", 9614 { className: "react-datepicker__header ".concat(_this.props.showTimeSelect ? "react-datepicker__header--has-time-select" : "") }, 9615 _this.renderCurrentMonth(monthDate), 9616 import_react3.default.createElement( 9617 "div", 9618 { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(_this.props.dropdownMode), onFocus: _this.handleDropdownFocus }, 9619 _this.renderMonthDropdown(i !== 0), 9620 _this.renderMonthYearDropdown(i !== 0), 9621 _this.renderYearDropdown(i !== 0) 9622 ), 9623 import_react3.default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate)) 9624 ); 9625 }; 9626 _this.renderCustomHeader = function(headerArgs) { 9627 var _a2, _b; 9628 var monthDate = headerArgs.monthDate, i = headerArgs.i; 9629 if (_this.props.showTimeSelect && !_this.state.monthContainer || _this.props.showTimeSelectOnly) { 9630 return null; 9631 } 9632 var prevMonthButtonDisabled = monthDisabledBefore(_this.state.date, _this.props); 9633 var nextMonthButtonDisabled = monthDisabledAfter(_this.state.date, _this.props); 9634 var prevYearButtonDisabled = yearDisabledBefore(_this.state.date, _this.props); 9635 var nextYearButtonDisabled = yearDisabledAfter(_this.state.date, _this.props); 9636 var showDayNames = !_this.props.showMonthYearPicker && !_this.props.showQuarterYearPicker && !_this.props.showYearPicker; 9637 return import_react3.default.createElement( 9638 "div", 9639 { className: "react-datepicker__header react-datepicker__header--custom", onFocus: _this.props.onDropdownFocus }, 9640 (_b = (_a2 = _this.props).renderCustomHeader) === null || _b === void 0 ? void 0 : _b.call(_a2, _assign(_assign({}, _this.state), { customHeaderCount: i, monthDate, changeMonth: _this.changeMonth, changeYear: _this.changeYear, decreaseMonth: _this.decreaseMonth, increaseMonth: _this.increaseMonth, decreaseYear: _this.decreaseYear, increaseYear: _this.increaseYear, prevMonthButtonDisabled, nextMonthButtonDisabled, prevYearButtonDisabled, nextYearButtonDisabled })), 9641 showDayNames && import_react3.default.createElement("div", { className: "react-datepicker__day-names" }, _this.header(monthDate)) 9642 ); 9643 }; 9644 _this.renderYearHeader = function(_a2) { 9645 var monthDate = _a2.monthDate; 9646 var _b = _this.props, showYearPicker = _b.showYearPicker, _c = _b.yearItemNumber, yearItemNumber = _c === void 0 ? Calendar2.defaultProps.yearItemNumber : _c; 9647 var _d = getYearsPeriod(monthDate, yearItemNumber), startPeriod = _d.startPeriod, endPeriod = _d.endPeriod; 9648 return import_react3.default.createElement("div", { className: "react-datepicker__header react-datepicker-year-header" }, showYearPicker ? "".concat(startPeriod, " - ").concat(endPeriod) : getYear(monthDate)); 9649 }; 9650 _this.renderHeader = function(_a2) { 9651 var monthDate = _a2.monthDate, _b = _a2.i, i = _b === void 0 ? 0 : _b; 9652 var headerArgs = { monthDate, i }; 9653 switch (true) { 9654 case _this.props.renderCustomHeader !== void 0: 9655 return _this.renderCustomHeader(headerArgs); 9656 case (_this.props.showMonthYearPicker || _this.props.showQuarterYearPicker || _this.props.showYearPicker): 9657 return _this.renderYearHeader(headerArgs); 9658 default: 9659 return _this.renderDefaultHeader(headerArgs); 9660 } 9661 }; 9662 _this.renderMonths = function() { 9663 var _a2, _b; 9664 if (_this.props.showTimeSelectOnly || _this.props.showYearPicker) { 9665 return; 9666 } 9667 var monthList = []; 9668 var monthsShown = (_a2 = _this.props.monthsShown) !== null && _a2 !== void 0 ? _a2 : Calendar2.defaultProps.monthsShown; 9669 var monthsToSubtract = _this.props.showPreviousMonths ? monthsShown - 1 : 0; 9670 var fromMonthDate = _this.props.showMonthYearPicker || _this.props.showQuarterYearPicker ? addYears(_this.state.date, monthsToSubtract) : subMonths(_this.state.date, monthsToSubtract); 9671 var monthSelectedIn = (_b = _this.props.monthSelectedIn) !== null && _b !== void 0 ? _b : monthsToSubtract; 9672 for (var i = 0; i < monthsShown; ++i) { 9673 var monthsToAdd = i - monthSelectedIn + monthsToSubtract; 9674 var monthDate = _this.props.showMonthYearPicker || _this.props.showQuarterYearPicker ? addYears(fromMonthDate, monthsToAdd) : addMonths(fromMonthDate, monthsToAdd); 9675 var monthKey = "month-".concat(i); 9676 var monthShowsDuplicateDaysEnd = i < monthsShown - 1; 9677 var monthShowsDuplicateDaysStart = i > 0; 9678 monthList.push(import_react3.default.createElement( 9679 "div", 9680 { key: monthKey, ref: function(div) { 9681 _this.monthContainer = div !== null && div !== void 0 ? div : void 0; 9682 }, className: "react-datepicker__month-container" }, 9683 _this.renderHeader({ monthDate, i }), 9684 import_react3.default.createElement(Month, _assign({}, Calendar2.defaultProps, _this.props, { containerRef: _this.containerRef, ariaLabelPrefix: _this.props.monthAriaLabelPrefix, day: monthDate, onDayClick: _this.handleDayClick, handleOnKeyDown: _this.props.handleOnDayKeyDown, handleOnMonthKeyDown: _this.props.handleOnKeyDown, onDayMouseEnter: _this.handleDayMouseEnter, onMouseLeave: _this.handleMonthMouseLeave, orderInDisplay: i, selectingDate: _this.state.selectingDate, monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart })) 9685 )); 9686 } 9687 return monthList; 9688 }; 9689 _this.renderYears = function() { 9690 if (_this.props.showTimeSelectOnly) { 9691 return; 9692 } 9693 if (_this.props.showYearPicker) { 9694 return import_react3.default.createElement( 9695 "div", 9696 { className: "react-datepicker__year--container" }, 9697 _this.renderHeader({ monthDate: _this.state.date }), 9698 import_react3.default.createElement(Year, _assign({}, Calendar2.defaultProps, _this.props, { selectingDate: _this.state.selectingDate, date: _this.state.date, onDayClick: _this.handleDayClick, clearSelectingDate: _this.clearSelectingDate, onYearMouseEnter: _this.handleYearMouseEnter, onYearMouseLeave: _this.handleYearMouseLeave })) 9699 ); 9700 } 9701 return; 9702 }; 9703 _this.renderTimeSection = function() { 9704 if (_this.props.showTimeSelect && (_this.state.monthContainer || _this.props.showTimeSelectOnly)) { 9705 return import_react3.default.createElement(Time, _assign({}, Calendar2.defaultProps, _this.props, { onChange: _this.props.onTimeChange, format: _this.props.timeFormat, intervals: _this.props.timeIntervals, monthRef: _this.state.monthContainer })); 9706 } 9707 return; 9708 }; 9709 _this.renderInputTimeSection = function() { 9710 var time = _this.props.selected ? new Date(_this.props.selected) : void 0; 9711 var timeValid = time && isValid2(time) && Boolean(_this.props.selected); 9712 var timeString = timeValid ? "".concat(addZero(time.getHours()), ":").concat(addZero(time.getMinutes())) : ""; 9713 if (_this.props.showTimeInput) { 9714 return import_react3.default.createElement(InputTime, _assign({}, Calendar2.defaultProps, _this.props, { date: time, timeString, onChange: _this.props.onTimeChange })); 9715 } 9716 return; 9717 }; 9718 _this.renderAriaLiveRegion = function() { 9719 var _a2; 9720 var _b = getYearsPeriod(_this.state.date, (_a2 = _this.props.yearItemNumber) !== null && _a2 !== void 0 ? _a2 : Calendar2.defaultProps.yearItemNumber), startPeriod = _b.startPeriod, endPeriod = _b.endPeriod; 9721 var ariaLiveMessage; 9722 if (_this.props.showYearPicker) { 9723 ariaLiveMessage = "".concat(startPeriod, " - ").concat(endPeriod); 9724 } else if (_this.props.showMonthYearPicker || _this.props.showQuarterYearPicker) { 9725 ariaLiveMessage = getYear(_this.state.date); 9726 } else { 9727 ariaLiveMessage = "".concat(getMonthInLocale(getMonth(_this.state.date), _this.props.locale), " ").concat(getYear(_this.state.date)); 9728 } 9729 return import_react3.default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }, _this.state.isRenderAriaLiveMessage && ariaLiveMessage); 9730 }; 9731 _this.renderChildren = function() { 9732 if (_this.props.children) { 9733 return import_react3.default.createElement("div", { className: "react-datepicker__children-container" }, _this.props.children); 9734 } 9735 return; 9736 }; 9737 _this.containerRef = (0, import_react3.createRef)(); 9738 _this.state = { 9739 date: _this.getDateInView(), 9740 selectingDate: void 0, 9741 monthContainer: void 0, 9742 isRenderAriaLiveMessage: false 9743 }; 9744 return _this; 9745 } 9746 Object.defineProperty(Calendar2, "defaultProps", { 9747 get: function() { 9748 return { 9749 monthsShown: 1, 9750 forceShowMonthNavigation: false, 9751 timeCaption: "Time", 9752 previousYearButtonLabel: "Previous Year", 9753 nextYearButtonLabel: "Next Year", 9754 previousMonthButtonLabel: "Previous Month", 9755 nextMonthButtonLabel: "Next Month", 9756 yearItemNumber: DEFAULT_YEAR_ITEM_NUMBER 9757 }; 9758 }, 9759 enumerable: false, 9760 configurable: true 9761 }); 9762 Calendar2.prototype.componentDidMount = function() { 9763 var _this = this; 9764 if (this.props.showTimeSelect) { 9765 this.assignMonthContainer = function() { 9766 _this.setState({ monthContainer: _this.monthContainer }); 9767 }(); 9768 } 9769 }; 9770 Calendar2.prototype.componentDidUpdate = function(prevProps) { 9771 var _this = this; 9772 if (this.props.preSelection && (!isSameDay2(this.props.preSelection, prevProps.preSelection) || this.props.monthSelectedIn !== prevProps.monthSelectedIn)) { 9773 var hasMonthChanged_1 = !isSameMonth2(this.state.date, this.props.preSelection); 9774 this.setState({ 9775 date: this.props.preSelection 9776 }, function() { 9777 return hasMonthChanged_1 && _this.handleCustomMonthChange(_this.state.date); 9778 }); 9779 } else if (this.props.openToDate && !isSameDay2(this.props.openToDate, prevProps.openToDate)) { 9780 this.setState({ 9781 date: this.props.openToDate 9782 }); 9783 } 9784 }; 9785 Calendar2.prototype.render = function() { 9786 var Container = this.props.container || CalendarContainer; 9787 return import_react3.default.createElement( 9788 ClickOutsideWrapper, 9789 { onClickOutside: this.handleClickOutside, style: { display: "contents" }, ignoreClass: this.props.outsideClickIgnoreClass }, 9790 import_react3.default.createElement( 9791 "div", 9792 { style: { display: "contents" }, ref: this.containerRef }, 9793 import_react3.default.createElement( 9794 Container, 9795 { className: clsx("react-datepicker", this.props.className, { 9796 "react-datepicker--time-only": this.props.showTimeSelectOnly 9797 }), showTime: this.props.showTimeSelect || this.props.showTimeInput, showTimeSelectOnly: this.props.showTimeSelectOnly }, 9798 this.renderAriaLiveRegion(), 9799 this.renderPreviousButton(), 9800 this.renderNextButton(), 9801 this.renderMonths(), 9802 this.renderYears(), 9803 this.renderTodayButton(), 9804 this.renderTimeSection(), 9805 this.renderInputTimeSection(), 9806 this.renderChildren() 9807 ) 9808 ) 9809 ); 9810 }; 9811 return Calendar2; 9812 }(import_react3.Component) 9813); 9814var CalendarIcon = function(_a2) { 9815 var icon = _a2.icon, _b = _a2.className, className = _b === void 0 ? "" : _b, onClick = _a2.onClick; 9816 var defaultClass = "react-datepicker__calendar-icon"; 9817 if (typeof icon === "string") { 9818 return import_react3.default.createElement("i", { className: "".concat(defaultClass, " ").concat(icon, " ").concat(className), "aria-hidden": "true", onClick }); 9819 } 9820 if (import_react3.default.isValidElement(icon)) { 9821 var iconElement_1 = icon; 9822 return import_react3.default.cloneElement(iconElement_1, { 9823 className: "".concat(iconElement_1.props.className || "", " ").concat(defaultClass, " ").concat(className), 9824 onClick: function(event) { 9825 if (typeof iconElement_1.props.onClick === "function") { 9826 iconElement_1.props.onClick(event); 9827 } 9828 if (typeof onClick === "function") { 9829 onClick(event); 9830 } 9831 } 9832 }); 9833 } 9834 return import_react3.default.createElement( 9835 "svg", 9836 { className: "".concat(defaultClass, " ").concat(className), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", onClick }, 9837 import_react3.default.createElement("path", { d: "M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z" }) 9838 ); 9839}; 9840var Portal = ( 9841 /** @class */ 9842 function(_super) { 9843 __extends(Portal2, _super); 9844 function Portal2(props) { 9845 var _this = _super.call(this, props) || this; 9846 _this.portalRoot = null; 9847 _this.el = document.createElement("div"); 9848 return _this; 9849 } 9850 Portal2.prototype.componentDidMount = function() { 9851 this.portalRoot = (this.props.portalHost || document).getElementById(this.props.portalId); 9852 if (!this.portalRoot) { 9853 this.portalRoot = document.createElement("div"); 9854 this.portalRoot.setAttribute("id", this.props.portalId); 9855 (this.props.portalHost || document.body).appendChild(this.portalRoot); 9856 } 9857 this.portalRoot.appendChild(this.el); 9858 }; 9859 Portal2.prototype.componentWillUnmount = function() { 9860 if (this.portalRoot) { 9861 this.portalRoot.removeChild(this.el); 9862 } 9863 }; 9864 Portal2.prototype.render = function() { 9865 return import_react_dom3.default.createPortal(this.props.children, this.el); 9866 }; 9867 return Portal2; 9868 }(import_react3.Component) 9869); 9870var focusableElementsSelector = "[tabindex], a, button, input, select, textarea"; 9871var focusableFilter = function(node) { 9872 if (node instanceof HTMLAnchorElement) { 9873 return node.tabIndex !== -1; 9874 } 9875 return !node.disabled && node.tabIndex !== -1; 9876}; 9877var TabLoop = ( 9878 /** @class */ 9879 function(_super) { 9880 __extends(TabLoop2, _super); 9881 function TabLoop2(props) { 9882 var _this = _super.call(this, props) || this; 9883 _this.getTabChildren = function() { 9884 var _a2; 9885 return Array.prototype.slice.call((_a2 = _this.tabLoopRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelectorAll(focusableElementsSelector), 1, -1).filter(focusableFilter); 9886 }; 9887 _this.handleFocusStart = function() { 9888 var tabChildren = _this.getTabChildren(); 9889 tabChildren && tabChildren.length > 1 && tabChildren[tabChildren.length - 1].focus(); 9890 }; 9891 _this.handleFocusEnd = function() { 9892 var tabChildren = _this.getTabChildren(); 9893 tabChildren && tabChildren.length > 1 && tabChildren[0].focus(); 9894 }; 9895 _this.tabLoopRef = (0, import_react3.createRef)(); 9896 return _this; 9897 } 9898 TabLoop2.prototype.render = function() { 9899 var _a2; 9900 if (!((_a2 = this.props.enableTabLoop) !== null && _a2 !== void 0 ? _a2 : TabLoop2.defaultProps.enableTabLoop)) { 9901 return this.props.children; 9902 } 9903 return import_react3.default.createElement( 9904 "div", 9905 { className: "react-datepicker__tab-loop", ref: this.tabLoopRef }, 9906 import_react3.default.createElement("div", { className: "react-datepicker__tab-loop__start", tabIndex: 0, onFocus: this.handleFocusStart }), 9907 this.props.children, 9908 import_react3.default.createElement("div", { className: "react-datepicker__tab-loop__end", tabIndex: 0, onFocus: this.handleFocusEnd }) 9909 ); 9910 }; 9911 TabLoop2.defaultProps = { 9912 enableTabLoop: true 9913 }; 9914 return TabLoop2; 9915 }(import_react3.Component) 9916); 9917function withFloating(Component2) { 9918 var WithFloating = function(props) { 9919 var _a2; 9920 var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true; 9921 var arrowRef = (0, import_react3.useRef)(null); 9922 var floatingProps = useFloating2(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([ 9923 flip3({ padding: 15 }), 9924 offset3(10), 9925 arrow3({ element: arrowRef }) 9926 ], (_a2 = props.popperModifiers) !== null && _a2 !== void 0 ? _a2 : [], true) }, props.popperProps)); 9927 var componentProps = _assign(_assign({}, props), { hidePopper, popperProps: _assign(_assign({}, floatingProps), { arrowRef }) }); 9928 return import_react3.default.createElement(Component2, _assign({}, componentProps)); 9929 }; 9930 return WithFloating; 9931} 9932var PopperComponent = ( 9933 /** @class */ 9934 function(_super) { 9935 __extends(PopperComponent2, _super); 9936 function PopperComponent2() { 9937 return _super !== null && _super.apply(this, arguments) || this; 9938 } 9939 Object.defineProperty(PopperComponent2, "defaultProps", { 9940 get: function() { 9941 return { 9942 hidePopper: true 9943 }; 9944 }, 9945 enumerable: false, 9946 configurable: true 9947 }); 9948 PopperComponent2.prototype.render = function() { 9949 var _a2 = this.props, className = _a2.className, wrapperClassName = _a2.wrapperClassName, _b = _a2.hidePopper, hidePopper = _b === void 0 ? PopperComponent2.defaultProps.hidePopper : _b, popperComponent = _a2.popperComponent, targetComponent = _a2.targetComponent, enableTabLoop = _a2.enableTabLoop, popperOnKeyDown = _a2.popperOnKeyDown, portalId = _a2.portalId, portalHost = _a2.portalHost, popperProps = _a2.popperProps, showArrow = _a2.showArrow; 9950 var popper = void 0; 9951 if (!hidePopper) { 9952 var classes = clsx("react-datepicker-popper", className); 9953 popper = import_react3.default.createElement( 9954 TabLoop, 9955 { enableTabLoop }, 9956 import_react3.default.createElement( 9957 "div", 9958 { ref: popperProps.refs.setFloating, style: popperProps.floatingStyles, className: classes, "data-placement": popperProps.placement, onKeyDown: popperOnKeyDown }, 9959 popperComponent, 9960 showArrow && import_react3.default.createElement(FloatingArrow, { ref: popperProps.arrowRef, context: popperProps.context, fill: "currentColor", strokeWidth: 1, height: 8, width: 16, style: { transform: "translateY(-1px)" }, className: "react-datepicker__triangle" }) 9961 ) 9962 ); 9963 } 9964 if (this.props.popperContainer) { 9965 popper = (0, import_react3.createElement)(this.props.popperContainer, {}, popper); 9966 } 9967 if (portalId && !hidePopper) { 9968 popper = import_react3.default.createElement(Portal, { portalId, portalHost }, popper); 9969 } 9970 var wrapperClasses = clsx("react-datepicker-wrapper", wrapperClassName); 9971 return import_react3.default.createElement( 9972 import_react3.default.Fragment, 9973 null, 9974 import_react3.default.createElement("div", { ref: popperProps.refs.setReference, className: wrapperClasses }, targetComponent), 9975 popper 9976 ); 9977 }; 9978 return PopperComponent2; 9979 }(import_react3.Component) 9980); 9981var PopperComponent$1 = withFloating(PopperComponent); 9982var outsideClickIgnoreClass = "react-datepicker-ignore-onclickoutside"; 9983function hasPreSelectionChanged(date1, date2) { 9984 if (date1 && date2) { 9985 return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2); 9986 } 9987 return date1 !== date2; 9988} 9989var INPUT_ERR_1 = "Date input not valid."; 9990var DatePicker = ( 9991 /** @class */ 9992 function(_super) { 9993 __extends(DatePicker2, _super); 9994 function DatePicker2(props) { 9995 var _this = _super.call(this, props) || this; 9996 _this.calendar = null; 9997 _this.input = null; 9998 _this.getPreSelection = function() { 9999 return _this.props.openToDate ? _this.props.openToDate : _this.props.selectsEnd && _this.props.startDate ? _this.props.startDate : _this.props.selectsStart && _this.props.endDate ? _this.props.endDate : newDate(); 10000 }; 10001 _this.modifyHolidays = function() { 10002 var _a2; 10003 return (_a2 = _this.props.holidays) === null || _a2 === void 0 ? void 0 : _a2.reduce(function(accumulator, holiday) { 10004 var date = new Date(holiday.date); 10005 if (!isValid2(date)) { 10006 return accumulator; 10007 } 10008 return __spreadArray(__spreadArray([], accumulator, true), [_assign(_assign({}, holiday), { date })], false); 10009 }, []); 10010 }; 10011 _this.calcInitialState = function() { 10012 var _a2; 10013 var defaultPreSelection = _this.getPreSelection(); 10014 var minDate = getEffectiveMinDate(_this.props); 10015 var maxDate = getEffectiveMaxDate(_this.props); 10016 var boundedPreSelection = minDate && isBefore(defaultPreSelection, getStartOfDay(minDate)) ? minDate : maxDate && isAfter(defaultPreSelection, getEndOfDay(maxDate)) ? maxDate : defaultPreSelection; 10017 return { 10018 open: _this.props.startOpen || false, 10019 preventFocus: false, 10020 inputValue: null, 10021 preSelection: (_a2 = _this.props.selectsRange ? _this.props.startDate : _this.props.selected) !== null && _a2 !== void 0 ? _a2 : boundedPreSelection, 10022 // transforming highlighted days (perhaps nested array) 10023 // to flat Map for faster access in day.jsx 10024 highlightDates: getHighLightDaysMap(_this.props.highlightDates), 10025 focused: false, 10026 // used to focus day in inline version after month has changed, but not on 10027 // initial render 10028 shouldFocusDayInline: false, 10029 isRenderAriaLiveMessage: false, 10030 wasHidden: false 10031 }; 10032 }; 10033 _this.resetHiddenStatus = function() { 10034 _this.setState(_assign(_assign({}, _this.state), { wasHidden: false })); 10035 }; 10036 _this.setHiddenStatus = function() { 10037 _this.setState(_assign(_assign({}, _this.state), { wasHidden: true })); 10038 }; 10039 _this.setHiddenStateOnVisibilityHidden = function() { 10040 if (document.visibilityState !== "hidden") { 10041 return; 10042 } 10043 _this.setHiddenStatus(); 10044 }; 10045 _this.clearPreventFocusTimeout = function() { 10046 if (_this.preventFocusTimeout) { 10047 clearTimeout(_this.preventFocusTimeout); 10048 } 10049 }; 10050 _this.setFocus = function() { 10051 var _a2, _b; 10052 (_b = (_a2 = _this.input) === null || _a2 === void 0 ? void 0 : _a2.focus) === null || _b === void 0 ? void 0 : _b.call(_a2, { preventScroll: true }); 10053 }; 10054 _this.setBlur = function() { 10055 var _a2, _b; 10056 (_b = (_a2 = _this.input) === null || _a2 === void 0 ? void 0 : _a2.blur) === null || _b === void 0 ? void 0 : _b.call(_a2); 10057 _this.cancelFocusInput(); 10058 }; 10059 _this.deferBlur = function() { 10060 requestAnimationFrame(function() { 10061 _this.setBlur(); 10062 }); 10063 }; 10064 _this.setOpen = function(open, skipSetBlur) { 10065 if (skipSetBlur === void 0) { 10066 skipSetBlur = false; 10067 } 10068 _this.setState({ 10069 open, 10070 preSelection: open && _this.state.open ? _this.state.preSelection : _this.calcInitialState().preSelection, 10071 lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE 10072 }, function() { 10073 if (!open) { 10074 _this.setState(function(prev) { 10075 return { 10076 focused: skipSetBlur ? prev.focused : false 10077 }; 10078 }, function() { 10079 !skipSetBlur && _this.deferBlur(); 10080 _this.setState({ inputValue: null }); 10081 }); 10082 } 10083 }); 10084 }; 10085 _this.inputOk = function() { 10086 return isDate(_this.state.preSelection); 10087 }; 10088 _this.isCalendarOpen = function() { 10089 return _this.props.open === void 0 ? _this.state.open && !_this.props.disabled && !_this.props.readOnly : _this.props.open; 10090 }; 10091 _this.handleFocus = function(event) { 10092 var _a2, _b; 10093 var isAutoReFocus = _this.state.wasHidden; 10094 var isOpenAllowed = isAutoReFocus ? _this.state.open : true; 10095 if (isAutoReFocus) { 10096 _this.resetHiddenStatus(); 10097 } 10098 if (!_this.state.preventFocus) { 10099 (_b = (_a2 = _this.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 10100 if (isOpenAllowed && !_this.props.preventOpenOnFocus && !_this.props.readOnly) { 10101 _this.setOpen(true); 10102 } 10103 } 10104 _this.setState({ focused: true }); 10105 }; 10106 _this.sendFocusBackToInput = function() { 10107 if (_this.preventFocusTimeout) { 10108 _this.clearPreventFocusTimeout(); 10109 } 10110 _this.setState({ preventFocus: true }, function() { 10111 _this.preventFocusTimeout = setTimeout(function() { 10112 _this.setFocus(); 10113 _this.setState({ preventFocus: false }); 10114 }); 10115 }); 10116 }; 10117 _this.cancelFocusInput = function() { 10118 clearTimeout(_this.inputFocusTimeout); 10119 _this.inputFocusTimeout = void 0; 10120 }; 10121 _this.deferFocusInput = function() { 10122 _this.cancelFocusInput(); 10123 _this.inputFocusTimeout = setTimeout(function() { 10124 return _this.setFocus(); 10125 }, 1); 10126 }; 10127 _this.handleDropdownFocus = function() { 10128 _this.cancelFocusInput(); 10129 }; 10130 _this.handleBlur = function(event) { 10131 var _a2, _b; 10132 if (!_this.state.open || _this.props.withPortal || _this.props.showTimeInput) { 10133 (_b = (_a2 = _this.props).onBlur) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 10134 } 10135 if (_this.state.open && _this.props.open === false) { 10136 _this.setOpen(false); 10137 } 10138 _this.setState({ focused: false }); 10139 }; 10140 _this.handleCalendarClickOutside = function(event) { 10141 var _a2, _b; 10142 if (!_this.props.inline) { 10143 _this.setOpen(false); 10144 } 10145 (_b = (_a2 = _this.props).onClickOutside) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 10146 if (_this.props.withPortal) { 10147 event.preventDefault(); 10148 } 10149 }; 10150 _this.handleChange = function() { 10151 var _a2, _b, _c, _d, _e; 10152 var allArgs = []; 10153 for (var _i = 0; _i < arguments.length; _i++) { 10154 allArgs[_i] = arguments[_i]; 10155 } 10156 var event = allArgs[0]; 10157 if (_this.props.onChangeRaw) { 10158 _this.props.onChangeRaw.apply(_this, allArgs); 10159 if (!event || typeof event.isDefaultPrevented !== "function" || event.isDefaultPrevented()) { 10160 return; 10161 } 10162 } 10163 _this.setState({ 10164 inputValue: (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : null, 10165 lastPreSelectChange: PRESELECT_CHANGE_VIA_INPUT 10166 }); 10167 var _f = _this.props, selectsRange = _f.selectsRange, startDate = _f.startDate, endDate = _f.endDate; 10168 var dateFormat = (_a2 = _this.props.dateFormat) !== null && _a2 !== void 0 ? _a2 : DatePicker2.defaultProps.dateFormat; 10169 var strictParsing = (_b = _this.props.strictParsing) !== null && _b !== void 0 ? _b : DatePicker2.defaultProps.strictParsing; 10170 var value = (event === null || event === void 0 ? void 0 : event.target) instanceof HTMLInputElement ? event.target.value : ""; 10171 if (selectsRange) { 10172 var _g = value.split("-", 2).map(function(val) { 10173 return val.trim(); 10174 }), valueStart = _g[0], valueEnd = _g[1]; 10175 var startDateNew = parseDate2(valueStart !== null && valueStart !== void 0 ? valueStart : "", dateFormat, _this.props.locale, strictParsing); 10176 var endDateNew = parseDate2(valueEnd !== null && valueEnd !== void 0 ? valueEnd : "", dateFormat, _this.props.locale, strictParsing); 10177 var startChanged = (startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) !== (startDateNew === null || startDateNew === void 0 ? void 0 : startDateNew.getTime()); 10178 var endChanged = (endDate === null || endDate === void 0 ? void 0 : endDate.getTime()) !== (endDateNew === null || endDateNew === void 0 ? void 0 : endDateNew.getTime()); 10179 if (!startChanged && !endChanged) { 10180 return; 10181 } 10182 if (startDateNew && isDayDisabled(startDateNew, _this.props)) { 10183 return; 10184 } 10185 if (endDateNew && isDayDisabled(endDateNew, _this.props)) { 10186 return; 10187 } 10188 (_d = (_c = _this.props).onChange) === null || _d === void 0 ? void 0 : _d.call(_c, [startDateNew, endDateNew], event); 10189 } else { 10190 var date = parseDate2(value, dateFormat, _this.props.locale, strictParsing, (_e = _this.props.selected) !== null && _e !== void 0 ? _e : void 0); 10191 if (date || !value) { 10192 _this.setSelected(date, event, true); 10193 } 10194 } 10195 }; 10196 _this.handleSelect = function(date, event, monthSelectedIn) { 10197 if (_this.props.shouldCloseOnSelect && !_this.props.showTimeSelect) { 10198 _this.sendFocusBackToInput(); 10199 } 10200 if (_this.props.onChangeRaw) { 10201 _this.props.onChangeRaw(event); 10202 } 10203 _this.setSelected(date, event, false, monthSelectedIn); 10204 if (_this.props.showDateSelect) { 10205 _this.setState({ isRenderAriaLiveMessage: true }); 10206 } 10207 if (!_this.props.shouldCloseOnSelect || _this.props.showTimeSelect) { 10208 _this.setPreSelection(date); 10209 } else if (!_this.props.inline) { 10210 if (!_this.props.selectsRange) { 10211 _this.setOpen(false); 10212 } 10213 var _a2 = _this.props, startDate = _a2.startDate, endDate = _a2.endDate; 10214 if (startDate && !endDate && (_this.props.swapRange || !isDateBefore(date, startDate))) { 10215 _this.setOpen(false); 10216 } 10217 } 10218 }; 10219 _this.setSelected = function(date, event, keepInput, monthSelectedIn) { 10220 var _a2, _b; 10221 var changedDate = date; 10222 if (_this.props.showYearPicker) { 10223 if (changedDate !== null && isYearDisabled(getYear(changedDate), _this.props)) { 10224 return; 10225 } 10226 } else if (_this.props.showMonthYearPicker) { 10227 if (changedDate !== null && isMonthDisabled(changedDate, _this.props)) { 10228 return; 10229 } 10230 } else { 10231 if (changedDate !== null && isDayDisabled(changedDate, _this.props)) { 10232 return; 10233 } 10234 } 10235 var _c = _this.props, onChange = _c.onChange, selectsRange = _c.selectsRange, startDate = _c.startDate, endDate = _c.endDate, selectsMultiple = _c.selectsMultiple, selectedDates = _c.selectedDates, minTime2 = _c.minTime, swapRange = _c.swapRange; 10236 if (!isEqual2(_this.props.selected, changedDate) || _this.props.allowSameDay || selectsRange || selectsMultiple) { 10237 if (changedDate !== null) { 10238 if (_this.props.selected && (!keepInput || !_this.props.showTimeSelect && !_this.props.showTimeSelectOnly && !_this.props.showTimeInput)) { 10239 changedDate = setTime(changedDate, { 10240 hour: getHours(_this.props.selected), 10241 minute: getMinutes(_this.props.selected), 10242 second: getSeconds(_this.props.selected) 10243 }); 10244 } 10245 if (!keepInput && (_this.props.showTimeSelect || _this.props.showTimeSelectOnly)) { 10246 if (minTime2) { 10247 changedDate = setTime(changedDate, { 10248 hour: minTime2.getHours(), 10249 minute: minTime2.getMinutes(), 10250 second: minTime2.getSeconds() 10251 }); 10252 } 10253 } 10254 if (!_this.props.inline) { 10255 _this.setState({ 10256 preSelection: changedDate 10257 }); 10258 } 10259 if (!_this.props.focusSelectedMonth) { 10260 _this.setState({ monthSelectedIn }); 10261 } 10262 } 10263 if (selectsRange) { 10264 var noRanges = !startDate && !endDate; 10265 var hasStartRange = startDate && !endDate; 10266 var isRangeFilled = startDate && endDate; 10267 if (noRanges) { 10268 onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event); 10269 } else if (hasStartRange) { 10270 if (changedDate === null) { 10271 onChange === null || onChange === void 0 ? void 0 : onChange([null, null], event); 10272 } else if (isDateBefore(changedDate, startDate)) { 10273 if (swapRange) { 10274 onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, startDate], event); 10275 } else { 10276 onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event); 10277 } 10278 } else { 10279 onChange === null || onChange === void 0 ? void 0 : onChange([startDate, changedDate], event); 10280 } 10281 } 10282 if (isRangeFilled) { 10283 onChange === null || onChange === void 0 ? void 0 : onChange([changedDate, null], event); 10284 } 10285 } else if (selectsMultiple) { 10286 if (changedDate !== null) { 10287 if (!(selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.length)) { 10288 onChange === null || onChange === void 0 ? void 0 : onChange([changedDate], event); 10289 } else { 10290 var isChangedDateAlreadySelected = selectedDates.some(function(selectedDate) { 10291 return isSameDay2(selectedDate, changedDate); 10292 }); 10293 if (isChangedDateAlreadySelected) { 10294 var nextDates = selectedDates.filter(function(selectedDate) { 10295 return !isSameDay2(selectedDate, changedDate); 10296 }); 10297 onChange === null || onChange === void 0 ? void 0 : onChange(nextDates, event); 10298 } else { 10299 onChange === null || onChange === void 0 ? void 0 : onChange(__spreadArray(__spreadArray([], selectedDates, true), [changedDate], false), event); 10300 } 10301 } 10302 } 10303 } else { 10304 onChange === null || onChange === void 0 ? void 0 : onChange(changedDate, event); 10305 } 10306 } 10307 if (!keepInput) { 10308 (_b = (_a2 = _this.props).onSelect) === null || _b === void 0 ? void 0 : _b.call(_a2, changedDate, event); 10309 _this.setState({ inputValue: null }); 10310 } 10311 }; 10312 _this.setPreSelection = function(date) { 10313 var hasMinDate = isDate(_this.props.minDate); 10314 var hasMaxDate = isDate(_this.props.maxDate); 10315 var isValidDateSelection = true; 10316 if (date) { 10317 var dateStartOfDay = getStartOfDay(date); 10318 if (hasMinDate && hasMaxDate) { 10319 isValidDateSelection = isDayInRange(date, _this.props.minDate, _this.props.maxDate); 10320 } else if (hasMinDate) { 10321 var minDateStartOfDay = getStartOfDay(_this.props.minDate); 10322 isValidDateSelection = isAfter(date, minDateStartOfDay) || isEqual2(dateStartOfDay, minDateStartOfDay); 10323 } else if (hasMaxDate) { 10324 var maxDateEndOfDay = getEndOfDay(_this.props.maxDate); 10325 isValidDateSelection = isBefore(date, maxDateEndOfDay) || isEqual2(dateStartOfDay, maxDateEndOfDay); 10326 } 10327 } 10328 if (isValidDateSelection) { 10329 _this.setState({ 10330 preSelection: date 10331 }); 10332 } 10333 }; 10334 _this.toggleCalendar = function() { 10335 _this.setOpen(!_this.state.open); 10336 }; 10337 _this.handleTimeChange = function(time) { 10338 var _a2, _b; 10339 if (_this.props.selectsRange || _this.props.selectsMultiple) { 10340 return; 10341 } 10342 var selected = _this.props.selected ? _this.props.selected : _this.getPreSelection(); 10343 var changedDate = _this.props.selected ? time : setTime(selected, { 10344 hour: getHours(time), 10345 minute: getMinutes(time) 10346 }); 10347 _this.setState({ 10348 preSelection: changedDate 10349 }); 10350 (_b = (_a2 = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a2, changedDate); 10351 if (_this.props.shouldCloseOnSelect && !_this.props.showTimeInput) { 10352 _this.sendFocusBackToInput(); 10353 _this.setOpen(false); 10354 } 10355 if (_this.props.showTimeInput) { 10356 _this.setOpen(true); 10357 } 10358 if (_this.props.showTimeSelectOnly || _this.props.showTimeSelect) { 10359 _this.setState({ isRenderAriaLiveMessage: true }); 10360 } 10361 _this.setState({ inputValue: null }); 10362 }; 10363 _this.onInputClick = function() { 10364 var _a2, _b; 10365 if (!_this.props.disabled && !_this.props.readOnly) { 10366 _this.setOpen(true); 10367 } 10368 (_b = (_a2 = _this.props).onInputClick) === null || _b === void 0 ? void 0 : _b.call(_a2); 10369 }; 10370 _this.onInputKeyDown = function(event) { 10371 var _a2, _b, _c, _d, _e, _f; 10372 (_b = (_a2 = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 10373 var eventKey = event.key; 10374 if (!_this.state.open && !_this.props.inline && !_this.props.preventOpenOnFocus) { 10375 if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp || eventKey === KeyType.Enter) { 10376 (_c = _this.onInputClick) === null || _c === void 0 ? void 0 : _c.call(_this); 10377 } 10378 return; 10379 } 10380 if (_this.state.open) { 10381 if (eventKey === KeyType.ArrowDown || eventKey === KeyType.ArrowUp) { 10382 event.preventDefault(); 10383 var selectorString = _this.props.showTimeSelectOnly ? ".react-datepicker__time-list-item[tabindex='0']" : _this.props.showWeekPicker && _this.props.showWeekNumbers ? '.react-datepicker__week-number[tabindex="0"]' : _this.props.showFullMonthYearPicker || _this.props.showMonthYearPicker ? '.react-datepicker__month-text[tabindex="0"]' : '.react-datepicker__day[tabindex="0"]'; 10384 var selectedItem = ((_d = _this.calendar) === null || _d === void 0 ? void 0 : _d.containerRef.current) instanceof Element && _this.calendar.containerRef.current.querySelector(selectorString); 10385 selectedItem instanceof HTMLElement && selectedItem.focus({ preventScroll: true }); 10386 return; 10387 } 10388 var copy = newDate(_this.state.preSelection); 10389 if (eventKey === KeyType.Enter) { 10390 event.preventDefault(); 10391 event.target.blur(); 10392 if (_this.inputOk() && _this.state.lastPreSelectChange === PRESELECT_CHANGE_VIA_NAVIGATE) { 10393 _this.handleSelect(copy, event); 10394 !_this.props.shouldCloseOnSelect && _this.setPreSelection(copy); 10395 } else { 10396 _this.setOpen(false); 10397 } 10398 } else if (eventKey === KeyType.Escape) { 10399 event.preventDefault(); 10400 event.target.blur(); 10401 _this.sendFocusBackToInput(); 10402 _this.setOpen(false); 10403 } else if (eventKey === KeyType.Tab) { 10404 _this.setOpen(false); 10405 } 10406 if (!_this.inputOk()) { 10407 (_f = (_e = _this.props).onInputError) === null || _f === void 0 ? void 0 : _f.call(_e, { code: 1, msg: INPUT_ERR_1 }); 10408 } 10409 } 10410 }; 10411 _this.onPortalKeyDown = function(event) { 10412 var eventKey = event.key; 10413 if (eventKey === KeyType.Escape) { 10414 event.preventDefault(); 10415 _this.setState({ 10416 preventFocus: true 10417 }, function() { 10418 _this.setOpen(false); 10419 setTimeout(function() { 10420 _this.setFocus(); 10421 _this.setState({ preventFocus: false }); 10422 }); 10423 }); 10424 } 10425 }; 10426 _this.onDayKeyDown = function(event) { 10427 var _a2, _b, _c, _d, _e, _f; 10428 var _g = _this.props, minDate = _g.minDate, maxDate = _g.maxDate, disabledKeyboardNavigation = _g.disabledKeyboardNavigation, showWeekPicker = _g.showWeekPicker, shouldCloseOnSelect = _g.shouldCloseOnSelect, locale = _g.locale, calendarStartDay = _g.calendarStartDay, adjustDateOnChange = _g.adjustDateOnChange, inline4 = _g.inline; 10429 (_b = (_a2 = _this.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a2, event); 10430 if (disabledKeyboardNavigation) 10431 return; 10432 var eventKey = event.key; 10433 var isShiftKeyActive = event.shiftKey; 10434 var copy = newDate(_this.state.preSelection); 10435 var calculateNewDate = function(eventKey2, date) { 10436 var newCalculatedDate = date; 10437 switch (eventKey2) { 10438 case KeyType.ArrowRight: 10439 newCalculatedDate = showWeekPicker ? addWeeks(date, 1) : addDays(date, 1); 10440 break; 10441 case KeyType.ArrowLeft: 10442 newCalculatedDate = showWeekPicker ? subWeeks(date, 1) : subDays(date, 1); 10443 break; 10444 case KeyType.ArrowUp: 10445 newCalculatedDate = subWeeks(date, 1); 10446 break; 10447 case KeyType.ArrowDown: 10448 newCalculatedDate = addWeeks(date, 1); 10449 break; 10450 case KeyType.PageUp: 10451 newCalculatedDate = isShiftKeyActive ? subYears(date, 1) : subMonths(date, 1); 10452 break; 10453 case KeyType.PageDown: 10454 newCalculatedDate = isShiftKeyActive ? addYears(date, 1) : addMonths(date, 1); 10455 break; 10456 case KeyType.Home: 10457 newCalculatedDate = getStartOfWeek(date, locale, calendarStartDay); 10458 break; 10459 case KeyType.End: 10460 newCalculatedDate = getEndOfWeek(date); 10461 break; 10462 } 10463 return newCalculatedDate; 10464 }; 10465 var getNewDate = function(eventKey2, date) { 10466 var MAX_ITERATIONS = 40; 10467 var eventKeyCopy = eventKey2; 10468 var validDateFound = false; 10469 var iterations = 0; 10470 var newSelection2 = calculateNewDate(eventKey2, date); 10471 while (!validDateFound) { 10472 if (iterations >= MAX_ITERATIONS) { 10473 newSelection2 = date; 10474 break; 10475 } 10476 if (minDate && newSelection2 < minDate) { 10477 eventKeyCopy = KeyType.ArrowRight; 10478 newSelection2 = isDayDisabled(minDate, _this.props) ? calculateNewDate(eventKeyCopy, newSelection2) : minDate; 10479 } 10480 if (maxDate && newSelection2 > maxDate) { 10481 eventKeyCopy = KeyType.ArrowLeft; 10482 newSelection2 = isDayDisabled(maxDate, _this.props) ? calculateNewDate(eventKeyCopy, newSelection2) : maxDate; 10483 } 10484 if (isDayDisabled(newSelection2, _this.props)) { 10485 if (eventKeyCopy === KeyType.PageUp || eventKeyCopy === KeyType.Home) { 10486 eventKeyCopy = KeyType.ArrowRight; 10487 } 10488 if (eventKeyCopy === KeyType.PageDown || eventKeyCopy === KeyType.End) { 10489 eventKeyCopy = KeyType.ArrowLeft; 10490 } 10491 newSelection2 = calculateNewDate(eventKeyCopy, newSelection2); 10492 } else { 10493 validDateFound = true; 10494 } 10495 iterations++; 10496 } 10497 return newSelection2; 10498 }; 10499 if (eventKey === KeyType.Enter) { 10500 event.preventDefault(); 10501 _this.handleSelect(copy, event); 10502 !shouldCloseOnSelect && _this.setPreSelection(copy); 10503 return; 10504 } else if (eventKey === KeyType.Escape) { 10505 event.preventDefault(); 10506 _this.setOpen(false); 10507 if (!_this.inputOk()) { 10508 (_d = (_c = _this.props).onInputError) === null || _d === void 0 ? void 0 : _d.call(_c, { code: 1, msg: INPUT_ERR_1 }); 10509 } 10510 return; 10511 } 10512 var newSelection = null; 10513 switch (eventKey) { 10514 case KeyType.ArrowLeft: 10515 case KeyType.ArrowRight: 10516 case KeyType.ArrowUp: 10517 case KeyType.ArrowDown: 10518 case KeyType.PageUp: 10519 case KeyType.PageDown: 10520 case KeyType.Home: 10521 case KeyType.End: 10522 newSelection = getNewDate(eventKey, copy); 10523 break; 10524 } 10525 if (!newSelection) { 10526 (_f = (_e = _this.props).onInputError) === null || _f === void 0 ? void 0 : _f.call(_e, { code: 1, msg: INPUT_ERR_1 }); 10527 return; 10528 } 10529 event.preventDefault(); 10530 _this.setState({ lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE }); 10531 if (adjustDateOnChange) { 10532 _this.setSelected(newSelection); 10533 } 10534 _this.setPreSelection(newSelection); 10535 if (inline4) { 10536 var prevMonth = getMonth(copy); 10537 var newMonth = getMonth(newSelection); 10538 var prevYear = getYear(copy); 10539 var newYear = getYear(newSelection); 10540 if (prevMonth !== newMonth || prevYear !== newYear) { 10541 _this.setState({ shouldFocusDayInline: true }); 10542 } else { 10543 _this.setState({ shouldFocusDayInline: false }); 10544 } 10545 } 10546 }; 10547 _this.onPopperKeyDown = function(event) { 10548 var eventKey = event.key; 10549 if (eventKey === KeyType.Escape) { 10550 event.preventDefault(); 10551 _this.sendFocusBackToInput(); 10552 } 10553 }; 10554 _this.onClearClick = function(event) { 10555 if (event) { 10556 if (event.preventDefault) { 10557 event.preventDefault(); 10558 } 10559 } 10560 _this.sendFocusBackToInput(); 10561 var _a2 = _this.props, selectsRange = _a2.selectsRange, onChange = _a2.onChange; 10562 if (selectsRange) { 10563 onChange === null || onChange === void 0 ? void 0 : onChange([null, null], event); 10564 } else { 10565 onChange === null || onChange === void 0 ? void 0 : onChange(null, event); 10566 } 10567 _this.setState({ inputValue: null }); 10568 }; 10569 _this.clear = function() { 10570 _this.onClearClick(); 10571 }; 10572 _this.onScroll = function(event) { 10573 if (typeof _this.props.closeOnScroll === "boolean" && _this.props.closeOnScroll) { 10574 if (event.target === document || event.target === document.documentElement || event.target === document.body) { 10575 _this.setOpen(false); 10576 } 10577 } else if (typeof _this.props.closeOnScroll === "function") { 10578 if (_this.props.closeOnScroll(event)) { 10579 _this.setOpen(false); 10580 } 10581 } 10582 }; 10583 _this.renderCalendar = function() { 10584 var _a2, _b; 10585 if (!_this.props.inline && !_this.isCalendarOpen()) { 10586 return null; 10587 } 10588 return import_react3.default.createElement(Calendar, _assign({ showMonthYearDropdown: void 0, ref: function(elem) { 10589 _this.calendar = elem; 10590 } }, _this.props, _this.state, { setOpen: _this.setOpen, dateFormat: (_a2 = _this.props.dateFormatCalendar) !== null && _a2 !== void 0 ? _a2 : DatePicker2.defaultProps.dateFormatCalendar, onSelect: _this.handleSelect, onClickOutside: _this.handleCalendarClickOutside, holidays: getHolidaysMap(_this.modifyHolidays()), outsideClickIgnoreClass, onDropdownFocus: _this.handleDropdownFocus, onTimeChange: _this.handleTimeChange, className: _this.props.calendarClassName, container: _this.props.calendarContainer, handleOnKeyDown: _this.props.onKeyDown, handleOnDayKeyDown: _this.onDayKeyDown, setPreSelection: _this.setPreSelection, dropdownMode: (_b = _this.props.dropdownMode) !== null && _b !== void 0 ? _b : DatePicker2.defaultProps.dropdownMode }), _this.props.children); 10591 }; 10592 _this.renderAriaLiveRegion = function() { 10593 var _a2 = _this.props, _b = _a2.dateFormat, dateFormat = _b === void 0 ? DatePicker2.defaultProps.dateFormat : _b, locale = _a2.locale; 10594 var isContainsTime = _this.props.showTimeInput || _this.props.showTimeSelect; 10595 var longDateFormat = isContainsTime ? "PPPPp" : "PPPP"; 10596 var ariaLiveMessage; 10597 if (_this.props.selectsRange) { 10598 ariaLiveMessage = "Selected start date: ".concat(safeDateFormat(_this.props.startDate, { 10599 dateFormat: longDateFormat, 10600 locale 10601 }), ". ").concat(_this.props.endDate ? "End date: " + safeDateFormat(_this.props.endDate, { 10602 dateFormat: longDateFormat, 10603 locale 10604 }) : ""); 10605 } else { 10606 if (_this.props.showTimeSelectOnly) { 10607 ariaLiveMessage = "Selected time: ".concat(safeDateFormat(_this.props.selected, { dateFormat, locale })); 10608 } else if (_this.props.showYearPicker) { 10609 ariaLiveMessage = "Selected year: ".concat(safeDateFormat(_this.props.selected, { dateFormat: "yyyy", locale })); 10610 } else if (_this.props.showMonthYearPicker) { 10611 ariaLiveMessage = "Selected month: ".concat(safeDateFormat(_this.props.selected, { dateFormat: "MMMM yyyy", locale })); 10612 } else if (_this.props.showQuarterYearPicker) { 10613 ariaLiveMessage = "Selected quarter: ".concat(safeDateFormat(_this.props.selected, { 10614 dateFormat: "yyyy, QQQ", 10615 locale 10616 })); 10617 } else { 10618 ariaLiveMessage = "Selected date: ".concat(safeDateFormat(_this.props.selected, { 10619 dateFormat: longDateFormat, 10620 locale 10621 })); 10622 } 10623 } 10624 return import_react3.default.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }, ariaLiveMessage); 10625 }; 10626 _this.renderDateInput = function() { 10627 var _a2, _b; 10628 var _c; 10629 var className = clsx(_this.props.className, (_a2 = {}, _a2[outsideClickIgnoreClass] = _this.state.open, _a2)); 10630 var customInput = _this.props.customInput || import_react3.default.createElement("input", { type: "text" }); 10631 var customInputRef = _this.props.customInputRef || "ref"; 10632 var _d = _this.props, _e = _d.dateFormat, dateFormat = _e === void 0 ? DatePicker2.defaultProps.dateFormat : _e, locale = _d.locale; 10633 var inputValue = typeof _this.props.value === "string" ? _this.props.value : typeof _this.state.inputValue === "string" ? _this.state.inputValue : _this.props.selectsRange ? safeDateRangeFormat(_this.props.startDate, _this.props.endDate, { 10634 dateFormat, 10635 locale 10636 }) : _this.props.selectsMultiple ? safeMultipleDatesFormat((_c = _this.props.selectedDates) !== null && _c !== void 0 ? _c : [], { 10637 dateFormat, 10638 locale 10639 }) : safeDateFormat(_this.props.selected, { 10640 dateFormat, 10641 locale 10642 }); 10643 return (0, import_react3.cloneElement)(customInput, (_b = {}, _b[customInputRef] = function(input) { 10644 _this.input = input; 10645 }, _b.value = inputValue, _b.onBlur = _this.handleBlur, _b.onChange = _this.handleChange, _b.onClick = _this.onInputClick, _b.onFocus = _this.handleFocus, _b.onKeyDown = _this.onInputKeyDown, _b.id = _this.props.id, _b.name = _this.props.name, _b.form = _this.props.form, _b.autoFocus = _this.props.autoFocus, _b.placeholder = _this.props.placeholderText, _b.disabled = _this.props.disabled, _b.autoComplete = _this.props.autoComplete, _b.className = clsx(customInput.props.className, className), _b.title = _this.props.title, _b.readOnly = _this.props.readOnly, _b.required = _this.props.required, _b.tabIndex = _this.props.tabIndex, _b["aria-describedby"] = _this.props.ariaDescribedBy, _b["aria-invalid"] = _this.props.ariaInvalid, _b["aria-labelledby"] = _this.props.ariaLabelledBy, _b["aria-required"] = _this.props.ariaRequired, _b)); 10646 }; 10647 _this.renderClearButton = function() { 10648 var _a2 = _this.props, isClearable = _a2.isClearable, disabled = _a2.disabled, selected = _a2.selected, startDate = _a2.startDate, endDate = _a2.endDate, clearButtonTitle = _a2.clearButtonTitle, _b = _a2.clearButtonClassName, clearButtonClassName = _b === void 0 ? "" : _b, _c = _a2.ariaLabelClose, ariaLabelClose = _c === void 0 ? "Close" : _c, selectedDates = _a2.selectedDates; 10649 if (isClearable && (selected != null || startDate != null || endDate != null || (selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.length))) { 10650 return import_react3.default.createElement("button", { type: "button", className: clsx("react-datepicker__close-icon", clearButtonClassName, { "react-datepicker__close-icon--disabled": disabled }), disabled, "aria-label": ariaLabelClose, onClick: _this.onClearClick, title: clearButtonTitle, tabIndex: -1 }); 10651 } else { 10652 return null; 10653 } 10654 }; 10655 _this.state = _this.calcInitialState(); 10656 _this.preventFocusTimeout = void 0; 10657 return _this; 10658 } 10659 Object.defineProperty(DatePicker2, "defaultProps", { 10660 get: function() { 10661 return { 10662 allowSameDay: false, 10663 dateFormat: "MM/dd/yyyy", 10664 dateFormatCalendar: "LLLL yyyy", 10665 disabled: false, 10666 disabledKeyboardNavigation: false, 10667 dropdownMode: "scroll", 10668 preventOpenOnFocus: false, 10669 monthsShown: 1, 10670 readOnly: false, 10671 withPortal: false, 10672 selectsDisabledDaysInRange: false, 10673 shouldCloseOnSelect: true, 10674 showTimeSelect: false, 10675 showTimeInput: false, 10676 showPreviousMonths: false, 10677 showMonthYearPicker: false, 10678 showFullMonthYearPicker: false, 10679 showTwoColumnMonthYearPicker: false, 10680 showFourColumnMonthYearPicker: false, 10681 showYearPicker: false, 10682 showQuarterYearPicker: false, 10683 showWeekPicker: false, 10684 strictParsing: false, 10685 swapRange: false, 10686 timeIntervals: 30, 10687 timeCaption: "Time", 10688 previousMonthAriaLabel: "Previous Month", 10689 previousMonthButtonLabel: "Previous Month", 10690 nextMonthAriaLabel: "Next Month", 10691 nextMonthButtonLabel: "Next Month", 10692 previousYearAriaLabel: "Previous Year", 10693 previousYearButtonLabel: "Previous Year", 10694 nextYearAriaLabel: "Next Year", 10695 nextYearButtonLabel: "Next Year", 10696 timeInputLabel: "Time", 10697 enableTabLoop: true, 10698 yearItemNumber: DEFAULT_YEAR_ITEM_NUMBER, 10699 focusSelectedMonth: false, 10700 showPopperArrow: true, 10701 excludeScrollbar: true, 10702 customTimeInput: null, 10703 calendarStartDay: void 0, 10704 toggleCalendarOnIconClick: false, 10705 usePointerEvent: false 10706 }; 10707 }, 10708 enumerable: false, 10709 configurable: true 10710 }); 10711 DatePicker2.prototype.componentDidMount = function() { 10712 window.addEventListener("scroll", this.onScroll, true); 10713 document.addEventListener("visibilitychange", this.setHiddenStateOnVisibilityHidden); 10714 }; 10715 DatePicker2.prototype.componentDidUpdate = function(prevProps, prevState) { 10716 var _a2, _b, _c, _d; 10717 if (prevProps.inline && hasPreSelectionChanged(prevProps.selected, this.props.selected)) { 10718 this.setPreSelection(this.props.selected); 10719 } 10720 if (this.state.monthSelectedIn !== void 0 && prevProps.monthsShown !== this.props.monthsShown) { 10721 this.setState({ monthSelectedIn: 0 }); 10722 } 10723 if (prevProps.highlightDates !== this.props.highlightDates) { 10724 this.setState({ 10725 highlightDates: getHighLightDaysMap(this.props.highlightDates) 10726 }); 10727 } 10728 if (!prevState.focused && !isEqual2(prevProps.selected, this.props.selected)) { 10729 this.setState({ inputValue: null }); 10730 } 10731 if (prevState.open !== this.state.open) { 10732 if (prevState.open === false && this.state.open === true) { 10733 (_b = (_a2 = this.props).onCalendarOpen) === null || _b === void 0 ? void 0 : _b.call(_a2); 10734 } 10735 if (prevState.open === true && this.state.open === false) { 10736 (_d = (_c = this.props).onCalendarClose) === null || _d === void 0 ? void 0 : _d.call(_c); 10737 } 10738 } 10739 }; 10740 DatePicker2.prototype.componentWillUnmount = function() { 10741 this.clearPreventFocusTimeout(); 10742 window.removeEventListener("scroll", this.onScroll, true); 10743 document.removeEventListener("visibilitychange", this.setHiddenStateOnVisibilityHidden); 10744 }; 10745 DatePicker2.prototype.renderInputContainer = function() { 10746 var _a2 = this.props, showIcon = _a2.showIcon, icon = _a2.icon, calendarIconClassname = _a2.calendarIconClassname, calendarIconClassName = _a2.calendarIconClassName, toggleCalendarOnIconClick = _a2.toggleCalendarOnIconClick; 10747 var open = this.state.open; 10748 if (calendarIconClassname) { 10749 console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."); 10750 } 10751 return import_react3.default.createElement( 10752 "div", 10753 { className: "react-datepicker__input-container".concat(showIcon ? " react-datepicker__view-calendar-icon" : "") }, 10754 showIcon && import_react3.default.createElement(CalendarIcon, _assign({ icon, className: clsx(calendarIconClassName, !calendarIconClassName && calendarIconClassname, open && "react-datepicker-ignore-onclickoutside") }, toggleCalendarOnIconClick ? { 10755 onClick: this.toggleCalendar 10756 } : null)), 10757 this.state.isRenderAriaLiveMessage && this.renderAriaLiveRegion(), 10758 this.renderDateInput(), 10759 this.renderClearButton() 10760 ); 10761 }; 10762 DatePicker2.prototype.render = function() { 10763 var calendar = this.renderCalendar(); 10764 if (this.props.inline) 10765 return calendar; 10766 if (this.props.withPortal) { 10767 var portalContainer = this.state.open ? import_react3.default.createElement( 10768 TabLoop, 10769 { enableTabLoop: this.props.enableTabLoop }, 10770 import_react3.default.createElement("div", { className: "react-datepicker__portal", tabIndex: -1, onKeyDown: this.onPortalKeyDown }, calendar) 10771 ) : null; 10772 if (this.state.open && this.props.portalId) { 10773 portalContainer = import_react3.default.createElement(Portal, _assign({ portalId: this.props.portalId }, this.props), portalContainer); 10774 } 10775 return import_react3.default.createElement( 10776 "div", 10777 null, 10778 this.renderInputContainer(), 10779 portalContainer 10780 ); 10781 } 10782 return import_react3.default.createElement(PopperComponent$1, _assign({}, this.props, { className: this.props.popperClassName, hidePopper: !this.isCalendarOpen(), targetComponent: this.renderInputContainer(), popperComponent: calendar, popperOnKeyDown: this.onPopperKeyDown, showArrow: this.props.showPopperArrow })); 10783 }; 10784 return DatePicker2; 10785 }(import_react3.Component) 10786); 10787var PRESELECT_CHANGE_VIA_INPUT = "input"; 10788var PRESELECT_CHANGE_VIA_NAVIGATE = "navigate"; 10789export { 10790 CalendarContainer, 10791 DatePicker as default, 10792 getDefaultLocale, 10793 registerLocale, 10794 setDefaultLocale 10795}; 10796/*! Bundled license information: 10797 10798tabbable/dist/index.esm.js: 10799 (*! 10800 * tabbable 6.2.0 10801 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 10802 *) 10803 10804react-datepicker/dist/index.es.js: 10805 (*! 10806 react-datepicker v8.2.1 10807 https://github.com/Hacker0x01/react-datepicker 10808 Released under the MIT License. 10809 *) 10810*/ 10811//# sourceMappingURL=react-datepicker.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.