'use client';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Select = Select;
exports.SelectGroup = SelectGroup;
exports.SelectValue = SelectValue;
exports.SelectTrigger = SelectTrigger;
exports.SelectContent = SelectContent;
exports.SelectEmpty = SelectEmpty;
exports.SelectLabel = SelectLabel;
exports.SelectItem = SelectItem;
exports.SelectSeparator = SelectSeparator;
exports.SelectScrollUpButton = SelectScrollUpButton;
exports.SelectScrollDownButton = SelectScrollDownButton;
const jsx_runtime_1 = require("react/jsx-runtime");
const React = __importStar(require("react"));
const SelectPrimitive = __importStar(require("@radix-ui/react-select"));
const lucide_react_1 = require("lucide-react");
const utils_1 = require("../../../lib/utils");
function Select({ ...props }) {
    return (0, jsx_runtime_1.jsx)(SelectPrimitive.Root, { "data-slot": "select", ...props });
}
function SelectGroup({ ...props }) {
    return (0, jsx_runtime_1.jsx)(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
}
function SelectValue({ ...props }) {
    return (0, jsx_runtime_1.jsx)(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
}
function SelectTrigger({ className, readOnly, children, ...props }) {
    return ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": "default", className: (0, utils_1.cn)('select-trigger select-read-only select-disabled', className), "aria-readonly": readOnly, "data-read-only": readOnly ? '' : undefined, ...props, children: [children, !readOnly && ((0, jsx_runtime_1.jsx)(SelectPrimitive.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "select-chevron" }) }))] }));
}
function SelectScrollUpButton({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: (0, utils_1.cn)('select-scroll-button', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { className: "size-4" }) }));
}
function SelectScrollDownButton({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: (0, utils_1.cn)('select-scroll-button', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "size-4" }) }));
}
function SelectContent({ className, children, position = 'popper', ...props }) {
    const options = React.useMemo(() => React.Children.map(React.Children.toArray(children), (child) => {
        if (React.isValidElement(child) &&
            child.type === SelectItem) {
            return child.props.value;
        }
    }), [children]);
    return ((0, jsx_runtime_1.jsx)(SelectPrimitive.Portal, { children: (0, jsx_runtime_1.jsxs)(SelectPrimitive.Content, { "data-slot": "select-content", "data-position": position, className: (0, utils_1.cn)('group/select select-content', position === 'popper' && 'select-content-popper', className), "data-empty": options.length === 0, position: position, ...props, children: [(0, jsx_runtime_1.jsx)(SelectScrollUpButton, {}), (0, jsx_runtime_1.jsx)(SelectPrimitive.Viewport, { className: (0, utils_1.cn)('p-1', position === 'popper' &&
                        'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'), children: children }), (0, jsx_runtime_1.jsx)(SelectScrollDownButton, {})] }) }));
}
function SelectEmpty({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "select-empty", className: (0, utils_1.cn)('select-empty', className), ...props }));
}
function SelectLabel({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)(SelectPrimitive.Label, { "data-slot": "select-label", className: (0, utils_1.cn)('select-label', className), ...props }));
}
function SelectItem({ className, children, ...props }) {
    return ((0, jsx_runtime_1.jsxs)(SelectPrimitive.Item, { "data-slot": "select-item", className: (0, utils_1.cn)('select-item', className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: (0, jsx_runtime_1.jsx)(SelectPrimitive.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "size-4" }) }) }), (0, jsx_runtime_1.jsx)(SelectPrimitive.ItemText, { children: children })] }));
}
function SelectSeparator({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)(SelectPrimitive.Separator, { "data-slot": "select-separator", className: (0, utils_1.cn)('select-separator', className), ...props }));
}
