import DatePicker from 'primevue/datepicker';
import { computed } from 'vue';
const props = defineProps();
const emit = defineEmits();
const dateValue = computed(() => {
    if (props.modelValue instanceof Date)
        return props.modelValue;
    if (typeof props.modelValue === 'string')
        return new Date(props.modelValue);
    return null;
});
const handleDateChange = (value) => {
    if (value instanceof Date)
        emit('update:modelValue', value);
    else if (value === null || value === undefined)
        emit('update:modelValue', null);
    else
        emit('update:modelValue', value[0] ?? null);
};
const __VLS_ctx = {
    ...{},
    ...{},
    ...{},
    ...{},
    ...{},
};
let __VLS_components;
let __VLS_intrinsics;
let __VLS_directives;
let __VLS_0;
/** @ts-ignore @type { | typeof __VLS_components.DatePicker} */
DatePicker;
// @ts-ignore
const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
    ...{ 'onUpdate:modelValue': {} },
    ...{ 'onBlur': {} },
    inputId: (__VLS_ctx.inputId),
    modelValue: (__VLS_ctx.dateValue),
    disabled: (__VLS_ctx.disabled),
    invalid: (__VLS_ctx.invalid),
    minDate: (__VLS_ctx.min),
    maxDate: (__VLS_ctx.max),
    dateFormat: "yy-mm-dd",
    showIcon: true,
}));
const __VLS_2 = __VLS_1({
    ...{ 'onUpdate:modelValue': {} },
    ...{ 'onBlur': {} },
    inputId: (__VLS_ctx.inputId),
    modelValue: (__VLS_ctx.dateValue),
    disabled: (__VLS_ctx.disabled),
    invalid: (__VLS_ctx.invalid),
    minDate: (__VLS_ctx.min),
    maxDate: (__VLS_ctx.max),
    dateFormat: "yy-mm-dd",
    showIcon: true,
}, ...__VLS_functionalComponentArgsRest(__VLS_1));
let __VLS_5;
const __VLS_6 = {
    /** @type {typeof __VLS_5.'update:modelValue'} */
    'onUpdate:modelValue': (__VLS_ctx.handleDateChange),
};
const __VLS_7 = {
    /** @type {typeof __VLS_5.blur} */
    onBlur: (...[$event]) => {
        return (__VLS_ctx.emit('blur', $event));
        // @ts-ignore
        [inputId, dateValue, disabled, invalid, min, max, handleDateChange, emit,];
    },
};
var __VLS_8;
var __VLS_3;
var __VLS_4;
// @ts-ignore
[];
const __VLS_export = (await import('vue')).defineComponent({
    __typeEmits: {},
    __typeProps: {},
});
export default {};
