// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
    InternalAttrs,
    type Element, FormatBreakpointStateAttr,
} from '@divi/types';

import type {
    AttrVal,
    BorderValue,
    TypographyValue,
    SpacingValue,
} from '../custom-types';

type BaseDecoration = Element.Decoration.PickedAttributes<
    | 'animation'
    | 'background'
    | 'border'
    | 'boxShadow'
    | 'disabledOn'
    | 'filters'
    | 'overflow'
    | 'position'
    | 'scroll'
    | 'sizing'
    | 'spacing'
    | 'sticky'
    | 'transform'
    | 'transition'
    | 'zIndex'
>;

type DecorationExtras = {
    datepickerTypography?: FormatBreakpointStateAttr<TypographyValue>;
    datepickerNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    datepickerNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
    datepickerHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    datepickerHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    datepickerBorder?: FormatBreakpointStateAttr<BorderValue>;
    datepickerSpacing?: FormatBreakpointStateAttr<SpacingValue>;
    datepickerAlignment?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevHorOffset?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevHorWidth?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    nextPrevBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarTypography?: FormatBreakpointStateAttr<TypographyValue>;
    calendarVerOffset?: FormatBreakpointStateAttr<AttrVal>;
    calendarHorOffset?: FormatBreakpointStateAttr<AttrVal>;
    calendarWidth?: FormatBreakpointStateAttr<AttrVal>;
    calendarBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarBorder?: FormatBreakpointStateAttr<BorderValue>;
    cellNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    cellNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
    cellHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    cellHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    cellActiveColor?: FormatBreakpointStateAttr<AttrVal>;
    cellActiveBgColor?: FormatBreakpointStateAttr<AttrVal>;
    cellCurrentColor?: FormatBreakpointStateAttr<AttrVal>;
    cellCurrentBgColor?: FormatBreakpointStateAttr<AttrVal>;
    labelTypography?: FormatBreakpointStateAttr<TypographyValue>;
    labelColor?: FormatBreakpointStateAttr<AttrVal>;
    labelGapY?: FormatBreakpointStateAttr<AttrVal>;
    labelAlignment?: FormatBreakpointStateAttr<AttrVal>;
    applyTypography?: FormatBreakpointStateAttr<TypographyValue>;
    applyNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    applyNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    applyBorder?: FormatBreakpointStateAttr<BorderValue>;
    applySpacing?: FormatBreakpointStateAttr<SpacingValue>;
    applyAlignment?: FormatBreakpointStateAttr<AttrVal>;
};

export interface DatePeriodFilterAttrs extends InternalAttrs {
	module?: {
		meta?: Element.Meta.Attributes;
		advanced?: {
			link?: Element.Advanced.Link.Attributes;
			htmlAttributes?: Element.Advanced.IdClasses.Attributes;
		};
        decoration?: BaseDecoration & DecorationExtras;
	};

	[key: string]: any;
}

export type DatePeriodFilterEditProps = ModuleEditProps<DatePeriodFilterAttrs>;
