'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var index$1 = require('../../checkbox/style/index.cjs');
require('../../../theme/index.cjs');
var index = require('../../tree/style/index.cjs');
var statistic = require('../../../theme/token/util/statistic.cjs');
var genComponentStyleHook = require('../../../theme/token/util/genComponentStyleHook.cjs');

const genBaseStyle = (token) => {
  const {
    componentCls,
    treePrefixCls,
    colorBgElevated
  } = token;
  const treeCls = `.${treePrefixCls}`;
  return [
    // ======================================================
    // ==                     Dropdown                     ==
    // ======================================================
    {
      [`${componentCls}-dropdown`]: [
        {
          padding: `${token.paddingXS}px ${token.paddingXS / 2}px`
        },
        // ====================== Tree ======================
        index.genTreeStyle(treePrefixCls, statistic.merge(token, {
          colorBgContainer: colorBgElevated
        })),
        {
          [treeCls]: {
            "borderRadius": 0,
            "&-list-holder-inner": {
              alignItems: "stretch",
              [`${treeCls}-treenode`]: {
                [`${treeCls}-node-content-wrapper`]: {
                  flex: "auto"
                }
              }
            }
          }
        },
        // ==================== Checkbox ====================
        index$1.getStyle(`${treePrefixCls}-checkbox`, token),
        // ====================== RTL =======================
        {
          "&-rtl": {
            direction: "rtl",
            [`${treeCls}-switcher${treeCls}-switcher_close`]: {
              [`${treeCls}-switcher-icon svg`]: {
                transform: "rotate(90deg)"
              }
            }
          }
        }
      ]
    }
  ];
};
function useTreeSelectStyle(prefixCls, treePrefixCls) {
  return genComponentStyleHook.default("TreeSelect", (token) => {
    const treeSelectToken = statistic.merge(token, {
      treePrefixCls: treePrefixCls.value
    });
    return [genBaseStyle(treeSelectToken)];
  })(prefixCls);
}

exports.default = useTreeSelectStyle;
//# sourceMappingURL=index.cjs.map
