"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const event = require("../../../constants/event.js");
const constants = require("./constants.js");
const props = require("./common/props.js");
const picker = require("./common/picker.js");
const panelTimePick = require("./time-picker-com/panel-time-pick.js");
const panelTimeRange = require("./time-picker-com/panel-time-range.js");
const Vue = require("vue");
const dayjs_min = require("../../../../../../_virtual/dayjs.min.js");
const customParseFormat = require("../../../../../../_virtual/customParseFormat.js");
dayjs_min.default.extend(customParseFormat.default);
var time_picker_default = /* @__PURE__ */ Vue.defineComponent({
  name: "ElTimePicker",
  install: null,
  props: {
    ...props.timePickerDefaultProps,
    isRange: Boolean
  },
  emits: [event.UPDATE_MODEL_EVENT],
  setup(props2, ctx) {
    const commonPicker = Vue.ref();
    const [type, Panel] = props2.isRange ? ["timerange", panelTimeRange.default] : ["time", panelTimePick.default];
    const modelUpdater = (value) => ctx.emit(event.UPDATE_MODEL_EVENT, value);
    Vue.provide(constants.PICKER_POPPER_OPTIONS_INJECTION_KEY, props2.popperOptions);
    ctx.expose({
      focus: () => {
        var _a;
        (_a = commonPicker.value) == null ? void 0 : _a.focus();
      },
      blur: () => {
        var _a;
        (_a = commonPicker.value) == null ? void 0 : _a.blur();
      },
      handleOpen: () => {
        var _a;
        (_a = commonPicker.value) == null ? void 0 : _a.handleOpen();
      },
      handleClose: () => {
        var _a;
        (_a = commonPicker.value) == null ? void 0 : _a.handleClose();
      }
    });
    return () => {
      const format = props2.format ?? constants.DEFAULT_FORMATS_TIME;
      return Vue.createVNode(picker.default, Vue.mergeProps(props2, {
        "ref": commonPicker,
        "type": type,
        "format": format,
        "onUpdate:modelValue": modelUpdater
      }), { default: (props3) => Vue.createVNode(Panel, props3, null) });
    };
  }
});
exports.default = time_picker_default;
