function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
/*
 * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { Combobox as BaseUICombobox } from "@base-ui/react/combobox";
import { CaretDown, Cross, Search, Tick } from "@blueprintjs/icons";
import classnames from "classnames";
import React from "react";
import styles from "./Combobox.module.css";
function ComboboxTrigger({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Trigger, _extends({
    className: classnames(styles.osdkComboboxTrigger, className)
  }, rest), children ?? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: styles.osdkComboboxValueContainer
  }, /*#__PURE__*/React.createElement(BaseUICombobox.Value, null)), /*#__PURE__*/React.createElement(ComboboxIcon, null)));
}
function ComboboxIcon({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Icon, _extends({
    className: classnames(styles.osdkComboboxIcon, className)
  }, rest), children ?? /*#__PURE__*/React.createElement(CaretDown, null));
}
function ComboboxSearchInput({
  className,
  ...rest
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: classnames(styles.osdkComboboxInputWrapper, className)
  }, /*#__PURE__*/React.createElement(Search, {
    className: styles.osdkComboboxSearchIcon
  }), /*#__PURE__*/React.createElement(BaseUICombobox.Input, _extends({
    className: styles.osdkComboboxInput
  }, rest)));
}
function ComboboxInput({
  className,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Input, _extends({
    className: classnames(styles.osdkComboboxInput, className)
  }, rest));
}
function ComboboxPositioner({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Positioner, _extends({
    className: classnames(styles.osdkComboboxPositioner, className),
    sideOffset: 4
  }, rest), children);
}
function ComboboxPopup({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Popup, _extends({
    className: classnames(styles.osdkComboboxPopup, className)
  }, rest), children);
}
function ComboboxItem({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Item, _extends({
    className: classnames(styles.osdkComboboxItem, className)
  }, rest), children);
}
function ComboboxChips({
  children,
  className
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Chips, {
    render: props => /*#__PURE__*/React.createElement("div", _extends({}, props, {
      className: classnames(styles.osdkComboboxInputWrapper, className)
    }), props.children)
  }, children);
}
function ComboboxChip({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Chip, _extends({
    className: classnames(styles.osdkComboboxChip, className)
  }, rest), children);
}
function ComboboxChipRemove({
  className,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.ChipRemove, _extends({
    className: classnames(styles.osdkComboboxChipRemove, className),
    "aria-label": "Remove"
  }, rest), /*#__PURE__*/React.createElement(Cross, null));
}
function ComboboxClear({
  className,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Clear, _extends({
    className: classnames(styles.osdkComboboxClear, className),
    "aria-label": "Clear all"
  }, rest), /*#__PURE__*/React.createElement(Cross, null));
}
function ComboboxEmpty({
  children,
  className
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.Empty, {
    className: classnames(styles.osdkComboboxEmpty, className)
  }, children);
}
function ComboboxList({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.List, _extends({
    className: classnames(styles.osdkComboboxList, className)
  }, rest), children);
}
function ComboboxItemIndicator({
  className,
  children,
  ...rest
}) {
  return /*#__PURE__*/React.createElement(BaseUICombobox.ItemIndicator, _extends({
    className: classnames(styles.osdkComboboxItemIndicator, className),
    keepMounted: true
  }, rest), children ?? /*#__PURE__*/React.createElement(Tick, {
    size: 16
  }));
}
export const Combobox = {
  Root: BaseUICombobox.Root,
  Trigger: ComboboxTrigger,
  Icon: ComboboxIcon,
  SearchInput: ComboboxSearchInput,
  Input: ComboboxInput,
  Portal: BaseUICombobox.Portal,
  Positioner: ComboboxPositioner,
  Popup: ComboboxPopup,
  List: ComboboxList,
  Item: ComboboxItem,
  ItemIndicator: ComboboxItemIndicator,
  Collection: BaseUICombobox.Collection,
  Chips: ComboboxChips,
  Chip: ComboboxChip,
  ChipRemove: ComboboxChipRemove,
  Clear: ComboboxClear,
  Empty: ComboboxEmpty,
  Value: BaseUICombobox.Value
};
//# sourceMappingURL=Combobox.js.map