Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@floating-ui/react

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@floating-ui/react - npm Package Compare versions

Comparing version 0.26.12 to 0.26.13

149

dist/floating-ui.react.d.ts

@@ -44,3 +44,3 @@ import { AlignedPlacement } from '@floating-ui/react-dom';

import { platform } from '@floating-ui/react-dom';
import * as React_2 from 'react';
import * as React from 'react';
import { Rect } from '@floating-ui/react-dom';

@@ -97,3 +97,3 @@ import { ReferenceElement } from '@floating-ui/react-dom';

*/
export declare const Composite: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLElement> & CompositeProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
export declare const Composite: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & CompositeProps, "ref"> & React.RefAttributes<HTMLElement>>;

@@ -103,3 +103,3 @@ /**

*/
export declare const CompositeItem: React_2.ForwardRefExoticComponent<Omit<React_2.HTMLProps<HTMLElement> & CompositeItemProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
export declare const CompositeItem: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & CompositeItemProps, "ref"> & React.RefAttributes<HTMLElement>>;

@@ -184,6 +184,6 @@ declare interface CompositeItemProps {

declare type CSSStylesProperty = React_2.CSSProperties | ((params: {
declare type CSSStylesProperty = React.CSSProperties | ((params: {
side: Side;
placement: Placement;
}) => React_2.CSSProperties);
}) => React.CSSProperties);

@@ -204,5 +204,5 @@ declare type Delay = number | Partial<{

export declare interface ElementProps {
reference?: React_2.HTMLProps<Element>;
floating?: React_2.HTMLProps<HTMLElement>;
item?: React_2.HTMLProps<HTMLElement> | ((props: ExtendedUserProps) => React_2.HTMLProps<HTMLElement>);
reference?: React.HTMLProps<Element>;
floating?: React.HTMLProps<HTMLElement>;
item?: React.HTMLProps<HTMLElement> | ((props: ExtendedUserProps) => React.HTMLProps<HTMLElement>);
}

@@ -221,5 +221,5 @@

export declare interface ExtendedRefs<RT> {
reference: React_2.MutableRefObject<ReferenceType | null>;
floating: React_2.MutableRefObject<HTMLElement | null>;
domReference: React_2.MutableRefObject<NarrowedElement<RT> | null>;
reference: React.MutableRefObject<ReferenceType | null>;
floating: React.MutableRefObject<HTMLElement | null>;
domReference: React.MutableRefObject<NarrowedElement<RT> | null>;
setReference(node: RT | null): void;

@@ -243,5 +243,5 @@ setFloating(node: HTMLElement | null): void;

*/
export declare const FloatingArrow: React_2.ForwardRefExoticComponent<Omit<FloatingArrowProps, "ref"> & React_2.RefAttributes<SVGSVGElement>>;
export declare const FloatingArrow: React.ForwardRefExoticComponent<Omit<FloatingArrowProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
export declare interface FloatingArrowProps extends React_2.ComponentPropsWithRef<'svg'> {
export declare interface FloatingArrowProps extends React.ComponentPropsWithRef<'svg'> {
/**

@@ -290,3 +290,3 @@ * The floating context.

events: FloatingEvents;
dataRef: React_2.MutableRefObject<ContextData>;
dataRef: React.MutableRefObject<ContextData>;
nodeId: string | undefined;

@@ -303,6 +303,6 @@ floatingId: string;

*/
export declare const FloatingDelayGroup: (props: FloatingDelayGroupProps) => React_2.JSX.Element;
export declare function FloatingDelayGroup(props: FloatingDelayGroupProps): JSX.Element;
declare interface FloatingDelayGroupProps {
children?: React_2.ReactNode;
children?: React.ReactNode;
/**

@@ -333,10 +333,10 @@ * The delay to use for the group.

*/
export declare function FloatingFocusManager<RT extends ReferenceType = ReferenceType>(props: FloatingFocusManagerProps<RT>): React_2.JSX.Element;
export declare function FloatingFocusManager(props: FloatingFocusManagerProps): JSX.Element;
export declare interface FloatingFocusManagerProps<RT extends ReferenceType = ReferenceType> {
children: React_2.JSX.Element;
export declare interface FloatingFocusManagerProps {
children: JSX.Element;
/**
* The floating context returned from `useFloating`.
*/
context: FloatingContext<RT>;
context: FloatingContext;
/**

@@ -359,3 +359,3 @@ * Whether or not the focus manager should be disabled. Useful to delay focus

*/
initialFocus?: number | React_2.MutableRefObject<HTMLElement | null>;
initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
/**

@@ -405,6 +405,6 @@ * Determines if the focus guards are rendered. If not, focus can escape into

*/
export declare function FloatingList(props: FloatingListProps): React_2.JSX.Element;
export declare function FloatingList(props: FloatingListProps): JSX.Element;
declare interface FloatingListProps {
children: React_2.ReactNode;
children: React.ReactNode;
/**

@@ -414,3 +414,3 @@ * A ref to the list of HTML elements, ordered by their index.

*/
elementsRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
elementsRef: React.MutableRefObject<Array<HTMLElement | null>>;
/**

@@ -420,3 +420,3 @@ * A ref to the list of element labels, ordered by their index.

*/
labelsRef?: React_2.MutableRefObject<Array<string | null>>;
labelsRef?: React.MutableRefObject<Array<string | null>>;
}

@@ -429,5 +429,5 @@

export declare function FloatingNode(props: {
children?: React_2.ReactNode;
children?: React.ReactNode;
id: string;
}): React_2.JSX.Element;
}): JSX.Element;

@@ -446,3 +446,3 @@ export declare interface FloatingNodeType<RT extends ReferenceType = ReferenceType> {

*/
export declare const FloatingOverlay: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & FloatingOverlayProps & React_2.RefAttributes<HTMLDivElement>>;
export declare const FloatingOverlay: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & FloatingOverlayProps & React.RefAttributes<HTMLDivElement>>;

@@ -465,6 +465,6 @@ export declare interface FloatingOverlayProps {

*/
export declare function FloatingPortal(props: FloatingPortalProps): React_2.JSX.Element;
export declare function FloatingPortal(props: FloatingPortalProps): JSX.Element;
declare interface FloatingPortalProps {
children?: React_2.ReactNode;
children?: React.ReactNode;
/**

@@ -478,3 +478,3 @@ * Optionally selects the node with the id if it exists, or create it and

*/
root?: HTMLElement | null | React_2.MutableRefObject<HTMLElement | null>;
root?: HTMLElement | null | React.MutableRefObject<HTMLElement | null>;
/**

@@ -499,7 +499,7 @@ * When using non-modal focus management using `FloatingFocusManager`, this

export declare function FloatingTree(props: {
children?: React_2.ReactNode;
}): React_2.JSX.Element;
children?: React.ReactNode;
}): JSX.Element;
export declare interface FloatingTreeType<RT extends ReferenceType = ReferenceType> {
nodesRef: React_2.MutableRefObject<Array<FloatingNodeType<RT>>>;
nodesRef: React.MutableRefObject<Array<FloatingNodeType<RT>>>;
events: FloatingEvents;

@@ -513,4 +513,4 @@ addNode(node: FloatingNodeType): void;

declare interface GroupContext extends GroupState {
setCurrentId: React_2.Dispatch<React_2.SetStateAction<any>>;
setState: React_2.Dispatch<Partial<GroupState>>;
setCurrentId: React.Dispatch<React.SetStateAction<any>>;
setState: React.Dispatch<Partial<GroupState>>;
}

@@ -526,6 +526,6 @@

declare interface HandleCloseFn<RT extends ReferenceType = ReferenceType> {
(context: FloatingContext<RT> & {
declare interface HandleCloseFn {
(context: FloatingContext & {
onClose: () => void;
tree?: FloatingTreeType<RT> | null;
tree?: FloatingTreeType | null;
leave?: boolean;

@@ -558,3 +558,3 @@ }): (event: MouseEvent) => void;

*/
listRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
listRef: React.MutableRefObject<Array<HTMLElement | null>>;
/**

@@ -577,3 +577,3 @@ * The index of the active (focused or highlighted) item in the list.

*/
overflowRef?: React_2.MutableRefObject<SideObject | null>;
overflowRef?: React.MutableRefObject<SideObject | null>;
/**

@@ -585,3 +585,3 @@ * An optional ref containing an HTMLElement. This may be used as the

*/
scrollRef?: React_2.MutableRefObject<HTMLElement | null>;
scrollRef?: React.MutableRefObject<HTMLElement | null>;
/**

@@ -641,3 +641,3 @@ * The minimum number of items that should be visible in the list.

declare type RenderProp = React_2.JSX.Element | ((props: React_2.HTMLAttributes<HTMLElement>) => React_2.JSX.Element);
declare type RenderProp = JSX.Element | ((props: React.HTMLAttributes<HTMLElement>) => JSX.Element);

@@ -651,8 +651,8 @@ export { RootBoundary }

*/
export declare function safePolygon<RT extends ReferenceType = ReferenceType>(options?: Partial<SafePolygonOptions>): HandleCloseFn<RT>;
export declare function safePolygon(options?: SafePolygonOptions): HandleCloseFn;
declare interface SafePolygonOptions {
buffer: number;
blockPointerEvents: boolean;
requireIntent: boolean;
buffer?: number;
blockPointerEvents?: boolean;
requireIntent?: boolean;
}

@@ -682,3 +682,3 @@

*/
export declare function useClick<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseClickProps): ElementProps;
export declare function useClick(context: FloatingContext, props?: UseClickProps): ElementProps;

@@ -726,3 +726,3 @@ export declare interface UseClickProps {

*/
export declare function useClientPoint<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseClientPointProps): ElementProps;
export declare function useClientPoint(context: FloatingContext, props?: UseClientPointProps): ElementProps;

@@ -773,3 +773,3 @@ export declare interface UseClientPointProps {

*/
export declare function useDismiss<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseDismissProps): ElementProps;
export declare function useDismiss(context: FloatingContext, props?: UseDismissProps): ElementProps;

@@ -852,3 +852,3 @@ export declare interface UseDismissProps {

*/
export declare function useFloating<RT extends ReferenceType = ReferenceType>(options?: Partial<UseFloatingOptions>): UseFloatingReturn<RT>;
export declare function useFloating<RT extends ReferenceType = ReferenceType>(options?: UseFloatingOptions): UseFloatingReturn<RT>;

@@ -899,6 +899,9 @@ export declare type UseFloatingData = Prettify<UseFloatingReturn>;

id?: string;
root?: HTMLElement | null | React_2.MutableRefObject<HTMLElement | null>;
root?: HTMLElement | null | React.MutableRefObject<HTMLElement | null>;
}): HTMLElement | null;
export declare type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UseFloatingReturn_2 & {
/**
* `FloatingContext`
*/
context: Prettify<FloatingContext<RT>>;

@@ -922,3 +925,3 @@ /**

*/
export declare function useFocus<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseFocusProps): ElementProps;
export declare function useFocus(context: FloatingContext, props?: UseFocusProps): ElementProps;

@@ -949,5 +952,5 @@ export declare interface UseFocusProps {

*/
export declare function useHover<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseHoverProps<RT>): ElementProps;
export declare function useHover(context: FloatingContext, props?: UseHoverProps): ElementProps;
export declare interface UseHoverProps<RT extends ReferenceType = ReferenceType> {
export declare interface UseHoverProps {
/**

@@ -965,3 +968,3 @@ * Whether the Hook is enabled, including all internal Effects and event

*/
handleClose?: HandleCloseFn<RT> | null;
handleClose?: HandleCloseFn | null;
/**

@@ -1021,3 +1024,3 @@ * Waits until the user’s cursor is at “rest” over the reference element

*/
overflowRef: React_2.MutableRefObject<SideObject | null>;
overflowRef: React.MutableRefObject<SideObject | null>;
/**

@@ -1029,3 +1032,3 @@ * An optional ref containing an HTMLElement. This may be used as the

*/
scrollRef?: React_2.MutableRefObject<HTMLElement | null>;
scrollRef?: React.MutableRefObject<HTMLElement | null>;
/**

@@ -1043,8 +1046,10 @@ * Callback invoked when the offset changes.

*/
export declare function useInteractions(propsList?: Array<ElementProps | void>): {
getReferenceProps: (userProps?: React_2.HTMLProps<Element>) => Record<string, unknown>;
getFloatingProps: (userProps?: React_2.HTMLProps<HTMLElement>) => Record<string, unknown>;
getItemProps: (userProps?: Omit<React_2.HTMLProps<HTMLElement>, 'selected' | 'active'> & ExtendedUserProps) => Record<string, unknown>;
};
export declare function useInteractions(propsList?: Array<ElementProps | void>): UseInteractionsReturn;
export declare interface UseInteractionsReturn {
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, 'selected' | 'active'> & ExtendedUserProps) => Record<string, unknown>;
}
/**

@@ -1069,3 +1074,3 @@ * Used to register a list item and its index (DOM position) in the

*/
export declare function useListNavigation<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props: UseListNavigationProps): ElementProps;
export declare function useListNavigation(context: FloatingContext, props: UseListNavigationProps): ElementProps;

@@ -1077,3 +1082,3 @@ export declare interface UseListNavigationProps {

*/
listRef: React_2.MutableRefObject<Array<HTMLElement | null>>;
listRef: React.MutableRefObject<Array<HTMLElement | null>>;
/**

@@ -1194,3 +1199,3 @@ * The index of the currently active (focused or highlighted) item, which may

*/
virtualItemRef?: React_2.MutableRefObject<HTMLElement | null>;
virtualItemRef?: React.MutableRefObject<HTMLElement | null>;
/**

@@ -1213,3 +1218,3 @@ * Only for `cols > 1`, specify sizes for grid items.

*/
export declare function useMergeRefs<Instance>(refs: Array<React_2.Ref<Instance> | undefined>): React_2.RefCallback<Instance> | null;
export declare function useMergeRefs<Instance>(refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;

@@ -1221,3 +1226,3 @@ /**

*/
export declare function useRole<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseRoleProps): ElementProps;
export declare function useRole(context: FloatingContext, props?: UseRoleProps): ElementProps;

@@ -1243,3 +1248,3 @@ export declare interface UseRoleProps {

*/
export declare function useTransitionStatus<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props?: UseTransitionStatusProps): {
export declare function useTransitionStatus(context: FloatingContext, props?: UseTransitionStatusProps): {
isMounted: boolean;

@@ -1267,3 +1272,3 @@ status: Status;

isMounted: boolean;
styles: React_2.CSSProperties;
styles: React.CSSProperties;
};

@@ -1297,3 +1302,3 @@

*/
export declare function useTypeahead<RT extends ReferenceType = ReferenceType>(context: FloatingContext<RT>, props: UseTypeaheadProps): ElementProps;
export declare function useTypeahead(context: FloatingContext, props: UseTypeaheadProps): ElementProps;

@@ -1306,3 +1311,3 @@ export declare interface UseTypeaheadProps {

*/
listRef: React_2.MutableRefObject<Array<string | null>>;
listRef: React.MutableRefObject<Array<string | null>>;
/**

@@ -1309,0 +1314,0 @@ * The index of the active (focused or highlighted) item in the list.

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/react-dom"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/react-dom","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.FloatingUIReactDOM,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t);function i(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const c={...u},l=c.useInsertionEffect||(e=>e());function s(e){const t=u.useRef((()=>{}));return l((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function a(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return e instanceof Node||e instanceof f(e).Node}function v(e){return e instanceof Element||e instanceof f(e).Element}function m(e){return e instanceof HTMLElement||e instanceof f(e).HTMLElement}function p(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function g(e){return["html","body","#document"].includes(a(e))}function h(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function y(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function b(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function E(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function w(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function x(e){return!(0!==e.mozInputSource||!e.isTrusted)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function R(e){return!w().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function I(){return/apple/i.test(navigator.vendor)}function k(){const e=/android/i;return e.test(E())||e.test(w())}function O(){return E().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function T(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function S(e){return"composedPath"in e?e.composedPath()[0]:e.target}const P="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L(e){return m(e)&&e.matches(P)}function A(e){e.preventDefault(),e.stopPropagation()}function N(e){return!!e&&("combobox"===e.getAttribute("role")&&L(e))}const D=Math.floor,F="ArrowUp",j="ArrowDown",K="ArrowLeft",H="ArrowRight";function q(e,t,n){return Math.floor(e/t)!==n}function _(e,t){return t<0||t>=e.current.length}function B(e,t){return U(e,{disabledIndices:t})}function W(e,t){return U(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function U(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current,c=o?e=>o.includes(e):e=>{const t=i[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let l=n;do{l+=r?-u:u}while(l>=0&&l<=i.length-1&&c(l));return l}function z(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===F){if(a&&A(n),-1===s)f=l;else if(f=U(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}_(e,f)&&(f=s)}if(n.key===j&&(a&&A(n),-1===s?f=c:(f=U(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=U(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),_(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===H&&(a&&A(n),s%u!=u-1?(f=U(e,{startingIndex:s,disabledIndices:i}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i})),q(f,u,t)&&(f=s)),n.key===K&&(a&&A(n),s%u!=0?(f=U(e,{startingIndex:s,disabledIndices:i,decrement:!0}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),q(f,u,t)&&(f=s));const r=D(l/u)===t;_(e,f)&&(f=o&&r?n.key===K?l:U(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function X(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function Y(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e);switch(o){case"tl":return u;case"tr":return u+t[e].width-1;case"bl":return u+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function V(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let G=0;function Z(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(G);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():G=requestAnimationFrame(u)}var $="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Q(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const J=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function ee(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return $((()=>{const e=new Map(o);Array.from(e.keys()).sort(Q).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(J.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function te(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(J),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return $((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),$((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function ne(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const re=u.createContext({activeIndex:0,onNavigate:()=>{}}),oe=[K,H],ue=[F,j],ie=[...oe,...ue],ce=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c=[],activeIndex:l,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e,[m,p]=u.useState(0),g=null!=l?l:m,h=s(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},E=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),w=i>1;const x={...v,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==v.onKeyDown||v.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!ie.includes(e.key))return;let t=g;if(w){const n=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),u=X(n,i,d),l=u.findIndex((e=>null!=e&&!c.includes(e))),s=u.reduce(((e,t,n)=>null==t||null!=c&&c.includes(t)?e:n),-1);t=u[z({current:u.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:V([...c,void 0],u),minIndex:l,maxIndex:s,prevIndex:Y(g,n,u,i,e.key===j?"bl":e.key===H?"tr":"tl")})]}const n=B(y,c),u=W(y,c),l={horizontal:[H],vertical:[j],both:[H,j]}[r],s={horizontal:[K],vertical:[F],both:[K,F]}[r],a=w?ie:{horizontal:oe,vertical:ue,both:ie}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:U(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||_(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{Z(y.current[t])})))}(e)}};return u.createElement(re.Provider,{value:E},u.createElement(ee,{elementsRef:y},ne(n,x)))})),le=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:l}=u.useContext(re),{ref:s,index:a}=te(),f=i([s,t,o.ref]),d=c===a;return ne(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}let ae=!1,fe=0;const de=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fe++;const ve=c.useId||function(){const[e,t]=u.useState((()=>ae?de():void 0));return $((()=>{null==e&&t(de())}),[]),u.useEffect((()=>{ae=!0}),[]),e},me=u.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:m,...p}={},...g}=e,h=ve();if(!o)return null;const y=2*a,b=y/2,E=c/2*(s/-8+1),w=l/2*s/4,[x,R]=r.split("-"),I=n.platform.isRTL(o),k=!!v,O="top"===x||"bottom"===x,C=f&&"end"===R?"bottom":"top";let M=f&&"end"===R?"right":"left";f&&I&&(M="end"===R?"left":"right");const T=null!=(null==i?void 0:i.x)?f||i.x:"",S=null!=(null==i?void 0:i.y)?f||i.y:"",P=v||"M0,0 H"+c+" L"+(c-E)+","+(l-w)+" Q"+c/2+","+l+" "+E+","+(l-w)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",se({},g,{"aria-hidden":!0,ref:t,width:k?c:c+y,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[M]:T,[C]:S,[x]:O||k?"100%":"calc(100% - "+y/2+"px)",transform:""+L+(null!=m?m:""),...p}}),y>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:y+(v?0:1),d:P}),u.createElement("path",{stroke:y&&!v?g.fill:"none",d:P}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-b,y:b*(k?-1:1),width:c+y,height:c})))}));function pe(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const ge=u.createContext(null),he=u.createContext(null),ye=()=>{var e;return(null==(e=u.useContext(ge))?void 0:e.id)||null},be=()=>u.useContext(he);function Ee(e){return"data-floating-ui-"+e}function we(e){const n=t.useRef(e);return $((()=>{n.current=e})),n}const xe=Ee("safe-polygon");function Re(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Ie=()=>{},ke=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ie,setState:Ie,isInstantPhase:!1}),Oe=()=>u.useContext(ke);
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/react-dom"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/react-dom","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIReact={},e.React,e.FloatingUIReactDOM,e.ReactDOM)}(this,(function(e,t,n,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=o(t);function i(e){return u.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const c={...u},l=c.useInsertionEffect||(e=>e());function s(e){const t=u.useRef((()=>{}));return l((()=>{t.current=e})),u.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function a(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){return e instanceof Node||e instanceof f(e).Node}function v(e){return e instanceof Element||e instanceof f(e).Element}function m(e){return e instanceof HTMLElement||e instanceof f(e).HTMLElement}function p(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function g(e){return["html","body","#document"].includes(a(e))}function h(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||function(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return p(t)?t.host:t}function y(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function b(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function w(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function E(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function x(e){return!(0!==e.mozInputSource||!e.isTrusted)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function R(e){return!E().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function I(){return/apple/i.test(navigator.vendor)}function k(){const e=/android/i;return e.test(w())||e.test(E())}function O(){return w().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function C(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function T(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function S(e){return"composedPath"in e?e.composedPath()[0]:e.target}const P="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function L(e){return m(e)&&e.matches(P)}function A(e){e.preventDefault(),e.stopPropagation()}function N(e){return!!e&&("combobox"===e.getAttribute("role")&&L(e))}const D=Math.floor,F="ArrowUp",j="ArrowDown",K="ArrowLeft",H="ArrowRight";function q(e,t,n){return Math.floor(e/t)!==n}function _(e,t){return t<0||t>=e.current.length}function B(e,t){return U(e,{disabledIndices:t})}function W(e,t){return U(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function U(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===t?{}:t;const i=e.current,c=o?e=>o.includes(e):e=>{const t=i[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")};let l=n;do{l+=r?-u:u}while(l>=0&&l<=i.length-1&&c(l));return l}function z(e,t){let{event:n,orientation:r,loop:o,cols:u,disabledIndices:i,minIndex:c,maxIndex:l,prevIndex:s,stopEvent:a=!1}=t,f=s;if(n.key===F){if(a&&A(n),-1===s)f=l;else if(f=U(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:i}),o&&(s-u<c||f<0)){const e=s%u,t=l%u,n=l-(t-e);f=t===e?l:t>e?n:n-u}_(e,f)&&(f=s)}if(n.key===j&&(a&&A(n),-1===s?f=c:(f=U(e,{startingIndex:s,amount:u,disabledIndices:i}),o&&s+u>l&&(f=U(e,{startingIndex:s%u-u,amount:u,disabledIndices:i}))),_(e,f)&&(f=s)),"both"===r){const t=D(s/u);n.key===H&&(a&&A(n),s%u!=u-1?(f=U(e,{startingIndex:s,disabledIndices:i}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s-s%u-1,disabledIndices:i})),q(f,u,t)&&(f=s)),n.key===K&&(a&&A(n),s%u!=0?(f=U(e,{startingIndex:s,disabledIndices:i,decrement:!0}),o&&q(f,u,t)&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i}))):o&&(f=U(e,{startingIndex:s+(u-s%u),decrement:!0,disabledIndices:i})),q(f,u,t)&&(f=s));const r=D(l/u)===t;_(e,f)&&(f=o&&r?n.key===K?l:U(e,{startingIndex:s-s%u-1,disabledIndices:i}):s)}return f}function X(e,t,n){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<c;r++)e.push(o+n+r*t);o%t+i<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function Y(e,t,n,r,o){if(-1===e)return-1;const u=n.indexOf(e);switch(o){case"tl":return u;case"tr":return u+t[e].width-1;case"bl":return u+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function V(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}let G=0;function Z(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(G);const u=()=>null==e?void 0:e.focus({preventScroll:n});o?u():G=requestAnimationFrame(u)}var $="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Q(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const J=u.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function ee(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,i]=u.useState((()=>new Map)),c=u.useCallback((e=>{i((t=>new Map(t).set(e,null)))}),[]),l=u.useCallback((e=>{i((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return $((()=>{const e=new Map(o);Array.from(e.keys()).sort(Q).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||i(e)}),[o]),u.createElement(J.Provider,{value:u.useMemo((()=>({register:c,unregister:l,map:o,elementsRef:n,labelsRef:r})),[c,l,o,n,r])},t)}function te(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:i,labelsRef:c}=u.useContext(J),[l,s]=u.useState(null),a=u.useRef(null),f=u.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var n;const r=void 0!==t;c.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}}),[l,i,c,t]);return $((()=>{const e=a.current;if(e)return n(e),()=>{r(e)}}),[n,r]),$((()=>{const e=a.current?o.get(a.current):null;null!=e&&s(e)}),[o]),u.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function ne(e,t){return"function"==typeof e?e(t):e?u.cloneElement(e,t):u.createElement("div",t)}const re=u.createContext({activeIndex:0,onNavigate:()=>{}}),oe=[K,H],ue=[F,j],ie=[...oe,...ue],ce=u.forwardRef((function(e,t){const{render:n,orientation:r="both",loop:o=!0,cols:i=1,disabledIndices:c=[],activeIndex:l,onNavigate:a,itemSizes:f,dense:d=!1,...v}=e,[m,p]=u.useState(0),g=null!=l?l:m,h=s(null!=a?a:p),y=u.useRef([]),b=n&&"function"!=typeof n?n.props:{},w=u.useMemo((()=>({activeIndex:g,onNavigate:h})),[g,h]),E=i>1;const x={...v,...b,ref:t,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==v.onKeyDown||v.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!ie.includes(e.key))return;let t=g;if(E){const n=f||Array.from({length:y.current.length},(()=>({width:1,height:1}))),u=X(n,i,d),l=u.findIndex((e=>null!=e&&!c.includes(e))),s=u.reduce(((e,t,n)=>null==t||null!=c&&c.includes(t)?e:n),-1);t=u[z({current:u.map((e=>e?y.current[e]:null))},{event:e,orientation:r,loop:o,cols:i,disabledIndices:V([...c,void 0],u),minIndex:l,maxIndex:s,prevIndex:Y(g,n,u,i,e.key===j?"bl":e.key===H?"tr":"tl")})]}const n=B(y,c),u=W(y,c),l={horizontal:[H],vertical:[j],both:[H,j]}[r],s={horizontal:[K],vertical:[F],both:[K,F]}[r],a=E?ie:{horizontal:oe,vertical:ue,both:ie}[r];t===g&&[...l,...s].includes(e.key)&&(t=o&&t===u&&l.includes(e.key)?n:o&&t===n&&s.includes(e.key)?u:U(y,{startingIndex:t,decrement:s.includes(e.key),disabledIndices:c})),t===g||_(y,t)||(e.stopPropagation(),a.includes(e.key)&&e.preventDefault(),h(t),queueMicrotask((()=>{Z(y.current[t])})))}(e)}};return u.createElement(re.Provider,{value:w},u.createElement(ee,{elementsRef:y},ne(n,x)))})),le=u.forwardRef((function(e,t){const{render:n,...r}=e,o=n&&"function"!=typeof n?n.props:{},{activeIndex:c,onNavigate:l}=u.useContext(re),{ref:s,index:a}=te(),f=i([s,t,o.ref]),d=c===a;return ne(n,{...r,...o,ref:f,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==o.onFocus||o.onFocus(e),l(a)}})}));function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}let ae=!1,fe=0;const de=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fe++;const ve=c.useId||function(){const[e,t]=u.useState((()=>ae?de():void 0));return $((()=>{null==e&&t(de())}),[]),u.useEffect((()=>{ae=!0}),[]),e},me=u.forwardRef((function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:c=14,height:l=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:v,style:{transform:m,...p}={},...g}=e,h=ve();if(!o)return null;const y=2*a,b=y/2,w=c/2*(s/-8+1),E=l/2*s/4,[x,R]=r.split("-"),I=n.platform.isRTL(o),k=!!v,O="top"===x||"bottom"===x,C=f&&"end"===R?"bottom":"top";let M=f&&"end"===R?"right":"left";f&&I&&(M="end"===R?"left":"right");const T=null!=(null==i?void 0:i.x)?f||i.x:"",S=null!=(null==i?void 0:i.y)?f||i.y:"",P=v||"M0,0 H"+c+" L"+(c-w)+","+(l-E)+" Q"+c/2+","+l+" "+w+","+(l-E)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return u.createElement("svg",se({},g,{"aria-hidden":!0,ref:t,width:k?c:c+y,height:c,viewBox:"0 0 "+c+" "+(l>c?l:c),style:{position:"absolute",pointerEvents:"none",[M]:T,[C]:S,[x]:O||k?"100%":"calc(100% - "+y/2+"px)",transform:""+L+(null!=m?m:""),...p}}),y>0&&u.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:y+(v?0:1),d:P}),u.createElement("path",{stroke:y&&!v?g.fill:"none",d:P}),u.createElement("clipPath",{id:h},u.createElement("rect",{x:-b,y:b*(k?-1:1),width:c+y,height:c})))}));function pe(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const ge=u.createContext(null),he=u.createContext(null),ye=()=>{var e;return(null==(e=u.useContext(ge))?void 0:e.id)||null},be=()=>u.useContext(he);function we(e){return"data-floating-ui-"+e}function Ee(e){const n=t.useRef(e);return $((()=>{n.current=e})),n}const xe=we("safe-polygon");function Re(e,t,n){return n&&!C(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}const Ie=()=>{},ke=u.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ie,setState:Ie,isInstantPhase:!1}),Oe=()=>u.useContext(ke);
/*!

@@ -6,2 +6,2 @@ * tabbable 6.2.0

*/
var Ce=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Me="undefined"==typeof Element,Te=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Se=!Me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Pe=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Le=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Pe(i,!1))if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Te.call(i,Ce)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Pe(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},Ae=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ne=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ae(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fe=function(e){return"INPUT"===e.tagName},je=function(e){return function(e){return Fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Se(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},He=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Te.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Te.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Se(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Se(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Se(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},qe=function(e,t){return!(t.disabled||Pe(t)||function(e){return Fe(e)&&"hidden"===e.type}(t)||He(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Te.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},_e=function(e,t){return!(je(t)||Ne(t)<0||!qe(e,t))},Be=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},We=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=Ne(e);return n<0&&t&&!Ae(e)?0:n}(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(De).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ue=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Le([e],t.includeContainer,{filter:_e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Be}):function(e,t,n){if(Pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ce));return t&&Te.call(e,Ce)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,_e.bind(null,t)),We(n)},ze=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Te.call(e,Ce)&&_e(t,e)};function Xe(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Ye=new WeakMap,Ve=new WeakSet,Ge={},Ze=0;const $e=e=>e&&(e.host||$e(e.parentNode)),Qe=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=$e(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Je(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Qe(t,e),c=new Set,l=new Set(i),s=[];Ge[o]||(Ge[o]=new WeakMap);const a=Ge[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ye.get(t)||0)+1,i=(a.get(t)||0)+1;Ye.set(t,r),a.set(t,i),s.push(t),1===r&&n&&Ve.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Ze++,()=>{s.forEach((e=>{const t=(Ye.get(e)||0)-1,n=(a.get(e)||0)-1;Ye.set(e,t),a.set(e,n),t||(!Ve.has(e)&&u&&e.removeAttribute(u),Ve.delete(e)),n||e.removeAttribute(o)})),Ze--,Ze||(Ye=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,Ge={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=Ue(e,et());"prev"===t&&n.reverse();const r=n.indexOf(y(M(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!b(n,r)}function ut(e){Ue(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function it(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ct={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function lt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=u.forwardRef((function(e,t){const[n,r]=u.useState();$((()=>(I()&&r("button"),document.addEventListener("keydown",lt),()=>{document.removeEventListener("keydown",lt)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ee("focus-guard")]:"",style:ct};return u.createElement("span",se({},e,o))})),at=u.createContext(null),ft=Ee("portal");function dt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ve(),o=vt(),[i,c]=u.useState(null),l=u.useRef(null);return $((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),$((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ft,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),$((()=>{if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(ft,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const vt=()=>u.useContext(at),mt=20;let pt=[];function gt(e){pt=pt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==a(t)){if(!ze(t,et())){const e=Ue(t,et())[0];if(!e)return;t=e}pt.push(t),pt.length>mt&&(pt=pt.slice(-mt))}}function ht(){return pt.slice().reverse().find((e=>e.isConnected))}const yt=u.forwardRef((function(e,t){return u.createElement("button",se({},e,{type:"button",ref:t,tabIndex:-1,style:ct}))}));const bt=new Set,Et=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ve();return $((()=>{if(!n)return;bt.add(o);const e=/iP(hone|ad|od)|iOS/.test(E()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{bt.delete(o),0===bt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",se({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function wt(e){return m(e.target)&&"BUTTON"===e.target.tagName}function xt(e){return L(e)}function Rt(e){return null!=e&&null!=e.clientX}const It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ot=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};const Ct="active",Mt="selected";function Tt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Ct]:t,[Mt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[Ct,Mt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=u)})),e):e),{})}}let St=!1;function Pt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Lt(e,t){return Pt(t,e===F||e===j,e===K||e===H)}function At(e,t,n){return Pt(t,e===j,n?e===K:e===H)||"Enter"===e||" "===e||""===e}function Nt(e,t,n){return Pt(t,n?e===H:e===K,e===F)}const Dt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Ft=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function jt(e,t){return"function"==typeof e?e(t):e}function Kt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return $((()=>{c&&!f&&a("unmounted")}),[c,f]),$((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Ht(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function qt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return n.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return n.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return n.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return n.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return n.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return n.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return n.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return n.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return n.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return n.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return n.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return n.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return n.size}}),e.Composite=ce,e.CompositeItem=le,e.FloatingArrow=me,e.FloatingDelayGroup=e=>{const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return $((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(ke.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:v,nodeId:p,onOpenChange:g,events:h,dataRef:E,elements:{domReference:w,floating:I}}=t,k="number"==typeof c&&c<0,O=N(w)&&k,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,T=we(o),P=we(c),L=we(l),D=be(),F=vt(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Ue(e,et()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return T.current.map((e=>w&&"reference"===e?w:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[w,I,T,B]);function U(e){return!r&&a&&s?u.createElement(yt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){b(I,y(M(I)))&&0===B().length&&!O&&A(e);const t=W(),n=S(e);"reference"===T.current[0]&&n===w&&(A(e),e.shiftKey?Z(t[t.length-1]):Z(t[1])),"floating"===T.current[1]&&n===I&&e.shiftKey&&(A(e),Z(t[0]))}}const t=M(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,w,I,s,T,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&m(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(b(w,t)||b(I,t)||b(t,I)||b(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(Ee("focus-guard"))||D&&(Xe(D.nodesRef.current,p).find((e=>{var n,r;return b(null==(n=e.context)?void 0:n.elements.floating,t)||b(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(D.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!q.current&&t!==ht()&&(H.current=!0,g(!1,e))}))}}),[r,w,I,s,p,D,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+Ee("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,T.current.includes("reference")||O?w:null].filter((e=>null!=e)),n=s||O?Je(e,C,!C):Je(e);return()=>{n()}}}),[r,w,I,s,T,F,O,C]),$((()=>{if(r||!I)return;const e=y(M(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=b(I,e);k||o||!d||Z(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),$((()=>{if(r||!I)return;let e=!1;const t=M(I),n=y(t),o=E.current;function u(t){let{reason:n,event:r,nested:o}=t;"escape-key"===n&&v.domReference.current&&gt(v.domReference.current),"hover"===n&&"mouseleave"===r.type&&(H.current=!0),"outside-press"===n&&(o?(H.current=!1,e=!0):H.current=!(x(r)||R(r)))}return gt(n),h.on("openchange",u),()=>{h.off("openchange",u);const n=y(t),r=b(I,n)||D&&Xe(D.nodesRef.current,p).some((e=>{var t;return b(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&v.domReference.current&&gt(v.domReference.current);const i=ht();L.current&&!H.current&&m(i)&&(i===n||n===t.body||r)&&Z(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,L,E,v,h,D,p]),$((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:v}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,v,f]),$((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");T.current.includes("floating")||y(M(I))!==v.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,v,T,B,k]);const z=!r&&C&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();Z("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,ot(e,F.portalNode)){const e=nt()||w;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)Z(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),ot(e,F.portalNode)){const e=rt()||w;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=ee,e.FloatingNode=function(e){const{children:t,id:n}=e,r=ye();return u.createElement(ge.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=Et,e.FloatingPortal=function(e){const{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e,c=dt({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ot(e)){("focusin"===e.type?it:ut)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(at.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(st,{"data-type":"outside",ref:a,onFocus:e=>{if(ot(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=rt()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ct}),c&&r.createPortal(t,c),m&&c&&u.createElement(st,{"data-type":"outside",ref:f,onFocus:e=>{if(ot(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=nt()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){const{children:t}=e,n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>pe()))[0];return u.createElement(he.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[l];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-c).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(Ht(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),E=Math.max(0,y.top),w=g.y+E,x=Math.max(0,h.scrollHeight-E-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=E,i&&(h.offsetHeight<p.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await n.detectOverflow(Ht({...g,y:w},h.offsetHeight),d)),{y:w}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,E=[h,y],w=S(e),x="mouseleave"===e.type,R=b(f.floating,w),I=b(f.domReference,w),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,T=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(E,k),L=O.width>k.width,A=O.height>k.height,N=(L?k:O).left,D=(L?k:O).right,F=(A?k:O).top,j=(A?k:O).bottom;if(R&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&v(e.relatedTarget)&&b(f.floating,e.relatedTarget))return;if(p&&Xe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let K=[];switch(C){case"top":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"left":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]]}if(!qt([h,y],K)){if(u&&!P)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}qt([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:M?n+4*t:n-4*t,r+t+1],[L?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[O.left,M||L?O.bottom-t:O.top],[O.right,M?L?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[L?n+t/2:M?n+4*t:n-4*t,r-t],[L?n-t/2:M?n+4*t:n-4*t,r-t],...[[O.left,M||L?O.top+t:O.bottom],[O.right,M?L?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?O.right-t:O.left,O.top],[T?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?O.left+t:O.right,O.top],[T?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),v=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||wt(e)||(" "!==e.key||xt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||wt(e)||xt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:a=null,y:d=null}=t,v=u.useRef(!1),m=u.useRef(null),[p,g]=u.useState(),[h,y]=u.useState([]),E=s(((e,t)=>{v.current||o.current.openEvent&&!Rt(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,v=c.x,m=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),v-=n||0,m-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,v=l&&null!=t.x?t.x:v,m=s&&null!=t.y?t.y:m):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:v,y:m,top:m,right:v+f,bottom:m+d,left:v}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:p}))})),w=s((e=>{null==a&&null==d&&(n?m.current||y([]):E(e.clientX,e.clientY))})),x=C(p)?i:n,R=u.useCallback((()=>{if(!x||!c||null!=a||null!=d)return;const e=f(r.floating.current);function t(n){const o=S(n);b(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):E(n.clientX,n.clientY)}if(!o.current.openEvent||Rt(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,x,r,E,a,d]);return u.useEffect((()=>R()),[R,h]),u.useEffect((()=>{c&&!i&&(v.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(v.current=!0)}),[c,n]),$((()=>{!c||null==a&&null==d||(v.current=!1,E(a,d))}),[c,a,d,E]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:w,onMouseEnter:w}}}),[c,w])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Oe(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return $((()=>{l&&(f({delay:{open:1,close:Re(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),$((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),$((()=>{s!==Ie&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Oe,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:c,domReference:l,floating:a},dataRef:d}=e,{enabled:p=!0,escapeKey:y=!0,outsidePress:E=!0,outsidePressEvent:w="pointerdown",referencePress:x=!1,referencePressEvent:R="pointerdown",ancestorScroll:I=!1,bubbles:k,capture:O}=t,C=be(),P=s("function"==typeof E?E:()=>!1),L="function"==typeof E?P:E,A=u.useRef(!1),N=u.useRef(!1),{escapeKey:D,outsidePress:F}=Ot(k),{escapeKey:j,outsidePress:K}=Ot(O),H=s((e=>{if(!r||!p||!y||"Escape"!==e.key)return;const t=C?Xe(C.nodesRef.current,i):[];if(!D&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),q=s((e=>{var t;const n=()=>{var t;H(e),null==(t=S(e))||t.removeEventListener("keydown",n)};null==(t=S(e))||t.addEventListener("keydown",n)})),_=s((e=>{const t=A.current;A.current=!1;const n=N.current;if(N.current=!1,"click"===w&&n)return;if(t)return;if("function"==typeof L&&!L(e))return;const r=S(e),u="["+Ee("inert")+"]",c=M(a).querySelectorAll(u);let s=v(r)?r:null;for(;s&&!g(s);){const e=h(s);if(g(e)||!v(e))break;s=e}if(c.length&&v(r)&&!r.matches("html,body")&&!b(r,a)&&Array.from(c).every((e=>!b(s,e))))return;if(m(r)&&a){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n){const t="rtl"===function(e){return f(e).getComputedStyle(e)}(r).direction;t&&(o=e.offsetX<=r.offsetWidth-r.clientWidth)}if(o||t&&e.offsetY>r.clientHeight)return}const d=C&&Xe(C.nodesRef.current,i).some((t=>{var n;return T(e,null==(n=t.context)?void 0:n.elements.floating)}));if(T(e,a)||T(e,l)||d)return;const p=C?Xe(C.nodesRef.current,i):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),B=s((e=>{var t;const n=()=>{var t;_(e),null==(t=S(e))||t.removeEventListener(w,n)};null==(t=S(e))||t.addEventListener(w,n)}));return u.useEffect((()=>{if(!r||!p)return;function e(e){o(!1,e,"ancestor-scroll")}d.current.__escapeKeyBubbles=D,d.current.__outsidePressBubbles=F;const t=M(a);y&&t.addEventListener("keydown",j?q:H,j),L&&t.addEventListener(w,K?B:_,K);let u=[];return I&&(v(l)&&(u=n.getOverflowAncestors(l)),v(a)&&(u=u.concat(n.getOverflowAncestors(a))),!v(c)&&c&&c.contextElement&&(u=u.concat(n.getOverflowAncestors(c.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{y&&t.removeEventListener("keydown",j?q:H,j),L&&t.removeEventListener(w,K?B:_,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[d,a,l,c,y,L,w,r,o,I,p,D,F,H,j,q,_,K,B]),u.useEffect((()=>{A.current=!1}),[L,w]),u.useMemo((()=>p?{reference:{onKeyDown:H,[It[R]]:e=>{x&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:H,onMouseDown(){N.current=!0},onMouseUp(){N.current=!0},[kt[w]]:()=>{A.current=!0}}}:{}),[p,x,w,R,o,H])},e.useFloating=function(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),[a,f]=u.useState(null),d=(null==(t=e.elements)?void 0:t.reference)||c;$((()=>{d&&(y.current=d)}),[d]);const m=n.useFloating({...e,elements:{...e.elements,...a&&{reference:a}}}),p=be(),g=null!=ye(),h=s(((e,t,n)=>{b.current.openEvent=e?t:void 0,E.emit("openchange",{open:e,event:t,reason:n,nested:g}),null==o||o(e,t,n)})),y=u.useRef(null),b=u.useRef({}),E=u.useState((()=>pe()))[0],w=ve(),x=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),m.refs.setReference(t)}),[m.refs]),R=u.useCallback((e=>{(v(e)||null===e)&&(y.current=e,l(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),I=u.useMemo((()=>({...m.refs,setReference:R,setPositionReference:x,domReference:y})),[m.refs,R,x]),k=u.useMemo((()=>({...m.elements,domReference:d})),[m.elements,d]),O=u.useMemo((()=>({...m,refs:I,elements:k,dataRef:b,nodeId:i,floatingId:w,events:E,open:r,onOpenChange:h})),[m,i,w,E,r,h,I,k]);return $((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),u.useMemo((()=>({...m,context:O,refs:I,elements:k})),[m,I,k,O])},e.useFloatingNodeId=function(e){const t=ve(),n=be(),r=ye(),o=e||r;return $((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=ye,e.useFloatingPortalNode=dt,e.useFloatingTree=be,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),d=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=f(c);function t(){!n&&m(c)&&c===y(M(c))&&(a.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(d.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){R(e.nativeEvent)||(p.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=S(e.nativeEvent);if(s&&v(t))try{if(I()&&O())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!L(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=v(t)&&t.hasAttribute(Ee("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{const o=y(c?c.ownerDocument:document);(t||o!==c)&&(b(i.floating.current,o)||b(c,o)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,c,i,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=be(),y=ye(),E=we(d),w=we(f),x=u.useRef(),R=u.useRef(),I=u.useRef(),k=u.useRef(),O=u.useRef(!0),T=u.useRef(!1),S=u.useRef((()=>{})),P=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),O.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!E.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=M(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,E,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Re(w.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[w,r]),A=u.useCallback((()=>{S.current(),I.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=M(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(xe),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&v(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),O.current=!1,m&&!C(x.current)||p>0&&0===Re(w.current,"open"))return;const t=Re(w.current,"open",x.current);t?R.current=setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(r){if(t())return;S.current();const o=M(l);if(clearTimeout(k.current),E.current){n||clearTimeout(R.current),I.current=E.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),L(r,!0,"safe-polygon")}});const t=I.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!b(l,r.relatedTarget))&&L(r)}function s(n){t()||null==E.current||E.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),L(n)}})(n)}}),[c,l,a,e,m,p,g,L,A,N,r,n,h,w,E,o]),$((()=>{var e;if(a&&n&&null!=(e=E.current)&&e.__options.blockPointerEvents&&P()){const e=M(l).body;if(e.setAttribute(xe,""),e.style.pointerEvents="none",T.current=!0,v(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,E,P]),$((()=>{n||(x.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),N()}),[a,c,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){function t(){O.current||r(!0,e.nativeEvent,"hover")}m&&!C(x.current)||n||0===p||(clearTimeout(k.current),"touch"===x.current?t():k.current=setTimeout(t,p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,m,n,p,r,L])},e.useId=ve,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:a}=t,f=s(a),d=u.useRef(!1),v=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{f((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(w())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>Tt(t,e,"reference")),t),r=u.useCallback((t=>Tt(t,e,"floating")),t),o=u.useCallback((t=>Tt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=te,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:v=null,allowEscape:p=!1,loop:g=!1,nested:h=!1,rtl:E=!1,virtual:w=!1,focusItemOnOpen:k="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:T=!0,disabledIndices:S,orientation:P="vertical",cols:L=1,scrollItemIntoView:D=!0,virtualItemRef:F,itemSizes:q,dense:G=!1}=t,Q=ye(),J=be(),ee=s(f),te=u.useRef(k),ne=u.useRef(null!=v?v:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!c),ce=u.useRef(!1),le=u.useRef(!1),se=we(S),ae=we(n),fe=we(D),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=s((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(w?(ve(r.id),null==J||J.events.emit("virtualfocus",r),F&&(F.current=r)):Z(r,{preventScroll:!0,sync:!(!O()||!I())&&(St||ce.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!oe.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));$((()=>{document.createElement("div").focus({get preventScroll(){return St=!0,!1}})}),[]),$((()=>{d&&(n&&c?te.current&&null!=v&&(le.current=!0,ne.current=v,ee(v)):ie.current&&(ne.current=-1,ue.current(null)))}),[d,n,c,v,ee]),$((()=>{if(d&&n&&c)if(null==a){if(ce.current=!1,null!=v)return;if(ie.current&&(ne.current=-1,ge(l,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||At(re.current,P,E)||h?B(l,se.current):W(l,se.current),re.current=null,ee(ne.current)};t()}}else _(l,a)||(ne.current=a,ge(l,ne,le.current),le.current=!1)}),[d,n,c,a,v,h,l,P,E,ee,ge,se]),$((()=>{var e;if(!d||c||!J||w||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Q)))||null==(e=e.context)?void 0:e.elements.floating,r=y(M(c)),o=t.some((e=>e.context&&b(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[d,c,J,Q,w]),$((()=>{if(d&&J&&w&&!Q)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){pe(e.id),F&&(F.current=e)}}),[d,J,w,Q,F]),$((()=>{ue.current=ee,ie.current=!!c})),$((()=>{n||(re.current=null)}),[n]);const he=null!=a,Ee=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&ee(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ge(l,ne),ee(null),w||Z(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ge,C,l,ee,w]);return u.useMemo((()=>{if(!d)return{};const e=se.current;function t(t){if(oe.current=!1,ce.current=!0,!ae.current&&t.currentTarget===o.floating.current)return;if(h&&Nt(t.key,P,E))return A(t),r(!1,t.nativeEvent,"list-navigation"),void(m(i)&&!w&&i.focus());const u=ne.current,c=B(l,e),s=W(l,e);if("Home"===t.key&&(A(t),ne.current=c,ee(ne.current)),"End"===t.key&&(A(t),ne.current=s,ee(ne.current)),L>1){const n=q||Array.from({length:l.current.length},(()=>({width:1,height:1}))),r=X(n,L,G),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(ne.current=r[z({current:r.map((e=>null!=e?l.current[e]:null))},{event:t,orientation:P,loop:g,cols:L,disabledIndices:V([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:Y(ne.current,n,r,L,t.key===j?"bl":t.key===H?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Lt(t.key,P)){if(A(t),n&&!w&&y(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=At(t.key,P,E)?c:s,void ee(ne.current);At(t.key,P,E)?ne.current=g?u>=s?p&&u!==l.current.length?-1:c:U(l,{startingIndex:u,disabledIndices:e}):Math.min(s,U(l,{startingIndex:u,disabledIndices:e})):ne.current=g?u<=c?p&&-1!==u?l.current.length:s:U(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,U(l,{startingIndex:u,decrement:!0,disabledIndices:e})),_(l,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===k&&x(e.nativeEvent)&&(te.current=!0)}const c=w&&n&&he&&{"aria-activedescendant":me||de},s=l.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...c,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Pt(t,n?e===K:e===H,e===j)}(o.key,P,E),c=Nt(o.key,P,E),a=Lt(o.key,P),f=(h?i:a)||"Enter"===o.key||""===o.key.trim();if(w&&n){const e=null==J?void 0:J.nodesRef.current.find((e=>null==e.parentId)),n=J&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Xe(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(J.nodesRef.current,e.id):null;if(u&&n&&F){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||c){var d,m;const t=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,r=c&&!t?null==(m=n.context)?void 0:m.elements.domReference:i?s:null;r&&(A(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return A(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||T||!u)&&(f&&(re.current=h&&a?null:o.key),h?i&&(A(o),n?(ne.current=B(l,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=v&&(ne.current=v),A(o),!n&&T?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&ee(null)},onPointerDown:function(e){te.current=k,"auto"===k&&R(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!N(i)&&c,onKeyDown:t,onPointerMove(){oe.current=!0}},item:Ee}}),[i,o,de,me,se,ae,l,d,P,E,w,n,he,h,v,T,p,L,g,k,ee,r,Ee,J,F,q,G])},e.useMergeRefs=i,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=Dt.get(c))?n:c,s=ve(),a=null!=ye();return u.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===l&&{"aria-labelledby":s}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[i,c,l,r,o,s,a])},e.useTransitionStatus=Kt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,v=(f?c:c.close)||0,[m,p]=u.useState((()=>({...jt(i,a),...jt(n,a)}))),{isMounted:g,status:h}=Kt(e,{duration:c}),y=we(n),b=we(r),E=we(o),w=we(i);return $((()=>{const e=jt(y.current,a),t=jt(E.current,a),n=jt(w.current,a),r=jt(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(Ft).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Ft).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,E,y,b,w,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),E=s(l),w=s(a),x=we(d),R=we(m);return $((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),$((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&A(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(A(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),v);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(E(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,v,R,x,E,w])}}));
var Ce=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Me="undefined"==typeof Element,Te=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Se=!Me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Pe=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Le=function e(t,n,r){for(var o=[],u=Array.from(t);u.length;){var i=u.shift();if(!Pe(i,!1))if("SLOT"===i.tagName){var c=i.assignedElements(),l=e(c.length?c:i.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{Te.call(i,Ce)&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var s=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),a=!Pe(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(s&&a){var f=e(!0===s?i.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else u.unshift.apply(u,i.children)}}return o},Ae=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ne=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ae(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fe=function(e){return"INPUT"===e.tagName},je=function(e){return function(e){return Fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Se(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},He=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Te.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Te.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var u=e;e;){var i=e.parentElement,c=Se(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(e);e=e.assignedSlot?e.assignedSlot:i||c===e.ownerDocument?i:c.host}e=u}if(function(e){var t,n,r,o,u=e&&Se(e),i=null===(t=u)||void 0===t?void 0:t.host,c=!1;if(u&&u!==e)for(c=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&i;){var l,s,a;c=!(null===(s=i=null===(l=u=Se(i))||void 0===l?void 0:l.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(i))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},qe=function(e,t){return!(t.disabled||Pe(t)||function(e){return Fe(e)&&"hidden"===e.type}(t)||He(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Te.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},_e=function(e,t){return!(je(t)||Ne(t)<0||!qe(e,t))},Be=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},We=function e(t){var n=[],r=[];return t.forEach((function(t,o){var u=!!t.scopeParent,i=u?t.scopeParent:t,c=function(e,t){var n=Ne(e);return n<0&&t&&!Ae(e)?0:n}(i,u),l=u?e(t.candidates):i;0===c?u?n.push.apply(n,l):n.push(i):r.push({documentOrder:o,tabIndex:c,item:t,isScope:u,content:l})})),r.sort(De).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ue=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Le([e],t.includeContainer,{filter:_e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Be}):function(e,t,n){if(Pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ce));return t&&Te.call(e,Ce)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,_e.bind(null,t)),We(n)},ze=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Te.call(e,Ce)&&_e(t,e)};function Xe(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Ye=new WeakMap,Ve=new WeakSet,Ge={},Ze=0;const $e=e=>e&&(e.host||$e(e.parentNode)),Qe=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=$e(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Je(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,i=Qe(t,e),c=new Set,l=new Set(i),s=[];Ge[o]||(Ge[o]=new WeakMap);const a=Ge[o];return i.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(c.has(t))e(t);else{const e=u?t.getAttribute(u):null,n=null!==e&&"false"!==e,r=(Ye.get(t)||0)+1,i=(a.get(t)||0)+1;Ye.set(t,r),a.set(t,i),s.push(t),1===r&&n&&Ve.add(t),1===i&&t.setAttribute(o,""),!n&&u&&t.setAttribute(u,"true")}}))}(t),c.clear(),Ze++,()=>{s.forEach((e=>{const t=(Ye.get(e)||0)-1,n=(a.get(e)||0)-1;Ye.set(e,t),a.set(e,n),t||(!Ve.has(e)&&u&&e.removeAttribute(u),Ve.delete(e)),n||e.removeAttribute(o)})),Ze--,Ze||(Ye=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,Ge={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=Ue(e,et());"prev"===t&&n.reverse();const r=n.indexOf(y(M(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!b(n,r)}function ut(e){Ue(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function it(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ct={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function lt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=u.forwardRef((function(e,t){const[n,r]=u.useState();$((()=>(I()&&r("button"),document.addEventListener("keydown",lt),()=>{document.removeEventListener("keydown",lt)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[we("focus-guard")]:"",style:ct};return u.createElement("span",se({},e,o))})),at=u.createContext(null),ft=we("portal");function dt(e){void 0===e&&(e={});const{id:t,root:n}=e,r=ve(),o=vt(),[i,c]=u.useState(null),l=u.useRef(null);return $((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{l.current=null}))}),[i]),$((()=>{if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ft,""),e.appendChild(n),l.current=n,c(n)}),[t,r]),$((()=>{if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,e.appendChild(u));const i=document.createElement("div");i.id=r,i.setAttribute(ft,""),e=u||e,e.appendChild(i),l.current=i,c(i)}),[t,n,r,o]),i}const vt=()=>u.useContext(at),mt=20;let pt=[];function gt(e){pt=pt.filter((e=>e.isConnected));let t=e;if(t&&"body"!==a(t)){if(!ze(t,et())){const e=Ue(t,et())[0];e&&(t=e)}pt.push(t),pt.length>mt&&(pt=pt.slice(-mt))}}function ht(){return pt.slice().reverse().find((e=>e.isConnected))}const yt=u.forwardRef((function(e,t){return u.createElement("button",se({},e,{type:"button",ref:t,tabIndex:-1,style:ct}))}));const bt=new Set,wt=u.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e,o=ve();return $((()=>{if(!n)return;bt.add(o);const e=/iP(hone|ad|od)|iOS/.test(w()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.pageXOffset,c=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",u&&(t[r]=u+"px"),e){var l,s;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(c-Math.floor(n))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{bt.delete(o),0===bt.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,c)))}}),[o,n]),u.createElement("div",se({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Et(e){return m(e.target)&&"BUTTON"===e.target.tagName}function xt(e){return L(e)}function Rt(e){return null!=e&&null!=e.clientX}const It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ot=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};const Ct="active",Mt="selected";function Tt(e,t,n){const r=new Map,o="item"===n;let u=e;if(o&&e){const{[Ct]:t,[Mt]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1},...u,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,u]=t;var i;o&&[Ct,Mt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof u&&(null==(i=r.get(n))||i.push(u),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),u=0;u<t;u++)o[u]=arguments[u];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=u)})),e):e),{})}}let St=!1;function Pt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Lt(e,t){return Pt(t,e===F||e===j,e===K||e===H)}function At(e,t,n){return Pt(t,e===j,n?e===K:e===H)||"Enter"===e||" "===e||""===e}function Nt(e,t,n){return Pt(t,n?e===H:e===K,e===F)}const Dt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);const Ft=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function jt(e,t){return"function"==typeof e?e(t):e}function Kt(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[c,l]=u.useState(!1),[s,a]=u.useState("unmounted"),f=function(e,t){const[n,r]=u.useState(e);return e&&!n&&r(!0),u.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return $((()=>{c&&!f&&a("unmounted")}),[c,f]),$((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}l(!0),a("close")}}),[n,r]),{isMounted:f,status:s}}function Ht(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}function qt(e,t){const[n,r]=e;let o=!1;const u=t.length;for(let e=0,i=u-1;e<u;i=e++){const[u,c]=t[e]||[0,0],[l,s]=t[i]||[0,0];c>=r!=s>=r&&n<=(l-u)*(r-c)/(s-c)+u&&(o=!o)}return o}Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return n.arrow}}),Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return n.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return n.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return n.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return n.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return n.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return n.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return n.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return n.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return n.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return n.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return n.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return n.size}}),e.Composite=ce,e.CompositeItem=le,e.FloatingArrow=me,e.FloatingDelayGroup=function(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=u.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=u.useRef(null),l=u.useCallback((e=>{i({currentId:e})}),[]);return $((()=>{o.currentId?null===c.current?c.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),c.current=null)}),[o.currentId]),u.createElement(ke.Provider,{value:u.useMemo((()=>({...o,setState:i,setCurrentId:l})),[o,l])},t)},e.FloatingFocusManager=function(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:c=0,returnFocus:l=!0,modal:s=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0}=e,{open:d,refs:v,nodeId:p,onOpenChange:g,events:h,dataRef:w,elements:{domReference:E,floating:I}}=t,k="number"==typeof c&&c<0,O=N(E)&&k,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,T=Ee(o),P=Ee(c),L=Ee(l),D=be(),F=vt(),j=u.useRef(null),K=u.useRef(null),H=u.useRef(!1),q=u.useRef(!1),_=null!=F,B=u.useCallback((function(e){return void 0===e&&(e=I),e?Ue(e,et()):[]}),[I]),W=u.useCallback((e=>{const t=B(e);return T.current.map((e=>E&&"reference"===e?E:I&&"floating"===e?I:t)).filter(Boolean).flat()}),[E,I,T,B]);function U(e){return!r&&a&&s?u.createElement(yt,{ref:"start"===e?j:K,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof a?a:"Dismiss"):null}u.useEffect((()=>{if(r||!s)return;function e(e){if("Tab"===e.key){b(I,y(M(I)))&&0===B().length&&!O&&A(e);const t=W(),n=S(e);"reference"===T.current[0]&&n===E&&(A(e),e.shiftKey?Z(t[t.length-1]):Z(t[1])),"floating"===T.current[1]&&n===I&&e.shiftKey&&(A(e),Z(t[0]))}}const t=M(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,E,I,s,T,O,B,W]),u.useEffect((()=>{if(!r&&f)return I&&m(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!s&&I.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!s&&I.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(b(E,t)||b(I,t)||b(t,I)||b(null==F?void 0:F.portalNode,t)||null!=t&&t.hasAttribute(we("focus-guard"))||D&&(Xe(D.nodesRef.current,p).find((e=>{var n,r;return b(null==(n=e.context)?void 0:n.elements.floating,t)||b(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(D.nodesRef.current,p).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!q.current&&t!==ht()&&(H.current=!0,g(!1,e))}))}}),[r,E,I,s,p,D,F,g,f]),u.useEffect((()=>{var e;if(r)return;const t=Array.from((null==F||null==(e=F.portalNode)?void 0:e.querySelectorAll("["+we("portal")+"]"))||[]);if(I){const e=[I,...t,j.current,K.current,T.current.includes("reference")||O?E:null].filter((e=>null!=e)),n=s||O?Je(e,C,!C):Je(e);return()=>{n()}}}),[r,E,I,s,T,F,O,C]),$((()=>{if(r||!I)return;const e=y(M(I));queueMicrotask((()=>{const t=W(I),n=P.current,r=("number"==typeof n?t[n]:n.current)||I,o=b(I,e);k||o||!d||Z(r,{preventScroll:r===I})}))}),[r,d,I,k,W,P]),$((()=>{if(r||!I)return;let e=!1;const t=M(I),n=y(t);let o=w.current.openEvent;function u(t){let{open:n,reason:r,event:u,nested:i}=t;n&&(o=u),"escape-key"===r&&v.domReference.current&&gt(v.domReference.current),"hover"===r&&"mouseleave"===u.type&&(H.current=!0),"outside-press"===r&&(i?(H.current=!1,e=!0):H.current=!(x(u)||R(u)))}return gt(n),h.on("openchange",u),()=>{h.off("openchange",u);const n=y(t),r=b(I,n)||D&&Xe(D.nodesRef.current,p).some((e=>{var t;return b(null==(t=e.context)?void 0:t.elements.floating,n)}));(r||o&&["click","mousedown"].includes(o.type))&&v.domReference.current&&gt(v.domReference.current);const i=ht();L.current&&!H.current&&m(i)&&(i===n||n===t.body||r)&&Z(i,{cancelPrevious:!1,preventScroll:e})}}),[r,I,L,w,v,h,D,p]),$((()=>{if(!r&&F)return F.setFocusManagerState({modal:s,closeOnFocusOut:f,open:d,onOpenChange:g,refs:v}),()=>{F.setFocusManagerState(null)}}),[r,F,s,d,g,v,f]),$((()=>{if(r||!I||"function"!=typeof MutationObserver||k)return;const e=()=>{const e=I.getAttribute("tabindex");T.current.includes("floating")||y(M(I))!==v.domReference.current&&0===B().length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,I,v,T,B,k]);const z=!r&&C&&(_||s);return u.createElement(u.Fragment,null,z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.beforeInsideRef,onFocus:e=>{if(s){const e=W();Z("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(H.current=!1,ot(e,F.portalNode)){const e=nt()||E;null==e||e.focus()}else{var t;null==(t=F.beforeOutsideRef.current)||t.focus()}}}),!O&&U("start"),n,U("end"),z&&u.createElement(st,{"data-type":"inside",ref:null==F?void 0:F.afterInsideRef,onFocus:e=>{if(s)Z(W()[0]);else if(null!=F&&F.preserveTabOrder&&F.portalNode)if(f&&(H.current=!0),ot(e,F.portalNode)){const e=rt()||E;null==e||e.focus()}else{var t;null==(t=F.afterOutsideRef.current)||t.focus()}}}))},e.FloatingList=ee,e.FloatingNode=function(e){const{children:t,id:n}=e,r=ye();return u.createElement(ge.Provider,{value:u.useMemo((()=>({id:n,parentId:r})),[n,r])},t)},e.FloatingOverlay=wt,e.FloatingPortal=function(e){const{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e,c=dt({id:n,root:o}),[l,s]=u.useState(null),a=u.useRef(null),f=u.useRef(null),d=u.useRef(null),v=u.useRef(null),m=!!l&&!l.modal&&l.open&&i&&!(!o&&!c);return u.useEffect((()=>{if(c&&i&&(null==l||!l.modal))return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&ot(e)){("focusin"===e.type?it:ut)(c)}}}),[c,i,null==l?void 0:l.modal]),u.createElement(at.Provider,{value:u.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:v,portalNode:c,setFocusManagerState:s})),[i,c])},m&&c&&u.createElement(st,{"data-type":"outside",ref:a,onFocus:e=>{if(ot(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=rt()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),m&&c&&u.createElement("span",{"aria-owns":c.id,style:ct}),c&&r.createPortal(t,c),m&&c&&u.createElement(st,{"data-type":"outside",ref:f,onFocus:e=>{if(ot(e,c)){var t;null==(t=v.current)||t.focus()}else{const t=nt()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))},e.FloatingTree=function(e){const{children:t}=e,n=u.useRef([]),r=u.useCallback((e=>{n.current=[...n.current,e]}),[]),o=u.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),i=u.useState((()=>pe()))[0];return u.createElement(he.Provider,{value:u.useMemo((()=>({nodesRef:n,addNode:r,removeNode:o,events:i})),[r,o,i])},t)},e.inner=e=>({name:"inner",options:e,async fn(t){const{listRef:o,overflowRef:u,onFallbackChange:i,offset:c=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=e,{rects:v,elements:{floating:m}}=t,p=o.current[l];if(!p)return{};const g={...t,...await n.offset(-p.offsetTop-m.clientTop-v.reference.height/2-p.offsetHeight/2-c).fn(t)},h=(null==f?void 0:f.current)||m,y=await n.detectOverflow(Ht(g,h.scrollHeight),d),b=await n.detectOverflow(g,{...d,elementContext:"reference"}),w=Math.max(0,y.top),E=g.y+w,x=Math.max(0,h.scrollHeight-w-Math.max(0,y.bottom));return h.style.maxHeight=x+"px",h.scrollTop=w,i&&(h.offsetHeight<p.offsetHeight*Math.min(s,o.current.length-1)-1||b.top>=-a||b.bottom>=-a?r.flushSync((()=>i(!0))):r.flushSync((()=>i(!1)))),u&&(u.current=await n.detectOverflow(Ht({...g,y:E},h.offsetHeight),d)),{y:E}}}),e.safePolygon=function(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,u=!1,i=null,c=null,l=performance.now();const s=e=>{let{x:n,y:s,placement:a,elements:f,onClose:d,nodeId:m,tree:p}=e;return function(e){function g(){clearTimeout(o),d()}if(clearTimeout(o),!f.domReference||!f.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,w=[h,y],E=S(e),x="mouseleave"===e.type,R=b(f.floating,E),I=b(f.domReference,E),k=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],M=n>O.right-O.width/2,T=s>O.bottom-O.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),L=O.width>k.width,A=O.height>k.height,N=(L?k:O).left,D=(L?k:O).right,F=(A?k:O).top,j=(A?k:O).bottom;if(R&&(u=!0,!x))return;if(I&&(u=!1),I&&!x)return void(u=!0);if(x&&v(e.relatedTarget)&&b(f.floating,e.relatedTarget))return;if(p&&Xe(p.nodesRef.current,m).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let K=[];switch(C){case"top":K=[[N,k.top+1],[N,O.bottom-1],[D,O.bottom-1],[D,k.top+1]];break;case"bottom":K=[[N,O.top+1],[N,k.bottom-1],[D,k.bottom-1],[D,O.top+1]];break;case"left":K=[[O.right-1,j],[O.right-1,F],[k.left+1,F],[k.left+1,j]];break;case"right":K=[[k.right-1,j],[k.right-1,F],[O.left+1,F],[O.left+1,j]]}if(!qt([h,y],K)){if(u&&!P)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===c||0===r)return i=e,c=t,l=n,null;const o=e-i,u=t-c,s=Math.sqrt(o*o+u*u);return i=e,c=t,l=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}qt([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:M?n+4*t:n-4*t,r+t+1],[L?n-t/2:M?n+4*t:n-4*t,r+t+1],...[[O.left,M||L?O.bottom-t:O.top],[O.right,M?L?O.bottom-t:O.top:O.bottom-t]]];case"bottom":return[[L?n+t/2:M?n+4*t:n-4*t,r-t],[L?n-t/2:M?n+4*t:n-4*t,r-t],...[[O.left,M||L?O.top+t:O.bottom],[O.right,M?L?O.top+t:O.bottom:O.top+t]]];case"left":{const e=[n+t+1,A?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,A?r-t/2:T?r+4*t:r-4*t];return[...[[T||A?O.right-t:O.left,O.top],[T?A?O.right-t:O.left:O.right-t,O.bottom]],e,o]}case"right":return[[n-t,A?r+t/2:T?r+4*t:r-4*t],[n-t,A?r-t/2:T?r+4*t:r-4*t],...[[T||A?O.left+t:O.right,O.top],[T?A?O.left+t:O.right:O.left+t,O.bottom]]]}}([n,s]))?!u&&r&&(o=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s},e.useClick=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:l="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0}=t,d=u.useRef(),v=u.useRef(!1);return u.useMemo((()=>c?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0===e.button&&(C(d.current,!0)&&a||"click"!==l&&(!n||!s||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){"mousedown"===l&&d.current?d.current=void 0:C(d.current,!0)&&a||(!n||!s||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!f||Et(e)||(" "!==e.key||xt(i)||(e.preventDefault(),v.current=!0),"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||Et(e)||xt(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!s,e.nativeEvent,"click"))}}}:{}),[c,o,l,a,f,i,s,n,r])},e.useClientPoint=function(e,t){void 0===t&&(t={});const{open:n,refs:r,dataRef:o,elements:{floating:i}}=e,{enabled:c=!0,axis:l="both",x:a=null,y:d=null}=t,v=u.useRef(!1),m=u.useRef(null),[p,g]=u.useState(),[h,y]=u.useState([]),w=s(((e,t)=>{v.current||o.current.openEvent&&!Rt(o.current.openEvent)||r.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var u,i;const c=(null==(u=e.current)?void 0:u.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,a=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let f=c.width,d=c.height,v=c.x,m=c.y;return null==n&&t.x&&l&&(n=c.x-t.x),null==r&&t.y&&s&&(r=c.y-t.y),v-=n||0,m-=r||0,f=0,d=0,!o||a?(f="y"===t.axis?c.width:0,d="x"===t.axis?c.height:0,v=l&&null!=t.x?t.x:v,m=s&&null!=t.y?t.y:m):o&&!a&&(d="x"===t.axis?c.height:d,f="y"===t.axis?c.width:f),o=!0,{width:f,height:d,x:v,y:m,top:m,right:v+f,bottom:m+d,left:v}}}}(r.domReference,{x:e,y:t,axis:l,dataRef:o,pointerType:p}))})),E=s((e=>{null==a&&null==d&&(n?m.current||y([]):w(e.clientX,e.clientY))})),x=C(p)?i:n,R=u.useCallback((()=>{if(!x||!c||null!=a||null!=d)return;const e=f(r.floating.current);function t(n){const o=S(n);b(r.floating.current,o)?(e.removeEventListener("mousemove",t),m.current=null):w(n.clientX,n.clientY)}if(!o.current.openEvent||Rt(o.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),m.current=null};return m.current=n,n}r.setPositionReference(r.domReference.current)}),[o,c,x,r,w,a,d]);return u.useEffect((()=>R()),[R,h]),u.useEffect((()=>{c&&!i&&(v.current=!1)}),[c,i]),u.useEffect((()=>{!c&&n&&(v.current=!0)}),[c,n]),$((()=>{!c||null==a&&null==d||(v.current=!1,w(a,d))}),[c,a,d,w]),u.useMemo((()=>{if(!c)return{};function e(e){let{pointerType:t}=e;g(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:E,onMouseEnter:E}}}),[c,E])},e.useDelayGroup=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:u}=t,i=null!=u?u:o,c=Oe(),{currentId:l,setCurrentId:s,initialDelay:a,setState:f,timeoutMs:d}=c;return $((()=>{l&&(f({delay:{open:1,close:Re(a,"close")}}),l!==i&&r(!1))}),[i,r,f,l,a]),$((()=>{function e(){r(!1),f({delay:a,currentId:null})}if(l&&!n&&l===i){if(d){const t=window.setTimeout(e,d);return()=>{clearTimeout(t)}}e()}}),[n,f,l,i,r,a,d]),$((()=>{s!==Ie&&n&&s(i)}),[n,s,i]),c},e.useDelayGroupContext=Oe,e.useDismiss=function(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,nodeId:i,elements:{reference:c,domReference:l,floating:a},dataRef:d}=e,{enabled:p=!0,escapeKey:y=!0,outsidePress:w=!0,outsidePressEvent:E="pointerdown",referencePress:x=!1,referencePressEvent:R="pointerdown",ancestorScroll:I=!1,bubbles:k,capture:O}=t,C=be(),P=s("function"==typeof w?w:()=>!1),L="function"==typeof w?P:w,A=u.useRef(!1),N=u.useRef(!1),{escapeKey:D,outsidePress:F}=Ot(k),{escapeKey:j,outsidePress:K}=Ot(O),H=s((e=>{if(!r||!p||!y||"Escape"!==e.key)return;const t=C?Xe(C.nodesRef.current,i):[];if(!D&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),q=s((e=>{var t;const n=()=>{var t;H(e),null==(t=S(e))||t.removeEventListener("keydown",n)};null==(t=S(e))||t.addEventListener("keydown",n)})),_=s((e=>{const t=A.current;A.current=!1;const n=N.current;if(N.current=!1,"click"===E&&n)return;if(t)return;if("function"==typeof L&&!L(e))return;const r=S(e),u="["+we("inert")+"]",c=M(a).querySelectorAll(u);let s=v(r)?r:null;for(;s&&!g(s);){const e=h(s);if(g(e)||!v(e))break;s=e}if(c.length&&v(r)&&!r.matches("html,body")&&!b(r,a)&&Array.from(c).every((e=>!b(s,e))))return;if(m(r)&&a){const t=r.clientWidth>0&&r.scrollWidth>r.clientWidth,n=r.clientHeight>0&&r.scrollHeight>r.clientHeight;let o=n&&e.offsetX>r.clientWidth;if(n){const t="rtl"===function(e){return f(e).getComputedStyle(e)}(r).direction;t&&(o=e.offsetX<=r.offsetWidth-r.clientWidth)}if(o||t&&e.offsetY>r.clientHeight)return}const d=C&&Xe(C.nodesRef.current,i).some((t=>{var n;return T(e,null==(n=t.context)?void 0:n.elements.floating)}));if(T(e,a)||T(e,l)||d)return;const p=C?Xe(C.nodesRef.current,i):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),B=s((e=>{var t;const n=()=>{var t;_(e),null==(t=S(e))||t.removeEventListener(E,n)};null==(t=S(e))||t.addEventListener(E,n)}));return u.useEffect((()=>{if(!r||!p)return;function e(e){o(!1,e,"ancestor-scroll")}d.current.__escapeKeyBubbles=D,d.current.__outsidePressBubbles=F;const t=M(a);y&&t.addEventListener("keydown",j?q:H,j),L&&t.addEventListener(E,K?B:_,K);let u=[];return I&&(v(l)&&(u=n.getOverflowAncestors(l)),v(a)&&(u=u.concat(n.getOverflowAncestors(a))),!v(c)&&c&&c.contextElement&&(u=u.concat(n.getOverflowAncestors(c.contextElement)))),u=u.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),u.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{y&&t.removeEventListener("keydown",j?q:H,j),L&&t.removeEventListener(E,K?B:_,K),u.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[d,a,l,c,y,L,E,r,o,I,p,D,F,H,j,q,_,K,B]),u.useEffect((()=>{A.current=!1}),[L,E]),u.useMemo((()=>p?{reference:{onKeyDown:H,[It[R]]:e=>{x&&o(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:H,onMouseDown(){N.current=!0},onMouseUp(){N.current=!0},[kt[E]]:()=>{A.current=!0}}}:{}),[p,x,E,R,o,H])},e.useFloating=function(e){var t;void 0===e&&(e={});const{open:r=!1,onOpenChange:o,nodeId:i}=e,[c,l]=u.useState(null),[a,f]=u.useState(null),d=(null==(t=e.elements)?void 0:t.reference)||c;$((()=>{d&&(y.current=d)}),[d]);const m=n.useFloating({...e,elements:{...e.elements,...a&&{reference:a}}}),p=be(),g=null!=ye(),h=s(((e,t,n)=>{b.current.openEvent=e?t:void 0,w.emit("openchange",{open:e,event:t,reason:n,nested:g}),null==o||o(e,t,n)})),y=u.useRef(null),b=u.useRef({}),w=u.useState((()=>pe()))[0],E=ve(),x=u.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),m.refs.setReference(t)}),[m.refs]),R=u.useCallback((e=>{(v(e)||null===e)&&(y.current=e,l(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),I=u.useMemo((()=>({...m.refs,setReference:R,setPositionReference:x,domReference:y})),[m.refs,R,x]),k=u.useMemo((()=>({...m.elements,domReference:d})),[m.elements,d]),O=u.useMemo((()=>({...m,refs:I,elements:k,dataRef:b,nodeId:i,floatingId:E,events:w,open:r,onOpenChange:h})),[m,i,E,w,r,h,I,k]);return $((()=>{const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),u.useMemo((()=>({...m,context:O,refs:I,elements:k})),[m,I,k,O])},e.useFloatingNodeId=function(e){const t=ve(),n=be(),r=ye(),o=e||r;return $((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t},e.useFloatingParentNodeId=ye,e.useFloatingPortalNode=dt,e.useFloatingTree=be,e.useFocus=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:c}}=e,{enabled:l=!0,visibleOnly:s=!0}=t,a=u.useRef(!1),d=u.useRef(),p=u.useRef(!0);return u.useEffect((()=>{if(!l)return;const e=f(c);function t(){!n&&m(c)&&c===y(M(c))&&(a.current=!0)}function r(){p.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[c,n,l]),u.useEffect((()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}}),[o,l]),u.useEffect((()=>()=>{clearTimeout(d.current)}),[]),u.useMemo((()=>l?{reference:{onPointerDown(e){R(e.nativeEvent)||(p.current=!1)},onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=S(e.nativeEvent);if(s&&v(t))try{if(I()&&O())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!p.current&&!L(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=v(t)&&t.hasAttribute(we("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{const o=y(c?c.ownerDocument:document);(t||o!==c)&&(b(i.floating.current,o)||b(c,o)||n||r(!1,e.nativeEvent,"focus"))}))}}}:{}),[l,s,c,i,r])},e.useHover=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:c,floating:l},refs:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:m=!1,restMs:p=0,move:g=!0}=t,h=be(),y=ye(),w=Ee(d),E=Ee(f),x=u.useRef(),R=u.useRef(-1),I=u.useRef(),k=u.useRef(-1),O=u.useRef(!0),T=u.useRef(!1),S=u.useRef((()=>{})),P=u.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);u.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(R.current),clearTimeout(k.current),O.current=!0)}}),[a,i]),u.useEffect((()=>{if(!a||!w.current||!n)return;function e(e){P()&&r(!1,e,"hover")}const t=M(l).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l,n,r,a,w,P]);const L=u.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Re(E.current,"close",x.current);o&&!I.current?(clearTimeout(R.current),R.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(R.current),r(!1,e,n))}),[E,r]),A=u.useCallback((()=>{S.current(),I.current=void 0}),[]),N=u.useCallback((()=>{if(T.current){const e=M(s.floating.current).body;e.style.pointerEvents="",e.removeAttribute(xe),T.current=!1}}),[s]);return u.useEffect((()=>{if(a&&v(c)){const e=c;return n&&e.addEventListener("mouseleave",s),null==l||l.addEventListener("mouseleave",s),g&&e.addEventListener("mousemove",u,{once:!0}),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",i),()=>{n&&e.removeEventListener("mouseleave",s),null==l||l.removeEventListener("mouseleave",s),g&&e.removeEventListener("mousemove",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",i)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function u(e){if(clearTimeout(R.current),O.current=!1,m&&!C(x.current)||p>0&&!Re(E.current,"open"))return;const t=Re(E.current,"open",x.current);t?R.current=window.setTimeout((()=>{r(!0,e,"hover")}),t):r(!0,e,"hover")}function i(r){if(t())return;S.current();const o=M(l);if(clearTimeout(k.current),w.current){n||clearTimeout(R.current),I.current=w.current({...e,tree:h,x:r.clientX,y:r.clientY,onClose(){N(),A(),L(r,!0,"safe-polygon")}});const t=I.current;return o.addEventListener("mousemove",t),void(S.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==x.current||!b(l,r.relatedTarget))&&L(r)}function s(n){t()||null==w.current||w.current({...e,tree:h,x:n.clientX,y:n.clientY,onClose(){N(),A(),L(n)}})(n)}}),[c,l,a,e,m,p,g,L,A,N,r,n,h,E,w,o]),$((()=>{var e;if(a&&n&&null!=(e=w.current)&&e.__options.blockPointerEvents&&P()){const e=M(l).body;if(e.setAttribute(xe,""),e.style.pointerEvents="none",T.current=!0,v(c)&&l){var t;const e=c,n=null==h||null==(t=h.nodesRef.current.find((e=>e.id===y)))||null==(t=t.context)?void 0:t.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{e.style.pointerEvents="",l.style.pointerEvents=""}}}}),[a,n,y,l,c,h,w,P]),$((()=>{n||(x.current=void 0,A(),N())}),[n,A,N]),u.useEffect((()=>()=>{A(),clearTimeout(R.current),clearTimeout(k.current),N()}),[a,c,A,N]),u.useMemo((()=>{if(!a)return{};function e(e){x.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){function t(){O.current||r(!0,e.nativeEvent,"hover")}m&&!C(x.current)||n||0===p||(clearTimeout(k.current),"touch"===x.current?t():k.current=window.setTimeout(t,p))}},floating:{onMouseEnter(){clearTimeout(R.current)},onMouseLeave(e){L(e.nativeEvent,!1)}}}}),[a,m,n,p,r,L])},e.useId=ve,e.useInnerOffset=function(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:a}=t,f=s(a),d=u.useRef(!1),v=u.useRef(null),m=u.useRef(null);return u.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;const n=e.deltaY,o=c.current.top>=-.5,u=c.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!o&&n>0||!u&&n<0?(e.preventDefault(),r.flushSync((()=>{f((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(E())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=t.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,c,l,f]),u.useMemo((()=>i?{floating:{onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(c.current&&e&&d.current){if(null!==v.current){const t=e.scrollTop-v.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&r.flushSync((()=>f((e=>e+t))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}}}:{}),[i,c,o.floating,l,f])},e.useInteractions=function(e){void 0===e&&(e=[]);const t=e,n=u.useCallback((t=>Tt(t,e,"reference")),t),r=u.useCallback((t=>Tt(t,e,"floating")),t),o=u.useCallback((t=>Tt(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return u.useMemo((()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o})),[n,r,o])},e.useListItem=te,e.useListNavigation=function(e,t){const{open:n,onOpenChange:r,refs:o,elements:{domReference:i,floating:c}}=e,{listRef:l,activeIndex:a,onNavigate:f=(()=>{}),enabled:d=!0,selectedIndex:v=null,allowEscape:p=!1,loop:g=!1,nested:h=!1,rtl:w=!1,virtual:E=!1,focusItemOnOpen:k="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:T=!0,disabledIndices:S,orientation:P="vertical",cols:L=1,scrollItemIntoView:D=!0,virtualItemRef:F,itemSizes:q,dense:G=!1}=t,Q=ye(),J=be(),ee=s(f),te=u.useRef(k),ne=u.useRef(null!=v?v:-1),re=u.useRef(null),oe=u.useRef(!0),ue=u.useRef(ee),ie=u.useRef(!!c),ce=u.useRef(!1),le=u.useRef(!1),se=Ee(S),ae=Ee(n),fe=Ee(D),[de,ve]=u.useState(),[me,pe]=u.useState(),ge=s((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(E?(ve(r.id),null==J||J.events.emit("virtualfocus",r),F&&(F.current=r)):Z(r,{preventScroll:!0,sync:!(!O()||!I())&&(St||ce.current)}),requestAnimationFrame((()=>{const e=fe.current;e&&r&&(n||!oe.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));$((()=>{document.createElement("div").focus({get preventScroll(){return St=!0,!1}})}),[]),$((()=>{d&&(n&&c?te.current&&null!=v&&(le.current=!0,ne.current=v,ee(v)):ie.current&&(ne.current=-1,ue.current(null)))}),[d,n,c,v,ee]),$((()=>{if(d&&n&&c)if(null==a){if(ce.current=!1,null!=v)return;if(ie.current&&(ne.current=-1,ge(l,ne)),!ie.current&&te.current&&(null!=re.current||!0===te.current&&null==re.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else ne.current=null==re.current||At(re.current,P,w)||h?B(l,se.current):W(l,se.current),re.current=null,ee(ne.current)};t()}}else _(l,a)||(ne.current=a,ge(l,ne,le.current),le.current=!1)}),[d,n,c,a,v,h,l,P,w,ee,ge,se]),$((()=>{var e;if(!d||c||!J||E||!ie.current)return;const t=J.nodesRef.current,n=null==(e=t.find((e=>e.id===Q)))||null==(e=e.context)?void 0:e.elements.floating,r=y(M(c)),o=t.some((e=>e.context&&b(e.context.elements.floating,r)));n&&!o&&oe.current&&n.focus({preventScroll:!0})}),[d,c,J,Q,E]),$((()=>{if(d&&J&&E&&!Q)return J.events.on("virtualfocus",e),()=>{J.events.off("virtualfocus",e)};function e(e){pe(e.id),F&&(F.current=e)}}),[d,J,E,Q,F]),$((()=>{ue.current=ee,ie.current=!!c})),$((()=>{n||(re.current=null)}),[n]);const he=null!=a,we=u.useMemo((()=>{function e(e){if(!n)return;const t=l.current.indexOf(e);-1!==t&&ee(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...C&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;oe.current&&"touch"!==t&&(ne.current=-1,ge(l,ne),ee(null),E||Z(o.floating.current,{preventScroll:!0}))}}}}),[n,o,ge,C,l,ee,E]);return u.useMemo((()=>{if(!d)return{};const e=se.current;function t(t){if(oe.current=!1,ce.current=!0,!ae.current&&t.currentTarget===o.floating.current)return;if(h&&Nt(t.key,P,w))return A(t),r(!1,t.nativeEvent,"list-navigation"),void(m(i)&&!E&&i.focus());const u=ne.current,c=B(l,e),s=W(l,e);if("Home"===t.key&&(A(t),ne.current=c,ee(ne.current)),"End"===t.key&&(A(t),ne.current=s,ee(ne.current)),L>1){const n=q||Array.from({length:l.current.length},(()=>({width:1,height:1}))),r=X(n,L,G),o=r.findIndex((t=>null!=t&&!(null!=e&&e.includes(t)))),u=r.reduce(((t,n,r)=>null==n||null!=e&&e.includes(n)?t:r),-1);if(ne.current=r[z({current:r.map((e=>null!=e?l.current[e]:null))},{event:t,orientation:P,loop:g,cols:L,disabledIndices:V([...e||[],void 0],r),minIndex:o,maxIndex:u,prevIndex:Y(ne.current,n,r,L,t.key===j?"bl":t.key===H?"tr":"tl"),stopEvent:!0})],ee(ne.current),"both"===P)return}if(Lt(t.key,P)){if(A(t),n&&!E&&y(t.currentTarget.ownerDocument)===t.currentTarget)return ne.current=At(t.key,P,w)?c:s,void ee(ne.current);At(t.key,P,w)?ne.current=g?u>=s?p&&u!==l.current.length?-1:c:U(l,{startingIndex:u,disabledIndices:e}):Math.min(s,U(l,{startingIndex:u,disabledIndices:e})):ne.current=g?u<=c?p&&-1!==u?l.current.length:s:U(l,{startingIndex:u,decrement:!0,disabledIndices:e}):Math.max(c,U(l,{startingIndex:u,decrement:!0,disabledIndices:e})),_(l,ne.current)?ee(null):ee(ne.current)}}function u(e){"auto"===k&&x(e.nativeEvent)&&(te.current=!0)}const c=E&&n&&he&&{"aria-activedescendant":me||de},s=l.current.find((e=>(null==e?void 0:e.id)===de));return{reference:{...c,onKeyDown(o){oe.current=!1;const u=0===o.key.indexOf("Arrow"),i=function(e,t,n){return Pt(t,n?e===K:e===H,e===j)}(o.key,P,w),c=Nt(o.key,P,w),a=Lt(o.key,P),f=(h?i:a)||"Enter"===o.key||""===o.key.trim();if(E&&n){const e=null==J?void 0:J.nodesRef.current.find((e=>null==e.parentId)),n=J&&e?function(e,t){let n,r=-1;return function t(o,u){u>r&&(n=o,r=u),Xe(e,o).forEach((e=>{t(e.id,u+1)}))}(t,0),e.find((e=>e.id===n))}(J.nodesRef.current,e.id):null;if(u&&n&&F){const e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(i||c){var d,m;const t=(null==(d=n.context)?void 0:d.elements.domReference)===o.currentTarget,r=c&&!t?null==(m=n.context)?void 0:m.elements.domReference:i?s:null;r&&(A(o),r.dispatchEvent(e),pe(void 0))}var p;if(a&&n.context)if(n.context.open&&n.parentId&&o.currentTarget!==n.context.elements.domReference)return A(o),void(null==(p=n.context.elements.domReference)||p.dispatchEvent(e))}return t(o)}(n||T||!u)&&(f&&(re.current=h&&a?null:o.key),h?i&&(A(o),n?(ne.current=B(l,e),ee(ne.current)):r(!0,o.nativeEvent,"list-navigation")):a&&(null!=v&&(ne.current=v),A(o),!n&&T?r(!0,o.nativeEvent,"list-navigation"):t(o),n&&ee(ne.current)))},onFocus(){n&&ee(null)},onPointerDown:function(e){te.current=k,"auto"===k&&R(e.nativeEvent)&&(te.current=!0)},onMouseDown:u,onClick:u},floating:{"aria-orientation":"both"===P?void 0:P,...!N(i)&&c,onKeyDown:t,onPointerMove(){oe.current=!0}},item:we}}),[i,o,de,me,se,ae,l,d,P,w,E,n,he,h,v,T,p,L,g,k,ee,r,we,J,F,q,G])},e.useMergeRefs=i,e.useRole=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:c="dialog"}=t,l=null!=(n=Dt.get(c))?n:c,s=ve(),a=null!=ye();return u.useMemo((()=>{if(!i)return{};const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===c?{reference:{["aria-"+("label"===c?"labelledby":"describedby")]:r?o:void 0},floating:e}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===l&&{"aria-labelledby":s}},item(e){let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}}}),[i,c,l,r,o,s,a])},e.useTransitionStatus=Kt,e.useTransitionStyles=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:c=250}=t,l=e.placement,s=l.split("-")[0],a=u.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,v=(f?c:c.close)||0,[m,p]=u.useState((()=>({...jt(i,a),...jt(n,a)}))),{isMounted:g,status:h}=Kt(e,{duration:c}),y=Ee(n),b=Ee(r),w=Ee(o),E=Ee(i);return $((()=>{const e=jt(y.current,a),t=jt(w.current,a),n=jt(E.current,a),r=jt(b.current,a)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===h&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(Ft).join(","),transitionDuration:d+"ms",...n,...r}),"close"===h){const r=t||e;p({transitionProperty:Object.keys(r).map(Ft).join(","),transitionDuration:v+"ms",...n,...r})}}),[v,w,y,b,E,d,h,a]),{isMounted:g,styles:m}},e.useTypeahead=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],selectedIndex:p=null}=t,g=u.useRef(),h=u.useRef(""),y=u.useRef(null!=(n=null!=p?p:c)?n:-1),b=u.useRef(null),w=s(l),E=s(a),x=Ee(d),R=Ee(m);return $((()=>{r&&(clearTimeout(g.current),b.current=null,h.current="")}),[r]),$((()=>{var e;r&&""===h.current&&(y.current=null!=(e=null!=p?p:c)?e:-1)}),[r,p,c]),u.useMemo((()=>{if(!f)return{};function e(e){e?o.current.typing||(o.current.typing=e,E(e)):o.current.typing&&(o.current.typing=e,E(e))}function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const o=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(o,o,h.current)?e(!1):" "===n.key&&A(n)),null==o||R.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;r&&" "!==n.key&&(A(n),e(!0));o.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&h.current===n.key&&(h.current="",y.current=b.current),h.current+=n.key,clearTimeout(g.current),g.current=setTimeout((()=>{h.current="",y.current=b.current,e(!1)}),v);const u=y.current,c=t(o,[...o.slice((u||0)+1),...o.slice(0,(u||0)+1)],h.current);-1!==c?(w(c),b.current=c):" "!==n.key&&(h.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[f,r,o,i,v,R,x,w,E])}}));

@@ -1,2 +0,2 @@

import type * as React_2 from 'react';
import type * as React from 'react';

@@ -25,3 +25,3 @@ export declare function activeElement(doc: Document): Element | null;

export declare function isReactEvent(event: any): event is React_2.SyntheticEvent;
export declare function isReactEvent(event: any): event is React.SyntheticEvent;

@@ -40,3 +40,3 @@ export declare function isRootElement(element: Element): boolean;

export declare function stopEvent(event: Event | React_2.SyntheticEvent): void;
export declare function stopEvent(event: Event | React.SyntheticEvent): void;

@@ -43,0 +43,0 @@ export declare const TYPEABLE_SELECTOR: string;

{
"name": "@floating-ui/react",
"version": "0.26.12",
"version": "0.26.13",
"description": "Floating UI for React",

@@ -5,0 +5,0 @@ "publishConfig": {

@@ -1,2 +0,2 @@

import type * as React_2 from 'react';
import type * as React from 'react';

@@ -25,3 +25,3 @@ export declare function activeElement(doc: Document): Element | null;

export declare function isReactEvent(event: any): event is React_2.SyntheticEvent;
export declare function isReactEvent(event: any): event is React.SyntheticEvent;

@@ -40,3 +40,3 @@ export declare function isRootElement(element: Element): boolean;

export declare function stopEvent(event: Event | React_2.SyntheticEvent): void;
export declare function stopEvent(event: Event | React.SyntheticEvent): void;

@@ -43,0 +43,0 @@ export declare const TYPEABLE_SELECTOR: string;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc