// muse-ui v4.0.0-alpha.1
// © 2024 kjxbyz. All Rights Reserved.
"use client";
function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
function _array_without_holes(arr) {
    if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _iterable_to_array(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = _object_without_properties_loose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceSymbolKeys.length; i++){
            key = sourceSymbolKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
    }
    return target;
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _to_consumable_array(arr) {
    return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
// ../../node_modules/.pnpm/@babel+runtime@7.22.3/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function _extends(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-collapsible@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-collapsible/dist/index.mjs
import { forwardRef as $73KQ4$forwardRef, createElement as $73KQ4$createElement, useCallback as $73KQ4$useCallback, useState as $73KQ4$useState, useRef as $73KQ4$useRef, useEffect as $73KQ4$useEffect } from "react";
// ../../node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler) {
    var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref_checkForDefaultPrevented = _ref.checkForDefaultPrevented, checkForDefaultPrevented = _ref_checkForDefaultPrevented === void 0 ? true : _ref_checkForDefaultPrevented;
    return function handleEvent(event) {
        originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
        if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
    };
}
// ../../node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName) {
    var createContextScopeDeps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var defaultContexts = [];
    function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
        var BaseContext = /* @__PURE__ */ $3bkAK$createContext(defaultContext);
        var index = defaultContexts.length;
        defaultContexts = _to_consumable_array(defaultContexts).concat([
            defaultContext
        ]);
        function Provider(props) {
            var scope = props.scope, children = props.children, context = _object_without_properties(props, [
                "scope",
                "children"
            ]);
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var value = $3bkAK$useMemo(function() {
                return context;
            }, Object.values(context));
            return /* @__PURE__ */ $3bkAK$createElement(Context.Provider, {
                value: value
            }, children);
        }
        function useContext(consumerName, scope) {
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var context = $3bkAK$useContext(Context);
            if (context) return context;
            if (defaultContext !== void 0) return defaultContext;
            throw new Error("`".concat(consumerName, "` must be used within `").concat(rootComponentName, "`"));
        }
        Provider.displayName = rootComponentName + "Provider";
        return [
            Provider,
            useContext
        ];
    }
    var createScope = function() {
        var scopeContexts = defaultContexts.map(function(defaultContext) {
            return /* @__PURE__ */ $3bkAK$createContext(defaultContext);
        });
        return function useScope(scope) {
            var contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
            return $3bkAK$useMemo(function() {
                return _define_property({}, "__scope".concat(scopeName), _object_spread_props(_object_spread({}, scope), _define_property({}, scopeName, contexts)));
            }, [
                scope,
                contexts
            ]);
        };
    };
    createScope.scopeName = scopeName;
    return [
        $c512c27ab02ef895$export$fd42f52fd3ae1109,
        $c512c27ab02ef895$var$composeContextScopes.apply(void 0, [
            createScope
        ].concat(_to_consumable_array(createContextScopeDeps)))
    ];
}
function $c512c27ab02ef895$var$composeContextScopes() {
    for(var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++){
        scopes[_key] = arguments[_key];
    }
    var baseScope = scopes[0];
    if (scopes.length === 1) return baseScope;
    var createScope1 = function() {
        var scopeHooks = scopes.map(function(createScope) {
            return {
                useScope: createScope(),
                scopeName: createScope.scopeName
            };
        });
        return function useComposedScopes(overrideScopes) {
            var nextScopes1 = scopeHooks.reduce(function(nextScopes, param) {
                var useScope = param.useScope, scopeName = param.scopeName;
                var scopeProps = useScope(overrideScopes);
                var currentScope = scopeProps["__scope".concat(scopeName)];
                return _object_spread({}, nextScopes, currentScope);
            }, {});
            return $3bkAK$useMemo(function() {
                return _define_property({}, "__scope".concat(baseScope.scopeName), nextScopes1);
            }, [
                nextScopes1
            ]);
        };
    };
    createScope1.scopeName = baseScope.scopeName;
    return createScope1;
}
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
    var callbackRef = $lwiWj$useRef(callback);
    $lwiWj$useEffect(function() {
        callbackRef.current = callback;
    });
    return $lwiWj$useMemo(function() {
        return function() {
            for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                args[_key] = arguments[_key];
            }
            var _callbackRef$current;
            var _callbackRef$current1;
            return (_callbackRef$current1 = callbackRef.current) === null || _callbackRef$current1 === void 0 ? void 0 : (_callbackRef$current = _callbackRef$current1).call.apply(_callbackRef$current, [
                callbackRef
            ].concat(_to_consumable_array(args)));
        };
    }, []);
}
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
function $71cd76cc60e0454e$export$6f32135080cb4c3(param) {
    var prop = param.prop, defaultProp = param.defaultProp, _param_onChange = param.onChange, onChange = _param_onChange === void 0 ? function() {} : _param_onChange;
    var _$71cd76cc60e0454e$var$useUncontrolledState = _sliced_to_array($71cd76cc60e0454e$var$useUncontrolledState({
        defaultProp: defaultProp,
        onChange: onChange
    }), 2), uncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[0], setUncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[1];
    var isControlled = prop !== void 0;
    var value1 = isControlled ? prop : uncontrolledProp;
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    var setValue = $bnPw9$useCallback(function(nextValue) {
        if (isControlled) {
            var setter = nextValue;
            var value = typeof nextValue === "function" ? setter(prop) : nextValue;
            if (value !== prop) handleChange(value);
        } else setUncontrolledProp(nextValue);
    }, [
        isControlled,
        prop,
        setUncontrolledProp,
        handleChange
    ]);
    return [
        value1,
        setValue
    ];
}
function $71cd76cc60e0454e$var$useUncontrolledState(param) {
    var defaultProp = param.defaultProp, onChange = param.onChange;
    var uncontrolledState = $bnPw9$useState(defaultProp);
    var _uncontrolledState = _sliced_to_array(uncontrolledState, 1), value = _uncontrolledState[0];
    var prevValueRef = $bnPw9$useRef(value);
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    $bnPw9$useEffect(function() {
        if (prevValueRef.current !== value) {
            handleChange(value);
            prevValueRef.current = value;
        }
    }, [
        value,
        prevValueRef,
        handleChange
    ]);
    return uncontrolledState;
}
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : function() {};
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
import { useCallback as $3vqmr$useCallback } from "react";
function $6ed0406888f73fc4$var$setRef(ref, value) {
    if (typeof ref === "function") ref(value);
    else if (ref !== null && ref !== void 0) ref.current = value;
}
function $6ed0406888f73fc4$export$43e446d32b3d21af() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return function(node) {
        return refs.forEach(function(ref) {
            return $6ed0406888f73fc4$var$setRef(ref, node);
        });
    };
}
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af.apply(void 0, _to_consumable_array(refs)), refs);
}
// ../../node_modules/.pnpm/@babel+runtime@7.22.6/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends2() {
    _extends2 = Object.assign ? Object.assign.bind() : function _extends2(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends2.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
import { flushSync as $4q5Fq$flushSync } from "react-dom";
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ $9IrjX$forwardRef(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    var childrenArray = $9IrjX$Children.toArray(children);
    var slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
    if (slottable) {
        var newElement = slottable.props.children;
        var newChildren = childrenArray.map(function(child) {
            if (child === slottable) {
                if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);
                return /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;
            } else return child;
        });
        return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
            ref: forwardedRef
        }), /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? /* @__PURE__ */ $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
    }
    return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
        ref: forwardedRef
    }), children);
});
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ $9IrjX$forwardRef(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    if (/* @__PURE__ */ $9IrjX$isValidElement(children)) return /* @__PURE__ */ $9IrjX$cloneElement(children, _object_spread_props(_object_spread({}, $5e63c961fc1ce211$var$mergeProps(slotProps, children.props)), {
        ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
    }));
    return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
});
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = function(param) {
    var children = param.children;
    return /* @__PURE__ */ $9IrjX$createElement($9IrjX$Fragment, null, children);
};
function $5e63c961fc1ce211$var$isSlottable(child) {
    return /* @__PURE__ */ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
}
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
    var _loop = function(propName) {
        var slotPropValue = slotProps[propName];
        var childPropValue = childProps[propName];
        var isHandler = /^on[A-Z]/.test(propName);
        if (isHandler) {
            if (slotPropValue && childPropValue) overrideProps[propName] = function() {
                for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                    args[_key] = arguments[_key];
                }
                childPropValue.apply(void 0, _to_consumable_array(args));
                slotPropValue.apply(void 0, _to_consumable_array(args));
            };
            else if (slotPropValue) overrideProps[propName] = slotPropValue;
        } else if (propName === "style") overrideProps[propName] = _object_spread({}, slotPropValue, childPropValue);
        else if (propName === "className") overrideProps[propName] = [
            slotPropValue,
            childPropValue
        ].filter(Boolean).join(" ");
    };
    var overrideProps = _object_spread({}, childProps);
    for(var propName in childProps)_loop(propName);
    return _object_spread({}, slotProps, overrideProps);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
