import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
import { defineComponent } from 'vue';
import VcColorPicker from '../../vc-color-picker';
import { usePanelPickerContext } from '../context';
import ColorClear from './ColorClear';
import ColorInput from './ColorInput';
var PanelPicker = defineComponent({
  name: 'PanelPicker',
  setup: function setup() {
    var context = usePanelPickerContext();
    return function () {
      var _context$value$value;
      return _createVNode(_Fragment, null, [context.value.allowClear && _createVNode(ColorClear, _objectSpread(_objectSpread({
        "prefixCls": context.value.prefixCls,
        "value": context.value.value,
        "colorCleared": context.value.colorCleared
      }, context.value), {}, {
        "onChange": function onChange(clearColor) {
          var _context$value$onChan, _context$value, _context$value$onClea, _context$value2;
          (_context$value$onChan = (_context$value = context.value).onChange) === null || _context$value$onChan === void 0 ? void 0 : _context$value$onChan.call(_context$value, clearColor);
          (_context$value$onClea = (_context$value2 = context.value).onClear) === null || _context$value$onClea === void 0 ? void 0 : _context$value$onClea.call(_context$value2);
        }
      }), null), _createVNode(VcColorPicker, {
        "prefixCls": context.value.prefixCls,
        "value": (_context$value$value = context.value.value) === null || _context$value$value === void 0 ? void 0 : _context$value$value.toHsb(),
        "onChange": function onChange(colorValue, type) {
          var _context$value$onChan2, _context$value3;
          return (_context$value$onChan2 = (_context$value3 = context.value).onChange) === null || _context$value$onChan2 === void 0 ? void 0 : _context$value$onChan2.call(_context$value3, colorValue, type, true);
        },
        "onChangeComplete": context.value.onChangeComplete
      }, null), _createVNode(ColorInput, context.value, null)]);
    };
  }
});
export default PanelPicker;