willba-component-library 0.3.13 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WillbaComponentLibrary = {}, global.jsxRuntime, global.React));
5
- })(this, (function (exports, jsxRuntime, React__default) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WillbaComponentLibrary = {}, global.React));
5
+ })(this, (function (exports, React) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -21,7 +21,7 @@
21
21
  return Object.freeze(n);
22
22
  }
23
23
 
24
- var React__default__namespace = /*#__PURE__*/_interopNamespaceDefault(React__default);
24
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
25
25
 
26
26
  /******************************************************************************
27
27
  Copyright (c) Microsoft Corporation.
@@ -221,8 +221,8 @@
221
221
  */
222
222
  var Button$1 = function (_a) {
223
223
  var _b = _a.type, type = _b === void 0 ? 'primary' : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 'medium' : _c, onClick = _a.onClick, label = _a.label;
224
- var _d = __read(React__default.useState(4), 2), theState = _d[0]; _d[1];
225
- return (jsxRuntime.jsx("button", { type: "button", className: classNames('storybook-button', "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick, children: "".concat(label, " ").concat(theState) }));
224
+ var _d = __read(React.useState(4), 2), theState = _d[0]; _d[1];
225
+ return (React.createElement("button", { type: "button", className: classNames('storybook-button', "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
226
226
  };
227
227
 
228
228
  function warn() {
@@ -363,7 +363,7 @@
363
363
  }
364
364
  };
365
365
 
366
- const I18nContext = React__default.createContext();
366
+ const I18nContext = React.createContext();
367
367
  class ReportNamespaces {
368
368
  constructor() {
369
369
  this.usedNamespaces = {};
@@ -379,8 +379,8 @@
379
379
  }
380
380
 
381
381
  const usePrevious = (value, ignore) => {
382
- const ref = React__default.useRef();
383
- React__default.useEffect(() => {
382
+ const ref = React.useRef();
383
+ React.useEffect(() => {
384
384
  ref.current = ignore ? ref.current : value;
385
385
  }, [value, ignore]);
386
386
  return ref.current;
@@ -393,7 +393,7 @@
393
393
  const {
394
394
  i18n: i18nFromContext,
395
395
  defaultNS: defaultNSFromContext
396
- } = React__default.useContext(I18nContext) || {};
396
+ } = React.useContext(I18nContext) || {};
397
397
  const i18n = i18nFromProps || i18nFromContext || getI18n();
398
398
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
399
399
  if (!i18n) {
@@ -426,12 +426,12 @@
426
426
  function getT() {
427
427
  return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
428
428
  }
429
- const [t, setT] = React__default.useState(getT);
429
+ const [t, setT] = React.useState(getT);
430
430
  let joinedNS = namespaces.join();
431
431
  if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
432
432
  const previousJoinedNS = usePrevious(joinedNS);
433
- const isMounted = React__default.useRef(true);
434
- React__default.useEffect(() => {
433
+ const isMounted = React.useRef(true);
434
+ React.useEffect(() => {
435
435
  const {
436
436
  bindI18n,
437
437
  bindI18nStore
@@ -462,8 +462,8 @@
462
462
  if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
463
463
  };
464
464
  }, [i18n, joinedNS]);
465
- const isInitial = React__default.useRef(true);
466
- React__default.useEffect(() => {
465
+ const isInitial = React.useRef(true);
466
+ React.useEffect(() => {
467
467
  if (isMounted.current && !isInitial.current) {
468
468
  setT(getT);
469
469
  }
@@ -491,7 +491,7 @@
491
491
  style: undefined,
492
492
  attr: undefined
493
493
  };
494
- var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
494
+ var IconContext = React.createContext && React.createContext(DefaultContext);
495
495
 
496
496
  var __assign$1 = undefined && undefined.__assign || function () {
497
497
  __assign$1 = Object.assign || function (t) {
@@ -513,7 +513,7 @@
513
513
  };
514
514
  function Tree2Element(tree) {
515
515
  return tree && tree.map(function (node, i) {
516
- return React__default.createElement(node.tag, __assign$1({
516
+ return React.createElement(node.tag, __assign$1({
517
517
  key: i
518
518
  }, node.attr), Tree2Element(node.child));
519
519
  });
@@ -521,7 +521,7 @@
521
521
  function GenIcon(data) {
522
522
  // eslint-disable-next-line react/display-name
523
523
  return function (props) {
524
- return React__default.createElement(IconBase, __assign$1({
524
+ return React.createElement(IconBase, __assign$1({
525
525
  attr: __assign$1({}, data.attr)
526
526
  }, props), Tree2Element(data.child));
527
527
  };
@@ -536,7 +536,7 @@
536
536
  var className;
537
537
  if (conf.className) className = conf.className;
538
538
  if (props.className) className = (className ? className + " " : "") + props.className;
539
- return React__default.createElement("svg", __assign$1({
539
+ return React.createElement("svg", __assign$1({
540
540
  stroke: "currentColor",
541
541
  fill: "currentColor",
542
542
  strokeWidth: "0"
@@ -548,9 +548,9 @@
548
548
  height: computedSize,
549
549
  width: computedSize,
550
550
  xmlns: "http://www.w3.org/2000/svg"
551
- }), title && React__default.createElement("title", null, title), props.children);
551
+ }), title && React.createElement("title", null, title), props.children);
552
552
  };
553
- return IconContext !== undefined ? React__default.createElement(IconContext.Consumer, null, function (conf) {
553
+ return IconContext !== undefined ? React.createElement(IconContext.Consumer, null, function (conf) {
554
554
  return elem(conf);
555
555
  }) : elem(DefaultContext);
556
556
  }
@@ -576,8 +576,8 @@
576
576
  styleInject(css_248z$g);
577
577
 
578
578
  var useAwaitRender = function () {
579
- var _a = __read(React__default.useState(false), 2), initialRenderComplete = _a[0], setInitialRenderComplete = _a[1];
580
- React__default.useEffect(function () {
579
+ var _a = __read(React.useState(false), 2), initialRenderComplete = _a[0], setInitialRenderComplete = _a[1];
580
+ React.useEffect(function () {
581
581
  setInitialRenderComplete(true);
582
582
  }, []);
583
583
  if (!initialRenderComplete)
@@ -2972,8 +2972,8 @@
2972
2972
 
2973
2973
  var useUpdateTranslations = function (_a) {
2974
2974
  var language = _a.language;
2975
- var _b = __read(React__default.useState(0), 2); _b[0]; var setRerenderKey = _b[1];
2976
- React__default.useEffect(function () {
2975
+ var _b = __read(React.useState(0), 2); _b[0]; var setRerenderKey = _b[1];
2976
+ React.useEffect(function () {
2977
2977
  instance.changeLanguage(language);
2978
2978
  setRerenderKey(function (prevKey) { return prevKey + 1; });
2979
2979
  }, [language]);
@@ -2982,8 +2982,8 @@
2982
2982
  // TODO - Refactor and rename this hook
2983
2983
  var useCloseFilterSection = function (_a) {
2984
2984
  var handleSelectedFilter = _a.handleSelectedFilter;
2985
- var filtersRef = React__default.useRef(null);
2986
- React__default.useEffect(function () {
2985
+ var filtersRef = React.useRef(null);
2986
+ React.useEffect(function () {
2987
2987
  var handleClickOutside = function (event) {
2988
2988
  if (filtersRef.current &&
2989
2989
  !filtersRef.current.contains(event.target)) {
@@ -2999,8 +2999,8 @@
2999
2999
  };
3000
3000
 
3001
3001
  var useAutoFocus = function (autoFocus) {
3002
- var ref = React__default.useRef(null);
3003
- React__default.useEffect(function () {
3002
+ var ref = React.useRef(null);
3003
+ React.useEffect(function () {
3004
3004
  if (!autoFocus || !ref.current)
3005
3005
  return;
3006
3006
  var attemptFocus = function (attempts) {
@@ -3025,7 +3025,9 @@
3025
3025
 
3026
3026
  var SubmitButton = function (_a) {
3027
3027
  var onClick = _a.onClick, startIcon = _a.startIcon, label = _a.label, disabled = _a.disabled, isLoading = _a.isLoading, variant = _a.variant;
3028
- return (jsxRuntime.jsxs("button", { className: "will-filter-bar-submit-button ".concat(variant || 'default'), onClick: onClick, disabled: disabled || isLoading, children: [isLoading ? (jsxRuntime.jsx("span", { children: jsxRuntime.jsx(FaSpinner, { style: { animation: 'spin 1s linear infinite' } }) })) : (startIcon && jsxRuntime.jsx("span", { children: startIcon })), label || 'Label'] }));
3028
+ return (React.createElement("button", { className: "will-filter-bar-submit-button ".concat(variant || 'default'), onClick: onClick, disabled: disabled || isLoading },
3029
+ isLoading ? (React.createElement("span", null, React.createElement(FaSpinner, { style: { animation: 'spin 1s linear infinite' } }))) : (startIcon && React.createElement("span", null, startIcon)),
3030
+ label || 'Label'));
3029
3031
  };
3030
3032
 
3031
3033
  // THIS FILE IS AUTO GENERATED
@@ -3038,7 +3040,8 @@
3038
3040
 
3039
3041
  var CloseButton = function (_a) {
3040
3042
  var handleClose = _a.handleClose;
3041
- return (jsxRuntime.jsx("button", { className: "will-filter-bar-close-button", onClick: handleClose, children: jsxRuntime.jsx(IoIosCloseCircleOutline, {}) }));
3043
+ return (React.createElement("button", { className: "will-filter-bar-close-button", onClick: handleClose },
3044
+ React.createElement(IoIosCloseCircleOutline, null)));
3042
3045
  };
3043
3046
 
3044
3047
  function _typeof(o) {
@@ -7319,7 +7322,7 @@
7319
7322
  *
7320
7323
  * Access to this context from the {@link useDayPicker} hook.
7321
7324
  */
7322
- var DayPickerContext = React__default.createContext(undefined);
7325
+ var DayPickerContext = React.createContext(undefined);
7323
7326
  /**
7324
7327
  * The provider for the {@link DayPickerContext}, assigning the defaults from the
7325
7328
  * initial DayPicker props.
@@ -7341,7 +7344,7 @@
7341
7344
  onSelect = initialProps.onSelect;
7342
7345
  }
7343
7346
  var value = __assign(__assign(__assign({}, defaultContextValues), initialProps), { captionLayout: captionLayout, classNames: __assign(__assign({}, defaultContextValues.classNames), initialProps.classNames), components: __assign({}, initialProps.components), formatters: __assign(__assign({}, defaultContextValues.formatters), initialProps.formatters), fromDate: fromDate, labels: __assign(__assign({}, defaultContextValues.labels), initialProps.labels), mode: initialProps.mode || defaultContextValues.mode, modifiers: __assign(__assign({}, defaultContextValues.modifiers), initialProps.modifiers), modifiersClassNames: __assign(__assign({}, defaultContextValues.modifiersClassNames), initialProps.modifiersClassNames), onSelect: onSelect, styles: __assign(__assign({}, defaultContextValues.styles), initialProps.styles), toDate: toDate });
7344
- return (React__default.createElement(DayPickerContext.Provider, { value: value }, props.children));
7347
+ return (React.createElement(DayPickerContext.Provider, { value: value }, props.children));
7345
7348
  }
7346
7349
  /**
7347
7350
  * Hook to access the {@link DayPickerContextValue}.
@@ -7350,7 +7353,7 @@
7350
7353
  * internal or custom components.
7351
7354
  */
7352
7355
  function useDayPicker() {
7353
- var context = React__default.useContext(DayPickerContext);
7356
+ var context = React.useContext(DayPickerContext);
7354
7357
  if (!context) {
7355
7358
  throw new Error("useDayPicker must be used within a DayPickerProvider.");
7356
7359
  }
@@ -7360,15 +7363,15 @@
7360
7363
  /** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
7361
7364
  function CaptionLabel(props) {
7362
7365
  var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;
7363
- return (React__default.createElement("div", { className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", role: "presentation", id: props.id }, formatCaption(props.displayMonth, { locale: locale })));
7366
+ return (React.createElement("div", { className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", role: "presentation", id: props.id }, formatCaption(props.displayMonth, { locale: locale })));
7364
7367
  }
7365
7368
 
7366
7369
  /**
7367
7370
  * Render the icon in the styled drop-down.
7368
7371
  */
7369
7372
  function IconDropdown(props) {
7370
- return (React__default.createElement("svg", __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props),
7371
- React__default.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" })));
7373
+ return (React.createElement("svg", __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props),
7374
+ React.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" })));
7372
7375
  }
7373
7376
 
7374
7377
  /**
@@ -7380,12 +7383,12 @@
7380
7383
  var onChange = props.onChange, value = props.value, children = props.children, caption = props.caption, className = props.className, style = props.style;
7381
7384
  var dayPicker = useDayPicker();
7382
7385
  var IconDropdownComponent = (_b = (_a = dayPicker.components) === null || _a === void 0 ? void 0 : _a.IconDropdown) !== null && _b !== void 0 ? _b : IconDropdown;
7383
- return (React__default.createElement("div", { className: className, style: style },
7384
- React__default.createElement("span", { className: dayPicker.classNames.vhidden }, props['aria-label']),
7385
- React__default.createElement("select", { name: props.name, "aria-label": props['aria-label'], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value: value, onChange: onChange }, children),
7386
- React__default.createElement("div", { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, "aria-hidden": "true" },
7386
+ return (React.createElement("div", { className: className, style: style },
7387
+ React.createElement("span", { className: dayPicker.classNames.vhidden }, props['aria-label']),
7388
+ React.createElement("select", { name: props.name, "aria-label": props['aria-label'], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value: value, onChange: onChange }, children),
7389
+ React.createElement("div", { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, "aria-hidden": "true" },
7387
7390
  caption,
7388
- React__default.createElement(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon }))));
7391
+ React.createElement(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon }))));
7389
7392
  }
7390
7393
 
7391
7394
  /** Render the dropdown to navigate between months. */
@@ -7394,9 +7397,9 @@
7394
7397
  var _b = useDayPicker(), fromDate = _b.fromDate, toDate = _b.toDate, styles = _b.styles, locale = _b.locale, formatMonthCaption = _b.formatters.formatMonthCaption, classNames = _b.classNames, components = _b.components, labelMonthDropdown = _b.labels.labelMonthDropdown;
7395
7398
  // Dropdown should appear only when both from/toDate is set
7396
7399
  if (!fromDate)
7397
- return React__default.createElement(React__default.Fragment, null);
7400
+ return React.createElement(React.Fragment, null);
7398
7401
  if (!toDate)
7399
- return React__default.createElement(React__default.Fragment, null);
7402
+ return React.createElement(React.Fragment, null);
7400
7403
  var dropdownMonths = [];
7401
7404
  if (isSameYear(fromDate, toDate)) {
7402
7405
  // only display the months included in the range
@@ -7418,7 +7421,7 @@
7418
7421
  props.onChange(newMonth);
7419
7422
  };
7420
7423
  var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;
7421
- return (React__default.createElement(DropdownComponent, { name: "months", "aria-label": labelMonthDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption(props.displayMonth, { locale: locale }) }, dropdownMonths.map(function (m) { return (React__default.createElement("option", { key: m.getMonth(), value: m.getMonth() }, formatMonthCaption(m, { locale: locale }))); })));
7424
+ return (React.createElement(DropdownComponent, { name: "months", "aria-label": labelMonthDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption(props.displayMonth, { locale: locale }) }, dropdownMonths.map(function (m) { return (React.createElement("option", { key: m.getMonth(), value: m.getMonth() }, formatMonthCaption(m, { locale: locale }))); })));
7422
7425
  }
7423
7426
 
7424
7427
  /**
@@ -7432,9 +7435,9 @@
7432
7435
  var years = [];
7433
7436
  // Dropdown should appear only when both from/toDate is set
7434
7437
  if (!fromDate)
7435
- return React__default.createElement(React__default.Fragment, null);
7438
+ return React.createElement(React.Fragment, null);
7436
7439
  if (!toDate)
7437
- return React__default.createElement(React__default.Fragment, null);
7440
+ return React.createElement(React.Fragment, null);
7438
7441
  var fromYear = fromDate.getFullYear();
7439
7442
  var toYear = toDate.getFullYear();
7440
7443
  for (var year = fromYear; year <= toYear; year++) {
@@ -7445,7 +7448,7 @@
7445
7448
  props.onChange(newMonth);
7446
7449
  };
7447
7450
  var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;
7448
- return (React__default.createElement(DropdownComponent, { name: "years", "aria-label": labelYearDropdown(), className: classNames.dropdown_year, style: styles.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption(displayMonth, { locale: locale }) }, years.map(function (year) { return (React__default.createElement("option", { key: year.getFullYear(), value: year.getFullYear() }, formatYearCaption(year, { locale: locale }))); })));
7451
+ return (React.createElement(DropdownComponent, { name: "years", "aria-label": labelYearDropdown(), className: classNames.dropdown_year, style: styles.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption(displayMonth, { locale: locale }) }, years.map(function (year) { return (React.createElement("option", { key: year.getFullYear(), value: year.getFullYear() }, formatYearCaption(year, { locale: locale }))); })));
7449
7452
  }
7450
7453
 
7451
7454
  /**
@@ -7458,7 +7461,7 @@
7458
7461
  * argument, which will be always returned as `value`.
7459
7462
  */
7460
7463
  function useControlledValue(defaultValue, controlledValue) {
7461
- var _a = React__default.useState(defaultValue), uncontrolledValue = _a[0], setValue = _a[1];
7464
+ var _a = React.useState(defaultValue), uncontrolledValue = _a[0], setValue = _a[1];
7462
7465
  var value = controlledValue === undefined ? uncontrolledValue : controlledValue;
7463
7466
  return [value, setValue];
7464
7467
  }
@@ -7576,7 +7579,7 @@
7576
7579
  * The Navigation context shares details and methods to navigate the months in DayPicker.
7577
7580
  * Access this context from the {@link useNavigation} hook.
7578
7581
  */
7579
- var NavigationContext = React__default.createContext(undefined);
7582
+ var NavigationContext = React.createContext(undefined);
7580
7583
  /** Provides the values for the {@link NavigationContext}. */
7581
7584
  function NavigationProvider(props) {
7582
7585
  var dayPicker = useDayPicker();
@@ -7609,7 +7612,7 @@
7609
7612
  nextMonth: nextMonth,
7610
7613
  isDateDisplayed: isDateDisplayed
7611
7614
  };
7612
- return (React__default.createElement(NavigationContext.Provider, { value: value }, props.children));
7615
+ return (React.createElement(NavigationContext.Provider, { value: value }, props.children));
7613
7616
  }
7614
7617
  /**
7615
7618
  * Hook to access the {@link NavigationContextValue}. Use this hook to navigate
@@ -7618,7 +7621,7 @@
7618
7621
  * This hook is meant to be used inside internal or custom components.
7619
7622
  */
7620
7623
  function useNavigation() {
7621
- var context = React__default.useContext(NavigationContext);
7624
+ var context = React.useContext(NavigationContext);
7622
7625
  if (!context) {
7623
7626
  throw new Error('useNavigation must be used within a NavigationProvider');
7624
7627
  }
@@ -7636,31 +7639,31 @@
7636
7639
  goToMonth(newMonth);
7637
7640
  };
7638
7641
  var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;
7639
- var captionLabel = (React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
7640
- return (React__default.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
7641
- React__default.createElement("div", { className: classNames.vhidden }, captionLabel),
7642
- React__default.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }),
7643
- React__default.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })));
7642
+ var captionLabel = (React.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
7643
+ return (React.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
7644
+ React.createElement("div", { className: classNames.vhidden }, captionLabel),
7645
+ React.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }),
7646
+ React.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })));
7644
7647
  }
7645
7648
 
7646
7649
  /**
7647
7650
  * Render the "previous month" button in the navigation.
7648
7651
  */
7649
7652
  function IconLeft(props) {
7650
- return (React__default.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
7651
- React__default.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" })));
7653
+ return (React.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
7654
+ React.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" })));
7652
7655
  }
7653
7656
 
7654
7657
  /**
7655
7658
  * Render the "next month" button in the navigation.
7656
7659
  */
7657
7660
  function IconRight(props) {
7658
- return (React__default.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
7659
- React__default.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" })));
7661
+ return (React.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
7662
+ React.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" })));
7660
7663
  }
7661
7664
 
7662
7665
  /** Render a button HTML element applying the reset class name. */
7663
- var Button = React__default.forwardRef(function (props, ref) {
7666
+ var Button = React.forwardRef(function (props, ref) {
7664
7667
  var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;
7665
7668
  var classNamesArr = [classNames.button_reset, classNames.button];
7666
7669
  if (props.className) {
@@ -7671,7 +7674,7 @@
7671
7674
  if (props.style) {
7672
7675
  Object.assign(style, props.style);
7673
7676
  }
7674
- return (React__default.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
7677
+ return (React.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
7675
7678
  });
7676
7679
 
7677
7680
  /** A component rendering the navigation buttons or the drop-downs. */
@@ -7679,7 +7682,7 @@
7679
7682
  var _a, _b;
7680
7683
  var _c = useDayPicker(), dir = _c.dir, locale = _c.locale, classNames = _c.classNames, styles = _c.styles, _d = _c.labels, labelPrevious = _d.labelPrevious, labelNext = _d.labelNext, components = _c.components;
7681
7684
  if (!props.nextMonth && !props.previousMonth) {
7682
- return React__default.createElement(React__default.Fragment, null);
7685
+ return React.createElement(React.Fragment, null);
7683
7686
  }
7684
7687
  var previousLabel = labelPrevious(props.previousMonth, { locale: locale });
7685
7688
  var previousClassName = [
@@ -7693,9 +7696,9 @@
7693
7696
  ].join(' ');
7694
7697
  var IconRightComponent = (_a = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a !== void 0 ? _a : IconRight;
7695
7698
  var IconLeftComponent = (_b = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b !== void 0 ? _b : IconLeft;
7696
- return (React__default.createElement("div", { className: classNames.nav, style: styles.nav },
7697
- !props.hidePrevious && (React__default.createElement(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick }, dir === 'rtl' ? (React__default.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React__default.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })))),
7698
- !props.hideNext && (React__default.createElement(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick }, dir === 'rtl' ? (React__default.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React__default.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon }))))));
7699
+ return (React.createElement("div", { className: classNames.nav, style: styles.nav },
7700
+ !props.hidePrevious && (React.createElement(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick }, dir === 'rtl' ? (React.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })))),
7701
+ !props.hideNext && (React.createElement(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick }, dir === 'rtl' ? (React.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon }))))));
7699
7702
  }
7700
7703
 
7701
7704
  /**
@@ -7721,7 +7724,7 @@
7721
7724
  return;
7722
7725
  goToMonth(nextMonth);
7723
7726
  };
7724
- return (React__default.createElement(Navigation, { displayMonth: props.displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }));
7727
+ return (React.createElement(Navigation, { displayMonth: props.displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }));
7725
7728
  }
7726
7729
 
7727
7730
  /**
@@ -7734,22 +7737,22 @@
7734
7737
  var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;
7735
7738
  var caption;
7736
7739
  if (disableNavigation) {
7737
- caption = (React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
7740
+ caption = (React.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
7738
7741
  }
7739
7742
  else if (captionLayout === 'dropdown') {
7740
- caption = (React__default.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }));
7743
+ caption = (React.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }));
7741
7744
  }
7742
7745
  else if (captionLayout === 'dropdown-buttons') {
7743
- caption = (React__default.createElement(React__default.Fragment, null,
7744
- React__default.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }),
7745
- React__default.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
7746
+ caption = (React.createElement(React.Fragment, null,
7747
+ React.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }),
7748
+ React.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
7746
7749
  }
7747
7750
  else {
7748
- caption = (React__default.createElement(React__default.Fragment, null,
7749
- React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }),
7750
- React__default.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
7751
+ caption = (React.createElement(React.Fragment, null,
7752
+ React.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }),
7753
+ React.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
7751
7754
  }
7752
- return (React__default.createElement("div", { className: classNames.caption, style: styles.caption }, caption));
7755
+ return (React.createElement("div", { className: classNames.caption, style: styles.caption }, caption));
7753
7756
  }
7754
7757
 
7755
7758
  /** Render the Footer component (empty as default).*/
@@ -7757,10 +7760,10 @@
7757
7760
  function Footer$1(props) {
7758
7761
  var _a = useDayPicker(), footer = _a.footer, styles = _a.styles, tfoot = _a.classNames.tfoot;
7759
7762
  if (!footer)
7760
- return React__default.createElement(React__default.Fragment, null);
7761
- return (React__default.createElement("tfoot", { className: tfoot, style: styles.tfoot },
7762
- React__default.createElement("tr", null,
7763
- React__default.createElement("td", { colSpan: 8 }, footer))));
7763
+ return React.createElement(React.Fragment, null);
7764
+ return (React.createElement("tfoot", { className: tfoot, style: styles.tfoot },
7765
+ React.createElement("tr", null,
7766
+ React.createElement("td", { colSpan: 8 }, footer))));
7764
7767
  }
7765
7768
 
7766
7769
  /**
@@ -7789,9 +7792,9 @@
7789
7792
  function HeadRow() {
7790
7793
  var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles, showWeekNumber = _a.showWeekNumber, locale = _a.locale, weekStartsOn = _a.weekStartsOn, ISOWeek = _a.ISOWeek, formatWeekdayName = _a.formatters.formatWeekdayName, labelWeekday = _a.labels.labelWeekday;
7791
7794
  var weekdays = getWeekdays(locale, weekStartsOn, ISOWeek);
7792
- return (React__default.createElement("tr", { style: styles.head_row, className: classNames.head_row },
7793
- showWeekNumber && (React__default.createElement("td", { style: styles.head_cell, className: classNames.head_cell })),
7794
- weekdays.map(function (weekday, i) { return (React__default.createElement("th", { key: i, scope: "col", className: classNames.head_cell, style: styles.head_cell, "aria-label": labelWeekday(weekday, { locale: locale }) }, formatWeekdayName(weekday, { locale: locale }))); })));
7795
+ return (React.createElement("tr", { style: styles.head_row, className: classNames.head_row },
7796
+ showWeekNumber && (React.createElement("td", { style: styles.head_cell, className: classNames.head_cell })),
7797
+ weekdays.map(function (weekday, i) { return (React.createElement("th", { key: i, scope: "col", className: classNames.head_cell, style: styles.head_cell, "aria-label": labelWeekday(weekday, { locale: locale }) }, formatWeekdayName(weekday, { locale: locale }))); })));
7795
7798
  }
7796
7799
 
7797
7800
  /** Render the table head. */
@@ -7799,14 +7802,14 @@
7799
7802
  var _a;
7800
7803
  var _b = useDayPicker(), classNames = _b.classNames, styles = _b.styles, components = _b.components;
7801
7804
  var HeadRowComponent = (_a = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a !== void 0 ? _a : HeadRow;
7802
- return (React__default.createElement("thead", { style: styles.head, className: classNames.head },
7803
- React__default.createElement(HeadRowComponent, null)));
7805
+ return (React.createElement("thead", { style: styles.head, className: classNames.head },
7806
+ React.createElement(HeadRowComponent, null)));
7804
7807
  }
7805
7808
 
7806
7809
  /** Render the content of the day cell. */
7807
7810
  function DayContent(props) {
7808
7811
  var _a = useDayPicker(), locale = _a.locale, formatDay = _a.formatters.formatDay;
7809
- return React__default.createElement(React__default.Fragment, null, formatDay(props.date, { locale: locale }));
7812
+ return React.createElement(React.Fragment, null, formatDay(props.date, { locale: locale }));
7810
7813
  }
7811
7814
 
7812
7815
  /**
@@ -7815,7 +7818,7 @@
7815
7818
  *
7816
7819
  * Access this context from the {@link useSelectMultiple} hook.
7817
7820
  */
7818
- var SelectMultipleContext = React__default.createContext(undefined);
7821
+ var SelectMultipleContext = React.createContext(undefined);
7819
7822
  /** Provides the values for the {@link SelectMultipleContext}. */
7820
7823
  function SelectMultipleProvider(props) {
7821
7824
  if (!isDayPickerMultiple(props.initialProps)) {
@@ -7825,9 +7828,9 @@
7825
7828
  disabled: []
7826
7829
  }
7827
7830
  };
7828
- return (React__default.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props.children));
7831
+ return (React.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props.children));
7829
7832
  }
7830
- return (React__default.createElement(SelectMultipleProviderInternal, { initialProps: props.initialProps, children: props.children }));
7833
+ return (React.createElement(SelectMultipleProviderInternal, { initialProps: props.initialProps, children: props.children }));
7831
7834
  }
7832
7835
  function SelectMultipleProviderInternal(_a) {
7833
7836
  var initialProps = _a.initialProps, children = _a.children;
@@ -7872,7 +7875,7 @@
7872
7875
  onDayClick: onDayClick,
7873
7876
  modifiers: modifiers
7874
7877
  };
7875
- return (React__default.createElement(SelectMultipleContext.Provider, { value: contextValue }, children));
7878
+ return (React.createElement(SelectMultipleContext.Provider, { value: contextValue }, children));
7876
7879
  }
7877
7880
  /**
7878
7881
  * Hook to access the {@link SelectMultipleContextValue}.
@@ -7880,7 +7883,7 @@
7880
7883
  * This hook is meant to be used inside internal or custom components.
7881
7884
  */
7882
7885
  function useSelectMultiple() {
7883
- var context = React__default.useContext(SelectMultipleContext);
7886
+ var context = React.useContext(SelectMultipleContext);
7884
7887
  if (!context) {
7885
7888
  throw new Error('useSelectMultiple must be used within a SelectMultipleProvider');
7886
7889
  }
@@ -7928,7 +7931,7 @@
7928
7931
  *
7929
7932
  * Access this context from the {@link useSelectRange} hook.
7930
7933
  */
7931
- var SelectRangeContext = React__default.createContext(undefined);
7934
+ var SelectRangeContext = React.createContext(undefined);
7932
7935
  /** Provides the values for the {@link SelectRangeProvider}. */
7933
7936
  function SelectRangeProvider(props) {
7934
7937
  if (!isDayPickerRange(props.initialProps)) {
@@ -7941,9 +7944,9 @@
7941
7944
  disabled: []
7942
7945
  }
7943
7946
  };
7944
- return (React__default.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props.children));
7947
+ return (React.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props.children));
7945
7948
  }
7946
- return (React__default.createElement(SelectRangeProviderInternal, { initialProps: props.initialProps, children: props.children }));
7949
+ return (React.createElement(SelectRangeProviderInternal, { initialProps: props.initialProps, children: props.children }));
7947
7950
  }
7948
7951
  function SelectRangeProviderInternal(_a) {
7949
7952
  var initialProps = _a.initialProps, children = _a.children;
@@ -8014,7 +8017,7 @@
8014
8017
  });
8015
8018
  }
8016
8019
  }
8017
- return (React__default.createElement(SelectRangeContext.Provider, { value: { selected: selected, onDayClick: onDayClick, modifiers: modifiers } }, children));
8020
+ return (React.createElement(SelectRangeContext.Provider, { value: { selected: selected, onDayClick: onDayClick, modifiers: modifiers } }, children));
8018
8021
  }
8019
8022
  /**
8020
8023
  * Hook to access the {@link SelectRangeContextValue}.
@@ -8022,7 +8025,7 @@
8022
8025
  * This hook is meant to be used inside internal or custom components.
8023
8026
  */
8024
8027
  function useSelectRange() {
8025
- var context = React__default.useContext(SelectRangeContext);
8028
+ var context = React.useContext(SelectRangeContext);
8026
8029
  if (!context) {
8027
8030
  throw new Error('useSelectRange must be used within a SelectRangeProvider');
8028
8031
  }
@@ -8105,7 +8108,7 @@
8105
8108
  }
8106
8109
 
8107
8110
  /** The Modifiers context store the modifiers used in DayPicker. To access the value of this context, use {@link useModifiers}. */
8108
- var ModifiersContext = React__default.createContext(undefined);
8111
+ var ModifiersContext = React.createContext(undefined);
8109
8112
  /** Provide the value for the {@link ModifiersContext}. */
8110
8113
  function ModifiersProvider(props) {
8111
8114
  var dayPicker = useDayPicker();
@@ -8114,7 +8117,7 @@
8114
8117
  var internalModifiers = getInternalModifiers(dayPicker, selectMultiple, selectRange);
8115
8118
  var customModifiers = getCustomModifiers(dayPicker.modifiers);
8116
8119
  var modifiers = __assign(__assign({}, internalModifiers), customModifiers);
8117
- return (React__default.createElement(ModifiersContext.Provider, { value: modifiers }, props.children));
8120
+ return (React.createElement(ModifiersContext.Provider, { value: modifiers }, props.children));
8118
8121
  }
8119
8122
  /**
8120
8123
  * Return the modifiers used by DayPicker.
@@ -8124,7 +8127,7 @@
8124
8127
  *
8125
8128
  */
8126
8129
  function useModifiers() {
8127
- var context = React__default.useContext(ModifiersContext);
8130
+ var context = React.useContext(ModifiersContext);
8128
8131
  if (!context) {
8129
8132
  throw new Error('useModifiers must be used within a ModifiersProvider');
8130
8133
  }
@@ -8362,13 +8365,13 @@
8362
8365
  *
8363
8366
  * Access this context from the {@link useFocusContext} hook.
8364
8367
  */
8365
- var FocusContext = React__default.createContext(undefined);
8368
+ var FocusContext = React.createContext(undefined);
8366
8369
  /** The provider for the {@link FocusContext}. */
8367
8370
  function FocusProvider(props) {
8368
8371
  var navigation = useNavigation();
8369
8372
  var modifiers = useModifiers();
8370
- var _a = React__default.useState(), focusedDay = _a[0], setFocusedDay = _a[1];
8371
- var _b = React__default.useState(), lastFocused = _b[0], setLastFocused = _b[1];
8373
+ var _a = React.useState(), focusedDay = _a[0], setFocusedDay = _a[1];
8374
+ var _b = React.useState(), lastFocused = _b[0], setLastFocused = _b[1];
8372
8375
  var initialFocusTarget = getInitialFocusTarget(navigation.displayMonths, modifiers);
8373
8376
  // TODO: cleanup and test obscure code below
8374
8377
  var focusTarget = (focusedDay !== null && focusedDay !== void 0 ? focusedDay : (lastFocused && navigation.isDateDisplayed(lastFocused)))
@@ -8412,7 +8415,7 @@
8412
8415
  focusStartOfWeek: function () { return moveFocus('startOfWeek', 'before'); },
8413
8416
  focusEndOfWeek: function () { return moveFocus('endOfWeek', 'after'); }
8414
8417
  };
8415
- return (React__default.createElement(FocusContext.Provider, { value: value }, props.children));
8418
+ return (React.createElement(FocusContext.Provider, { value: value }, props.children));
8416
8419
  }
8417
8420
  /**
8418
8421
  * Hook to access the {@link FocusContextValue}. Use this hook to handle the
@@ -8421,7 +8424,7 @@
8421
8424
  * This hook is meant to be used inside internal or custom components.
8422
8425
  */
8423
8426
  function useFocusContext() {
8424
- var context = React__default.useContext(FocusContext);
8427
+ var context = React.useContext(FocusContext);
8425
8428
  if (!context) {
8426
8429
  throw new Error('useFocusContext must be used within a FocusProvider');
8427
8430
  }
@@ -8453,16 +8456,16 @@
8453
8456
  *
8454
8457
  * Access this context from the {@link useSelectSingle} hook.
8455
8458
  */
8456
- var SelectSingleContext = React__default.createContext(undefined);
8459
+ var SelectSingleContext = React.createContext(undefined);
8457
8460
  /** Provides the values for the {@link SelectSingleProvider}. */
8458
8461
  function SelectSingleProvider(props) {
8459
8462
  if (!isDayPickerSingle(props.initialProps)) {
8460
8463
  var emptyContextValue = {
8461
8464
  selected: undefined
8462
8465
  };
8463
- return (React__default.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props.children));
8466
+ return (React.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props.children));
8464
8467
  }
8465
- return (React__default.createElement(SelectSingleProviderInternal, { initialProps: props.initialProps, children: props.children }));
8468
+ return (React.createElement(SelectSingleProviderInternal, { initialProps: props.initialProps, children: props.children }));
8466
8469
  }
8467
8470
  function SelectSingleProviderInternal(_a) {
8468
8471
  var initialProps = _a.initialProps, children = _a.children;
@@ -8479,7 +8482,7 @@
8479
8482
  selected: initialProps.selected,
8480
8483
  onDayClick: onDayClick
8481
8484
  };
8482
- return (React__default.createElement(SelectSingleContext.Provider, { value: contextValue }, children));
8485
+ return (React.createElement(SelectSingleContext.Provider, { value: contextValue }, children));
8483
8486
  }
8484
8487
  /**
8485
8488
  * Hook to access the {@link SelectSingleContextValue}.
@@ -8487,7 +8490,7 @@
8487
8490
  * This hook is meant to be used inside internal or custom components.
8488
8491
  */
8489
8492
  function useSelectSingle() {
8490
- var context = React__default.useContext(SelectSingleContext);
8493
+ var context = React.useContext(SelectSingleContext);
8491
8494
  if (!context) {
8492
8495
  throw new Error('useSelectSingle must be used within a SelectSingleProvider');
8493
8496
  }
@@ -8726,7 +8729,7 @@
8726
8729
  var selectedDays = useSelectedDays();
8727
8730
  var isButton = Boolean(dayPicker.onDayClick || dayPicker.mode !== 'default');
8728
8731
  // Focus the button if the day is focused according to the focus context
8729
- React__default.useEffect(function () {
8732
+ React.useEffect(function () {
8730
8733
  var _a;
8731
8734
  if (activeModifiers.outside)
8732
8735
  return;
@@ -8749,7 +8752,7 @@
8749
8752
  var isHidden = Boolean((activeModifiers.outside && !dayPicker.showOutsideDays) ||
8750
8753
  activeModifiers.hidden);
8751
8754
  var DayContentComponent = (_c = (_b = dayPicker.components) === null || _b === void 0 ? void 0 : _b.DayContent) !== null && _c !== void 0 ? _c : DayContent;
8752
- var children = (React__default.createElement(DayContentComponent, { date: day, displayMonth: displayMonth, activeModifiers: activeModifiers }));
8755
+ var children = (React.createElement(DayContentComponent, { date: day, displayMonth: displayMonth, activeModifiers: activeModifiers }));
8753
8756
  var divProps = {
8754
8757
  style: style,
8755
8758
  className: className,
@@ -8777,15 +8780,15 @@
8777
8780
  * modifiers.
8778
8781
  */
8779
8782
  function Day(props) {
8780
- var buttonRef = React__default.useRef(null);
8783
+ var buttonRef = React.useRef(null);
8781
8784
  var dayRender = useDayRender(props.date, props.displayMonth, buttonRef);
8782
8785
  if (dayRender.isHidden) {
8783
- return React__default.createElement("div", { role: "gridcell" });
8786
+ return React.createElement("div", { role: "gridcell" });
8784
8787
  }
8785
8788
  if (!dayRender.isButton) {
8786
- return React__default.createElement("div", __assign({}, dayRender.divProps));
8789
+ return React.createElement("div", __assign({}, dayRender.divProps));
8787
8790
  }
8788
- return React__default.createElement(Button, __assign({ name: "day", ref: buttonRef }, dayRender.buttonProps));
8791
+ return React.createElement(Button, __assign({ name: "day", ref: buttonRef }, dayRender.buttonProps));
8789
8792
  }
8790
8793
 
8791
8794
  /**
@@ -8797,13 +8800,13 @@
8797
8800
  var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles = _a.styles, classNames = _a.classNames, locale = _a.locale, labelWeekNumber = _a.labels.labelWeekNumber, formatWeekNumber = _a.formatters.formatWeekNumber;
8798
8801
  var content = formatWeekNumber(Number(weekNumber), { locale: locale });
8799
8802
  if (!onWeekNumberClick) {
8800
- return (React__default.createElement("span", { className: classNames.weeknumber, style: styles.weeknumber }, content));
8803
+ return (React.createElement("span", { className: classNames.weeknumber, style: styles.weeknumber }, content));
8801
8804
  }
8802
8805
  var label = labelWeekNumber(Number(weekNumber), { locale: locale });
8803
8806
  var handleClick = function (e) {
8804
8807
  onWeekNumberClick(weekNumber, dates, e);
8805
8808
  };
8806
- return (React__default.createElement(Button, { name: "week-number", "aria-label": label, className: classNames.weeknumber, style: styles.weeknumber, onClick: handleClick }, content));
8809
+ return (React.createElement(Button, { name: "week-number", "aria-label": label, className: classNames.weeknumber, style: styles.weeknumber, onClick: handleClick }, content));
8807
8810
  }
8808
8811
 
8809
8812
  /** Render a row in the calendar, with the days and the week number. */
@@ -8814,13 +8817,13 @@
8814
8817
  var WeeknumberComponent = (_b = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b !== void 0 ? _b : WeekNumber;
8815
8818
  var weekNumberCell;
8816
8819
  if (showWeekNumber) {
8817
- weekNumberCell = (React__default.createElement("td", { className: classNames.cell, style: styles.cell },
8818
- React__default.createElement(WeeknumberComponent, { number: props.weekNumber, dates: props.dates })));
8820
+ weekNumberCell = (React.createElement("td", { className: classNames.cell, style: styles.cell },
8821
+ React.createElement(WeeknumberComponent, { number: props.weekNumber, dates: props.dates })));
8819
8822
  }
8820
- return (React__default.createElement("tr", { className: classNames.row, style: styles.row },
8823
+ return (React.createElement("tr", { className: classNames.row, style: styles.row },
8821
8824
  weekNumberCell,
8822
- props.dates.map(function (date) { return (React__default.createElement("td", { className: classNames.cell, style: styles.cell, key: getUnixTime(date), role: "presentation" },
8823
- React__default.createElement(DayComponent, { displayMonth: props.displayMonth, date: date }))); })));
8825
+ props.dates.map(function (date) { return (React.createElement("td", { className: classNames.cell, style: styles.cell, key: getUnixTime(date), role: "presentation" },
8826
+ React.createElement(DayComponent, { displayMonth: props.displayMonth, date: date }))); })));
8824
8827
  }
8825
8828
 
8826
8829
  /** Return the weeks between two dates. */
@@ -8888,10 +8891,10 @@
8888
8891
  var HeadComponent = (_a = components === null || components === void 0 ? void 0 : components.Head) !== null && _a !== void 0 ? _a : Head;
8889
8892
  var RowComponent = (_b = components === null || components === void 0 ? void 0 : components.Row) !== null && _b !== void 0 ? _b : Row;
8890
8893
  var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer$1;
8891
- return (React__default.createElement("table", { id: props.id, className: classNames.table, style: styles.table, role: "grid", "aria-labelledby": props['aria-labelledby'] },
8892
- !hideHead && React__default.createElement(HeadComponent, null),
8893
- React__default.createElement("tbody", { className: classNames.tbody, style: styles.tbody, role: "rowgroup" }, weeks.map(function (week) { return (React__default.createElement(RowComponent, { displayMonth: props.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber })); })),
8894
- React__default.createElement(FooterComponent, { displayMonth: props.displayMonth })));
8894
+ return (React.createElement("table", { id: props.id, className: classNames.table, style: styles.table, role: "grid", "aria-labelledby": props['aria-labelledby'] },
8895
+ !hideHead && React.createElement(HeadComponent, null),
8896
+ React.createElement("tbody", { className: classNames.tbody, style: styles.tbody, role: "rowgroup" }, weeks.map(function (week) { return (React.createElement(RowComponent, { displayMonth: props.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber })); })),
8897
+ React.createElement(FooterComponent, { displayMonth: props.displayMonth })));
8895
8898
  }
8896
8899
 
8897
8900
  /*
@@ -8935,8 +8938,8 @@
8935
8938
  * @param deps
8936
8939
  */
8937
8940
  var useIsomorphicLayoutEffect = canUseDOM()
8938
- ? React__default__namespace.useLayoutEffect
8939
- : React__default__namespace.useEffect;
8941
+ ? React__namespace.useLayoutEffect
8942
+ : React__namespace.useEffect;
8940
8943
  var serverHandoffComplete = false;
8941
8944
  var id = 0;
8942
8945
  function genId() {
@@ -8949,7 +8952,7 @@
8949
8952
  // If this instance isn't part of the initial render, we don't have to do the
8950
8953
  // double render/patch-up dance. We can just generate the ID and return it.
8951
8954
  var initialId = providedId !== null && providedId !== void 0 ? providedId : (serverHandoffComplete ? genId() : null);
8952
- var _b = React__default__namespace.useState(initialId), id = _b[0], setId = _b[1];
8955
+ var _b = React__namespace.useState(initialId), id = _b[0], setId = _b[1];
8953
8956
  useIsomorphicLayoutEffect(function () {
8954
8957
  if (id === null) {
8955
8958
  // Patch the ID after render. We do this in `useLayoutEffect` to avoid any
@@ -8960,7 +8963,7 @@
8960
8963
  }
8961
8964
  // eslint-disable-next-line react-hooks/exhaustive-deps
8962
8965
  }, []);
8963
- React__default__namespace.useEffect(function () {
8966
+ React__namespace.useEffect(function () {
8964
8967
  if (serverHandoffComplete === false) {
8965
8968
  // Flag all future uses of `useId` to skip the update dance. This is in
8966
8969
  // `useEffect` because it goes after `useLayoutEffect`, ensuring we don't
@@ -9003,9 +9006,9 @@
9003
9006
  style = __assign(__assign({}, style), styles.caption_between);
9004
9007
  }
9005
9008
  var CaptionComponent = (_b = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b !== void 0 ? _b : Caption;
9006
- return (React__default.createElement("div", { key: props.displayIndex, className: className.join(' '), style: style },
9007
- React__default.createElement(CaptionComponent, { id: captionId, displayMonth: props.displayMonth }),
9008
- React__default.createElement(Table, { id: tableId, "aria-labelledby": captionId, displayMonth: props.displayMonth })));
9009
+ return (React.createElement("div", { key: props.displayIndex, className: className.join(' '), style: style },
9010
+ React.createElement(CaptionComponent, { id: captionId, displayMonth: props.displayMonth }),
9011
+ React.createElement(Table, { id: tableId, "aria-labelledby": captionId, displayMonth: props.displayMonth })));
9009
9012
  }
9010
9013
 
9011
9014
  /** Render the container with the months according to the number of months to display. */
@@ -9014,9 +9017,9 @@
9014
9017
  var dayPicker = useDayPicker();
9015
9018
  var focusContext = useFocusContext();
9016
9019
  var navigation = useNavigation();
9017
- var _b = React__default.useState(false), hasInitialFocus = _b[0], setHasInitialFocus = _b[1];
9020
+ var _b = React.useState(false), hasInitialFocus = _b[0], setHasInitialFocus = _b[1];
9018
9021
  // Focus the focus target when initialFocus is passed in
9019
- React__default.useEffect(function () {
9022
+ React.useEffect(function () {
9020
9023
  if (!dayPicker.initialFocus)
9021
9024
  return;
9022
9025
  if (!focusContext.focusTarget)
@@ -9047,20 +9050,20 @@
9047
9050
  var _a;
9048
9051
  return __assign(__assign({}, attrs), (_a = {}, _a[key] = initialProps[key], _a));
9049
9052
  }, {});
9050
- return (React__default.createElement("div", __assign({ className: classNames.join(' '), style: style, dir: dayPicker.dir, id: dayPicker.id }, dataAttributes),
9051
- React__default.createElement("div", { className: dayPicker.classNames.months, style: dayPicker.styles.months }, navigation.displayMonths.map(function (month, i) { return (React__default.createElement(Month, { key: i, displayIndex: i, displayMonth: month })); }))));
9053
+ return (React.createElement("div", __assign({ className: classNames.join(' '), style: style, dir: dayPicker.dir, id: dayPicker.id }, dataAttributes),
9054
+ React.createElement("div", { className: dayPicker.classNames.months, style: dayPicker.styles.months }, navigation.displayMonths.map(function (month, i) { return (React.createElement(Month, { key: i, displayIndex: i, displayMonth: month })); }))));
9052
9055
  }
9053
9056
 
9054
9057
  /** Provide the value for all the context providers. */
9055
9058
  function RootProvider(props) {
9056
9059
  var children = props.children, initialProps = __rest(props, ["children"]);
9057
- return (React__default.createElement(DayPickerProvider, { initialProps: initialProps },
9058
- React__default.createElement(NavigationProvider, null,
9059
- React__default.createElement(SelectSingleProvider, { initialProps: initialProps },
9060
- React__default.createElement(SelectMultipleProvider, { initialProps: initialProps },
9061
- React__default.createElement(SelectRangeProvider, { initialProps: initialProps },
9062
- React__default.createElement(ModifiersProvider, null,
9063
- React__default.createElement(FocusProvider, null, children))))))));
9060
+ return (React.createElement(DayPickerProvider, { initialProps: initialProps },
9061
+ React.createElement(NavigationProvider, null,
9062
+ React.createElement(SelectSingleProvider, { initialProps: initialProps },
9063
+ React.createElement(SelectMultipleProvider, { initialProps: initialProps },
9064
+ React.createElement(SelectRangeProvider, { initialProps: initialProps },
9065
+ React.createElement(ModifiersProvider, null,
9066
+ React.createElement(FocusProvider, null, children))))))));
9064
9067
  }
9065
9068
 
9066
9069
  /**
@@ -9151,8 +9154,8 @@
9151
9154
  * ```
9152
9155
  */
9153
9156
  function DayPicker(props) {
9154
- return (React__default.createElement(RootProvider, __assign({}, props),
9155
- React__default.createElement(Root, { initialProps: props })));
9157
+ return (React.createElement(RootProvider, __assign({}, props),
9158
+ React.createElement(Root, { initialProps: props })));
9156
9159
  }
9157
9160
 
9158
9161
  var reactResponsive$1 = {exports: {}};
@@ -9166,7 +9169,7 @@
9166
9169
  hasRequiredReactResponsive = 1;
9167
9170
  (function (module, exports) {
9168
9171
  (function webpackUniversalModuleDefinition(root, factory) {
9169
- module.exports = factory(React__default);
9172
+ module.exports = factory(React);
9170
9173
  })(reactResponsive, (__WEBPACK_EXTERNAL_MODULE_react__) => {
9171
9174
  return /******/ (() => { // webpackBootstrap
9172
9175
  /******/ var __webpack_modules__ = ({
@@ -10995,15 +10998,19 @@
10995
10998
  var fill = _a.fill, size = _a.size, icon = _a.icon;
10996
10999
  switch (icon) {
10997
11000
  case 'spinner':
10998
- return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), viewBox: "0 0 24 24", children: [jsxRuntime.jsx("style", { children: "\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n " }), jsxRuntime.jsx("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", opacity: ".25", fill: fill }), jsxRuntime.jsx("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "spinner_z9k8", fill: fill })] }));
11001
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), viewBox: "0 0 24 24" },
11002
+ React.createElement("style", null, "\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n "),
11003
+ React.createElement("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", opacity: ".25", fill: fill }),
11004
+ React.createElement("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "spinner_z9k8", fill: fill })));
10999
11005
  case 'warning':
11000
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), className: "svg-icon", style: {
11006
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), className: "svg-icon", style: {
11001
11007
  verticalAlign: 'middle',
11002
11008
  fill: fill,
11003
11009
  overflow: 'hidden',
11004
11010
  minWidth: '25px',
11005
11011
  minHeight: '25px',
11006
- }, viewBox: "0 0 1024 1024", version: "1.1", children: jsxRuntime.jsx("path", { d: "M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z" }) }));
11012
+ }, viewBox: "0 0 1024 1024", version: "1.1" },
11013
+ React.createElement("path", { d: "M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z" })));
11007
11014
  default:
11008
11015
  return null;
11009
11016
  }
@@ -11329,7 +11336,7 @@
11329
11336
  calendarRangeTo &&
11330
11337
  areIntervalsOverlapping({ start: calendarRangeFrom, end: calendarRangeTo }, { start: rangeFrom, end: rangeTo }));
11331
11338
  });
11332
- React__default.useEffect(function () {
11339
+ React.useEffect(function () {
11333
11340
  if ((rangeContext &&
11334
11341
  calendarRangeFrom &&
11335
11342
  !startIsEqualOrBeforeRangeContextEnd) ||
@@ -11344,7 +11351,7 @@
11344
11351
 
11345
11352
  var useCalendarTooltips = function (_a) {
11346
11353
  var showFeedback = _a.showFeedback;
11347
- return React__default.useEffect(function () {
11354
+ return React.useEffect(function () {
11348
11355
  if (typeof document === 'undefined' || !showFeedback)
11349
11356
  return;
11350
11357
  // Children
@@ -11421,7 +11428,7 @@
11421
11428
 
11422
11429
  var useCalendarLoadingSpinner = function (_a) {
11423
11430
  var loadingData = _a.loadingData;
11424
- return React__default.useEffect(function () {
11431
+ return React.useEffect(function () {
11425
11432
  if (typeof document === 'undefined')
11426
11433
  return;
11427
11434
  var loadingSpinner = document.querySelector('.will-filter-bar-calendar .rdp-months .will-calendar-spinner');
@@ -11438,9 +11445,9 @@
11438
11445
 
11439
11446
  var useUpdateDisabledDates = function (_a) {
11440
11447
  var disableCalendarDates = _a.disableCalendarDates, calendarRange = _a.calendarRange, updateCalendarMonthNavigation = _a.updateCalendarMonthNavigation, updateCalendarDefaultMonth = _a.updateCalendarDefaultMonth;
11441
- var _b = __read(React__default.useState(undefined), 2), overlappingDate = _b[0], setOverlappingDate = _b[1];
11442
- var _c = __read(React__default.useState([]), 2), lastPossibleCheckout = _c[0], setLatsPossibleCheckout = _c[1];
11443
- var newDisableCalendarDates = React__default.useMemo(function () {
11448
+ var _b = __read(React.useState(undefined), 2), overlappingDate = _b[0], setOverlappingDate = _b[1];
11449
+ var _c = __read(React.useState([]), 2), lastPossibleCheckout = _c[0], setLatsPossibleCheckout = _c[1];
11450
+ var newDisableCalendarDates = React.useMemo(function () {
11444
11451
  var _a;
11445
11452
  if (disableCalendarDates === null || disableCalendarDates === void 0 ? void 0 : disableCalendarDates.availableDates) {
11446
11453
  var dateFormat_1 = 'dd-MM-yyyy';
@@ -11497,7 +11504,7 @@
11497
11504
  var css_248z$c = ".will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n.will-calendar-filter-container .rdp {\n margin: 0;\n}\n\n.will-calendar-filter-container .DayPicker {\n font-size: 25px;\n}\n\n.will-calendar-filter-container .rdp-month {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 70px;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 70px;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav {\n border: 1px solid var(--will-primary);\n border-radius: 50%;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav svg {\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption {\n position: initial;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,\n.will-calendar-filter-container .rdp-table .rdp-head {\n opacity: 0.6;\n}\n\n.will-calendar-filter-container .rdp-table {\n border-collapse: separate;\n border-spacing: 0px 2px;\n}\n\n.will-calendar-filter-container\n .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {\n background-color: var(--will-primary);\n opacity: 1;\n color: var(--will-white);\n}\n\n.will-calendar-filter-container .my-today:not(.rdp-day_selected) {\n font-weight: 700;\n opacity: 1;\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-cell {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-cell button {\n font-weight: 500;\n}\n\n.will-calendar-filter-container .rdp-cell button.booked {\n font-weight: 400;\n cursor: not-allowed;\n}\n\n.will-calendar-filter-container .rdp-cell .rdp-button[disabled] {\n color: var(--will-transparent-black);\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-calendar-filter-container .rdp-month .rdp-nav {\n border: none;\n border-radius: initial;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 10px;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 10px;\n }\n}\n\n/* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n position: absolute;\n top: -42px;\n transform: translateX(calc(-50% + 20px));\n display: none;\n white-space: nowrap;\n z-index: 2;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only\n > div {\n background-color: white;\n position: relative;\n padding: 5px 10px;\n border: 1px solid var(--will-primary);\n border-radius: 5px;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only::before {\n content: '';\n width: 10px;\n height: 10px;\n border: 1px solid var(--will-primary);\n position: absolute;\n bottom: -4px;\n left: calc(50% - 5.555px);\n rotate: 45deg;\n z-index: 0;\n background-color: var(--will-white);\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-in-only {\n display: block;\n}\n\n/* Loading spinner */\n\n.will-root .will-calendar-filter-container .rdp-months {\n position: relative;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-spinner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: var(--will-white-transparent);\n z-index: 3;\n display: none;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n}\n\n/* No active selection */\n\n.will-root .will-calendar-filter-container .no-active-selection-start,\n.will-root .will-calendar-filter-container .no-active-selection-mid,\n.will-root .will-calendar-filter-container .no-active-selection-end {\n position: initial;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before,\n.will-root .will-calendar-filter-container .no-active-selection-mid::before,\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n border: 2px solid var(--will-light-grey);\n box-sizing: border-box;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before {\n border-right: none;\n border-top-left-radius: 50%;\n border-bottom-left-radius: 50%;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-mid::before {\n border-right: none;\n border-left: none;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n border-left: none;\n border-top-right-radius: 50%;\n border-bottom-right-radius: 50%;\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-day_selected.rdp-day_range_middle.checkout-option {\n background-color: var(--will-primary-lightest);\n color: inherit;\n}\n\n/* Overlapping date */\n\n.will-root .will-calendar-filter-container .overlapping-date {\n user-select: none;\n pointer-events: none;\n}\n\n.will-root .will-calendar-filter-container .overlapping-date:hover {\n cursor: not-allowed;\n}\n\n@media (max-width: 600px) {\n /* Tooltips */\n .will-root .will-calendar-filter-container .will-calendar-tooltip,\n .will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n top: -70px;\n white-space: wrap;\n max-width: 120px;\n }\n}\n";
11498
11505
  styleInject(css_248z$c);
11499
11506
 
11500
- var Calendar = React__default.forwardRef(function (_a, ref) {
11507
+ var Calendar = React.forwardRef(function (_a, ref) {
11501
11508
  var _b;
11502
11509
  var selectedPath = _a.selectedPath, calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange, language = _a.language, disableCalendarDates = _a.disableCalendarDates, requestDates = _a.requestDates, disabledDates = _a.disabledDates, updateCalendarMonthNavigation = _a.updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation = _a.setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth = _a.updateCalendarDefaultMonth, loadingData = _a.loadingData, showFeedback = _a.showFeedback, palette = _a.palette, setCalendarHasError = _a.setCalendarHasError, setUpdatedForSubmit = _a.setUpdatedForSubmit, rangeContext = _a.rangeContext, calendarHasError = _a.calendarHasError, autoFocus = _a.autoFocus;
11503
11510
  // Translations
@@ -11585,39 +11592,53 @@
11585
11592
  : __spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1([
11586
11593
  lastPossibleCheckout
11587
11594
  ], __read(base), false), __read(firstPossibleRangeContextCheckIn), false), __read(lastPossibleRangeContextCheckOut), false), __read(disabledInsideSelectableRange()), false);
11588
- return (jsxRuntime.jsx("div", { className: "will-filter-bar-calendar", ref: ref, children: jsxRuntime.jsxs("div", { className: "will-calendar-filter-container", ref: calendarContainerRef, children: [jsxRuntime.jsx(DayPicker, { id: "will-calendar", mode: "range", locale: language === 'en' ? enUS : fi, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, selected: calendarRange, onSelect: function (range) { return handleOnSelect(range); }, captionLayout: "dropdown-buttons", defaultMonth: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ||
11589
- selectedStartDate ||
11590
- rangeContextStartDate ||
11591
- (((_b = newDisableCalendarDates === null || newDisableCalendarDates === void 0 ? void 0 : newDisableCalendarDates.disabledDates) === null || _b === void 0 ? void 0 : _b.length)
11592
- ? newDisableCalendarDates.disabledDates[0].from
11593
- : today), disabled: disabled, fromMonth: today, onMonthChange: function (val) {
11594
- requestDates === null || requestDates === void 0 ? void 0 : requestDates(val);
11595
- setUpdateCalendarMonthNavigation === null || setUpdateCalendarMonthNavigation === void 0 ? void 0 : setUpdateCalendarMonthNavigation(function (prev) { return !prev; });
11596
- }, classNames: {
11597
- day_range_start: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ? 'rdp-day_range_start' : '',
11598
- day_range_end: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) ? 'rdp-day_range_end' : '',
11599
- }, modifiersClassNames: {
11600
- today: 'my-today',
11601
- booked: 'booked',
11602
- disabledAfterCheckIn: 'disabled-after-check-in',
11603
- overlappingDate: 'overlapping-date',
11604
- noActiveSelectionStart: 'no-active-selection-start',
11605
- noActiveSelectionMid: 'no-active-selection-mid',
11606
- noActiveSelectionEnd: 'no-active-selection-end',
11607
- checkoutOptionsMid: 'rdp-day_selected rdp-day_range_middle checkout-option',
11608
- checkInOnly: 'check-in-only',
11609
- checkOutOnly: 'check-out-only',
11610
- }, modifiers:
11611
- // This function handles conditions for applying the modifiersClassNames
11612
- handleCalendarModifiers({
11613
- calendarRange: calendarRange,
11614
- disabledDates: disabled,
11615
- overlappingDate: overlappingDate,
11616
- rangeContext: rangeContext,
11617
- findFirstPossibleRangeContextCheckIn: findFirstPossibleRangeContextCheckIn,
11618
- findLastPossibleRangeContextCheckOut: findLastPossibleRangeContextCheckOut,
11619
- currentSelectionLastCheckoutDate: currentSelectionAvailability,
11620
- }) }, updateCalendarDefaultMonth), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip', children: jsxRuntime.jsx("div", { children: t('noCheckIn') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-out', children: jsxRuntime.jsx("div", { children: t('noCheckOut') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-overlapping-date', children: jsxRuntime.jsx("div", { children: t('checkOutOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-in-only', children: jsxRuntime.jsx("div", { children: t('checkInOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-out-only', children: jsxRuntime.jsx("div", { children: t('checkOutOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-spinner', children: jsxRuntime.jsx(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.primary) || 'inherit', size: 50, icon: "spinner" }) })] }) }));
11595
+ return (React.createElement("div", { className: "will-filter-bar-calendar", ref: ref },
11596
+ React.createElement("div", { className: "will-calendar-filter-container", ref: calendarContainerRef },
11597
+ React.createElement(DayPicker, { key: updateCalendarDefaultMonth, id: "will-calendar", mode: "range", locale: language === 'en' ? enUS : fi, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, selected: calendarRange, onSelect: function (range) { return handleOnSelect(range); }, captionLayout: "dropdown-buttons", defaultMonth: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ||
11598
+ selectedStartDate ||
11599
+ rangeContextStartDate ||
11600
+ (((_b = newDisableCalendarDates === null || newDisableCalendarDates === void 0 ? void 0 : newDisableCalendarDates.disabledDates) === null || _b === void 0 ? void 0 : _b.length)
11601
+ ? newDisableCalendarDates.disabledDates[0].from
11602
+ : today), disabled: disabled, fromMonth: today, onMonthChange: function (val) {
11603
+ requestDates === null || requestDates === void 0 ? void 0 : requestDates(val);
11604
+ setUpdateCalendarMonthNavigation === null || setUpdateCalendarMonthNavigation === void 0 ? void 0 : setUpdateCalendarMonthNavigation(function (prev) { return !prev; });
11605
+ }, classNames: {
11606
+ day_range_start: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ? 'rdp-day_range_start' : '',
11607
+ day_range_end: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) ? 'rdp-day_range_end' : '',
11608
+ }, modifiersClassNames: {
11609
+ today: 'my-today',
11610
+ booked: 'booked',
11611
+ disabledAfterCheckIn: 'disabled-after-check-in',
11612
+ overlappingDate: 'overlapping-date',
11613
+ noActiveSelectionStart: 'no-active-selection-start',
11614
+ noActiveSelectionMid: 'no-active-selection-mid',
11615
+ noActiveSelectionEnd: 'no-active-selection-end',
11616
+ checkoutOptionsMid: 'rdp-day_selected rdp-day_range_middle checkout-option',
11617
+ checkInOnly: 'check-in-only',
11618
+ checkOutOnly: 'check-out-only',
11619
+ }, modifiers:
11620
+ // This function handles conditions for applying the modifiersClassNames
11621
+ handleCalendarModifiers({
11622
+ calendarRange: calendarRange,
11623
+ disabledDates: disabled,
11624
+ overlappingDate: overlappingDate,
11625
+ rangeContext: rangeContext,
11626
+ findFirstPossibleRangeContextCheckIn: findFirstPossibleRangeContextCheckIn,
11627
+ findLastPossibleRangeContextCheckOut: findLastPossibleRangeContextCheckOut,
11628
+ currentSelectionLastCheckoutDate: currentSelectionAvailability,
11629
+ }) }),
11630
+ React.createElement("div", { className: 'will-calendar-tooltip' },
11631
+ React.createElement("div", null, t('noCheckIn'))),
11632
+ React.createElement("div", { className: 'will-calendar-tooltip-check-out' },
11633
+ React.createElement("div", null, t('noCheckOut'))),
11634
+ React.createElement("div", { className: 'will-calendar-tooltip-overlapping-date' },
11635
+ React.createElement("div", null, t('checkOutOnly'))),
11636
+ React.createElement("div", { className: 'will-calendar-tooltip-check-in-only' },
11637
+ React.createElement("div", null, t('checkInOnly'))),
11638
+ React.createElement("div", { className: 'will-calendar-tooltip-check-out-only' },
11639
+ React.createElement("div", null, t('checkOutOnly'))),
11640
+ React.createElement("div", { className: 'will-calendar-spinner' },
11641
+ React.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.primary) || 'inherit', size: 50, icon: "spinner" })))));
11621
11642
  });
11622
11643
 
11623
11644
  var parseGuests = function (_a) {
@@ -11677,8 +11698,6 @@
11677
11698
 
11678
11699
  var calculateDropdownPosition = function (_a) {
11679
11700
  var filterSection = _a.filterSection, headerRef = _a.headerRef, locationsButtonRef = _a.locationsButtonRef, datesButtonRef = _a.datesButtonRef, guestsButtonRef = _a.guestsButtonRef, isMobile = _a.isMobile;
11680
- // On mobile, don't apply any positioning - let CSS handle it naturally
11681
- // Dropdowns will start from leftmost point with position: relative
11682
11701
  if (isMobile) {
11683
11702
  return {};
11684
11703
  }
@@ -11688,7 +11707,6 @@
11688
11707
  var containerLeft = 0;
11689
11708
  switch (filterSection) {
11690
11709
  case FilterSections.LOCATIONS:
11691
- // Locations: Start from beginning, hug content
11692
11710
  if (locationsButtonRef.current) {
11693
11711
  var buttonRect = locationsButtonRef.current.getBoundingClientRect();
11694
11712
  var relativeLeft = buttonRect.left - containerRect.left;
@@ -11700,15 +11718,12 @@
11700
11718
  }
11701
11719
  break;
11702
11720
  case FilterSections.CALENDAR:
11703
- // Calendar: Two months side-by-side, needs ~650-700px
11704
- // Start from dates button, but push left if not enough space
11705
11721
  if (datesButtonRef.current) {
11706
11722
  var buttonRect = datesButtonRef.current.getBoundingClientRect();
11707
11723
  var relativeLeft = buttonRect.left - containerRect.left;
11708
11724
  var availableWidth = containerRect.width - relativeLeft;
11709
11725
  var calendarMinWidth = 650;
11710
11726
  if (availableWidth < calendarMinWidth) {
11711
- // Not enough space, align to the right edge
11712
11727
  return {
11713
11728
  left: 'auto',
11714
11729
  right: containerLeft,
@@ -11717,7 +11732,6 @@
11717
11732
  };
11718
11733
  }
11719
11734
  else {
11720
- // Enough space, start from dates button
11721
11735
  return {
11722
11736
  left: relativeLeft,
11723
11737
  right: 'auto',
@@ -11727,14 +11741,12 @@
11727
11741
  }
11728
11742
  break;
11729
11743
  case FilterSections.GUESTS:
11730
- // Guests: Start from guests button, push left if not enough space
11731
11744
  if (guestsButtonRef.current) {
11732
11745
  var buttonRect = guestsButtonRef.current.getBoundingClientRect();
11733
11746
  var relativeLeft = buttonRect.left - containerRect.left;
11734
11747
  var availableWidth = containerRect.width - relativeLeft;
11735
11748
  var dropdownMinWidth = 350;
11736
11749
  if (availableWidth < dropdownMinWidth) {
11737
- // Not enough space, align to the right
11738
11750
  return {
11739
11751
  left: 'auto',
11740
11752
  right: containerLeft,
@@ -11743,7 +11755,6 @@
11743
11755
  };
11744
11756
  }
11745
11757
  else {
11746
- // Enough space, start from button
11747
11758
  return {
11748
11759
  left: relativeLeft,
11749
11760
  right: 'auto',
@@ -11760,14 +11771,14 @@
11760
11771
 
11761
11772
  var useFilterBar = function (_a) {
11762
11773
  var redirectUrl = _a.redirectUrl, ageCategories = _a.ageCategories, onSubmit = _a.onSubmit, tabs = _a.tabs, locations = _a.locations;
11763
- var _b = __read(React__default.useState(Pages.EVENTS), 2), selectedPath = _b[0], setSelectedPath = _b[1];
11764
- var _c = __read(React__default.useState(false), 2), selectedFilter = _c[0], setSelectedFilter = _c[1];
11765
- var _d = __read(React__default.useState(), 2), calendarRange = _d[0], setCalendarRange = _d[1];
11766
- var _e = __read(React__default.useState(false), 2), innerLoading = _e[0], setInnerLoading = _e[1];
11767
- var _f = __read(React__default.useState(0), 2), categories = _f[0], setCategories = _f[1];
11768
- var _g = __read(React__default.useState({}), 2), ageCategoryCounts = _g[0], setAgeCategoryCounts = _g[1];
11769
- var _h = __read(React__default.useState([]), 2), selectedLocations = _h[0], setSelectedLocations = _h[1];
11770
- React__default.useEffect(function () {
11774
+ var _b = __read(React.useState(Pages.EVENTS), 2), selectedPath = _b[0], setSelectedPath = _b[1];
11775
+ var _c = __read(React.useState(false), 2), selectedFilter = _c[0], setSelectedFilter = _c[1];
11776
+ var _d = __read(React.useState(), 2), calendarRange = _d[0], setCalendarRange = _d[1];
11777
+ var _e = __read(React.useState(false), 2), innerLoading = _e[0], setInnerLoading = _e[1];
11778
+ var _f = __read(React.useState(0), 2), categories = _f[0], setCategories = _f[1];
11779
+ var _g = __read(React.useState({}), 2), ageCategoryCounts = _g[0], setAgeCategoryCounts = _g[1];
11780
+ var _h = __read(React.useState([]), 2), selectedLocations = _h[0], setSelectedLocations = _h[1];
11781
+ React.useEffect(function () {
11771
11782
  var _a;
11772
11783
  var urlSearchParams = new URLSearchParams(window.location.search);
11773
11784
  var startDateParam = urlSearchParams.get('startDate');
@@ -11792,7 +11803,7 @@
11792
11803
  setSelectedLocations(matchedLocations);
11793
11804
  }
11794
11805
  }, []);
11795
- React__default.useEffect(function () {
11806
+ React.useEffect(function () {
11796
11807
  if (typeof window === 'undefined')
11797
11808
  return;
11798
11809
  var defaultTab = (tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 ? tabs[0] : tabs === null || tabs === void 0 ? void 0 : tabs.find(function (tab) { return tab.default; });
@@ -11925,9 +11936,9 @@
11925
11936
 
11926
11937
  var useScrollInToView = function (_a) {
11927
11938
  var selectedFilter = _a.selectedFilter;
11928
- var _b = __read(React__default.useState(true), 2), isMobile = _b[0], setIsMobile = _b[1];
11929
- var targetFilterBarRef = React__default.useRef(null);
11930
- React__default.useEffect(function () {
11939
+ var _b = __read(React.useState(true), 2), isMobile = _b[0], setIsMobile = _b[1];
11940
+ var targetFilterBarRef = React.useRef(null);
11941
+ React.useEffect(function () {
11931
11942
  if (typeof window !== 'undefined' && window.innerWidth > 960) {
11932
11943
  setIsMobile(false);
11933
11944
  return;
@@ -11947,9 +11958,13 @@
11947
11958
  var css_248z$b = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n}\n\n.will-filter-bar-select-button.disabled {\n cursor: not-allowed;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid;\n}\n\n.will-filter-bar-select-button .select-button-label {\n color: var(--will-black);\n font-weight: 600;\n}\n\n.will-filter-bar-select-button .select-button-description {\n color: var(--will-black);\n font-weight: 400;\n opacity: 0.5;\n white-space: nowrap;\n min-height: 19px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.will-filter-bar-select-button .select-button-description span {\n font: inherit;\n}\n\n.will-filter-bar-select-button .select-button-label.active,\n.will-filter-bar-select-button .select-button-description.active {\n font-weight: 700;\n font-size: 15px;\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-select-button {\n padding: 15px 0;\n }\n\n .will-filter-bar-select-button:first-child {\n padding: 0 0 15px 0;\n }\n\n .will-filter-bar-select-button .select-button-wrapper {\n justify-content: center;\n text-align: center;\n }\n\n .will-filter-bar-select-button .select-button-description {\n white-space: wrap;\n }\n\n .will-filter-bar-select-button .select-button-divider {\n display: none;\n }\n}\n";
11948
11959
  styleInject(css_248z$b);
11949
11960
 
11950
- var SelectButton = React__default.forwardRef(function (_a, ref) {
11961
+ var SelectButton = React.forwardRef(function (_a, ref) {
11951
11962
  var active = _a.active, label = _a.label, onClick = _a.onClick, description = _a.description, disabled = _a.disabled, ariaExpanded = _a.ariaExpanded, ariaControls = _a.ariaControls;
11952
- return (jsxRuntime.jsx("button", { ref: ref, className: "will-filter-bar-select-button ".concat(disabled ? 'disabled' : ''), onClick: disabled ? undefined : onClick, disabled: disabled, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": "true", "aria-disabled": disabled, children: jsxRuntime.jsx("span", { className: "select-button-wrapper", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "select-button-label", children: label }), jsxRuntime.jsx("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })] }) }) }));
11963
+ return (React.createElement("button", { ref: ref, className: "will-filter-bar-select-button ".concat(disabled ? 'disabled' : ''), onClick: disabled ? undefined : onClick, disabled: disabled, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": "true", "aria-disabled": disabled },
11964
+ React.createElement("span", { className: "select-button-wrapper" },
11965
+ React.createElement("div", null,
11966
+ React.createElement("p", { className: "select-button-label" }, label),
11967
+ React.createElement("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })))));
11953
11968
  });
11954
11969
  SelectButton.displayName = 'SelectButton';
11955
11970
 
@@ -11958,7 +11973,7 @@
11958
11973
 
11959
11974
  var TabButton = function (_a) {
11960
11975
  var onClick = _a.onClick, label = _a.label, active = _a.active, mode = _a.mode;
11961
- return (jsxRuntime.jsx("button", { className: "will-filter-bar-tab-button ".concat(mode || 'light', " ").concat(active && 'active', " "), onClick: onClick, children: label }));
11976
+ return (React.createElement("button", { className: "will-filter-bar-tab-button ".concat(mode || 'light', " ").concat(active && 'active', " "), onClick: onClick }, label));
11962
11977
  };
11963
11978
 
11964
11979
  var css_248z$9 = ".will-guests-filter-label,\n.will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text);\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\n}\n\n.will-guests-filter-inner .will-guests-filter-counter {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 10px;\n min-width: 30px;\n text-align: center;\n}\n\n.will-guests-filter-counter-button {\n border-radius: 50%;\n background-color: transparent;\n border: 1px solid var(--will-grey);\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n color: var(--will-black);\n\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.will-guests-filter-counter-button:hover {\n background-color: var(--will-onahau);\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-inner {\n width: 100%;\n margin: 15px 0;\n justify-content: space-between;\n }\n}\n";
@@ -11966,7 +11981,7 @@
11966
11981
 
11967
11982
  var GuestCount = function (_a) {
11968
11983
  var label = _a.label, sortOrder = _a.sortOrder, id = _a.id, updateGuestsCount = _a.updateGuestsCount, count = _a.count, minVal = _a.minVal;
11969
- React__default.useEffect(function () {
11984
+ React.useEffect(function () {
11970
11985
  if (minVal && minVal > count) {
11971
11986
  updateGuestsCount("guests-".concat(id), minVal);
11972
11987
  }
@@ -11979,11 +11994,20 @@
11979
11994
  var handleIncrement = function () {
11980
11995
  updateGuestsCount("guests-".concat(id), count + 1);
11981
11996
  };
11982
- return (jsxRuntime.jsxs("div", { className: "will-guests-filter-inner", style: { order: "".concat(sortOrder) }, children: [jsxRuntime.jsx("p", { className: "will-guests-filter-label", children: label }), jsxRuntime.jsxs("div", { className: "will-guests-filter-counter", children: [jsxRuntime.jsx("button", { className: "will-guests-filter-counter-button", onClick: handleDecrement, disabled: (minVal && count <= minVal) || !count, style: {
11983
- cursor: (minVal && count <= minVal) || !count ? 'initial' : 'pointer',
11984
- paddingBottom: '4px',
11985
- opacity: (minVal && count <= minVal) || !count ? 0.4 : 1,
11986
- }, children: jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) }), jsxRuntime.jsx("span", { className: "will-guests-filter-count", children: count }), jsxRuntime.jsx("button", { className: "will-guests-filter-counter-button", onClick: handleIncrement, children: jsxRuntime.jsx("svg", { width: "15", height: "15", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })] })] }));
11997
+ return (React.createElement("div", { className: "will-guests-filter-inner", style: { order: "".concat(sortOrder) } },
11998
+ React.createElement("p", { className: "will-guests-filter-label" }, label),
11999
+ React.createElement("div", { className: "will-guests-filter-counter" },
12000
+ React.createElement("button", { className: "will-guests-filter-counter-button", onClick: handleDecrement, disabled: (minVal && count <= minVal) || !count, style: {
12001
+ cursor: (minVal && count <= minVal) || !count ? 'initial' : 'pointer',
12002
+ paddingBottom: '4px',
12003
+ opacity: (minVal && count <= minVal) || !count ? 0.4 : 1,
12004
+ } },
12005
+ React.createElement("svg", { width: "10", height: "10", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12006
+ React.createElement("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))),
12007
+ React.createElement("span", { className: "will-guests-filter-count" }, count),
12008
+ React.createElement("button", { className: "will-guests-filter-counter-button", onClick: handleIncrement },
12009
+ React.createElement("svg", { width: "15", height: "15", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12010
+ React.createElement("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))))));
11987
12011
  };
11988
12012
 
11989
12013
  var css_248z$8 = ".will-filter-section-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n}\n\n.will-filter-section-title {\n font-size: 22px;\n margin: 0;\n}\n\n.will-filter-section-action {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n.will-filter-section-action .will-filter-bar-close-button {\n position: relative;\n top: auto;\n right: auto;\n margin: 0;\n}\n\n@media (max-width: 960px) {\n .will-filter-section-title {\n font-size: 18px;\n }\n}\n";
@@ -11991,17 +12015,21 @@
11991
12015
 
11992
12016
  var FilterSectionHeader = function (_a) {
11993
12017
  var title = _a.title, action = _a.action;
11994
- return (jsxRuntime.jsxs("div", { className: "will-filter-section-header", children: [jsxRuntime.jsx("h3", { className: "will-filter-section-title", children: title }), action && jsxRuntime.jsx("div", { className: "will-filter-section-action", children: action })] }));
12018
+ return (React.createElement("div", { className: "will-filter-section-header" },
12019
+ React.createElement("h3", { className: "will-filter-section-title" }, title),
12020
+ action && React.createElement("div", { className: "will-filter-section-action" }, action)));
11995
12021
  };
11996
12022
 
11997
12023
  var css_248z$7 = ".will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 16px;\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
11998
12024
  styleInject(css_248z$7);
11999
12025
 
12000
- var Guests = React__default.forwardRef(function (_a, ref) {
12026
+ var Guests = React.forwardRef(function (_a, ref) {
12001
12027
  var ageCategories = _a.ageCategories, updateGuestsCount = _a.updateGuestsCount, ageCategoryCounts = _a.ageCategoryCounts, autoFocus = _a.autoFocus, onClose = _a.onClose;
12002
12028
  var t = useTranslation('filterBar').t;
12003
12029
  var containerRef = useAutoFocus(autoFocus);
12004
- return (jsxRuntime.jsxs("div", { className: "will-filter-bar-guests", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: t('guests.title'), action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-guests-filter-container", ref: containerRef, children: ageCategories === null || ageCategories === void 0 ? void 0 : ageCategories.map(function (category) { return (jsxRuntime.jsx(GuestCount, { id: category.id, label: category.name, minVal: category.minVal, sortOrder: category.sortOrder, updateGuestsCount: updateGuestsCount, count: ageCategoryCounts["guests-".concat(category.id)] || 0 }, category.id)); }) })] }));
12030
+ return (React.createElement("div", { className: "will-filter-bar-guests", ref: ref },
12031
+ React.createElement(FilterSectionHeader, { title: t('guests.title'), action: onClose && React.createElement(CloseButton, { handleClose: onClose }) }),
12032
+ React.createElement("div", { className: "will-guests-filter-container", ref: containerRef }, ageCategories === null || ageCategories === void 0 ? void 0 : ageCategories.map(function (category) { return (React.createElement(GuestCount, { key: category.id, id: category.id, label: category.name, minVal: category.minVal, sortOrder: category.sortOrder, updateGuestsCount: updateGuestsCount, count: ageCategoryCounts["guests-".concat(category.id)] || 0 })); }))));
12005
12033
  });
12006
12034
  Guests.displayName = 'Guests';
12007
12035
 
@@ -12009,7 +12037,7 @@
12009
12037
  styleInject(css_248z$6);
12010
12038
 
12011
12039
  var Divider = function () {
12012
- return jsxRuntime.jsx("div", { className: "will-filter-bar-divider" });
12040
+ return React.createElement("div", { className: "will-filter-bar-divider" });
12013
12041
  };
12014
12042
 
12015
12043
  var css_248z$5 = ".will-filter-bar-categories {\n text-align: center;\n}\n\n.will-categories-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0 30px 0;\n}\n\n.will-categories-filter-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 20px;\n}\n\n.will-categories-filter-inner input {\n cursor: pointer;\n margin-right: 10px;\n}\n";
@@ -12024,12 +12052,16 @@
12024
12052
  'Summer camp',
12025
12053
  'Winter camp',
12026
12054
  ];
12027
- var _b = __read(React__default.useState(''), 2), selectedCategory = _b[0], setSelectedCategory = _b[1];
12055
+ var _b = __read(React.useState(''), 2), selectedCategory = _b[0], setSelectedCategory = _b[1];
12028
12056
  var handleCategoryChange = function (selectedCategory) {
12029
12057
  setSelectedCategory(selectedCategory);
12030
12058
  setCategories(selectedCategory);
12031
12059
  };
12032
- return (jsxRuntime.jsxs("div", { className: "will-filter-bar-categories", children: [jsxRuntime.jsx("h3", { className: "will-categories-filter-title", children: t('categories.label') }), jsxRuntime.jsx("div", { className: "will-categories-filter-inner", children: categoriesPlaceholder.map(function (itm, idx) { return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("input", { type: "radio", value: itm, checked: selectedCategory === itm, onChange: function () { return handleCategoryChange(itm); } }), jsxRuntime.jsx("span", { children: itm })] }, idx)); }) })] }));
12060
+ return (React.createElement("div", { className: "will-filter-bar-categories" },
12061
+ React.createElement("h3", { className: "will-categories-filter-title" }, t('categories.label')),
12062
+ React.createElement("div", { className: "will-categories-filter-inner" }, categoriesPlaceholder.map(function (itm, idx) { return (React.createElement("div", { key: idx },
12063
+ React.createElement("input", { type: "radio", value: itm, checked: selectedCategory === itm, onChange: function () { return handleCategoryChange(itm); } }),
12064
+ React.createElement("span", null, itm))); }))));
12033
12065
  };
12034
12066
 
12035
12067
  var css_248z$4 = ".will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n gap: 10px;\n flex-direction: column;\n min-width: 400px;\n padding: 16px 0;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
@@ -12038,23 +12070,27 @@
12038
12070
  var css_248z$3 = ".will-image-card {\n display: flex;\n gap: 20px;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n cursor: pointer;\n user-select: none;\n min-height: 40px;\n}\n\n.will-image-card.is-selected {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card:hover {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card-image img {\n width: 120px;\n height: 68px;\n object-fit: cover;\n}\n";
12039
12071
  styleInject(css_248z$3);
12040
12072
 
12041
- var ImageCard = React__default.forwardRef(function (_a, ref) {
12073
+ var ImageCard = React.forwardRef(function (_a, ref) {
12042
12074
  var title = _a.title, description = _a.description, imageUrl = _a.imageUrl, isSelected = _a.isSelected, onClick = _a.onClick;
12043
12075
  var ariaLabel = "".concat(title).concat(description ? ", ".concat(description) : '');
12044
- return (jsxRuntime.jsxs("div", { ref: ref, className: "will-image-card ".concat(isSelected ? 'is-selected' : ''), onClick: onClick, onKeyDown: function (e) {
12076
+ return (React.createElement("div", { ref: ref, className: "will-image-card ".concat(isSelected ? 'is-selected' : ''), onClick: onClick, onKeyDown: function (e) {
12045
12077
  if (e.key === 'Enter' || e.key === ' ') {
12046
12078
  e.preventDefault();
12047
12079
  onClick === null || onClick === void 0 ? void 0 : onClick();
12048
12080
  }
12049
- }, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel, children: [jsxRuntime.jsxs("div", { className: "will-image-card-content", children: [jsxRuntime.jsx("h3", { children: title }), description && jsxRuntime.jsx("p", { children: description })] }), jsxRuntime.jsx("div", { className: "will-image-card-image", children: imageUrl && jsxRuntime.jsx("img", { src: imageUrl, alt: title || 'Location image' }) })] }));
12081
+ }, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel },
12082
+ React.createElement("div", { className: "will-image-card-content" },
12083
+ React.createElement("h3", null, title),
12084
+ description && React.createElement("p", null, description)),
12085
+ React.createElement("div", { className: "will-image-card-image" }, imageUrl && React.createElement("img", { src: imageUrl, alt: title || 'Location image' }))));
12050
12086
  });
12051
12087
  ImageCard.displayName = 'ImageCard';
12052
12088
 
12053
- var Locations = React__default.forwardRef(function (_a, ref) {
12089
+ var Locations = React.forwardRef(function (_a, ref) {
12054
12090
  var locations = _a.locations, language = _a.language, selectedLocations = _a.selectedLocations, setSelectedLocations = _a.setSelectedLocations, autoFocus = _a.autoFocus, _b = _a.multiSelect, multiSelect = _b === void 0 ? false : _b, onClose = _a.onClose;
12055
12091
  var t = useTranslation('filterBar').t;
12056
- var firstCardRef = React__default.useRef(null);
12057
- React__default.useEffect(function () {
12092
+ var firstCardRef = React.useRef(null);
12093
+ React.useEffect(function () {
12058
12094
  if (autoFocus && firstCardRef.current) {
12059
12095
  firstCardRef.current.focus();
12060
12096
  }
@@ -12078,10 +12114,12 @@
12078
12114
  onClose === null || onClose === void 0 ? void 0 : onClose();
12079
12115
  }
12080
12116
  };
12081
- return (jsxRuntime.jsxs("div", { className: "will-filter-bar-locations", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: t('locations.title'), action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-locations-filter-container", children: !!((locations === null || locations === void 0 ? void 0 : locations.length) && language) &&
12082
- locations.map(function (location, index) {
12083
- return (jsxRuntime.jsx(ImageCard, { ref: index === 0 ? firstCardRef : null, title: location.label, description: location.description, imageUrl: location.imageUrl, isSelected: selectedLocations.some(function (loc) { return loc.id === location.id; }), onClick: function () { return handleLocationClick(location); } }, location.id));
12084
- }) })] }));
12117
+ return (React.createElement("div", { className: "will-filter-bar-locations", ref: ref },
12118
+ React.createElement(FilterSectionHeader, { title: t('locations.title'), action: onClose && React.createElement(CloseButton, { handleClose: onClose }) }),
12119
+ React.createElement("div", { className: "will-locations-filter-container" }, !!((locations === null || locations === void 0 ? void 0 : locations.length) && language) &&
12120
+ locations.map(function (location, index) {
12121
+ return (React.createElement(ImageCard, { key: location.id, ref: index === 0 ? firstCardRef : null, title: location.label, description: location.description, imageUrl: location.imageUrl, isSelected: selectedLocations.some(function (loc) { return loc.id === location.id; }), onClick: function () { return handleLocationClick(location); } }));
12122
+ }))));
12085
12123
  });
12086
12124
  Locations.displayName = 'Locations';
12087
12125
 
@@ -12091,9 +12129,12 @@
12091
12129
  var css_248z$1 = ".will-dates-filter-container {\n padding: 0 16px;\n}\n";
12092
12130
  styleInject(css_248z$1);
12093
12131
 
12094
- var Dates = React__default.forwardRef(function (_a, ref) {
12132
+ var Dates = React.forwardRef(function (_a, ref) {
12095
12133
  var onClose = _a.onClose, autoFocus = _a.autoFocus, calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange, disableCalendarDates = _a.disableCalendarDates, selectedPath = _a.selectedPath, language = _a.language, filtersRef = _a.filtersRef;
12096
- return (jsxRuntime.jsxs("div", { className: "will-filter-bar-dates", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: '', action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-dates-filter-container", children: jsxRuntime.jsx(Calendar, { autoFocus: autoFocus, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, ref: filtersRef }) })] }));
12134
+ return (React.createElement("div", { className: "will-filter-bar-dates", ref: ref },
12135
+ React.createElement(FilterSectionHeader, { title: '', action: onClose && React.createElement(CloseButton, { handleClose: onClose }) }),
12136
+ React.createElement("div", { className: "will-dates-filter-container" },
12137
+ React.createElement(Calendar, { autoFocus: autoFocus, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, ref: filtersRef }))));
12097
12138
  });
12098
12139
  Dates.displayName = 'Dates';
12099
12140
 
@@ -12105,13 +12146,13 @@
12105
12146
  useUpdateTranslations({ language: language });
12106
12147
  var t = useTranslation('filterBar').t;
12107
12148
  // Refs for SelectButtons
12108
- var locationsButtonRef = React__default.useRef(null);
12109
- var datesButtonRef = React__default.useRef(null);
12110
- var guestsButtonRef = React__default.useRef(null);
12111
- var previouslyFocusedButtonRef = React__default.useRef(null);
12112
- var headerRef = React__default.useRef(null);
12149
+ var locationsButtonRef = React.useRef(null);
12150
+ var datesButtonRef = React.useRef(null);
12151
+ var guestsButtonRef = React.useRef(null);
12152
+ var previouslyFocusedButtonRef = React.useRef(null);
12153
+ var headerRef = React.useRef(null);
12113
12154
  // Dropdown positioning
12114
- var _f = __read(React__default.useState({}), 2), dropdownStyle = _f[0], setDropdownStyle = _f[1];
12155
+ var _f = __read(React.useState({}), 2), dropdownStyle = _f[0], setDropdownStyle = _f[1];
12115
12156
  // Filters
12116
12157
  var _g = useFilterBar({
12117
12158
  redirectUrl: redirectUrl,
@@ -12140,7 +12181,7 @@
12140
12181
  handleSelectedFilter(filter);
12141
12182
  };
12142
12183
  // Store previously focused button and restore focus when closing
12143
- React__default.useEffect(function () {
12184
+ React.useEffect(function () {
12144
12185
  if (!selectedFilter && previouslyFocusedButtonRef.current) {
12145
12186
  previouslyFocusedButtonRef.current.focus();
12146
12187
  previouslyFocusedButtonRef.current = null;
@@ -12162,31 +12203,50 @@
12162
12203
  locationsPlaceholder: t('locations.placeholder'),
12163
12204
  locationsSelectedLabel: t('locations.selected'),
12164
12205
  });
12165
- return (jsxRuntime.jsxs("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette, children: [tabs && tabs.length > 1 && (jsxRuntime.jsx("div", { className: "will-filter-bar-tabs", ref: targetFilterBarRef, children: tabs
12166
- .sort(function (a, b) { return a.order - b.order; })
12167
- .map(function (tab, idx) { return (jsxRuntime.jsx(TabButton, { label: tab.label || t("tabs.".concat(tab.path.substring(1))), onClick: function () {
12168
- setSelectedPath(tab.path);
12169
- handleResetFilters();
12170
- handleSelectedFilter(false);
12171
- }, active: selectedPath === tab.path, mode: mode }, "tab-".concat(idx))); }) })), jsxRuntime.jsxs("div", { className: "will-filter-bar-header ".concat(mode || 'light'), ref: function (el) {
12172
- headerRef.current = el;
12173
- if ((tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 && targetFilterBarRef) {
12174
- targetFilterBarRef.current = el;
12175
- }
12176
- }, children: [!!((_b = locations === null || locations === void 0 ? void 0 : locations.data) === null || _b === void 0 ? void 0 : _b.length) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectButton, { ref: locationsButtonRef, label: t('locations.label'), description: parsedLocations, onClick: function () {
12177
- previouslyFocusedButtonRef.current = locationsButtonRef.current;
12178
- handleSelectedFilterWithPosition(FilterSections.LOCATIONS);
12179
- }, active: !!selectedLocations.length, disabled: locations === null || locations === void 0 ? void 0 : locations.disabled, ariaExpanded: selectedFilter === FilterSections.LOCATIONS, ariaControls: "will-locations-filter" }), jsxRuntime.jsx(Divider, {})] })), jsxRuntime.jsx(SelectButton, { ref: datesButtonRef, label: t('calendar.label'), description: parsedDates
12180
- ? parsedDates
12181
- : selectedPath === Pages.ROOMS
12182
- ? t('calendar.roomsLabelPlaceholder')
12183
- : t('calendar.eventsLabelPlaceholder'), onClick: function () {
12184
- previouslyFocusedButtonRef.current = datesButtonRef.current;
12185
- handleSelectedFilterWithPosition(FilterSections.CALENDAR);
12186
- }, active: !!parsedDates, ariaExpanded: selectedFilter === FilterSections.CALENDAR, ariaControls: "will-calendar-filter" }), selectedPath !== Pages.EVENTS && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(SelectButton, { ref: guestsButtonRef, label: t('guests.label'), description: parsedGuests.content, onClick: function () {
12187
- previouslyFocusedButtonRef.current = guestsButtonRef.current;
12188
- handleSelectedFilterWithPosition(FilterSections.GUESTS);
12189
- }, active: !!parsedGuests.data.total, ariaExpanded: selectedFilter === FilterSections.GUESTS, ariaControls: "will-guests-filter" })] })), jsxRuntime.jsx(SubmitButton, { onClick: handleSubmit, startIcon: jsxRuntime.jsx(FaSearch, {}), label: t('common:search'), isLoading: innerLoading || outerLoading })] }), selectedFilter && (jsxRuntime.jsxs("div", { className: "will-filter-bar-container ".concat(mode || 'light'), style: __assign$2(__assign$2({}, ((!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {})), dropdownStyle), children: [selectedFilter === FilterSections.CALENDAR && (jsxRuntime.jsx("div", { id: "will-dates-filter", children: jsxRuntime.jsx(Dates, { autoFocus: true, ref: filtersRef, onClose: function () { return handleSelectedFilter(false); }, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, filtersRef: filtersRef }) })), selectedFilter === FilterSections.GUESTS && (jsxRuntime.jsx("div", { id: "will-guests-filter", children: jsxRuntime.jsx(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef, autoFocus: true, onClose: function () { return handleSelectedFilter(false); } }) })), selectedFilter === FilterSections.CATEGORIES && (jsxRuntime.jsx("div", { id: "will-categories-filter", children: jsxRuntime.jsx(Categories, { categories: categories, setCategories: setCategories }) })), selectedFilter === FilterSections.LOCATIONS && (jsxRuntime.jsx("div", { id: "will-locations-filter", children: jsxRuntime.jsx(Locations, { autoFocus: true, ref: filtersRef, locations: locations === null || locations === void 0 ? void 0 : locations.data, language: language, selectedLocations: selectedLocations, setSelectedLocations: setSelectedLocations, multiSelect: locations === null || locations === void 0 ? void 0 : locations.multiSelect, onClose: function () { return handleSelectedFilter(false); } }) }))] }))] }));
12206
+ return (React.createElement("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette },
12207
+ tabs && tabs.length > 1 && (React.createElement("div", { className: "will-filter-bar-tabs", ref: targetFilterBarRef }, tabs
12208
+ .sort(function (a, b) { return a.order - b.order; })
12209
+ .map(function (tab, idx) { return (React.createElement(TabButton, { key: "tab-".concat(idx), label: tab.label || t("tabs.".concat(tab.path.substring(1))), onClick: function () {
12210
+ setSelectedPath(tab.path);
12211
+ handleResetFilters();
12212
+ handleSelectedFilter(false);
12213
+ }, active: selectedPath === tab.path, mode: mode })); }))),
12214
+ React.createElement("div", { className: "will-filter-bar-header ".concat(mode || 'light'), ref: function (el) {
12215
+ headerRef.current = el;
12216
+ if ((tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 && targetFilterBarRef) {
12217
+ targetFilterBarRef.current = el;
12218
+ }
12219
+ } },
12220
+ !!((_b = locations === null || locations === void 0 ? void 0 : locations.data) === null || _b === void 0 ? void 0 : _b.length) && (React.createElement(React.Fragment, null,
12221
+ React.createElement(SelectButton, { ref: locationsButtonRef, label: t('locations.label'), description: parsedLocations, onClick: function () {
12222
+ previouslyFocusedButtonRef.current = locationsButtonRef.current;
12223
+ handleSelectedFilterWithPosition(FilterSections.LOCATIONS);
12224
+ }, active: !!selectedLocations.length, disabled: locations === null || locations === void 0 ? void 0 : locations.disabled, ariaExpanded: selectedFilter === FilterSections.LOCATIONS, ariaControls: "will-locations-filter" }),
12225
+ React.createElement(Divider, null))),
12226
+ React.createElement(SelectButton, { ref: datesButtonRef, label: t('calendar.label'), description: parsedDates
12227
+ ? parsedDates
12228
+ : selectedPath === Pages.ROOMS
12229
+ ? t('calendar.roomsLabelPlaceholder')
12230
+ : t('calendar.eventsLabelPlaceholder'), onClick: function () {
12231
+ previouslyFocusedButtonRef.current = datesButtonRef.current;
12232
+ handleSelectedFilterWithPosition(FilterSections.CALENDAR);
12233
+ }, active: !!parsedDates, ariaExpanded: selectedFilter === FilterSections.CALENDAR, ariaControls: "will-calendar-filter" }),
12234
+ selectedPath !== Pages.EVENTS && (React.createElement(React.Fragment, null,
12235
+ React.createElement(Divider, null),
12236
+ React.createElement(SelectButton, { ref: guestsButtonRef, label: t('guests.label'), description: parsedGuests.content, onClick: function () {
12237
+ previouslyFocusedButtonRef.current = guestsButtonRef.current;
12238
+ handleSelectedFilterWithPosition(FilterSections.GUESTS);
12239
+ }, active: !!parsedGuests.data.total, ariaExpanded: selectedFilter === FilterSections.GUESTS, ariaControls: "will-guests-filter" }))),
12240
+ React.createElement(SubmitButton, { onClick: handleSubmit, startIcon: React.createElement(FaSearch, null), label: t('common:search'), isLoading: innerLoading || outerLoading })),
12241
+ selectedFilter && (React.createElement("div", { className: "will-filter-bar-container ".concat(mode || 'light'), style: __assign$2(__assign$2({}, ((!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {})), dropdownStyle) },
12242
+ selectedFilter === FilterSections.CALENDAR && (React.createElement("div", { id: "will-dates-filter" },
12243
+ React.createElement(Dates, { autoFocus: true, ref: filtersRef, onClose: function () { return handleSelectedFilter(false); }, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, filtersRef: filtersRef }))),
12244
+ selectedFilter === FilterSections.GUESTS && (React.createElement("div", { id: "will-guests-filter" },
12245
+ React.createElement(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef, autoFocus: true, onClose: function () { return handleSelectedFilter(false); } }))),
12246
+ selectedFilter === FilterSections.CATEGORIES && (React.createElement("div", { id: "will-categories-filter" },
12247
+ React.createElement(Categories, { categories: categories, setCategories: setCategories }))),
12248
+ selectedFilter === FilterSections.LOCATIONS && (React.createElement("div", { id: "will-locations-filter" },
12249
+ React.createElement(Locations, { autoFocus: true, ref: filtersRef, locations: locations === null || locations === void 0 ? void 0 : locations.data, language: language, selectedLocations: selectedLocations, setSelectedLocations: setSelectedLocations, multiSelect: locations === null || locations === void 0 ? void 0 : locations.multiSelect, onClose: function () { return handleSelectedFilter(false); } })))))));
12190
12250
  }
12191
12251
  ////////////
12192
12252
  var AGE_CATEGORIES_FALLBACK = [
@@ -12209,18 +12269,18 @@
12209
12269
  var useFilterCalendar = function (_a) {
12210
12270
  var onSubmit = _a.onSubmit, setToggleCalendar = _a.setToggleCalendar, noActiveSelection = _a.noActiveSelection, toggleCalendar = _a.toggleCalendar, outerRangeContext = _a.outerRangeContext, outerDisableCalendarDates = _a.outerDisableCalendarDates;
12211
12271
  // State
12212
- var _b = __read(React__default.useState(), 2), calendarRange = _b[0], setCalendarRange = _b[1];
12213
- var _c = __read(React__default.useState(outerRangeContext), 2), rangeContext = _c[0], setRangeContext = _c[1];
12214
- var _d = __read(React__default.useState(), 2), initialCalendarRange = _d[0], setInitialCalendarRange = _d[1];
12215
- var _e = __read(React__default.useState([]), 2), disabledDates = _e[0], setDisabledDates = _e[1];
12216
- var _f = __read(React__default.useState(false), 2), updateCalendarMonthNavigation = _f[0], setUpdateCalendarMonthNavigation = _f[1];
12217
- var _g = __read(React__default.useState(0), 2), updateCalendarDefaultMonth = _g[0], setUpdateCalendarDefaultMonth = _g[1];
12218
- var _h = __read(React__default.useState(false), 2), calendarHasError = _h[0], setCalendarHasError = _h[1];
12219
- var _j = __read(React__default.useState(false), 2), updatedForSubmit = _j[0], setUpdatedForSubmit = _j[1];
12220
- var _k = __read(React__default.useState(), 2), disableCalendarDates = _k[0], setDisableCalendarDates = _k[1];
12272
+ var _b = __read(React.useState(), 2), calendarRange = _b[0], setCalendarRange = _b[1];
12273
+ var _c = __read(React.useState(outerRangeContext), 2), rangeContext = _c[0], setRangeContext = _c[1];
12274
+ var _d = __read(React.useState(), 2), initialCalendarRange = _d[0], setInitialCalendarRange = _d[1];
12275
+ var _e = __read(React.useState([]), 2), disabledDates = _e[0], setDisabledDates = _e[1];
12276
+ var _f = __read(React.useState(false), 2), updateCalendarMonthNavigation = _f[0], setUpdateCalendarMonthNavigation = _f[1];
12277
+ var _g = __read(React.useState(0), 2), updateCalendarDefaultMonth = _g[0], setUpdateCalendarDefaultMonth = _g[1];
12278
+ var _h = __read(React.useState(false), 2), calendarHasError = _h[0], setCalendarHasError = _h[1];
12279
+ var _j = __read(React.useState(false), 2), updatedForSubmit = _j[0], setUpdatedForSubmit = _j[1];
12280
+ var _k = __read(React.useState(), 2), disableCalendarDates = _k[0], setDisableCalendarDates = _k[1];
12221
12281
  // Lifecycle
12222
12282
  // Handle update component with new data
12223
- React__default.useEffect(function () {
12283
+ React.useEffect(function () {
12224
12284
  var _a;
12225
12285
  if (outerDisableCalendarDates === null || outerDisableCalendarDates === void 0 ? void 0 : outerDisableCalendarDates.availableDates) {
12226
12286
  setDisableCalendarDates({
@@ -12238,7 +12298,7 @@
12238
12298
  }
12239
12299
  }, [outerDisableCalendarDates]);
12240
12300
  // Handle Range Context initial selections
12241
- React__default.useEffect(function () {
12301
+ React.useEffect(function () {
12242
12302
  if (typeof window === 'undefined')
12243
12303
  return;
12244
12304
  var urlSearchParams = new URLSearchParams(window.location.search);
@@ -12268,7 +12328,7 @@
12268
12328
  }
12269
12329
  }, [toggleCalendar]);
12270
12330
  // Handle submit dates
12271
- React__default.useEffect(function () {
12331
+ React.useEffect(function () {
12272
12332
  var formatString = 'dd.MM.yyyy';
12273
12333
  var initialRangeTo = (initialCalendarRange === null || initialCalendarRange === void 0 ? void 0 : initialCalendarRange.to)
12274
12334
  ? format(initialCalendarRange.to, formatString)
@@ -12327,26 +12387,36 @@
12327
12387
  var nights = nightsCount({
12328
12388
  calendarRange: calendarRange,
12329
12389
  });
12330
- return (jsxRuntime.jsxs("div", { className: "will-calendar-footer-actions-wrapper", children: [jsxRuntime.jsxs("div", { className: "will-calendar-footer-dates", children: [calendarHasError ? (jsxRuntime.jsx("div", { className: "will-calendar-footer-error", children: calendarHasError &&
12331
- renderCalendarErrorMessage({
12332
- palette: palette,
12333
- message: t("common:errors.calendarErrors.checkInAvailabilityError"),
12334
- }) })) : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("span", { children: parseDate({
12335
- date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
12336
- dateFormat: 'EEEEEE d.M.yyyy',
12337
- language: language,
12338
- }) || t('common:checkIn') }), jsxRuntime.jsx("span", { className: "will-calendar-footer-dates-separator", children: "-" }), jsxRuntime.jsx("span", { children: parseDate({
12339
- date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
12340
- dateFormat: 'EEEEEE d.M.yyyy',
12341
- language: language,
12342
- }) || t('common:checkOut') })] })), jsxRuntime.jsx("span", { className: "will-calendar-footer-booked", children: !calendarHasError && nights
12343
- ? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
12344
- : '' })] }), jsxRuntime.jsx("div", { className: "will-calendar-footer-actions", children: jsxRuntime.jsx(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }) })] }));
12390
+ return (React.createElement("div", { className: "will-calendar-footer-actions-wrapper" },
12391
+ React.createElement("div", { className: "will-calendar-footer-dates" },
12392
+ calendarHasError ? (React.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
12393
+ renderCalendarErrorMessage({
12394
+ palette: palette,
12395
+ message: t("common:errors.calendarErrors.checkInAvailabilityError"),
12396
+ }))) : (React.createElement("div", null,
12397
+ React.createElement("span", null, parseDate({
12398
+ date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
12399
+ dateFormat: 'EEEEEE d.M.yyyy',
12400
+ language: language,
12401
+ }) || t('common:checkIn')),
12402
+ React.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
12403
+ React.createElement("span", null, parseDate({
12404
+ date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
12405
+ dateFormat: 'EEEEEE d.M.yyyy',
12406
+ language: language,
12407
+ }) || t('common:checkOut')))),
12408
+ React.createElement("span", { className: "will-calendar-footer-booked" }, !calendarHasError && nights
12409
+ ? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
12410
+ : '')),
12411
+ React.createElement("div", { className: "will-calendar-footer-actions" },
12412
+ React.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))));
12345
12413
  };
12346
12414
  /////////
12347
12415
  var renderCalendarErrorMessage = function (_a) {
12348
12416
  var message = _a.message, palette = _a.palette;
12349
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }), jsxRuntime.jsx("span", { children: message || '' })] }));
12417
+ return (React.createElement(React.Fragment, null,
12418
+ React.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }),
12419
+ React.createElement("span", null, message || '')));
12350
12420
  };
12351
12421
 
12352
12422
  var css_248z = ".will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n max-width: 80%;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error span {\n display: inline-block;\n margin-left: 10px;\n}\n\n@media (max-width: 960px) {\n .will-root .will-calendar-wrapper {\n width: -webkit-fill-available;\n margin: 0 -6%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-header,\n .will-root .will-calendar-wrapper .will-calendar-main,\n .will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n flex-direction: column;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates {\n text-align: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n justify-content: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions {\n flex-direction: column;\n width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions button{\n width: 100%;\n margin-top: 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error {\n max-width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error span {\n text-align: center;\n margin-left: 5px;\n }\n }\n\n.will-root .will-calendar-wrapper .will-calendar-header .will-filter-bar-close-button {\n position: initial;\n}";
@@ -12372,7 +12442,14 @@
12372
12442
  var filtersRef = useCloseFilterSection({
12373
12443
  handleSelectedFilter: setToggleCalendar,
12374
12444
  }).filtersRef;
12375
- return (jsxRuntime.jsx("div", { className: "will-root", style: themePalette, children: toggleCalendar && (jsxRuntime.jsxs("div", { className: "will-calendar-wrapper", ref: filtersRef, children: [jsxRuntime.jsxs("div", { className: "will-calendar-header", children: [jsxRuntime.jsx("h2", { children: t('filterBar:calendar.title') }), jsxRuntime.jsx(CloseButton, { handleClose: function () { return setToggleCalendar(false); } })] }), jsxRuntime.jsx("div", { className: "will-calendar-main", children: jsxRuntime.jsx(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError }) }), jsxRuntime.jsx("div", { className: "will-calendar-footer", children: jsxRuntime.jsx(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }) })] })) }));
12445
+ return (React.createElement("div", { className: "will-root", style: themePalette }, toggleCalendar && (React.createElement("div", { className: "will-calendar-wrapper", ref: filtersRef },
12446
+ React.createElement("div", { className: "will-calendar-header" },
12447
+ React.createElement("h2", null, t('filterBar:calendar.title')),
12448
+ React.createElement(CloseButton, { handleClose: function () { return setToggleCalendar(false); } })),
12449
+ React.createElement("div", { className: "will-calendar-main" },
12450
+ React.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError })),
12451
+ React.createElement("div", { className: "will-calendar-footer" },
12452
+ React.createElement(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }))))));
12376
12453
  }
12377
12454
 
12378
12455
  exports.Button = Button$1;