"use client"; import { require_jsx_runtime } from "./chunk-6PXSGDAH.js"; import { require_react_dom } from "./chunk-NXESFFTV.js"; import { require_react } from "./chunk-DRWLMN53.js"; import { __toESM } from "./chunk-G3PMV62Z.js"; // node_modules/@radix-ui/react-tabs/dist/index.mjs var React13 = __toESM(require_react(), 1); // node_modules/@radix-ui/primitive/dist/index.mjs function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler == null ? void 0 : originalEventHandler(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) { return ourEventHandler == null ? void 0 : ourEventHandler(event); } }; } // node_modules/@radix-ui/react-context/dist/index.mjs var React = __toESM(require_react(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function createContextScope(scopeName, createContextScopeDeps = []) { let defaultContexts = []; function createContext3(rootComponentName, defaultContext) { const BaseContext = React.createContext(defaultContext); const index = defaultContexts.length; defaultContexts = [...defaultContexts, defaultContext]; const Provider = (props) => { var _a; const { scope, children, ...context } = props; const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext; const value = React.useMemo(() => context, Object.values(context)); return (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); }; Provider.displayName = rootComponentName + "Provider"; function useContext22(consumerName, scope) { var _a; const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext; const context = React.useContext(Context); if (context) return context; if (defaultContext !== void 0) return defaultContext; throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } return [Provider, useContext22]; } const createScope = () => { const scopeContexts = defaultContexts.map((defaultContext) => { return React.createContext(defaultContext); }); return function useScope(scope) { const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts; return React.useMemo( () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts] ); }; }; createScope.scopeName = scopeName; return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; } function composeContextScopes(...scopes) { const baseScope = scopes[0]; if (scopes.length === 1) return baseScope; const createScope = () => { const scopeHooks = scopes.map((createScope2) => ({ useScope: createScope2(), scopeName: createScope2.scopeName })); return function useComposedScopes(overrideScopes) { const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { const scopeProps = useScope(overrideScopes); const currentScope = scopeProps[`__scope${scopeName}`]; return { ...nextScopes2, ...currentScope }; }, {}); return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); }; }; createScope.scopeName = baseScope.scopeName; return createScope; } // node_modules/@radix-ui/react-roving-focus/dist/index.mjs var React11 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-collection/dist/index.mjs var import_react = __toESM(require_react(), 1); // node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React2 = __toESM(require_react(), 1); function setRef(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef(refs[i], null); } } }; } }; } function useComposedRefs(...refs) { return React2.useCallback(composeRefs(...refs), refs); } // node_modules/@radix-ui/react-slot/dist/index.mjs var React3 = __toESM(require_react(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var Slot = React3.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React3.Children.toArray(children); const slottable = childrenArray.find(isSlottable); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React3.Children.count(newElement) > 1) return React3.Children.only(null); return React3.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null }); } return (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot.displayName = "Slot"; var SlotClone = React3.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React3.isValidElement(children)) { const childrenRef = getElementRef(children); const props2 = mergeProps(slotProps, children.props); if (children.type !== React3.Fragment) { props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; } return React3.cloneElement(children, props2); } return React3.Children.count(children) > 1 ? React3.Children.only(null) : null; }); SlotClone.displayName = "SlotClone"; var Slottable = ({ children }) => { return (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children }); }; function isSlottable(child) { return React3.isValidElement(child) && child.type === Slottable; } function mergeProps(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { childPropValue(...args); slotPropValue(...args); }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef(element) { var _a, _b; let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-collection/dist/index.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); function createCollection(name) { const PROVIDER_NAME = name + "CollectionProvider"; const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME); const [CollectionProviderImpl, useCollectionContext] = createCollectionContext( PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() } ); const CollectionProvider = (props) => { const { scope, children } = props; const ref = import_react.default.useRef(null); const itemMap = import_react.default.useRef(/* @__PURE__ */ new Map()).current; return (0, import_jsx_runtime3.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children }); }; CollectionProvider.displayName = PROVIDER_NAME; const COLLECTION_SLOT_NAME = name + "CollectionSlot"; const CollectionSlot = import_react.default.forwardRef( (props, forwardedRef) => { const { scope, children } = props; const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); const composedRefs = useComposedRefs(forwardedRef, context.collectionRef); return (0, import_jsx_runtime3.jsx)(Slot, { ref: composedRefs, children }); } ); CollectionSlot.displayName = COLLECTION_SLOT_NAME; const ITEM_SLOT_NAME = name + "CollectionItemSlot"; const ITEM_DATA_ATTR = "data-radix-collection-item"; const CollectionItemSlot = import_react.default.forwardRef( (props, forwardedRef) => { const { scope, children, ...itemData } = props; const ref = import_react.default.useRef(null); const composedRefs = useComposedRefs(forwardedRef, ref); const context = useCollectionContext(ITEM_SLOT_NAME, scope); import_react.default.useEffect(() => { context.itemMap.set(ref, { ref, ...itemData }); return () => void context.itemMap.delete(ref); }); return (0, import_jsx_runtime3.jsx)(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children }); } ); CollectionItemSlot.displayName = ITEM_SLOT_NAME; function useCollection2(scope) { const context = useCollectionContext(name + "CollectionConsumer", scope); const getItems = import_react.default.useCallback(() => { const collectionNode = context.collectionRef.current; if (!collectionNode) return []; const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); const items = Array.from(context.itemMap.values()); const orderedItems = items.sort( (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current) ); return orderedItems; }, [context.collectionRef, context.itemMap]); return getItems; } return [ { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot }, useCollection2, createCollectionScope2 ]; } // node_modules/@radix-ui/react-id/dist/index.mjs var React6 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs var React5 = __toESM(require_react(), 1); var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React5.useLayoutEffect : () => { }; // node_modules/@radix-ui/react-id/dist/index.mjs var useReactId = React6["useId".toString()] || (() => void 0); var count = 0; function useId(deterministicId) { const [id, setId] = React6.useState(useReactId()); useLayoutEffect2(() => { if (!deterministicId) setId((reactId) => reactId ?? String(count++)); }, [deterministicId]); return deterministicId || (id ? `radix-${id}` : ""); } // node_modules/@radix-ui/react-primitive/dist/index.mjs var React7 = __toESM(require_react(), 1); var ReactDOM = __toESM(require_react_dom(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var NODES = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul" ]; var Primitive = NODES.reduce((primitive, node) => { const Node = React7.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot : node; if (typeof window !== "undefined") { window[Symbol.for("radix-ui")] = true; } return (0, import_jsx_runtime4.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node }; }, {}); // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs var React8 = __toESM(require_react(), 1); function useCallbackRef(callback) { const callbackRef = React8.useRef(callback); React8.useEffect(() => { callbackRef.current = callback; }); return React8.useMemo(() => (...args) => { var _a; return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args); }, []); } // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs var React9 = __toESM(require_react(), 1); function useControllableState({ prop, defaultProp, onChange = () => { } }) { const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange }); const isControlled = prop !== void 0; const value = isControlled ? prop : uncontrolledProp; const handleChange = useCallbackRef(onChange); const setValue = React9.useCallback( (nextValue) => { if (isControlled) { const setter = nextValue; const value2 = typeof nextValue === "function" ? setter(prop) : nextValue; if (value2 !== prop) handleChange(value2); } else { setUncontrolledProp(nextValue); } }, [isControlled, prop, setUncontrolledProp, handleChange] ); return [value, setValue]; } function useUncontrolledState({ defaultProp, onChange }) { const uncontrolledState = React9.useState(defaultProp); const [value] = uncontrolledState; const prevValueRef = React9.useRef(value); const handleChange = useCallbackRef(onChange); React9.useEffect(() => { if (prevValueRef.current !== value) { handleChange(value); prevValueRef.current = value; } }, [value, prevValueRef, handleChange]); return uncontrolledState; } // node_modules/@radix-ui/react-direction/dist/index.mjs var React10 = __toESM(require_react(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var DirectionContext = React10.createContext(void 0); function useDirection(localDir) { const globalDir = React10.useContext(DirectionContext); return localDir || globalDir || "ltr"; } // node_modules/@radix-ui/react-roving-focus/dist/index.mjs var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; var EVENT_OPTIONS = { bubbles: false, cancelable: true }; var GROUP_NAME = "RovingFocusGroup"; var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME); var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope( GROUP_NAME, [createCollectionScope] ); var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME); var RovingFocusGroup = React11.forwardRef( (props, forwardedRef) => { return (0, import_jsx_runtime6.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: (0, import_jsx_runtime6.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: (0, import_jsx_runtime6.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) }); } ); RovingFocusGroup.displayName = GROUP_NAME; var RovingFocusGroupImpl = React11.forwardRef((props, forwardedRef) => { const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = props; const ref = React11.useRef(null); const composedRefs = useComposedRefs(forwardedRef, ref); const direction = useDirection(dir); const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({ prop: currentTabStopIdProp, defaultProp: defaultCurrentTabStopId, onChange: onCurrentTabStopIdChange }); const [isTabbingBackOut, setIsTabbingBackOut] = React11.useState(false); const handleEntryFocus = useCallbackRef(onEntryFocus); const getItems = useCollection(__scopeRovingFocusGroup); const isClickFocusRef = React11.useRef(false); const [focusableItemsCount, setFocusableItemsCount] = React11.useState(0); React11.useEffect(() => { const node = ref.current; if (node) { node.addEventListener(ENTRY_FOCUS, handleEntryFocus); return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus); } }, [handleEntryFocus]); return (0, import_jsx_runtime6.jsx)( RovingFocusProvider, { scope: __scopeRovingFocusGroup, orientation, dir: direction, loop, currentTabStopId, onItemFocus: React11.useCallback( (tabStopId) => setCurrentTabStopId(tabStopId), [setCurrentTabStopId] ), onItemShiftTab: React11.useCallback(() => setIsTabbingBackOut(true), []), onFocusableItemAdd: React11.useCallback( () => setFocusableItemsCount((prevCount) => prevCount + 1), [] ), onFocusableItemRemove: React11.useCallback( () => setFocusableItemsCount((prevCount) => prevCount - 1), [] ), children: (0, import_jsx_runtime6.jsx)( Primitive.div, { tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, "data-orientation": orientation, ...groupProps, ref: composedRefs, style: { outline: "none", ...props.style }, onMouseDown: composeEventHandlers(props.onMouseDown, () => { isClickFocusRef.current = true; }), onFocus: composeEventHandlers(props.onFocus, (event) => { const isKeyboardFocus = !isClickFocusRef.current; if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); event.currentTarget.dispatchEvent(entryFocusEvent); if (!entryFocusEvent.defaultPrevented) { const items = getItems().filter((item) => item.focusable); const activeItem = items.find((item) => item.active); const currentItem = items.find((item) => item.id === currentTabStopId); const candidateItems = [activeItem, currentItem, ...items].filter( Boolean ); const candidateNodes = candidateItems.map((item) => item.ref.current); focusFirst(candidateNodes, preventScrollOnEntryFocus); } } isClickFocusRef.current = false; }), onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false)) } ) } ); }); var ITEM_NAME = "RovingFocusGroupItem"; var RovingFocusGroupItem = React11.forwardRef( (props, forwardedRef) => { const { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, ...itemProps } = props; const autoId = useId(); const id = tabStopId || autoId; const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup); const isCurrentTabStop = context.currentTabStopId === id; const getItems = useCollection(__scopeRovingFocusGroup); const { onFocusableItemAdd, onFocusableItemRemove } = context; React11.useEffect(() => { if (focusable) { onFocusableItemAdd(); return () => onFocusableItemRemove(); } }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); return (0, import_jsx_runtime6.jsx)( Collection.ItemSlot, { scope: __scopeRovingFocusGroup, id, focusable, active, children: (0, import_jsx_runtime6.jsx)( Primitive.span, { tabIndex: isCurrentTabStop ? 0 : -1, "data-orientation": context.orientation, ...itemProps, ref: forwardedRef, onMouseDown: composeEventHandlers(props.onMouseDown, (event) => { if (!focusable) event.preventDefault(); else context.onItemFocus(id); }), onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)), onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { if (event.key === "Tab" && event.shiftKey) { context.onItemShiftTab(); return; } if (event.target !== event.currentTarget) return; const focusIntent = getFocusIntent(event, context.orientation, context.dir); if (focusIntent !== void 0) { if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return; event.preventDefault(); const items = getItems().filter((item) => item.focusable); let candidateNodes = items.map((item) => item.ref.current); if (focusIntent === "last") candidateNodes.reverse(); else if (focusIntent === "prev" || focusIntent === "next") { if (focusIntent === "prev") candidateNodes.reverse(); const currentIndex = candidateNodes.indexOf(event.currentTarget); candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); } setTimeout(() => focusFirst(candidateNodes)); } }) } ) } ); } ); RovingFocusGroupItem.displayName = ITEM_NAME; var MAP_KEY_TO_FOCUS_INTENT = { ArrowLeft: "prev", ArrowUp: "prev", ArrowRight: "next", ArrowDown: "next", PageUp: "first", Home: "first", PageDown: "last", End: "last" }; function getDirectionAwareKey(key, dir) { if (dir !== "rtl") return key; return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; } function getFocusIntent(event, orientation, dir) { const key = getDirectionAwareKey(event.key, dir); if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; return MAP_KEY_TO_FOCUS_INTENT[key]; } function focusFirst(candidates, preventScroll = false) { const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; for (const candidate of candidates) { if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; candidate.focus({ preventScroll }); if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; } } function wrapArray(array, startIndex) { return array.map((_, index) => array[(startIndex + index) % array.length]); } var Root = RovingFocusGroup; var Item = RovingFocusGroupItem; // node_modules/@radix-ui/react-presence/dist/index.mjs var React22 = __toESM(require_react(), 1); var React12 = __toESM(require_react(), 1); function useStateMachine(initialState, machine) { return React12.useReducer((state, event) => { const nextState = machine[state][event]; return nextState ?? state; }, initialState); } var Presence = (props) => { const { present, children } = props; const presence = usePresence(present); const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children); const ref = useComposedRefs(presence.ref, getElementRef2(child)); const forceMount = typeof children === "function"; return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null; }; Presence.displayName = "Presence"; function usePresence(present) { const [node, setNode] = React22.useState(); const stylesRef = React22.useRef({}); const prevPresentRef = React22.useRef(present); const prevAnimationNameRef = React22.useRef("none"); const initialState = present ? "mounted" : "unmounted"; const [state, send] = useStateMachine(initialState, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }); React22.useEffect(() => { const currentAnimationName = getAnimationName(stylesRef.current); prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; }, [state]); useLayoutEffect2(() => { const styles = stylesRef.current; const wasPresent = prevPresentRef.current; const hasPresentChanged = wasPresent !== present; if (hasPresentChanged) { const prevAnimationName = prevAnimationNameRef.current; const currentAnimationName = getAnimationName(styles); if (present) { send("MOUNT"); } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") { send("UNMOUNT"); } else { const isAnimating = prevAnimationName !== currentAnimationName; if (wasPresent && isAnimating) { send("ANIMATION_OUT"); } else { send("UNMOUNT"); } } prevPresentRef.current = present; } }, [present, send]); useLayoutEffect2(() => { if (node) { let timeoutId; const ownerWindow = node.ownerDocument.defaultView ?? window; const handleAnimationEnd = (event) => { const currentAnimationName = getAnimationName(stylesRef.current); const isCurrentAnimation = currentAnimationName.includes(event.animationName); if (event.target === node && isCurrentAnimation) { send("ANIMATION_END"); if (!prevPresentRef.current) { const currentFillMode = node.style.animationFillMode; node.style.animationFillMode = "forwards"; timeoutId = ownerWindow.setTimeout(() => { if (node.style.animationFillMode === "forwards") { node.style.animationFillMode = currentFillMode; } }); } } }; const handleAnimationStart = (event) => { if (event.target === node) { prevAnimationNameRef.current = getAnimationName(stylesRef.current); } }; node.addEventListener("animationstart", handleAnimationStart); node.addEventListener("animationcancel", handleAnimationEnd); node.addEventListener("animationend", handleAnimationEnd); return () => { ownerWindow.clearTimeout(timeoutId); node.removeEventListener("animationstart", handleAnimationStart); node.removeEventListener("animationcancel", handleAnimationEnd); node.removeEventListener("animationend", handleAnimationEnd); }; } else { send("ANIMATION_END"); } }, [node, send]); return { isPresent: ["mounted", "unmountSuspended"].includes(state), ref: React22.useCallback((node2) => { if (node2) stylesRef.current = getComputedStyle(node2); setNode(node2); }, []) }; } function getAnimationName(styles) { return (styles == null ? void 0 : styles.animationName) || "none"; } function getElementRef2(element) { var _a, _b; let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-tabs/dist/index.mjs var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var TABS_NAME = "Tabs"; var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [ createRovingFocusGroupScope ]); var useRovingFocusGroupScope = createRovingFocusGroupScope(); var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME); var Tabs = React13.forwardRef( (props, forwardedRef) => { const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props; const direction = useDirection(dir); const [value, setValue] = useControllableState({ prop: valueProp, onChange: onValueChange, defaultProp: defaultValue }); return (0, import_jsx_runtime7.jsx)( TabsProvider, { scope: __scopeTabs, baseId: useId(), value, onValueChange: setValue, orientation, dir: direction, activationMode, children: (0, import_jsx_runtime7.jsx)( Primitive.div, { dir: direction, "data-orientation": orientation, ...tabsProps, ref: forwardedRef } ) } ); } ); Tabs.displayName = TABS_NAME; var TAB_LIST_NAME = "TabsList"; var TabsList = React13.forwardRef( (props, forwardedRef) => { const { __scopeTabs, loop = true, ...listProps } = props; const context = useTabsContext(TAB_LIST_NAME, __scopeTabs); const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs); return (0, import_jsx_runtime7.jsx)( Root, { asChild: true, ...rovingFocusGroupScope, orientation: context.orientation, dir: context.dir, loop, children: (0, import_jsx_runtime7.jsx)( Primitive.div, { role: "tablist", "aria-orientation": context.orientation, ...listProps, ref: forwardedRef } ) } ); } ); TabsList.displayName = TAB_LIST_NAME; var TRIGGER_NAME = "TabsTrigger"; var TabsTrigger = React13.forwardRef( (props, forwardedRef) => { const { __scopeTabs, value, disabled = false, ...triggerProps } = props; const context = useTabsContext(TRIGGER_NAME, __scopeTabs); const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs); const triggerId = makeTriggerId(context.baseId, value); const contentId = makeContentId(context.baseId, value); const isSelected = value === context.value; return (0, import_jsx_runtime7.jsx)( Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, active: isSelected, children: (0, import_jsx_runtime7.jsx)( Primitive.button, { type: "button", role: "tab", "aria-selected": isSelected, "aria-controls": contentId, "data-state": isSelected ? "active" : "inactive", "data-disabled": disabled ? "" : void 0, disabled, id: triggerId, ...triggerProps, ref: forwardedRef, onMouseDown: composeEventHandlers(props.onMouseDown, (event) => { if (!disabled && event.button === 0 && event.ctrlKey === false) { context.onValueChange(value); } else { event.preventDefault(); } }), onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { if ([" ", "Enter"].includes(event.key)) context.onValueChange(value); }), onFocus: composeEventHandlers(props.onFocus, () => { const isAutomaticActivation = context.activationMode !== "manual"; if (!isSelected && !disabled && isAutomaticActivation) { context.onValueChange(value); } }) } ) } ); } ); TabsTrigger.displayName = TRIGGER_NAME; var CONTENT_NAME = "TabsContent"; var TabsContent = React13.forwardRef( (props, forwardedRef) => { const { __scopeTabs, value, forceMount, children, ...contentProps } = props; const context = useTabsContext(CONTENT_NAME, __scopeTabs); const triggerId = makeTriggerId(context.baseId, value); const contentId = makeContentId(context.baseId, value); const isSelected = value === context.value; const isMountAnimationPreventedRef = React13.useRef(isSelected); React13.useEffect(() => { const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false); return () => cancelAnimationFrame(rAF); }, []); return (0, import_jsx_runtime7.jsx)(Presence, { present: forceMount || isSelected, children: ({ present }) => (0, import_jsx_runtime7.jsx)( Primitive.div, { "data-state": isSelected ? "active" : "inactive", "data-orientation": context.orientation, role: "tabpanel", "aria-labelledby": triggerId, hidden: !present, id: contentId, tabIndex: 0, ...contentProps, ref: forwardedRef, style: { ...props.style, animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0 }, children: present && children } ) }); } ); TabsContent.displayName = CONTENT_NAME; function makeTriggerId(baseId, value) { return `${baseId}-trigger-${value}`; } function makeContentId(baseId, value) { return `${baseId}-content-${value}`; } var Root2 = Tabs; var List = TabsList; var Trigger = TabsTrigger; var Content = TabsContent; export { Content, List, Root2 as Root, Tabs, TabsContent, TabsList, TabsTrigger, Trigger, createTabsScope }; //# sourceMappingURL=@radix-ui_react-tabs.js.map