{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nimport { clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep } from \"@react-stately/utils\";\nimport $12uGp$react, { useState as $12uGp$useState, useRef as $12uGp$useRef, useCallback as $12uGp$useCallback, useEffect as $12uGp$useEffect, useMemo as $12uGp$useMemo } from \"react\";\nimport { useSSRSafeId as $12uGp$useSSRSafeId } from \"@react-aria/ssr\";\nimport $12uGp$clsx from \"clsx\";\nvar $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== \"undefined\" ? (0, $12uGp$react).useLayoutEffect : function () {};\nfunction $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {\n  var _ref = (0, $12uGp$useState)(defaultValue),\n    _ref2 = _slicedToArray(_ref, 2),\n    value = _ref2[0],\n    setValue = _ref2[1];\n  var valueRef = (0, $12uGp$useRef)(value);\n  var effect = (0, $12uGp$useRef)(null);\n  var nextIter = (0, $12uGp$useCallback)(function () {\n    var newValue = effect.current.next();\n    while (!newValue.done && valueRef.current === newValue.value) newValue = effect.current.next();\n    if (newValue.done) {\n      effect.current = null;\n      return;\n    }\n    setValue(newValue.value);\n    valueRef.current = newValue.value;\n  }, [setValue, valueRef, effect]);\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(function () {\n    if (effect.current) nextIter();\n  });\n  var queue = (0, $12uGp$useCallback)(function (fn) {\n    effect.current = fn(valueRef.current);\n    nextIter();\n  }, [nextIter, effect, valueRef]);\n  return [value, queue];\n}\nvar $bdb11010cef70236$var$idsUpdaterMap = new Map();\nfunction $bdb11010cef70236$export$f680877a34711e37(defaultId) {\n  var _ref3 = (0, $12uGp$useState)(defaultId),\n    _ref4 = _slicedToArray(_ref3, 2),\n    value = _ref4[0],\n    setValue = _ref4[1];\n  var nextId = (0, $12uGp$useRef)(null);\n  var res = (0, $12uGp$useSSRSafeId)(value);\n  var updateValue = (0, $12uGp$useCallback)(function (val) {\n    nextId.current = val;\n  }, []);\n  $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(function () {\n    var r = res;\n    return function () {\n      $bdb11010cef70236$var$idsUpdaterMap.delete(r);\n    };\n  }, [res]);\n  (0, $12uGp$useEffect)(function () {\n    var newId = nextId.current;\n    if (newId) {\n      nextId.current = null;\n      setValue(newId);\n    }\n  });\n  return res;\n}\nfunction $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {\n  if (idA === idB) return idA;\n  var setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);\n  if (setIdA) {\n    setIdA(idB);\n    return idB;\n  }\n  var setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);\n  if (setIdB) {\n    setIdB(idA);\n    return idA;\n  }\n  return idB;\n}\nfunction $bdb11010cef70236$export$b4cc09c592e8fdb8() {\n  var depArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n  var id = $bdb11010cef70236$export$f680877a34711e37();\n  var _ref5 = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id),\n    _ref6 = _slicedToArray(_ref5, 2),\n    resolvedId = _ref6[0],\n    setResolvedId = _ref6[1];\n  var updateId = (0, $12uGp$useCallback)(function () {\n    setResolvedId(function* () {\n      yield id;\n      yield document.getElementById(id) ? id : undefined;\n    });\n  }, [id, setResolvedId]);\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [id, updateId].concat(_toConsumableArray(depArray)));\n  return resolvedId;\n}\nfunction $ff5963eb1fccf552$export$e08e3b67e392101e() {\n  for (var _len = arguments.length, callbacks = new Array(_len), _key = 0; _key < _len; _key++) {\n    callbacks[_key] = arguments[_key];\n  }\n  return function () {\n    for (var callback of callbacks) if (typeof callback === \"function\") callback.apply(void 0, arguments);\n  };\n}\nfunction $3ef42575df84b30b$export$9d1611c77c2fe928() {\n  var result = _objectSpread({}, arguments.length <= 0 ? undefined : arguments[0]);\n  for (var i = 1; i < arguments.length; i++) {\n    var props = i < 0 || arguments.length <= i ? undefined : arguments[i];\n    for (var key in props) {\n      var a = result[key];\n      var b = props[key];\n      if (typeof a === \"function\" && typeof b === \"function\" && key[0] === \"o\" && key[1] === \"n\" && key.charCodeAt(2) >= 65 && key.charCodeAt(2) <= 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);else if ((key === \"className\" || key === \"UNSAFE_className\") && typeof a === \"string\" && typeof b === \"string\") result[key] = (0, $12uGp$clsx)(a, b);else if (key === \"id\" && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);else result[key] = b !== undefined ? b : a;\n    }\n  }\n  return result;\n}\nfunction $5dc95899b306f630$export$c9058316764c140e() {\n  for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n    refs[_key2] = arguments[_key2];\n  }\n  if (refs.length === 1) return refs[0];\n  return function (value) {\n    for (var ref of refs) {\n      if (typeof ref === \"function\") ref(value);else if (ref != null) ref.current = value;\n    }\n  };\n}\nvar $65484d02dcb7eb3e$var$DOMPropNames = new Set([\"id\"]);\nvar $65484d02dcb7eb3e$var$labelablePropNames = new Set([\"aria-label\", \"aria-labelledby\", \"aria-describedby\", \"aria-details\"]);\nvar $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;\nfunction $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props) {\n  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var labelable = opts.labelable,\n    propNames = opts.propNames;\n  var filteredProps = {};\n  for (var prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];\n  return filteredProps;\n}\nfunction $7215afc6de606d6b$export$de79e2c695e052f3(element) {\n  if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({\n    preventScroll: true\n  });else {\n    var scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);\n    element.focus();\n    $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);\n  }\n}\nvar $7215afc6de606d6b$var$supportsPreventScrollCached = null;\nfunction $7215afc6de606d6b$var$supportsPreventScroll() {\n  if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {\n    $7215afc6de606d6b$var$supportsPreventScrollCached = false;\n    try {\n      var focusElem = document.createElement(\"div\");\n      focusElem.focus({\n        get preventScroll() {\n          $7215afc6de606d6b$var$supportsPreventScrollCached = true;\n          return true;\n        }\n      });\n    } catch (e) {}\n  }\n  return $7215afc6de606d6b$var$supportsPreventScrollCached;\n}\nfunction $7215afc6de606d6b$var$getScrollableElements(element) {\n  var parent = element.parentNode;\n  var scrollableElements = [];\n  var rootScrollingElement = document.scrollingElement || document.documentElement;\n  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n    if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({\n      element: parent,\n      scrollTop: parent.scrollTop,\n      scrollLeft: parent.scrollLeft\n    });\n    parent = parent.parentNode;\n  }\n  if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({\n    element: rootScrollingElement,\n    scrollTop: rootScrollingElement.scrollTop,\n    scrollLeft: rootScrollingElement.scrollLeft\n  });\n  return scrollableElements;\n}\nfunction $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {\n  for (var _ref7 of scrollableElements) {\n    var element = _ref7.element;\n    var scrollTop = _ref7.scrollTop;\n    var scrollLeft = _ref7.scrollLeft;\n    element.scrollTop = scrollTop;\n    element.scrollLeft = scrollLeft;\n  }\n}\nfunction $ab71dadb03a6fb2e$export$622cea445a1c5b7d(element, reverse) {\n  var orientation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"horizontal\";\n  var rect = element.getBoundingClientRect();\n  if (reverse) return orientation === \"horizontal\" ? rect.right : rect.bottom;\n  return orientation === \"horizontal\" ? rect.left : rect.top;\n}\nvar $bbed8b41f857bcc0$var$transitionsByElement = new Map();\nvar $bbed8b41f857bcc0$var$transitionCallbacks = new Set();\nfunction $bbed8b41f857bcc0$var$setupGlobalEvents() {\n  if (typeof window === \"undefined\") return;\n  var onTransitionStart = function onTransitionStart(e) {\n    var transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);\n    if (!transitions) {\n      transitions = new Set();\n      $bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);\n      e.target.addEventListener(\"transitioncancel\", onTransitionEnd);\n    }\n    transitions.add(e.propertyName);\n  };\n  var onTransitionEnd = function onTransitionEnd(e) {\n    var properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);\n    if (!properties) return;\n    properties.delete(e.propertyName);\n    if (properties.size === 0) {\n      e.target.removeEventListener(\"transitioncancel\", onTransitionEnd);\n      $bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);\n    }\n    if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {\n      for (var cb of $bbed8b41f857bcc0$var$transitionCallbacks) cb();\n      $bbed8b41f857bcc0$var$transitionCallbacks.clear();\n    }\n  };\n  document.body.addEventListener(\"transitionrun\", onTransitionStart);\n  document.body.addEventListener(\"transitionend\", onTransitionEnd);\n}\nif (typeof document !== \"undefined\") {\n  if (document.readyState !== \"loading\") $bbed8b41f857bcc0$var$setupGlobalEvents();else document.addEventListener(\"DOMContentLoaded\", $bbed8b41f857bcc0$var$setupGlobalEvents);\n}\nfunction $bbed8b41f857bcc0$export$24490316f764c430(fn) {\n  requestAnimationFrame(function () {\n    if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);\n  });\n}\nvar $9cc09df9fd7676be$var$draggingElements = [];\nfunction $9cc09df9fd7676be$export$7bbed75feba39706(props) {\n  console.warn(\"useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html\");\n  var containerRef = props.containerRef,\n    reverse = props.reverse,\n    orientation = props.orientation,\n    onHover = props.onHover,\n    onDrag = props.onDrag,\n    onPositionChange = props.onPositionChange,\n    onIncrement = props.onIncrement,\n    onDecrement = props.onDecrement,\n    onIncrementToMax = props.onIncrementToMax,\n    onDecrementToMin = props.onDecrementToMin,\n    onCollapseToggle = props.onCollapseToggle;\n  var getPosition = function getPosition(e) {\n    return orientation === \"horizontal\" ? e.clientX : e.clientY;\n  };\n  var getNextOffset = function getNextOffset(e) {\n    var containerOffset = (0, $ab71dadb03a6fb2e$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);\n    var mouseOffset = getPosition(e);\n    var nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n    return nextOffset;\n  };\n  var dragging = (0, $12uGp$useRef)(false);\n  var prevPosition = (0, $12uGp$useRef)(0);\n  var handlers = (0, $12uGp$useRef)({\n    onPositionChange: onPositionChange,\n    onDrag: onDrag\n  });\n  handlers.current.onDrag = onDrag;\n  handlers.current.onPositionChange = onPositionChange;\n  var onMouseDragged = function onMouseDragged(e) {\n    e.preventDefault();\n    var nextOffset = getNextOffset(e);\n    if (!dragging.current) {\n      dragging.current = true;\n      if (handlers.current.onDrag) handlers.current.onDrag(true);\n      if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);\n    }\n    if (prevPosition.current === nextOffset) return;\n    prevPosition.current = nextOffset;\n    if (onPositionChange) onPositionChange(nextOffset);\n  };\n  var onMouseUp = function onMouseUp(e) {\n    var target = e.target;\n    dragging.current = false;\n    var nextOffset = getNextOffset(e);\n    if (handlers.current.onDrag) handlers.current.onDrag(false);\n    if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);\n    $9cc09df9fd7676be$var$draggingElements.splice($9cc09df9fd7676be$var$draggingElements.indexOf(target), 1);\n    window.removeEventListener(\"mouseup\", onMouseUp, false);\n    window.removeEventListener(\"mousemove\", onMouseDragged, false);\n  };\n  var onMouseDown = function onMouseDown(e) {\n    var target = e.currentTarget;\n    if ($9cc09df9fd7676be$var$draggingElements.some(function (elt) {\n      return target.contains(elt);\n    })) return;\n    $9cc09df9fd7676be$var$draggingElements.push(target);\n    window.addEventListener(\"mousemove\", onMouseDragged, false);\n    window.addEventListener(\"mouseup\", onMouseUp, false);\n  };\n  var onMouseEnter = function onMouseEnter() {\n    if (onHover) onHover(true);\n  };\n  var onMouseOut = function onMouseOut() {\n    if (onHover) onHover(false);\n  };\n  var onKeyDown = function onKeyDown(e) {\n    switch (e.key) {\n      case \"Left\":\n      case \"ArrowLeft\":\n        if (orientation === \"horizontal\") {\n          e.preventDefault();\n          if (onDecrement && !reverse) onDecrement();else if (onIncrement && reverse) onIncrement();\n        }\n        break;\n      case \"Up\":\n      case \"ArrowUp\":\n        if (orientation === \"vertical\") {\n          e.preventDefault();\n          if (onDecrement && !reverse) onDecrement();else if (onIncrement && reverse) onIncrement();\n        }\n        break;\n      case \"Right\":\n      case \"ArrowRight\":\n        if (orientation === \"horizontal\") {\n          e.preventDefault();\n          if (onIncrement && !reverse) onIncrement();else if (onDecrement && reverse) onDecrement();\n        }\n        break;\n      case \"Down\":\n      case \"ArrowDown\":\n        if (orientation === \"vertical\") {\n          e.preventDefault();\n          if (onIncrement && !reverse) onIncrement();else if (onDecrement && reverse) onDecrement();\n        }\n        break;\n      case \"Home\":\n        e.preventDefault();\n        if (onDecrementToMin) onDecrementToMin();\n        break;\n      case \"End\":\n        e.preventDefault();\n        if (onIncrementToMax) onIncrementToMax();\n        break;\n      case \"Enter\":\n        e.preventDefault();\n        if (onCollapseToggle) onCollapseToggle();\n        break;\n    }\n  };\n  return {\n    onMouseDown: onMouseDown,\n    onMouseEnter: onMouseEnter,\n    onMouseOut: onMouseOut,\n    onKeyDown: onKeyDown\n  };\n}\nfunction $03deb23ff14920c4$export$4eaf04e54aa8eed6() {\n  var globalListeners = (0, $12uGp$useRef)(new Map());\n  var addGlobalListener = (0, $12uGp$useCallback)(function (eventTarget, type, listener, options) {\n    var fn = (options === null || options === void 0 ? void 0 : options.once) ? function () {\n      globalListeners.current.delete(listener);\n      listener.apply(void 0, arguments);\n    } : listener;\n    globalListeners.current.set(listener, {\n      type: type,\n      eventTarget: eventTarget,\n      fn: fn,\n      options: options\n    });\n    eventTarget.addEventListener(type, listener, options);\n  }, []);\n  var removeGlobalListener = (0, $12uGp$useCallback)(function (eventTarget, type, listener, options) {\n    var _globalListeners_current_get;\n    var fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;\n    eventTarget.removeEventListener(type, fn, options);\n    globalListeners.current.delete(listener);\n  }, []);\n  var removeAllGlobalListeners = (0, $12uGp$useCallback)(function () {\n    globalListeners.current.forEach(function (value, key) {\n      removeGlobalListener(value.eventTarget, value.type, key, value.options);\n    });\n  }, [removeGlobalListener]);\n  (0, $12uGp$useEffect)(function () {\n    return removeAllGlobalListeners;\n  }, [removeAllGlobalListeners]);\n  return {\n    addGlobalListener: addGlobalListener,\n    removeGlobalListener: removeGlobalListener,\n    removeAllGlobalListeners: removeAllGlobalListeners\n  };\n}\nfunction $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {\n  var id = props.id,\n    label = props[\"aria-label\"],\n    labelledBy = props[\"aria-labelledby\"];\n  id = (0, $bdb11010cef70236$export$f680877a34711e37)(id);\n  if (labelledBy && label) {\n    var ids = new Set([id].concat(_toConsumableArray(labelledBy.trim().split(/\\s+/))));\n    labelledBy = _toConsumableArray(ids).join(\" \");\n  } else if (labelledBy) labelledBy = labelledBy.trim().split(/\\s+/).join(\" \");\n  if (!label && !labelledBy && defaultLabel) label = defaultLabel;\n  return {\n    id: id,\n    \"aria-label\": label,\n    \"aria-labelledby\": labelledBy\n  };\n}\nfunction $df56164dff5785e2$export$4338b53315abf666(forwardedRef) {\n  var objRef = (0, $12uGp$useRef)();\n  return (0, $12uGp$useMemo)(function () {\n    return {\n      get current() {\n        return objRef.current;\n      },\n      set current(value) {\n        objRef.current = value;\n        if (typeof forwardedRef === \"function\") forwardedRef(value);else if (forwardedRef) forwardedRef.current = value;\n      }\n    };\n  }, [forwardedRef]);\n}\nfunction $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {\n  var isInitialMount = (0, $12uGp$useRef)(true);\n  var lastDeps = (0, $12uGp$useRef)(null);\n  (0, $12uGp$useEffect)(function () {\n    isInitialMount.current = true;\n    return function () {\n      isInitialMount.current = false;\n    };\n  }, []);\n  (0, $12uGp$useEffect)(function () {\n    if (isInitialMount.current) isInitialMount.current = false;else if (!lastDeps.current || dependencies.some(function (dep, i) {\n      return !Object.is(dep, lastDeps[i]);\n    })) effect();\n    lastDeps.current = dependencies;\n  }, dependencies);\n}\nfunction $9daab02d461809db$var$hasResizeObserver() {\n  return typeof window.ResizeObserver !== \"undefined\";\n}\nfunction $9daab02d461809db$export$683480f191c0e3ea(options) {\n  var ref = options.ref,\n    onResize = options.onResize;\n  (0, $12uGp$useEffect)(function () {\n    var element = ref === null || ref === void 0 ? void 0 : ref.current;\n    if (!element) return;\n    if (!$9daab02d461809db$var$hasResizeObserver()) {\n      window.addEventListener(\"resize\", onResize, false);\n      return function () {\n        window.removeEventListener(\"resize\", onResize, false);\n      };\n    } else {\n      var resizeObserverInstance = new window.ResizeObserver(function (entries) {\n        if (!entries.length) return;\n        onResize();\n      });\n      resizeObserverInstance.observe(element);\n      return function () {\n        if (element) resizeObserverInstance.unobserve(element);\n      };\n    }\n  }, [onResize, ref]);\n}\nfunction $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(function () {\n    if (context && context.ref && ref) {\n      context.ref.current = ref.current;\n      return function () {\n        context.ref.current = null;\n      };\n    }\n  }, [context, ref]);\n}\nfunction $62d8ded9296f3872$export$cfa2225e87938781(node) {\n  if ($62d8ded9296f3872$export$2bb74740c4e19def(node)) node = node.parentElement;\n  while (node && !$62d8ded9296f3872$export$2bb74740c4e19def(node)) node = node.parentElement;\n  return node || document.scrollingElement || document.documentElement;\n}\nfunction $62d8ded9296f3872$export$2bb74740c4e19def(node) {\n  var style = window.getComputedStyle(node);\n  return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n}\nvar $5df64b3807dc15ee$var$visualViewport = typeof document !== \"undefined\" && window.visualViewport;\nfunction $5df64b3807dc15ee$export$d699905dd57c73ca() {\n  var _ref8 = (0, $12uGp$useState)(function () {\n      return $5df64b3807dc15ee$var$getViewportSize();\n    }),\n    _ref9 = _slicedToArray(_ref8, 2),\n    size = _ref9[0],\n    setSize = _ref9[1];\n  (0, $12uGp$useEffect)(function () {\n    var onResize = function onResize() {\n      setSize(function (size) {\n        var newSize = $5df64b3807dc15ee$var$getViewportSize();\n        if (newSize.width === size.width && newSize.height === size.height) return size;\n        return newSize;\n      });\n    };\n    if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener(\"resize\", onResize);else $5df64b3807dc15ee$var$visualViewport.addEventListener(\"resize\", onResize);\n    return function () {\n      if (!$5df64b3807dc15ee$var$visualViewport) window.removeEventListener(\"resize\", onResize);else $5df64b3807dc15ee$var$visualViewport.removeEventListener(\"resize\", onResize);\n    };\n  }, []);\n  return size;\n}\nfunction $5df64b3807dc15ee$var$getViewportSize() {\n  return {\n    width: ($5df64b3807dc15ee$var$visualViewport === null || $5df64b3807dc15ee$var$visualViewport === void 0 ? void 0 : $5df64b3807dc15ee$var$visualViewport.width) || window.innerWidth,\n    height: ($5df64b3807dc15ee$var$visualViewport === null || $5df64b3807dc15ee$var$visualViewport === void 0 ? void 0 : $5df64b3807dc15ee$var$visualViewport.height) || window.innerHeight\n  };\n}\nvar $ef06256079686ba0$var$descriptionId = 0;\nvar $ef06256079686ba0$var$descriptionNodes = new Map();\nfunction $ef06256079686ba0$export$f8aeda7b10753fa1(description) {\n  var _ref10 = (0, $12uGp$useState)(undefined),\n    _ref11 = _slicedToArray(_ref10, 2),\n    id = _ref11[0],\n    setId = _ref11[1];\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(function () {\n    if (!description) return;\n    var desc = $ef06256079686ba0$var$descriptionNodes.get(description);\n    if (!desc) {\n      var _id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;\n      setId(_id);\n      var node = document.createElement(\"div\");\n      node.id = _id;\n      node.style.display = \"none\";\n      node.textContent = description;\n      document.body.appendChild(node);\n      desc = {\n        refCount: 0,\n        element: node\n      };\n      $ef06256079686ba0$var$descriptionNodes.set(description, desc);\n    } else setId(desc.element.id);\n    desc.refCount++;\n    return function () {\n      if (--desc.refCount === 0) {\n        desc.element.remove();\n        $ef06256079686ba0$var$descriptionNodes.delete(description);\n      }\n    };\n  }, [description]);\n  return {\n    \"aria-describedby\": description ? id : undefined\n  };\n}\nfunction $c87311424ea30a05$var$testUserAgent(re) {\n  var _window_navigator_userAgentData;\n  if (typeof window === \"undefined\" || window.navigator == null) return false;\n  return ((_window_navigator_userAgentData = window.navigator[\"userAgentData\"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some(function (brand) {\n    return re.test(brand.brand);\n  })) || re.test(window.navigator.userAgent);\n}\nfunction $c87311424ea30a05$var$testPlatform(re) {\n  var _window_navigator_userAgentData;\n  return typeof window !== \"undefined\" && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator[\"userAgentData\"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;\n}\nfunction $c87311424ea30a05$export$9ac100e40613ea10() {\n  return $c87311424ea30a05$var$testPlatform(/^Mac/i);\n}\nfunction $c87311424ea30a05$export$186c6964ca17d99() {\n  return $c87311424ea30a05$var$testPlatform(/^iPhone/i);\n}\nfunction $c87311424ea30a05$export$7bef049ce92e4224() {\n  return $c87311424ea30a05$var$testPlatform(/^iPad/i) || $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;\n}\nfunction $c87311424ea30a05$export$fedb369cb70207f1() {\n  return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();\n}\nfunction $c87311424ea30a05$export$e1865c3bedcd822b() {\n  return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();\n}\nfunction $c87311424ea30a05$export$78551043582a6a98() {\n  return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();\n}\nfunction $c87311424ea30a05$export$6446a186d09e379e() {\n  return $c87311424ea30a05$var$testUserAgent(/Chrome/i);\n}\nfunction $c87311424ea30a05$export$a11b0059900ceec8() {\n  return $c87311424ea30a05$var$testUserAgent(/Android/i);\n}\nfunction $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {\n  var ref = (0, $12uGp$useRef)(null);\n  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(function () {\n    ref.current = fn;\n  }, [fn]);\n  return (0, $12uGp$useCallback)(function () {\n    var f = ref.current;\n    return f.apply(void 0, arguments);\n  }, []);\n}\nfunction $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {\n  var handleEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler);\n  var isDisabled = handler == null;\n  (0, $12uGp$useEffect)(function () {\n    if (isDisabled) return;\n    var element = ref.current;\n    element.addEventListener(event, handleEvent, options);\n    return function () {\n      element.removeEventListener(event, handleEvent, options);\n    };\n  }, [ref, event, options, isDisabled, handleEvent]);\n}\nfunction $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {\n  var offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, \"left\");\n  var offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, \"top\");\n  var width = element.offsetWidth;\n  var height = element.offsetHeight;\n  var x = scrollView.scrollLeft;\n  var y = scrollView.scrollTop;\n  var _getComputedStyle = getComputedStyle(scrollView),\n    borderTopWidth = _getComputedStyle.borderTopWidth,\n    borderLeftWidth = _getComputedStyle.borderLeftWidth;\n  var borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);\n  var borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);\n  var maxX = borderAdjustedX + scrollView.clientWidth;\n  var maxY = borderAdjustedY + scrollView.clientHeight;\n  if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10);else if (offsetX + width > maxX) x += offsetX + width - maxX;\n  if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10);else if (offsetY + height > maxY) y += offsetY + height - maxY;\n  scrollView.scrollLeft = x;\n  scrollView.scrollTop = y;\n}\nfunction $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {\n  var prop = axis === \"left\" ? \"offsetLeft\" : \"offsetTop\";\n  var sum = 0;\n  while (child.offsetParent) {\n    sum += child[prop];\n    if (child.offsetParent === ancestor) break;else if (child.offsetParent.contains(ancestor)) {\n      sum -= ancestor[prop];\n      break;\n    }\n    child = child.offsetParent;\n  }\n  return sum;\n}\nfunction $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {\n  if (document.contains(targetElement)) {\n    var root = document.scrollingElement || document.documentElement;\n    var isScrollPrevented = window.getComputedStyle(root).overflow === \"hidden\";\n    if (!isScrollPrevented) {\n      var _targetElement_scrollIntoView;\n      var _targetElement$getBou = targetElement.getBoundingClientRect(),\n        originalLeft = _targetElement$getBou.left,\n        originalTop = _targetElement$getBou.top;\n      targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {\n        block: \"nearest\"\n      });\n      var _targetElement$getBou2 = targetElement.getBoundingClientRect(),\n        newLeft = _targetElement$getBou2.left,\n        newTop = _targetElement$getBou2.top;\n      if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {\n        var _opts_containingElement, _opts_containingElement_scrollIntoView, _targetElement_scrollIntoView1;\n        opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {\n          block: \"center\",\n          inline: \"center\"\n        });\n        (_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {\n          block: \"nearest\"\n        });\n      }\n    } else {\n      var scrollParent = (0, $62d8ded9296f3872$export$cfa2225e87938781)(targetElement);\n      while (targetElement && scrollParent && targetElement !== root && scrollParent !== root) {\n        $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);\n        targetElement = scrollParent;\n        scrollParent = (0, $62d8ded9296f3872$export$cfa2225e87938781)(targetElement);\n      }\n    }\n  }\n}\nfunction $6a7db85432448f7f$export$60278871457622de(event) {\n  if (event.mozInputSource === 0 && event.isTrusted) return true;\n  if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === \"click\" && event.buttons === 1;\n  return event.detail === 0 && !event.pointerType;\n}\nfunction $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {\n  return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === \"mouse\";\n}\nfunction $5a387cc49350e6db$export$722debc0e56fea39(value, isEqual) {\n  var lastValue = (0, $12uGp$useRef)(null);\n  if (value && lastValue.current && isEqual(value, lastValue.current)) value = lastValue.current;\n  lastValue.current = value;\n  return value;\n}\nfunction $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {\n  var resetValue = (0, $12uGp$useRef)(initialValue);\n  var handleReset = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(function () {\n    if (onReset) onReset(resetValue.current);\n  });\n  (0, $12uGp$useEffect)(function () {\n    var _ref_current;\n    var form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;\n    form === null || form === void 0 ? void 0 : form.addEventListener(\"reset\", handleReset);\n    return function () {\n      form === null || form === void 0 ? void 0 : form.removeEventListener(\"reset\", handleReset);\n    };\n  }, [ref, handleReset]);\n}\nexport { $bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $62d8ded9296f3872$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset };","map":{"version":3,"sources":["packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/useFormReset.ts"],"names":[],"mappings":";;;;;;;;;ACiBO,IAAM,yCAAA,GAAkB,OAAO,QAAA,KAAa,WAAA,GAC/C,CAAA,CAAA,EAAA,YAAI,EAAE,eAAA,GACN,YAAA,CAAO,CAAA;ACEJ,SAAS,yCAAA,CAAkB,YAA2B,EAAA;EAC3D,IAAA,IAAA,GAAwB,CAAA,CAAA,EAAA,eAAO,EAAE,YAAA,CAAA;IAAA,KAAA,GAAA,cAAA,CAAA,IAAA;IAA5B,KAAA,GAAA,KAAA;IAAO,QAAA,GAAA,KAAA;EACZ,IAAI,QAAA,GAAW,CAAA,CAAA,EAAA,aAAK,EAAE,KAAA,CAAA;EACtB,IAAI,MAAA,GAAS,CAAA,CAAA,EAAA,aAAK,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AAA,CAAY,CAAA;AACvB","sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useSSRSafeId} from '@react-aria/ssr';\nimport {useValueEffect} from './';\n\nlet idsUpdaterMap: Map<string, (v: string) => void> = new Map();\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n  let [value, setValue] = useState(defaultId);\n  let nextId = useRef(null);\n\n  let res = useSSRSafeId(value);\n\n  let updateValue = useCallback((val) => {\n    nextId.current = val;\n  }, []);\n\n  idsUpdaterMap.set(res, updateValue);\n\n  useLayoutEffect(() => {\n    let r = res;\n    return () => {\n      idsUpdaterMap.delete(r);\n    };\n  }, [res]);\n\n  // This cannot cause an infinite loop because the ref is updated first.\n  // eslint-disable-next-line\n  useEffect(() => {\n    let newId = nextId.current;\n    if (newId) {\n      nextId.current = null;\n      setValue(newId);\n    }\n  });\n\n  return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n  if (idA === idB) {\n    return idA;\n  }\n\n  let setIdA = idsUpdaterMap.get(idA);\n  if (setIdA) {\n    setIdA(idB);\n    return idB;\n  }\n\n  let setIdB = idsUpdaterMap.get(idB);\n  if (setIdB) {\n    setIdB(idA);\n    return idA;\n  }\n\n  return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n  let id = useId();\n  let [resolvedId, setResolvedId] = useValueEffect(id);\n  let updateId = useCallback(() => {\n    setResolvedId(function *() {\n      yield id;\n\n      yield document.getElementById(id) ? id : undefined;\n    });\n  }, [id, setResolvedId]);\n\n  useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n  return resolvedId;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React from 'react';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect = typeof document !== 'undefined'\n  ? React.useLayoutEffect\n  : () => {};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Dispatch, useCallback, useRef, useState} from 'react';\nimport {useLayoutEffect} from './';\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {\n  let [value, setValue] = useState(defaultValue);\n  let valueRef = useRef(value);\n  let effect = useRef(null);\n\n  // Must be stable so that `queue` is stable.\n  let nextIter = useCallback(() => {\n    // Run the generator to the next yield.\n    let newValue = effect.current.next();\n    while (!newValue.done && valueRef.current === newValue.value) {\n      // If the value is the same as the current value,\n      // then continue to the next yield. Otherwise,\n      // set the value in state and wait for the next layout effect.\n      newValue = effect.current.next();\n    }\n    // If the generator is done, reset the effect.\n    if (newValue.done) {\n      effect.current = null;\n      return;\n    }\n\n    // Always update valueRef when setting the state.\n    // This is needed because the function is not regenerated with the new state value since\n    // they must be stable across renders. Instead, it gets carried in the ref, but the setState\n    // is also needed in order to cause a rerender.\n    setValue(newValue.value);\n    valueRef.current = newValue.value;\n    // this list of dependencies is stable, setState and refs never change after first render.\n  }, [setValue, valueRef, effect]);\n\n  useLayoutEffect(() => {\n    // If there is an effect currently running, continue to the next yield.\n    if (effect.current) {\n      nextIter();\n    }\n  });\n\n  // queue must be a stable function, much like setState.\n  let queue = useCallback(fn => {\n    effect.current = fn(valueRef.current);\n    nextIter();\n    // this list of dependencies is stable, setState and refs never change after first render.\n    // in addition, nextIter is stable as outlined above\n  }, [nextIter, effect, valueRef]);\n\n  return [value, queue];\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n  return (...args: any[]) => {\n    for (let callback of callbacks) {\n      if (typeof callback === 'function') {\n        callback(...args);\n      }\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n  [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated - different ids\n * will trigger a side-effect and re-render components hooked up with `useId`.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n  // Start with a base clone of the first argument. This is a lot faster than starting\n  // with an empty object and adding properties as we go.\n  let result: Props = {...args[0]};\n  for (let i = 1; i < args.length; i++) {\n    let props = args[i];\n    for (let key in props) {\n      let a = result[key];\n      let b = props[key];\n\n      // Chain events\n      if (\n        typeof a === 'function' &&\n        typeof b === 'function' &&\n        // This is a lot faster than a regex.\n        key[0] === 'o' &&\n        key[1] === 'n' &&\n        key.charCodeAt(2) >= /* 'A' */ 65 &&\n        key.charCodeAt(2) <= /* 'Z' */ 90\n      ) {\n        result[key] = chain(a, b);\n\n        // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n      } else if (\n        (key === 'className' || key === 'UNSAFE_className') &&\n        typeof a === 'string' &&\n        typeof b === 'string'\n      ) {\n        result[key] = clsx(a, b);\n      } else if (key === 'id' && a && b) {\n        result.id = mergeIds(a, b);\n        // Override others\n      } else {\n        result[key] = b !== undefined ? b : a;\n      }\n    }\n  }\n\n  return result as UnionToIntersection<TupleTypes<T>>;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ForwardedRef} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: ForwardedRef<T>[]): ForwardedRef<T> {\n  if (refs.length === 1) {\n    return refs[0];\n  }\n\n  return (value: T) => {\n    for (let ref of refs) {\n      if (typeof ref === 'function') {\n        ref(value);\n      } else if (ref != null) {\n        ref.current = value;\n      }\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\n\nconst DOMPropNames = new Set([\n  'id'\n]);\n\nconst labelablePropNames = new Set([\n  'aria-label',\n  'aria-labelledby',\n  'aria-describedby',\n  'aria-details'\n]);\n\ninterface Options {\n  /**\n   * If labelling associated aria properties should be included in the filter.\n   */\n  labelable?: boolean,\n  /**\n   * A Set of other property names that should be included in the filter.\n   */\n  propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps, opts: Options = {}): DOMProps & AriaLabelingProps {\n  let {labelable, propNames} = opts;\n  let filteredProps = {};\n\n  for (const prop in props) {\n    if (\n      Object.prototype.hasOwnProperty.call(props, prop) && (\n        DOMPropNames.has(prop) ||\n        (labelable && labelablePropNames.has(prop)) ||\n        propNames?.has(prop) ||\n        propRe.test(prop)\n      )\n    ) {\n      filteredProps[prop] = props[prop];\n    }\n  }\n\n  return filteredProps;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n//\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n  element: HTMLElement,\n  scrollTop: number,\n  scrollLeft: number\n}\n\nexport function focusWithoutScrolling(element: FocusableElement) {\n  if (supportsPreventScroll()) {\n    element.focus({preventScroll: true});\n  } else {\n    let scrollableElements = getScrollableElements(element);\n    element.focus();\n    restoreScrollPosition(scrollableElements);\n  }\n}\n\nlet supportsPreventScrollCached: boolean = null;\nfunction supportsPreventScroll() {\n  if (supportsPreventScrollCached == null) {\n    supportsPreventScrollCached = false;\n    try {\n      var focusElem = document.createElement('div');\n      focusElem.focus({\n        get preventScroll() {\n          supportsPreventScrollCached = true;\n          return true;\n        }\n      });\n    } catch (e) {\n      // Ignore\n    }\n  }\n\n  return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: FocusableElement): ScrollableElement[] {\n  var parent = element.parentNode;\n  var scrollableElements: ScrollableElement[] = [];\n  var rootScrollingElement = document.scrollingElement || document.documentElement;\n\n  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n    if (\n      parent.offsetHeight < parent.scrollHeight ||\n      parent.offsetWidth < parent.scrollWidth\n    ) {\n      scrollableElements.push({\n        element: parent,\n        scrollTop: parent.scrollTop,\n        scrollLeft: parent.scrollLeft\n      });\n    }\n    parent = parent.parentNode;\n  }\n\n  if (rootScrollingElement instanceof HTMLElement) {\n    scrollableElements.push({\n      element: rootScrollingElement,\n      scrollTop: rootScrollingElement.scrollTop,\n      scrollLeft: rootScrollingElement.scrollLeft\n    });\n  }\n\n  return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n  for (let {element, scrollTop, scrollLeft} of scrollableElements) {\n    element.scrollTop = scrollTop;\n    element.scrollLeft = scrollLeft;\n  }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function getOffset(element, reverse, orientation = 'horizontal') {\n  let rect = element.getBoundingClientRect();\n  if (reverse) {\n    return orientation === 'horizontal' ? rect.right : rect.bottom;\n  }\n  return orientation === 'horizontal' ? rect.left : rect.top;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n  if (typeof window === 'undefined') {\n    return;\n  }\n\n  let onTransitionStart = (e: TransitionEvent) => {\n    // Add the transitioning property to the list for this element.\n    let transitions = transitionsByElement.get(e.target);\n    if (!transitions) {\n      transitions = new Set();\n      transitionsByElement.set(e.target, transitions);\n\n      // The transitioncancel event must be registered on the element itself, rather than as a global\n      // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n      // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n      e.target.addEventListener('transitioncancel', onTransitionEnd);\n    }\n\n    transitions.add(e.propertyName);\n  };\n\n  let onTransitionEnd = (e: TransitionEvent) => {\n    // Remove property from list of transitioning properties.\n    let properties = transitionsByElement.get(e.target);\n    if (!properties) {\n      return;\n    }\n\n    properties.delete(e.propertyName);\n\n    // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n    if (properties.size === 0) {\n      e.target.removeEventListener('transitioncancel', onTransitionEnd);\n      transitionsByElement.delete(e.target);\n    }\n\n    // If no transitioning elements, call all of the queued callbacks.\n    if (transitionsByElement.size === 0) {\n      for (let cb of transitionCallbacks) {\n        cb();\n      }\n\n      transitionCallbacks.clear();\n    }\n  };\n\n  document.body.addEventListener('transitionrun', onTransitionStart);\n  document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n  if (document.readyState !== 'loading') {\n    setupGlobalEvents();\n  } else {\n    document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n  }\n}\n\nexport function runAfterTransition(fn: () => void) {\n  // Wait one frame to see if an animation starts, e.g. a transition on mount.\n  requestAnimationFrame(() => {\n    // If no transitions are running, call the function immediately.\n    // Otherwise, add it to a list of callbacks to run at the end of the animation.\n    if (transitionsByElement.size === 0) {\n      fn();\n    } else {\n      transitionCallbacks.add(fn);\n    }\n  });\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n  containerRef: MutableRefObject<HTMLElement>,\n  reverse?: boolean,\n  orientation?: Orientation,\n  onHover?: (hovered: boolean) => void,\n  onDrag?: (dragging: boolean) => void,\n  onPositionChange?: (position: number) => void,\n  onIncrement?: () => void,\n  onDecrement?: () => void,\n  onIncrementToMax?: () => void,\n  onDecrementToMin?: () => void,\n  onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n  console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n  let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n  let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n  let getNextOffset = (e: MouseEvent) => {\n    let containerOffset = getOffset(containerRef.current, reverse, orientation);\n    let mouseOffset = getPosition(e);\n    let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n    return nextOffset;\n  };\n  let dragging = useRef(false);\n  let prevPosition = useRef(0);\n\n  // Keep track of the current handlers in a ref so that the events can access them.\n  let handlers = useRef({onPositionChange, onDrag});\n  handlers.current.onDrag = onDrag;\n  handlers.current.onPositionChange = onPositionChange;\n\n  let onMouseDragged = (e: MouseEvent) => {\n    e.preventDefault();\n    let nextOffset = getNextOffset(e);\n    if (!dragging.current) {\n      dragging.current = true;\n      if (handlers.current.onDrag) {\n        handlers.current.onDrag(true);\n      }\n      if (handlers.current.onPositionChange) {\n        handlers.current.onPositionChange(nextOffset);\n      }\n    }\n    if (prevPosition.current === nextOffset) {\n      return;\n    }\n    prevPosition.current = nextOffset;\n    if (onPositionChange) {\n      onPositionChange(nextOffset);\n    }\n  };\n\n  let onMouseUp = (e: MouseEvent) => {\n    const target = e.target as HTMLElement;\n    dragging.current = false;\n    let nextOffset = getNextOffset(e);\n    if (handlers.current.onDrag) {\n      handlers.current.onDrag(false);\n    }\n    if (handlers.current.onPositionChange) {\n      handlers.current.onPositionChange(nextOffset);\n    }\n\n    draggingElements.splice(draggingElements.indexOf(target), 1);\n    window.removeEventListener('mouseup', onMouseUp, false);\n    window.removeEventListener('mousemove', onMouseDragged, false);\n  };\n\n  let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n    const target = e.currentTarget;\n    // If we're already handling dragging on a descendant with useDrag1D, then\n    // we don't want to handle the drag motion on this target as well.\n    if (draggingElements.some(elt => target.contains(elt))) {\n      return;\n    }\n    draggingElements.push(target);\n    window.addEventListener('mousemove', onMouseDragged, false);\n    window.addEventListener('mouseup', onMouseUp, false);\n  };\n\n  let onMouseEnter = () => {\n    if (onHover) {\n      onHover(true);\n    }\n  };\n\n  let onMouseOut = () => {\n    if (onHover) {\n      onHover(false);\n    }\n  };\n\n  let onKeyDown = (e) => {\n    switch (e.key) {\n      case 'Left':\n      case 'ArrowLeft':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onDecrement && !reverse) {\n            onDecrement();\n          } else if (onIncrement && reverse) {\n            onIncrement();\n          }\n        }\n        break;\n      case 'Up':\n      case 'ArrowUp':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onDecrement && !reverse) {\n            onDecrement();\n          } else if (onIncrement && reverse) {\n            onIncrement();\n          }\n        }\n        break;\n      case 'Right':\n      case 'ArrowRight':\n        if (orientation === 'horizontal') {\n          e.preventDefault();\n          if (onIncrement && !reverse) {\n            onIncrement();\n          } else if (onDecrement && reverse) {\n            onDecrement();\n          }\n        }\n        break;\n      case 'Down':\n      case 'ArrowDown':\n        if (orientation === 'vertical') {\n          e.preventDefault();\n          if (onIncrement && !reverse) {\n            onIncrement();\n          } else if (onDecrement && reverse) {\n            onDecrement();\n          }\n        }\n        break;\n      case 'Home':\n        e.preventDefault();\n        if (onDecrementToMin) {\n          onDecrementToMin();\n        }\n        break;\n      case 'End':\n        e.preventDefault();\n        if (onIncrementToMax) {\n          onIncrementToMax();\n        }\n        break;\n      case 'Enter':\n        e.preventDefault();\n        if (onCollapseToggle) {\n          onCollapseToggle();\n        }\n        break;\n    }\n  };\n\n  return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef} from 'react';\n\ninterface GlobalListeners {\n  addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n  addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,\n  removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,\n  removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,\n  removeAllGlobalListeners(): void\n}\n\nexport function useGlobalListeners(): GlobalListeners {\n  let globalListeners = useRef(new Map());\n  let addGlobalListener = useCallback((eventTarget, type, listener, options) => {\n    // Make sure we remove the listener after it is called with the `once` option.\n    let fn = options?.once ? (...args) => {\n      globalListeners.current.delete(listener);\n      listener(...args);\n    } : listener;\n    globalListeners.current.set(listener, {type, eventTarget, fn, options});\n    eventTarget.addEventListener(type, listener, options);\n  }, []);\n  let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {\n    let fn = globalListeners.current.get(listener)?.fn || listener;\n    eventTarget.removeEventListener(type, fn, options);\n    globalListeners.current.delete(listener);\n  }, []);\n  let removeAllGlobalListeners = useCallback(() => {\n    globalListeners.current.forEach((value, key) => {\n      removeGlobalListener(value.eventTarget, value.type, key, value.options);\n    });\n  }, [removeGlobalListener]);\n\n  // eslint-disable-next-line arrow-body-style\n  useEffect(() => {\n    return removeAllGlobalListeners;\n  }, [removeAllGlobalListeners]);\n\n  return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\nimport {useId} from './useId';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {\n  let {\n    id,\n    'aria-label': label,\n    'aria-labelledby': labelledBy\n  } = props;\n\n  // If there is both an aria-label and aria-labelledby,\n  // combine them by pointing to the element itself.\n  id = useId(id);\n  if (labelledBy && label) {\n    let ids = new Set([id, ...labelledBy.trim().split(/\\s+/)]);\n    labelledBy = [...ids].join(' ');\n  } else if (labelledBy) {\n    labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n  }\n\n  // If no labels are provided, use the default\n  if (!label && !labelledBy && defaultLabel) {\n    label = defaultLabel;\n  }\n\n  return {\n    id,\n    'aria-label': label,\n    'aria-labelledby': labelledBy\n  };\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria Hooks.\n *\n * @param forwardedRef The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://reactjs.org/docs/forwarding-refs.html\n */\nexport function useObjectRef<T>(forwardedRef?: ((instance: T | null) => void) | MutableRefObject<T | null> | null): MutableRefObject<T> {\n  const objRef = useRef<T>();\n  return useMemo(() => ({\n    get current() {\n      return objRef.current;\n    },\n    set current(value) {\n      objRef.current = value;\n      if (typeof forwardedRef === 'function') {\n        forwardedRef(value);\n      } else if (forwardedRef) {\n        forwardedRef.current = value;\n      }\n    }\n  }), [forwardedRef]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useEffect, useRef} from 'react';\n\n// Like useEffect, but only called for updates after the initial render.\nexport function useUpdateEffect(effect: EffectCallback, dependencies: any[]) {\n  const isInitialMount = useRef(true);\n  const lastDeps = useRef<any[] | null>(null);\n\n  useEffect(() => {\n    isInitialMount.current = true;\n    return () => {\n      isInitialMount.current = false;\n    };\n  }, []);\n\n  useEffect(() => {\n    if (isInitialMount.current) {\n      isInitialMount.current = false;\n    } else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) {\n      effect();\n    }\n    lastDeps.current = dependencies;\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, dependencies);\n}\n","import {RefObject, useEffect} from 'react';\n\nfunction hasResizeObserver() {\n  return typeof window.ResizeObserver !== 'undefined';\n}\n\ntype useResizeObserverOptionsType<T> = {\n  ref: RefObject<T | undefined> | undefined,\n  onResize: () => void\n}\n\nexport function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>) {\n  const {ref, onResize} = options;\n\n  useEffect(() => {\n    let element = ref?.current;\n    if (!element) {\n      return;\n    }\n\n    if (!hasResizeObserver()) {\n      window.addEventListener('resize', onResize, false);\n      return () => {\n        window.removeEventListener('resize', onResize, false);\n      };\n    } else {\n\n      const resizeObserverInstance = new window.ResizeObserver((entries) => {\n        if (!entries.length) {\n          return;\n        }\n\n        onResize();\n      });\n      resizeObserverInstance.observe(element);\n\n      return () => {\n        if (element) {\n          resizeObserverInstance.unobserve(element);\n        }\n      };\n    }\n\n  }, [onResize, ref]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, RefObject} from 'react';\nimport {useLayoutEffect} from './';\n\ninterface ContextValue<T> {\n  ref?: MutableRefObject<T>\n}\n\n// Syncs ref from context with ref passed to hook\nexport function useSyncRef<T>(context: ContextValue<T>, ref: RefObject<T>) {\n  useLayoutEffect(() => {\n    if (context && context.ref && ref) {\n      context.ref.current = ref.current;\n      return () => {\n        context.ref.current = null;\n      };\n    }\n  }, [context, ref]);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function getScrollParent(node: Element): Element {\n  if (isScrollable(node)) {\n    node = node.parentElement;\n  }\n\n  while (node && !isScrollable(node)) {\n    node = node.parentElement;\n  }\n\n  return node || document.scrollingElement || document.documentElement;\n}\n\nexport function isScrollable(node: Element): boolean {\n  let style = window.getComputedStyle(node);\n  return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\n\ninterface ViewportSize {\n  width: number,\n  height: number\n}\n\n// @ts-ignore\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n  let [size, setSize] = useState(() => getViewportSize());\n\n  useEffect(() => {\n    // Use visualViewport api to track available height even on iOS virtual keyboard opening\n    let onResize = () => {\n      setSize(size => {\n        let newSize = getViewportSize();\n        if (newSize.width === size.width && newSize.height === size.height) {\n          return size;\n        }\n        return newSize;\n      });\n    };\n\n    if (!visualViewport) {\n      window.addEventListener('resize', onResize);\n    } else {\n      visualViewport.addEventListener('resize', onResize);\n    }\n\n    return () => {\n      if (!visualViewport) {\n        window.removeEventListener('resize', onResize);\n      } else {\n        visualViewport.removeEventListener('resize', onResize);\n      }\n    };\n  }, []);\n\n  return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n  return {\n    width: visualViewport?.width || window.innerWidth,\n    height: visualViewport?.height || window.innerHeight\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useState} from 'react';\n\nlet descriptionId = 0;\nconst descriptionNodes = new Map<string, {refCount: number, element: Element}>();\n\nexport function useDescription(description: string): AriaLabelingProps {\n  let [id, setId] = useState(undefined);\n\n  useLayoutEffect(() => {\n    if (!description) {\n      return;\n    }\n\n    let desc = descriptionNodes.get(description);\n    if (!desc) {\n      let id = `react-aria-description-${descriptionId++}`;\n      setId(id);\n\n      let node = document.createElement('div');\n      node.id = id;\n      node.style.display = 'none';\n      node.textContent = description;\n      document.body.appendChild(node);\n      desc = {refCount: 0, element: node};\n      descriptionNodes.set(description, desc);\n    } else {\n      setId(desc.element.id);\n    }\n\n    desc.refCount++;\n    return () => {\n      if (--desc.refCount === 0) {\n        desc.element.remove();\n        descriptionNodes.delete(description);\n      }\n    };\n  }, [description]);\n\n  return {\n    'aria-describedby': description ? id : undefined\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction testUserAgent(re: RegExp) {\n  if (typeof window === 'undefined' || window.navigator == null) {\n    return false;\n  }\n  return (\n    window.navigator['userAgentData']?.brands.some((brand: {brand: string, version: string}) => re.test(brand.brand))\n  ) ||\n  re.test(window.navigator.userAgent);\n}\n\nfunction testPlatform(re: RegExp) {\n  return typeof window !== 'undefined' && window.navigator != null\n    ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)\n    : false;\n}\n\nexport function isMac() {\n  return testPlatform(/^Mac/i);\n}\n\nexport function isIPhone() {\n  return testPlatform(/^iPhone/i);\n}\n\nexport function isIPad() {\n  return testPlatform(/^iPad/i) ||\n    // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n    (isMac() && navigator.maxTouchPoints > 1);\n}\n\nexport function isIOS() {\n  return isIPhone() || isIPad();\n}\n\nexport function isAppleDevice() {\n  return isMac() || isIOS();\n}\n\nexport function isWebKit() {\n  return testUserAgent(/AppleWebKit/i) && !isChrome();\n}\n\nexport function isChrome() {\n  return testUserAgent(/Chrome/i);\n}\n\nexport function isAndroid() {\n  return testUserAgent(/Android/i);\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useEvent<K extends keyof GlobalEventHandlersEventMap>(\n  ref: RefObject<EventTarget>,\n  event: K,\n  handler: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,\n  options?: boolean | AddEventListenerOptions\n) {\n  let handleEvent = useEffectEvent(handler);\n  let isDisabled = handler == null;\n\n  useEffect(() => {\n    if (isDisabled) {\n      return;\n    }\n\n    let element = ref.current;\n    element.addEventListener(event, handleEvent, options);\n    return () => {\n      element.removeEventListener(event, handleEvent, options);\n    };\n  }, [ref, event, options, isDisabled, handleEvent]);\n}\n","/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport function useEffectEvent(fn) {\n  const ref = useRef(null);\n  useLayoutEffect(() => {\n    ref.current = fn;\n  }, [fn]);\n  return useCallback((...args) => {\n    const f = ref.current;\n    return f(...args);\n  }, []);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParent} from './';\n\ninterface ScrollIntoViewportOpts {\n  /** The optional containing element of the target to be centered in the viewport. */\n  containingElement?: Element\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement) {\n  let offsetX = relativeOffset(scrollView, element, 'left');\n  let offsetY = relativeOffset(scrollView, element, 'top');\n  let width = element.offsetWidth;\n  let height = element.offsetHeight;\n  let x = scrollView.scrollLeft;\n  let y = scrollView.scrollTop;\n\n  // Account for top/left border offsetting the scroll top/Left\n  let {borderTopWidth, borderLeftWidth} = getComputedStyle(scrollView);\n  let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);\n  let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);\n  // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n  let maxX = borderAdjustedX + scrollView.clientWidth;\n  let maxY = borderAdjustedY + scrollView.clientHeight;\n\n  if (offsetX <= x) {\n    x = offsetX - parseInt(borderLeftWidth, 10);\n  } else if (offsetX + width > maxX) {\n    x += offsetX + width - maxX;\n  }\n  if (offsetY <= borderAdjustedY) {\n    y = offsetY - parseInt(borderTopWidth, 10);\n  } else if (offsetY + height > maxY) {\n    y += offsetY + height - maxY;\n  }\n  scrollView.scrollLeft = x;\n  scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n  const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n  let sum = 0;\n  while (child.offsetParent) {\n    sum += child[prop];\n    if (child.offsetParent === ancestor) {\n      // Stop once we have found the ancestor we are interested in.\n      break;\n    } else if (child.offsetParent.contains(ancestor)) {\n      // If the ancestor is not `position:relative`, then we stop at\n      // _its_ offset parent, and we subtract off _its_ offset, so that\n      // we end up with the proper offset from child to ancestor.\n      sum -= ancestor[prop];\n      break;\n    }\n    child = child.offsetParent as HTMLElement;\n  }\n  return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element, opts?: ScrollIntoViewportOpts) {\n  if (document.contains(targetElement)) {\n    let root = document.scrollingElement || document.documentElement;\n    let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n    // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n    if (!isScrollPrevented) {\n      let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n      // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n      // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n      targetElement?.scrollIntoView?.({block: 'nearest'});\n      let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n      // Account for sub pixel differences from rounding\n      if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n        opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n        targetElement.scrollIntoView?.({block: 'nearest'});\n      }\n    } else {\n      let scrollParent = getScrollParent(targetElement);\n      // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n      while (targetElement && scrollParent && targetElement !== root && scrollParent !== root) {\n        scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n        targetElement = scrollParent;\n        scrollParent = getScrollParent(targetElement);\n      }\n    }\n  }\n}\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAndroid} from './platform';\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n  // JAWS/NVDA with Firefox.\n  if ((event as any).mozInputSource === 0 && event.isTrusted) {\n    return true;\n  }\n\n  // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n  // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n  // to detect TalkBack virtual clicks.\n  if (isAndroid() && (event as PointerEvent).pointerType) {\n    return event.type === 'click' && event.buttons === 1;\n  }\n\n  return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent) {\n  // If the pointer size is zero, then we assume it's from a screen reader.\n  // Android TalkBack double tap will sometimes return a event with width and height of 1\n  // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n  // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n  // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n  // Talkback double tap from Windows Firefox touch screen press\n  return (\n    (event.width === 0 && event.height === 0) ||\n    (event.width === 1 &&\n      event.height === 1 &&\n      event.pressure === 0 &&\n      event.detail === 0 &&\n      event.pointerType === 'mouse'\n    )\n  );\n}\n","/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/* eslint-disable rulesdir/pure-render */\n\nimport {useRef} from 'react';\n\nexport function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T {\n  // Using a ref during render is ok here because it's only an optimization – both values are equivalent.\n  // If a render is thrown away, it'll still work the same no matter if the next render is the same or not.\n  let lastValue = useRef(null);\n  if (value && lastValue.current && isEqual(value, lastValue.current)) {\n    value = lastValue.current;\n  }\n\n  lastValue.current = value;\n  return value;\n}\n","/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {RefObject, useEffect, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useFormReset<T>(\n  ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>,\n  initialValue: T,\n  onReset: (value: T) => void\n) {\n  let resetValue = useRef(initialValue);\n  let handleReset = useEffectEvent(() => {\n    if (onReset) {\n      onReset(resetValue.current);\n    }\n  });\n\n  useEffect(() => {\n    let form = ref?.current?.form;\n    form?.addEventListener('reset', handleReset);\n    return () => {\n      form?.removeEventListener('reset', handleReset);\n    };\n  }, [ref, handleReset]);\n}\n"]},"metadata":{},"sourceType":"module"}