var $8927f6f2acc4f386$var$NODES = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "span",
    "svg",
    "ul"
];
var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce(function(primitive, node) {
    var Node = /* @__PURE__ */ $4q5Fq$forwardRef(function(props, forwardedRef) {
        var asChild = props.asChild, primitiveProps = _object_without_properties(props, [
            "asChild"
        ]);
        var Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
        $4q5Fq$useEffect(function() {
            window[Symbol.for("radix-ui")] = true;
        }, []);
        return /* @__PURE__ */ $4q5Fq$createElement(Comp, _extends2({}, primitiveProps, {
            ref: forwardedRef
        }));
    });
    Node.displayName = "Primitive.".concat(node);
    return _object_spread_props(_object_spread({}, primitive), _define_property({}, node, Node));
}, {});
// ../../node_modules/.pnpm/@radix-ui+react-presence@1.0.1_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-presence/dist/index.mjs
import { Children as $iqq3r$Children, cloneElement as $iqq3r$cloneElement, useState as $iqq3r$useState, useRef as $iqq3r$useRef, useEffect as $iqq3r$useEffect, useCallback as $iqq3r$useCallback, useReducer as $iqq3r$useReducer } from "react";
import { flushSync as $iqq3r$flushSync } from "react-dom";
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
    return $iqq3r$useReducer(function(state, event) {
        var nextState = machine[state][event];
        return nextState !== null && nextState !== void 0 ? nextState : state;
    }, initialState);
}
var $921a889cee6df7e8$export$99c2b779aa4e8b8b = function(props) {
    var present = props.present, children = props.children;
    var presence = $921a889cee6df7e8$var$usePresence(present);
    var child = typeof children === "function" ? children({
        present: presence.isPresent
    }) : $iqq3r$Children.only(children);
    var ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
    var forceMount = typeof children === "function";
    return forceMount || presence.isPresent ? /* @__PURE__ */ $iqq3r$cloneElement(child, {
        ref: ref
    }) : null;
};
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
function $921a889cee6df7e8$var$usePresence(present) {
    var _$iqq3r$useState = _sliced_to_array($iqq3r$useState(), 2), node1 = _$iqq3r$useState[0], setNode = _$iqq3r$useState[1];
    var stylesRef = $iqq3r$useRef({});
    var prevPresentRef = $iqq3r$useRef(present);
    var prevAnimationNameRef = $iqq3r$useRef("none");
    var initialState = present ? "mounted" : "unmounted";
    var _$fe963b355347cc68$export$3e6543de14f8614f = _sliced_to_array($fe963b355347cc68$export$3e6543de14f8614f(initialState, {
        mounted: {
            UNMOUNT: "unmounted",
            ANIMATION_OUT: "unmountSuspended"
        },
        unmountSuspended: {
            MOUNT: "mounted",
            ANIMATION_END: "unmounted"
        },
        unmounted: {
            MOUNT: "mounted"
        }
    }), 2), state = _$fe963b355347cc68$export$3e6543de14f8614f[0], send = _$fe963b355347cc68$export$3e6543de14f8614f[1];
    $iqq3r$useEffect(function() {
        var currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
        prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
    }, [
        state
    ]);
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        var styles = stylesRef.current;
        var wasPresent = prevPresentRef.current;
        var hasPresentChanged = wasPresent !== present;
        if (hasPresentChanged) {
            var prevAnimationName = prevAnimationNameRef.current;
            var currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
            if (present) send("MOUNT");
            else if (currentAnimationName === "none" || (styles === null || styles === void 0 ? void 0 : styles.display) === "none") send("UNMOUNT");
            else {
                var isAnimating = prevAnimationName !== currentAnimationName;
                if (wasPresent && isAnimating) send("ANIMATION_OUT");
                else send("UNMOUNT");
            }
            prevPresentRef.current = present;
        }
    }, [
        present,
        send
    ]);
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        if (node1) {
            var handleAnimationEnd = function(event) {
                var currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
                var isCurrentAnimation = currentAnimationName.includes(event.animationName);
                if (event.target === node1 && isCurrentAnimation) $iqq3r$flushSync(function() {
                    return send("ANIMATION_END");
                });
            };
            var handleAnimationStart = function(event) {
                if (event.target === node1) prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
            };
            node1.addEventListener("animationstart", handleAnimationStart);
            node1.addEventListener("animationcancel", handleAnimationEnd);
            node1.addEventListener("animationend", handleAnimationEnd);
            return function() {
                node1.removeEventListener("animationstart", handleAnimationStart);
                node1.removeEventListener("animationcancel", handleAnimationEnd);
                node1.removeEventListener("animationend", handleAnimationEnd);
            };
        } else send("ANIMATION_END");
    }, [
        node1,
        send
    ]);
    return {
        isPresent: [
            "mounted",
            "unmountSuspended"
        ].includes(state),
        ref: $iqq3r$useCallback(function(node) {
            if (node) stylesRef.current = getComputedStyle(node);
            setNode(node);
        }, [])
    };
}
function $921a889cee6df7e8$var$getAnimationName(styles) {
    return (styles === null || styles === void 0 ? void 0 : styles.animationName) || "none";
}
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
import * as $2AODx$react from "react";
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || function() {
    return void 0;
};
var $1746a345f3d73bb7$var$count = 0;
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
    var _$2AODx$react_useState = _sliced_to_array($2AODx$react.useState($1746a345f3d73bb7$var$useReactId()), 2), id = _$2AODx$react_useState[0], setId = _$2AODx$react_useState[1];
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        if (!deterministicId) setId(function(reactId) {
            return reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++);
        });
    }, [
        deterministicId
    ]);
    return deterministicId || (id ? "radix-".concat(id) : "");
}
// ../../node_modules/.pnpm/@radix-ui+react-collapsible@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-collapsible/dist/index.mjs
var $409067139f391064$var$COLLAPSIBLE_NAME = "Collapsible";
var _$c512c27ab02ef895$export$50c7b4e9d9f19c1 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME), 2), $409067139f391064$var$createCollapsibleContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[0], $409067139f391064$export$952b32dcbe73087a = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[1];
var _$409067139f391064$var$createCollapsibleContext = _sliced_to_array($409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME), 2), $409067139f391064$var$CollapsibleProvider = _$409067139f391064$var$createCollapsibleContext[0], $409067139f391064$var$useCollapsibleContext = _$409067139f391064$var$createCollapsibleContext[1];
var $409067139f391064$export$6eb0f7ddcda6131f = /* @__PURE__ */ $73KQ4$forwardRef(function(props, forwardedRef) {
    var __scopeCollapsible = props.__scopeCollapsible, openProp = props.open, defaultOpen = props.defaultOpen, disabled = props.disabled, onOpenChange = props.onOpenChange, collapsibleProps = _object_without_properties(props, [
        "__scopeCollapsible",
        "open",
        "defaultOpen",
        "disabled",
        "onOpenChange"
    ]);
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: openProp,
        defaultProp: defaultOpen,
        onChange: onOpenChange
    }), 2), tmp = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], open = tmp === void 0 ? false : tmp, setOpen = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    return /* @__PURE__ */ $73KQ4$createElement($409067139f391064$var$CollapsibleProvider, {
        scope: __scopeCollapsible,
        disabled: disabled,
        contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
        open: open,
        onOpenToggle: $73KQ4$useCallback(function() {
            return setOpen(function(prevOpen) {
                return !prevOpen;
            });
        }, [
            setOpen
        ])
    }, /* @__PURE__ */ $73KQ4$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
        "data-state": $409067139f391064$var$getState(open),
        "data-disabled": disabled ? "" : void 0
    }, collapsibleProps, {
        ref: forwardedRef
    })));
});
var $409067139f391064$var$TRIGGER_NAME = "CollapsibleTrigger";
var $409067139f391064$export$c135dce7b15bbbdc = /* @__PURE__ */ $73KQ4$forwardRef(function(props, forwardedRef) {
    var __scopeCollapsible = props.__scopeCollapsible, triggerProps = _object_without_properties(props, [
        "__scopeCollapsible"
    ]);
    var context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
    return /* @__PURE__ */ $73KQ4$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
        type: "button",
        "aria-controls": context.contentId,
        "aria-expanded": context.open || false,
        "data-state": $409067139f391064$var$getState(context.open),
        "data-disabled": context.disabled ? "" : void 0,
        disabled: context.disabled
    }, triggerProps, {
        ref: forwardedRef,
        onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
    }));
});
var $409067139f391064$var$CONTENT_NAME = "CollapsibleContent";
var $409067139f391064$export$aadde00976f34151 = /* @__PURE__ */ $73KQ4$forwardRef(function(props, forwardedRef) {
    var forceMount = props.forceMount, contentProps = _object_without_properties(props, [
        "forceMount"
    ]);
    var context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
    return /* @__PURE__ */ $73KQ4$createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
        present: forceMount || context.open
    }, function(param) {
        var present = param.present;
        return /* @__PURE__ */ $73KQ4$createElement($409067139f391064$var$CollapsibleContentImpl, _extends({}, contentProps, {
            ref: forwardedRef,
            present: present
        }));
    });
});
var $409067139f391064$var$CollapsibleContentImpl = /* @__PURE__ */ $73KQ4$forwardRef(function(props, forwardedRef) {
    var __scopeCollapsible = props.__scopeCollapsible, present = props.present, children = props.children, contentProps = _object_without_properties(props, [
        "__scopeCollapsible",
        "present",
        "children"
    ]);
    var context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
    var _$73KQ4$useState = _sliced_to_array($73KQ4$useState(present), 2), isPresent = _$73KQ4$useState[0], setIsPresent = _$73KQ4$useState[1];
    var ref = $73KQ4$useRef(null);
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
    var heightRef = $73KQ4$useRef(0);
    var height = heightRef.current;
    var widthRef = $73KQ4$useRef(0);
    var width = widthRef.current;
    var isOpen = context.open || isPresent;
    var isMountAnimationPreventedRef = $73KQ4$useRef(isOpen);
    var originalStylesRef = $73KQ4$useRef();
    $73KQ4$useEffect(function() {
        var rAF = requestAnimationFrame(function() {
            return isMountAnimationPreventedRef.current = false;
        });
        return function() {
            return cancelAnimationFrame(rAF);
        };
    }, []);
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        var node = ref.current;
        if (node) {
            originalStylesRef.current = originalStylesRef.current || {
                transitionDuration: node.style.transitionDuration,
                animationName: node.style.animationName
            };
            node.style.transitionDuration = "0s";
            node.style.animationName = "none";
            var rect = node.getBoundingClientRect();
            heightRef.current = rect.height;
            widthRef.current = rect.width;
            if (!isMountAnimationPreventedRef.current) {
                node.style.transitionDuration = originalStylesRef.current.transitionDuration;
                node.style.animationName = originalStylesRef.current.animationName;
            }
            setIsPresent(present);
        }
    }, [
        context.open,
        present
    ]);
    var _obj;
    return /* @__PURE__ */ $73KQ4$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
        "data-state": $409067139f391064$var$getState(context.open),
        "data-disabled": context.disabled ? "" : void 0,
        id: context.contentId,
        hidden: !isOpen
    }, contentProps, {
        ref: composedRefs,
        style: _object_spread((_obj = {}, _define_property(_obj, "--radix-collapsible-content-height", height ? "".concat(height, "px") : void 0), _define_property(_obj, "--radix-collapsible-content-width", width ? "".concat(width, "px") : void 0), _obj), props.style)
    }), isOpen && children);
});
function $409067139f391064$var$getState(open) {
    return open ? "open" : "closed";
}
var $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
// registry/new-york/ui/collapsible.tsx
var Collapsible = $409067139f391064$export$be92b6f5f03c0fe9;
var CollapsibleTrigger = $409067139f391064$export$c135dce7b15bbbdc;
var CollapsibleContent = $409067139f391064$export$aadde00976f34151;
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
//# sourceMappingURL=collapsible.mjs.map