import { trigger, state, style, transition, animate, group } from '@angular/animations';
import * as datefns from 'date-fns';
import { I18nFormat } from 'ng-devui/i18n';
import * as i0 from '@angular/core';
import { InjectionToken, Injectable, Optional, Inject, Component, ChangeDetectionStrategy, HostBinding, Input, NgModule, EventEmitter, Directive, Output, ViewChild, Pipe } from '@angular/core';
import { Subject, fromEvent } from 'rxjs';
import { filter, mapTo, debounceTime, distinctUntilChanged } from 'rxjs/operators';
import * as i1$1 from '@angular/common';
import { DOCUMENT, CommonModule } from '@angular/common';
import * as i1 from '@angular/platform-browser';
import { createPopper } from '@popperjs/core';

class AnimationDuration {
}
AnimationDuration.SLOW = '0.3s';
AnimationDuration.BASE = '0.2s';
AnimationDuration.FAST = '0.1s';
class AnimationCurves {
}
AnimationCurves.EASE_OUT = 'cubic-bezier(0.16, 0.75, 0.5, 1)';
AnimationCurves.EASE_IN = 'cubic-bezier(0.5, 0, 0.84, 0.25)';
AnimationCurves.EASE_IN_OUT = 'cubic-bezier(0.5, 0.05, 0.5, 0.95)';
AnimationCurves.LINEAR = 'cubic-bezier(0, 0, 1, 1)';
/**
   * @deprecated 'EASE_IN_SMOOTH' does not match the actual bezier curve,replaced with 'EASE_IN_OUT_SMOOTH'
   */
AnimationCurves.EASE_IN_SMOOTH = 'cubic-bezier(0.645, 0.045, 0.355, 1)';
AnimationCurves.EASE_IN_OUT_SMOOTH = 'cubic-bezier(0.645, 0.045, 0.355, 1)';

const duration$5 = AnimationDuration.FAST;
const linear$1 = AnimationCurves.LINEAR;
const backdropFadeInOut = trigger('backdropAnimation', [
    state('void', style({ display: 'none', opacity: 0 })),
    state('in', style({ display: 'block', opacity: 1 })),
    transition('void => in', [
        style({ display: 'block' }),
        animate(`${duration$5} ${linear$1}`, style({ opacity: 1 }))
    ]),
    transition('in => void', group([
        animate(`${duration$5} ${linear$1}`, style({ opacity: 0 }))
    ])),
]);

/**
 * @deprecated
 */
const cornerFadeInOut = trigger('cornerFadeInOut', [
    transition('void => bottom', [
        style({ transform: 'scale(0.9)', opacity: 0, transformOrigin: '0% 0%', display: 'inline-block' }),
        animate('200ms cubic-bezier(0.23, 1, 0.32, 1)', style({ transform: 'scale(1)', opacity: 1, transformOrigin: '0% 0%' })),
    ]),
    transition('bottom => void', [
        style({ transform: 'scale(1)', opacity: 1, transformOrigin: '0% 0%', display: 'inline-block' }),
        animate('200ms cubic-bezier(0.755, 0.05, 0.855, 0.06)', style({ transform: 'scale(0.9)', opacity: 0, transformOrigin: '0% 0%' }))
    ]),
    transition('void => top', [
        style({ transform: 'scale(0.9)', opacity: 0, transformOrigin: '0% 100%', display: 'inline-block' }),
        animate('200ms cubic-bezier(0.23, 1, 0.32, 1)', style({ transform: 'scale(1)', opacity: 1, transformOrigin: '0% 100%' })),
    ]),
    transition('top => void', [
        style({ transform: 'scale(1)', opacity: 1, transformOrigin: '0% 100%', display: 'inline-block' }),
        animate('200ms cubic-bezier(0.755, 0.05, 0.855, 0.06)', style({ transform: 'scale(0.9)', opacity: 0, transformOrigin: '0% 100%' }))
    ])
]);

const easeOut$3 = AnimationCurves.EASE_OUT;
const easeIn$3 = AnimationCurves.EASE_IN;
const duration$4 = AnimationDuration.FAST;
const scaleY = 'scaleY(0.8)';
const scaleX = 'scaleX(0.8)';
const scaleY1 = 'scaleY(1)';
const scaleX1 = 'scaleX(1)';
const scaleXToVoid = 'scaleX(0.8)';
const scaleYToVoid = 'scaleY(0.8)';
const directionFadeInOut = trigger('directionFadeInOut', [
    state('void', style({ opacity: 0, })),
    state('bottom', style({ opacity: 1, })),
    state('bottom-left', style({ opacity: 1 })),
    state('bottom-right', style({ opacity: 1 })),
    state('top', style({ opacity: 1 })),
    state('top-left', style({ opacity: 1 })),
    state('top-right', style({ opacity: 1 })),
    state('left', style({ opacity: 1 })),
    state('left-top', style({ opacity: 1 })),
    state('left-bottom', style({ opacity: 1 })),
    state('right', style({ opacity: 1 })),
    state('right-top', style({ opacity: 1 })),
    state('right-bottom', style({ opacity: 1 })),
    // 下方
    transition('* => bottom', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}` }))
    ]),
    transition('bottom => void', [
        style({ transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => bottom-left', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}` }))
    ]),
    transition('bottom-left => void', [
        style({ opacity: 1, transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => bottom-right', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}` }))
    ]),
    transition('bottom-right => void', [
        style({ opacity: 1, transformOrigin: '50% -8px' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    // 上方
    transition('* => top', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}`, }))
    ]),
    transition('top => void', [
        style({ opacity: 1, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => top-left', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}`, }))
    ]),
    transition('top-left => void', [
        style({ opacity: 1, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => top-right', [
        style({ opacity: 0.8, transform: `${scaleY}`, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleY1}`, }))
    ]),
    transition('top-right => void', [
        style({ opacity: 1, transformOrigin: '50% calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleYToVoid}`, opacity: 0.8 }))
    ]),
    // 左方
    transition('* => left', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('left => void', [
        style({ opacity: 1, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => left-top', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('left-top => void', [
        style({ opacity: 1, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => left-bottom', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('left-bottom => void', [
        style({ opacity: 1, transformOrigin: 'calc(100% + 8px)' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0.8 }))
    ]),
    //  右方
    transition('* => right', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('right => void', [
        style({ opacity: 1, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0 }))
    ]),
    transition('* => right-top', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('right-top => void', [
        style({ opacity: 1, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0.8 }))
    ]),
    transition('* => right-bottom', [
        style({ opacity: 0.8, transform: `${scaleX}`, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeOut$3}`, style({ opacity: 1, transform: `${scaleX1}` }))
    ]),
    transition('right-bottom => void', [
        style({ opacity: 1, transformOrigin: '-8px 50% ' }),
        animate(`${duration$4}  ${easeIn$3}`, style({ transform: `${scaleXToVoid}`, opacity: 0.8 }))
    ]),
]);

const easeInOut = AnimationCurves.EASE_IN_OUT;
const duration$3 = AnimationDuration.SLOW;
const expandCollapse = trigger('collapse', [
    state('expanded', style({ opacity: 1, height: '*', overflow: 'hidden' })),
    state('collapsed', style({ opacity: 0, height: 0, overflow: 'hidden' })),
    transition('collapsed => expanded', animate(`${duration$3} ${easeInOut}`)),
    transition('expanded => collapsed', animate(`${duration$3} ${easeInOut}`))
]);
const expandCollapseForDomDestroy = trigger('collapseForDomDestroy', [
    transition(':enter', [
        style({ opacity: 0, height: 0, overflow: 'hidden' }),
        animate(`${duration$3} ${easeInOut}`, style({ opacity: 1, height: '*', overflow: 'hidden' }))
    ]),
    transition(':leave', [
        style({ opacity: 1, height: '*', overflow: 'hidden' }),
        animate(`${duration$3} ${easeInOut}`, style({ opacity: 0, height: 0, overflow: 'hidden' }))
    ]),
]);

const easeIn$2 = AnimationCurves.EASE_IN;
const easeOut$2 = AnimationCurves.EASE_OUT;
const duration$2 = AnimationDuration.BASE;
const fadeInOut = trigger('fadeInOut', [
    state('void', style({ transform: 'scaleY(0) translateY(-4px)', opacity: 0, transformOrigin: '0 0%', display: 'block' })),
    state('bottom', style({ transform: 'scaleY(0.9999) translateY(0)', opacity: 1, transformOrigin: '0 0%', display: 'block' })),
    state('top', style({ transform: 'scaleY(0.9999) translateY(0)', opacity: 1, transformOrigin: '0 100%', display: 'block' })),
    transition('void => bottom', [
        style({ opacity: 0.8, transform: 'scaleY(0.8) translateY(-4px)' }),
        animate(`${duration$2} ${easeOut$2}`)
    ]),
    transition('bottom => void', [
        animate(`${duration$2} ${easeIn$2}`, style({ transform: 'scaleY(0.8) translateY(-4px)', opacity: 0, transformOrigin: '0 0%', display: 'none' })),
    ]),
    transition('void => top', [
        style({ transform: 'scaleY(0.8) translateY(4px)', opacity: 0.8, transformOrigin: '0 100%', display: 'block' }),
        animate(`${duration$2} ${easeOut$2}`)
    ]),
    transition('top => void', [
        animate(`${duration$2} ${easeIn$2}`, style({ transform: 'scaleY(0.8) translateY(4px)', opacity: 0, transformOrigin: '0 100%', display: 'none' }))
    ])
]);

const easeIn$1 = AnimationCurves.EASE_IN;
const easeOut$1 = AnimationCurves.EASE_OUT;
const duration$1 = AnimationDuration.SLOW;
const flyInOut = trigger('flyInOut', [
    state('left-void', style({ transform: 'translateX(-100%)', left: 0, opacity: 0 })),
    state('left-in', style({ transform: 'translateX(0)', left: 0, opacity: 1 })),
    state('right-void', style({ transform: 'translateX(100%)', right: 0, opacity: 0.8 })),
    state('right-in', style({ transform: 'translateX(0)', right: 0, opacity: 1 })),
    // 解决初始化动效为'void'而非'left/right-void'
    transition('void => left-in', [
        style({ transform: 'translateX(-100%)', left: 0, opacity: 0.8 }),
        animate(`${duration$1} ${easeOut$1}`, style({ transform: 'translateX(0)', left: 0, opacity: 1 }))
    ]),
    transition('void => right-in', [
        style({ transform: 'translateX(100%)', right: 0, opacity: 0.8 }),
        animate(`${duration$1} ${easeOut$1}`, style({ transform: 'translateX(0)', right: 0, opacity: 1 }))
    ]),
    transition('left-void => left-in', [
        animate(`${duration$1} ${easeOut$1}`)
    ]),
    transition('right-void => right-in', [
        animate(`${duration$1} ${easeOut$1}`)
    ]),
    transition('left-in => left-void', [
        animate(`${duration$1} ${easeIn$1}`)
    ]),
    transition('right-in => right-void', [
        animate(`${duration$1} ${easeIn$1}`)
    ]),
]);

/** @deprecated  use collapseForDomDestroy to replace */
const openClose = trigger('openClose', [
    state('void', style({ transform: 'scaleY(0)', height: 0, opacity: 0, transformOrigin: '50% 0% 0px' })),
    state('open', style({ transform: 'scaleY(0.9999)', opacity: 1, transformOrigin: '50% 0% 0px' })),
    transition('void => open', [animate('300ms ease-in-out')]),
    transition('open => void', [animate('300ms ease-in-out')]),
]);

/**
 * @deprecated
 */
const isIE = typeof window !== 'undefined' && (window.navigator.userAgent.indexOf('MSIE ') > -1 ||
    window.navigator.userAgent.indexOf('Trident') > -1);
const ANIMATION = [
    state('void', style({ transform: 'scale(0)', transformOrigin: '50% 50%' })),
    state('in', style({ transform: 'scale(1)', transformOrigin: '50% 50%' })),
    transition('void => in', [
        animate('200ms cubic-bezier(0.23, 1, 0.32, 1)')
    ]),
    transition('in => void', [
        animate('200ms cubic-bezier(0.755, 0.05, 0.855, 0.06)')
    ]),
];
if (isIE) {
    ANIMATION.splice(2, 2); // remove last two animation transitions
}
const popInOut = trigger('popInOut', ANIMATION);

function scrollAnimate(target, currentTopValue, targetTopValue, timeGap = 40, scrollTime = 450, callback) {
    if (typeof document === 'undefined' || typeof window === 'undefined' || !target) {
        return;
    }
    const startTimeStamp = Date.now();
    const drawAnimateFrame = () => {
        const currentTime = Date.now() - startTimeStamp;
        if (currentTime - timeGap > scrollTime) {
            target.scrollTop = targetTopValue;
            if (target === document.documentElement) {
                // 兼容写法，老浏览器/老API模式需要document.body滚动，新的需要documentElement滚动
                document.body.scrollTop = targetTopValue;
            }
            if (callback) {
                callback();
            }
        }
        else {
            const tempTopValue = easeInOutCubic(currentTime, currentTopValue, targetTopValue, scrollTime);
            target.scrollTop = tempTopValue;
            if (target === document.documentElement) {
                document.body.scrollTop = tempTopValue;
            }
            setTimeout(() => {
                requestAnimationFrame(drawAnimateFrame);
            }, timeGap);
        }
    };
    requestAnimationFrame(drawAnimateFrame);
}
function easeInOutCubic(t, b, c, d) {
    const cc = c - b;
    let tt = t / (d / 2);
    if (tt < 1) {
        return ((cc / 2) * tt * tt * tt + b);
    }
    else {
        // eslint-disable-next-line no-return-assign
        return ((cc / 2) * ((tt -= 2) * tt * tt + 2) + b);
    }
}

const easeOut = AnimationCurves.EASE_OUT;
const easeIn = AnimationCurves.EASE_IN;
const linear = AnimationCurves.LINEAR;
const duration = AnimationDuration.FAST;
const wipeInOutAnimation = trigger('wipeInOutAnimation', [
    state('void', style({ opacity: 0.2, transform: 'translateY(-24px)' })),
    state('in', style({ opacity: 1, transform: 'translateY(0)' })),
    transition('void => in', group([
        animate(`${duration} ${easeOut}`, style({ opacity: 1 })),
        animate(`${duration} ${linear}`, style({ transform: 'translateY(0)' }))
    ])),
    transition('in => void', group([
        animate(`${duration} ${easeIn}`, style({ opacity: 0.2 })),
        animate(`${duration} ${linear}`, style({ transform: 'translateY(-24px)' }))
    ])),
]);

function formWithDropDown(ele) {
    if (ele) {
        if (!ele.nativeElement.classList.contains('devui-dropdown-origin')) {
            const parentEle = ele.nativeElement.parentElement;
            if (parentEle && parentEle.classList.contains('devui-dropdown-origin')) {
                return ele.nativeElement.parentElement;
            }
            else {
                return;
            }
        }
        else {
            return ele.nativeElement;
        }
    }
}
function addClassToOrigin(ele) {
    const originEle = formWithDropDown(ele);
    if (originEle && !originEle.classList.contains('devui-dropdown-origin-open')) {
        originEle.classList.add('devui-dropdown-origin-open');
    }
}
function removeClassFromOrigin(ele) {
    const originEle = formWithDropDown(ele);
    if (originEle && originEle.classList.contains('devui-dropdown-origin-open')) {
        originEle.classList.remove('devui-dropdown-origin-open');
    }
}

const AppendToBodyDirectionsConfig = {
    'rightDown': {
        originX: 'start',
        originY: 'bottom',
        overlayX: 'start',
        overlayY: 'top'
    },
    'rightUp': {
        originX: 'start',
        originY: 'top',
        overlayX: 'start',
        overlayY: 'bottom'
    },
    'leftUp': {
        originX: 'end',
        originY: 'top',
        overlayX: 'end',
        overlayY: 'bottom'
    },
    'leftDown': {
        originX: 'end',
        originY: 'bottom',
        overlayX: 'end',
        overlayY: 'top'
    },
    'centerDown': {
        originX: 'center',
        originY: 'bottom',
        overlayX: 'center',
        overlayY: 'top'
    },
    'centerUp': {
        originX: 'center',
        originY: 'top',
        overlayX: 'center',
        overlayY: 'bottom'
    }
};

function isValidDate(date) {
    return datefns.isDate(date) && !isNaN(date.getTime());
}
function parseDate(date, pattern) {
    if (!date) {
        return null;
    }
    if (datefns.isDate(date)) {
        return date;
    }
    const parsedDate = pattern ? datefns.parse(date, pattern, new Date())
        : datefns.parseISO(date);
    return isValidDate(parsedDate) ? parsedDate : new Date(date);
}
function formatDate(date, pattern = 'y/MM/dd HH:mm:ss') {
    return isValidDate(date) ? datefns.format(date, pattern) : '';
}

class DefaultDateConverter {
    parse(date, pattern, locale) {
        return parseDate(date, pattern);
    }
    format(date, pattern, locale) {
        return I18nFormat.formatDate(date, pattern, locale);
    }
    formatDateTime(date, pattern, locale) {
        return I18nFormat.formatDateTimeWithoutGMT(date, pattern, locale);
    }
}

function centerWindowPosition(elementRef, windowRef) {
    if (!elementRef.nativeElement || !elementRef.nativeElement.getBoundingClientRect) {
        return {};
    }
    const rect = elementRef.nativeElement.getBoundingClientRect();
    const elmHeight = rect.height;
    const elmWidth = rect.width;
    const winHeight = windowRef.innerHeight;
    const winWidth = windowRef.innerWidth;
    return {
        left: (winWidth - elmWidth) / 2,
        top: (winHeight - elmHeight) / 2
    };
}
function stopPropagationIfExist($event) {
    if ($event) {
        $event.stopPropagation();
    }
}

function unshiftString(str, targetLength, addString) {
    targetLength = targetLength > 0 ? targetLength : 0;
    addString = String((typeof addString !== 'undefined' && typeof addString !== 'object') ? addString : ' ');
    str = (str === undefined || str === null) ? '' : String(str);
    if (str.length >= targetLength) {
        return String(str);
    }
    else {
        targetLength = targetLength - str.length;
        if (targetLength > addString.length) {
            addString += addString.repeat(targetLength / addString.length);
        }
        return addString.slice(0, targetLength) + String(str);
    }
}

const DevUIGlobalConfigToken = new InjectionToken('DevUI_global_config');

const isDefined = function (value) {
    return value !== undefined;
};
class DevConfigService {
    constructor(defaultConfig) {
        this.configUpdated$ = new Subject();
        this.config = defaultConfig || {};
    }
    getConfigForComponent(componentName) {
        return this.config[componentName];
    }
    getConfigForApi(api) {
        const globalConfig = this.config['global'] || {};
        const apiConfig = globalConfig[api];
        return apiConfig;
    }
    getConfigChangeEventForComponent(componentName) {
        return this.configUpdated$.pipe(filter((n) => n === componentName), mapTo(undefined));
    }
    set(componentName, value) {
        this.config[componentName] = Object.assign(Object.assign({}, this.config[componentName]), value);
        this.configUpdated$.next(componentName);
    }
}
DevConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DevConfigService, deps: [{ token: DevUIGlobalConfigToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
DevConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DevConfigService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: DevConfigService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }], ctorParameters: function () {
        return [{ type: undefined, decorators: [{
                        type: Optional
                    }, {
                        type: Inject,
                        args: [DevUIGlobalConfigToken]
                    }] }];
    } });
function WithConfig(propertyKey) {
    return function ConfigDecorator(target, propName, originalDescriptor) {
        const privatePropName = `$$__assignedValue__${propName}`;
        if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
            console.warn(`The prop "${privatePropName}" is already exist, it will be overrided by withConfig decorator.`);
        }
        Object.defineProperty(target, privatePropName, {
            configurable: true,
            writable: true,
            enumerable: false,
        });
        return {
            get() {
                const originalValue = (originalDescriptor === null || originalDescriptor === void 0 ? void 0 : originalDescriptor.get) ? originalDescriptor.get.bind(this)() : this[privatePropName];
                const assignedByUser = ((this.assignmentCount || {})[propName] || 0) > 1;
                if (assignedByUser && isDefined(originalValue)) {
                    return originalValue;
                }
                if (JSON.stringify(this.devConfigService.config) === '{}') {
                    return originalValue;
                }
                let name = this.constructor.name;
                name = name.replace('Directive', '');
                name = name.replace('Component', '');
                name = name.toLowerCase();
                const componentConfig = this.devConfigService.config[name] || {};
                const configValue = componentConfig[propName];
                const globalConfig = this.devConfigService.config['global'] || {};
                const apiConfig = globalConfig[propName];
                const ret = isDefined(configValue) ? configValue : isDefined(apiConfig) ? apiConfig : originalValue;
                return ret;
            },
            set(value) {
                this.assignmentCount = this.assignmentCount || {};
                this.assignmentCount[propName] = (this.assignmentCount[propName] || 0) + 1;
                if (originalDescriptor && originalDescriptor.set) {
                    originalDescriptor.set.bind(this)(value);
                }
                this[privatePropName] = value;
            },
            configurable: true,
            enumerable: true,
        };
    };
}

class HighlightComponent {
    constructor(translateHtml, eleRef, doc) {
        this.translateHtml = translateHtml;
        this.eleRef = eleRef;
        this.doc = doc;
        this.display = 'inline';
        /**
         * @deprecated
         */
        this.highlightClass = 'devui-match-highlight';
        this.document = this.doc;
    }
    ngOnChanges(changes) {
        this.addDom(this.value, this.term);
    }
    addDom(value, term) {
        if (value && term) {
            this.highlight(value, term);
        }
        else {
            const container = this.eleRef.nativeElement;
            this.emptyChildren(container);
            container.textContent = value;
        }
    }
    emptyChildren(container) {
        while (container.hasChildNodes()) {
            container.removeChild(container.firstChild);
        }
    }
    highlight(value, term) {
        const container = this.eleRef.nativeElement;
        this.emptyChildren(container);
        const reg = (str) => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
        const regExp = new RegExp('(' + reg(term) + ')', 'gi');
        const temp = value.split(regExp);
        const createHighLight = (text) => {
            const spanDOM = this.document.createElement('span');
            spanDOM.classList.add('devui-match-highlight');
            spanDOM.textContent = text;
            return spanDOM;
        };
        temp.forEach((element, index) => {
            if (index % 2 === 0) {
                container.appendChild(this.document.createTextNode(element));
            }
            else {
                container.appendChild(createHighLight(element));
            }
        });
    }
}
HighlightComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighlightComponent, deps: [{ token: i1.DomSanitizer }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
HighlightComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: HighlightComponent, selector: "d-highlight", inputs: { value: "value", term: "term", highlightClass: "highlightClass" }, host: { properties: { "style.display": "this.display" } }, usesOnChanges: true, ngImport: i0, template: ``, isInline: true, styles: [":host ::ng-deep .devui-match-highlight{font-weight:700}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighlightComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-highlight', template: ``, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host ::ng-deep .devui-match-highlight{font-weight:700}\n"] }]
        }], ctorParameters: function () {
        return [{ type: i1.DomSanitizer }, { type: i0.ElementRef }, { type: undefined, decorators: [{
                        type: Inject,
                        args: [DOCUMENT]
                    }] }];
    }, propDecorators: { display: [{
                type: HostBinding,
                args: ['style.display']
            }], value: [{
                type: Input
            }], term: [{
                type: Input
            }], highlightClass: [{
                type: Input
            }] } });

class HighlightModule {
}
HighlightModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighlightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
HighlightModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: HighlightModule, declarations: [HighlightComponent], imports: [CommonModule], exports: [HighlightComponent] });
HighlightModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighlightModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: HighlightModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule],
                    declarations: [HighlightComponent],
                    exports: [HighlightComponent]
                }]
        }] });

class LazyLoadDirective {
    constructor(el) {
        this.el = el;
        // 启用懒加载，默认不启用
        this.enableLazyLoad = false;
        // 懒加载模式，默认列表模式
        this.contentMode = 'list';
        // 加载更多
        this.loadMore = new EventEmitter();
        // 触发懒加载的距离
        this.loadFactor = 5;
    }
    ngOnChanges(changes) {
        const element = this.target ? this.target : this.el.nativeElement;
        if (changes && changes['enableLazyLoad']) {
            if (changes.enableLazyLoad.currentValue) {
                const scrollEvent = fromEvent(element, 'scroll');
                let scrollEventFormat = scrollEvent;
                if (this.contentMode === 'list') {
                    scrollEventFormat = scrollEvent.pipe(debounceTime(300), distinctUntilChanged());
                }
                this.scrollSubscription = scrollEventFormat.subscribe(event => this.scrollList(event));
            }
            else if (this.scrollSubscription) {
                this.scrollSubscription.unsubscribe();
            }
            else {
                return;
            }
        }
    }
    ngAfterViewInit() {
        if (this.contentMode === 'img') {
            setTimeout(() => {
                const target = this.target ? this.target : this.el.nativeElement;
                const mockEvent = { target };
                this.scrollList(mockEvent);
            });
        }
    }
    ngOnDestroy() {
        if (this.scrollSubscription) {
            this.scrollSubscription.unsubscribe();
        }
    }
    scrollList(event) {
        const targetEl = event.target.scrollingElement ? event.target.scrollingElement : event.target;
        const clientHeight = targetEl.clientHeight;
        const scrollTop = targetEl.scrollTop;
        if (this.contentMode === 'img') {
            const rect = this.el.nativeElement.getBoundingClientRect();
            if (rect.top >= 0 && (clientHeight >= rect.top + this.loadFactor)) {
                if (this.imgLoadSrc) {
                    this.el.nativeElement.src = this.imgLoadSrc;
                }
                this.loadMore.emit(event);
                this.scrollSubscription.unsubscribe();
            }
        }
        else {
            const scrollHeight = targetEl.scrollHeight;
            if (scrollTop !== 0 && (scrollTop + clientHeight + this.loadFactor >= scrollHeight)) {
                this.loadMore.emit(event);
            }
        }
    }
}
LazyLoadDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
LazyLoadDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: LazyLoadDirective, selector: "[dLazyLoad]", inputs: { enableLazyLoad: "enableLazyLoad", contentMode: "contentMode", target: "target", imgLoadSrc: "imgLoadSrc" }, outputs: { loadMore: "loadMore" }, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadDirective, decorators: [{
            type: Directive,
            args: [{ selector: '[dLazyLoad]' }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { enableLazyLoad: [{
                type: Input
            }], contentMode: [{
                type: Input
            }], target: [{
                type: Input
            }], imgLoadSrc: [{
                type: Input
            }], loadMore: [{
                type: Output
            }] } });

class LazyLoadModule {
}
LazyLoadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LazyLoadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadModule, declarations: [LazyLoadDirective], imports: [CommonModule], exports: [LazyLoadDirective] });
LazyLoadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: LazyLoadModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule],
                    declarations: [LazyLoadDirective],
                    exports: [LazyLoadDirective]
                }]
        }] });

class PopperComponent {
    constructor(el, renderer, ngZone, changeDetectorRef, doc) {
        this.el = el;
        this.renderer = renderer;
        this.ngZone = ngZone;
        this.changeDetectorRef = changeDetectorRef;
        this.doc = doc;
        this.fluidPopper = true;
        this.poppoverAppendDirection = 'bottom';
        this.appendTo = 'body';
        this.showAnimation = true;
        this.popper = null;
        this._isOpen = false;
        this.directionAnimationTransformOrigin = {
            'top': '0 100%',
            'bottom': '0 0'
        };
        this.directionSubject = new Subject();
        this.openChange = new EventEmitter();
        this.onDocumentClick = ($event) => {
            if (!!this.appendTo && this.popperContainer.nativeElement !== $event.target &&
                !this.popperContainer.nativeElement.contains($event.target)) {
                this.open = false;
            }
            else if (!this.appendTo && this.open && !this.el.nativeElement.contains($event.target)) {
                this.open = false;
            }
        };
        this.blockEvent = ($event) => {
            $event.preventDefault();
            $event.stopPropagation();
        };
        this.applyTransitionStyle = (data) => {
            var _a, _b, _c;
            const optionsContainer = this.popperContainer.nativeElement;
            this.updateContainerTransitionDirection((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.state) === null || _a === void 0 ? void 0 : _a.modifiersData) === null || _b === void 0 ? void 0 : _b.flip) === null || _c === void 0 ? void 0 : _c._skip);
            if (this.animate) {
                // perspective(1px) solves pixel shift caused by webkit transform
                this.renderer.setStyle(optionsContainer, 'transform', optionsContainer.style.transform +
                    ` scale3d(1, 0.8, 1) perspective(1px) ${this.popperDirection === 'bottom' ? 'translateY(-4px)' : 'translateY(4px)'}`);
                // Set container init state to transparent as beginning of the transition.
                this.renderer.setStyle(optionsContainer, 'opacity', 0);
                PopperComponent.nextTick(() => {
                    this.setTransition('open');
                    const that = this;
                    const handler = function (e) {
                        // remove transition
                        that.setTransition();
                        e.currentTarget.removeEventListener(e.type, handler);
                    };
                    optionsContainer.addEventListener('transitionend', handler);
                    this.renderer.setStyle(optionsContainer, 'transform', optionsContainer.style.transform.replace('scale3d(1, 0.8, 1)', 'scale3d(1, 1, 1)'));
                    this.popperDirection === 'bottom' ?
                        this.renderer.setStyle(optionsContainer, 'transform', optionsContainer.style.transform.replace('translateY(-4px)', 'translateY(0)')) :
                        this.renderer.setStyle(optionsContainer, 'transform', optionsContainer.style.transform.replace('translateY(4px)', 'translateY(0)'));
                    this.renderer.setStyle(optionsContainer, 'opacity', 1);
                    this.animate = false;
                });
            }
            else {
                // handle popper re-rendering, incoming transform doesn't have scale info
                this.renderer.setStyle(optionsContainer, 'transform', optionsContainer.style.transform + (this.open ? ' scale3d(1, 1, 1)' : ' scale3d(1, 0.8, 1)') + ' perspective(1px)');
            }
        };
        this.document = this.doc;
    }
    get open() {
        return this._isOpen;
    }
    set open(value) {
        if (this._isOpen === value) {
            return;
        }
        this.animate = true;
        if (value) {
            this.show();
        }
        else {
            this.close();
        }
        this._isOpen = value;
        PopperComponent.nextTick(() => {
            this.openChange.emit(value);
            this.setBlurListener();
        });
    }
    static nextTick(fn) {
        // Force to run fn after current data changed.
        setTimeout(() => fn.bind(this)());
    }
    show() {
        // Append to selector or original parent.
        if (this.appendTo) {
            if (this.fluidPopper) {
                let popperWidth = this.popperActivator.nativeElement && this.popperActivator.nativeElement.offsetWidth;
                if (this.extraConfig && this.extraConfig.extraWidth) {
                    popperWidth = popperWidth + this.extraConfig.extraWidth;
                }
                const firstEle = this.popperContainer.nativeElement.firstElementChild;
                if (firstEle.classList.contains('devui-search-container')) {
                    for (const child of this.popperContainer.nativeElement.children) {
                        child.style.width = `${popperWidth}px`;
                    }
                }
                else {
                    firstEle.style.width = `${popperWidth}px`;
                }
            }
            this.attachPopperContainerToSelector(this.appendTo);
        }
        else {
            this.attachPopperContainerToNode(this.popperParent);
        }
        this.popper = this.createCustomPopper();
        this.renderer.setStyle(this.popperContainer.nativeElement, 'display', 'block');
    }
    close() {
        const popperContainer = this.popperContainer.nativeElement;
        this.setTransition('close');
        // For IE 11/Edge
        if (popperContainer.style.transform.match(/scale3d\(1, 1, 1\)/)) {
            // Replace transform open state with close state
            this.renderer.setStyle(popperContainer, 'transform', popperContainer.style.transform.replace('scale3d(1, 1, 1)', 'scale3d(1, 0.8, 1)'));
        }
        else {
            // perspective(1px) solves pixel shift caused by webkit transform
            this.renderer.setStyle(popperContainer, 'transform', popperContainer.style.transform + ` scale3d(1, 0.8, 1) perspective(1px)`);
        }
        // Set container to transparent
        this.renderer.setStyle(popperContainer, 'opacity', 0.8);
        // Can't use bind(this) since it calls itself
        const that = this;
        const handler = function (e) {
            if (!that.open && that.popper) {
                // Set final state of container to invisible
                that.renderer.setStyle(popperContainer, 'display', 'none');
                that.animate = false;
                // Remove transition
                that.setTransition();
                that.popper.destroy();
                that.popper = null;
                that.detachPopperContainer();
            }
            e.currentTarget.removeEventListener(e.type, handler);
        };
        if (this.showAnimation) {
            this.popperContainer.nativeElement.addEventListener('transitionend', handler);
        }
        else {
            that.renderer.setStyle(popperContainer, 'display', 'none');
            that.animate = false;
            that.popper.destroy();
            that.popper = null;
            that.detachPopperContainer();
        }
    }
    setBlurListener() {
        this.ngZone.runOutsideAngular(() => {
            if (this.open) {
                this.document.addEventListener('click', this.onDocumentClick);
                this.popperContainer.nativeElement.addEventListener('click', this.blockEvent);
            }
            else {
                this.document.removeEventListener('click', this.onDocumentClick);
                this.popperContainer.nativeElement.removeEventListener('click', this.blockEvent);
            }
        });
    }
    updateContainerTransitionDirection(flipped) {
        const direction = flipped ? 'top' : 'bottom';
        if (this.popperDirection !== direction) {
            this.popperDirection = direction;
            this.setTransitionOrigin();
        }
        this.directionSubject.next(this.popperDirection);
    }
    setTransitionOrigin() {
        if (this.popperContainer.nativeElement) {
            this.renderer.setStyle(this.popperContainer.nativeElement, 'transform-origin', this.directionAnimationTransformOrigin[this.popperDirection]);
        }
    }
    createCustomPopper() {
        return createPopper(this.popperActivator.nativeElement, this.popperContainer.nativeElement, {
            placement: 'bottom-start',
            modifiers: [
                {
                    name: 'preventOverflow',
                    options: {
                        mainAxis: true, // true by default
                    },
                },
                {
                    name: 'applyReactStyle',
                    phase: 'afterWrite',
                    enabled: true,
                    fn: this.applyTransitionStyle
                },
                {
                    name: 'offset',
                    options: {
                        offset: this.extraConfig && this.extraConfig.offset
                            ? [parseInt(this.extraConfig.offset.split(',')[0], 10), parseInt(this.extraConfig.offset.split(',')[1], 10)]
                            : [0, 5], // true by default
                    },
                },
                {
                    name: 'flip',
                    options: {
                        flipVariations: true, // true by default
                    },
                },
            ],
            strategy: this.appendTo ? 'fixed' : 'absolute',
        });
    }
    setTransition(command = null) {
        const popperContainer = this.popperContainer.nativeElement;
        if (this.animate && command) {
            if (command === 'open') {
                this.renderer.setStyle(popperContainer, 'transition', this.showAnimation
                    ? `all ${AnimationDuration.BASE} ${AnimationCurves.EASE_OUT}` : 'none');
            }
            else if (command === 'close') {
                popperContainer.style.transition = this.showAnimation ? `all ${AnimationDuration.BASE} ${AnimationCurves.EASE_IN}` : 'none';
            }
        }
        else {
            this.renderer.setStyle(popperContainer, 'transition', null);
        }
    }
    update() {
        PopperComponent.nextTick(() => {
            if (this.popper) {
                this.popper.forceUpdate();
            }
        });
    }
    ngOnDestroy() {
        // Close popper
        this.open = false;
    }
    detachPopperContainer() {
        // Cache popper's parent and popper node.
        this.popperParent = this.popperContainer.nativeElement.parentNode;
        this.popperNode = this.popperContainer.nativeElement;
        if (this.popperParent && this.popperNode) {
            this.popperParent.removeChild(this.popperNode);
        }
    }
    attachPopperContainerToNode(nodeParent) {
        if (nodeParent && this.popperNode) {
            this.popperParent = nodeParent;
            this.popperParent.appendChild(this.popperNode);
        }
    }
    attachPopperContainerToSelector(targetSelector) {
        const nodeParent = this.document.querySelector(targetSelector);
        this.attachPopperContainerToNode(nodeParent);
    }
    ngAfterViewInit() {
        // Detach popper container once view initialized.
        this.detachPopperContainer();
    }
    directionChange() {
        return this.directionSubject.asObservable();
    }
}
PopperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PopperComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
PopperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: PopperComponent, selector: "d-popper-component", inputs: { open: "open", fluidPopper: "fluidPopper", poppoverAppendDirection: "poppoverAppendDirection", appendTo: "appendTo", extraConfig: "extraConfig", showAnimation: "showAnimation" }, outputs: { openChange: "openChange" }, viewQueries: [{ propertyName: "popperActivator", first: true, predicate: ["popperActivator"], descendants: true, static: true }, { propertyName: "popperContainer", first: true, predicate: ["popperContainer"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"popper\">\n  <div class=\"popper-activator\" #popperActivator>\n    <ng-content select=\"[popper-activator]\"></ng-content>\n  </div>\n\n  <div\n    class=\"popper-container\"\n    #popperContainer\n    [ngClass]=\"{\n      fluid: fluidPopper && !appendTo,\n      'devui-popover-container-right': poppoverAppendDirection === 'right',\n      'devui-popover-container-left': poppoverAppendDirection === 'left'\n    }\"\n  >\n    <div class=\"devui-dropdown-menu-wrap\">\n      <ng-content select=\"[popper-prepend]\"></ng-content>\n      <div class=\"popper-container-scrollable devui-scrollbar\">\n        <ng-content select=\"[popper-container]\"></ng-content>\n      </div>\n    </div>\n    <div class=\"popper-append-area\">\n      <ng-content select=\"[popper-append]\"></ng-content>\n    </div>\n  </div>\n</div>\n", styles: [".popper{position:relative;width:100%}.popper .popper-activator{width:100%}.popper-container{display:none;z-index:1052;z-index:var(--devui-z-index-dropdown, 1052);position:absolute;box-shadow:0 8px 16px #252b3a33;box-shadow:var(--devui-shadow-length-feedback-overlay, 0 8px 16px 0) var(--devui-shadow, rgba(37, 43, 58, .2));background:#ffffff;background:var(--devui-connected-overlay-bg, #ffffff);border:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:2px;border-radius:var(--devui-border-radius, 2px)}.popper-container.devui-popover-container-right,.popper-container.devui-popover-container-left{display:flex!important}.popper-container.devui-popover-container-right>.devui-dropdown-menu-wrap,.popper-container.devui-popover-container-left>.devui-dropdown-menu-wrap{display:inline-block}.popper-container.devui-popover-container-right>.popper-append-area,.popper-container.devui-popover-container-left>.popper-append-area{display:inline-block;overflow:auto}.popper-container.devui-popover-container-right .popper-append-area,.popper-container.devui-popover-container-left .popper-append-area{border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.popper-container.devui-popover-container-right .popper-append-area:before,.popper-container.devui-popover-container-left .popper-append-area:before{display:none}.popper-container.devui-popover-container-left .popper-append-area{order:-1}.popper-container .popper-container-scrollable{min-height:40px;width:100%;overflow:auto;overflow:overlay}.popper-container.fluid{width:100%}:host{display:block}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PopperComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-popper-component', template: "<div class=\"popper\">\n  <div class=\"popper-activator\" #popperActivator>\n    <ng-content select=\"[popper-activator]\"></ng-content>\n  </div>\n\n  <div\n    class=\"popper-container\"\n    #popperContainer\n    [ngClass]=\"{\n      fluid: fluidPopper && !appendTo,\n      'devui-popover-container-right': poppoverAppendDirection === 'right',\n      'devui-popover-container-left': poppoverAppendDirection === 'left'\n    }\"\n  >\n    <div class=\"devui-dropdown-menu-wrap\">\n      <ng-content select=\"[popper-prepend]\"></ng-content>\n      <div class=\"popper-container-scrollable devui-scrollbar\">\n        <ng-content select=\"[popper-container]\"></ng-content>\n      </div>\n    </div>\n    <div class=\"popper-append-area\">\n      <ng-content select=\"[popper-append]\"></ng-content>\n    </div>\n  </div>\n</div>\n", styles: [".popper{position:relative;width:100%}.popper .popper-activator{width:100%}.popper-container{display:none;z-index:1052;z-index:var(--devui-z-index-dropdown, 1052);position:absolute;box-shadow:0 8px 16px #252b3a33;box-shadow:var(--devui-shadow-length-feedback-overlay, 0 8px 16px 0) var(--devui-shadow, rgba(37, 43, 58, .2));background:#ffffff;background:var(--devui-connected-overlay-bg, #ffffff);border:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:2px;border-radius:var(--devui-border-radius, 2px)}.popper-container.devui-popover-container-right,.popper-container.devui-popover-container-left{display:flex!important}.popper-container.devui-popover-container-right>.devui-dropdown-menu-wrap,.popper-container.devui-popover-container-left>.devui-dropdown-menu-wrap{display:inline-block}.popper-container.devui-popover-container-right>.popper-append-area,.popper-container.devui-popover-container-left>.popper-append-area{display:inline-block;overflow:auto}.popper-container.devui-popover-container-right .popper-append-area,.popper-container.devui-popover-container-left .popper-append-area{border-left:1px solid #f2f2f3;border-left:1px solid var(--devui-dividing-line, #f2f2f3)}.popper-container.devui-popover-container-right .popper-append-area:before,.popper-container.devui-popover-container-left .popper-append-area:before{display:none}.popper-container.devui-popover-container-left .popper-append-area{order:-1}.popper-container .popper-container-scrollable{min-height:40px;width:100%;overflow:auto;overflow:overlay}.popper-container.fluid{width:100%}:host{display:block}\n"] }]
        }], ctorParameters: function () {
        return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
                        type: Inject,
                        args: [DOCUMENT]
                    }] }];
    }, propDecorators: { open: [{
                type: Input
            }], fluidPopper: [{
                type: Input
            }], poppoverAppendDirection: [{
                type: Input
            }], appendTo: [{
                type: Input
            }], extraConfig: [{
                type: Input
            }], showAnimation: [{
                type: Input
            }], openChange: [{
                type: Output
            }], popperActivator: [{
                type: ViewChild,
                args: ['popperActivator', { static: true }]
            }], popperContainer: [{
                type: ViewChild,
                args: ['popperContainer', { static: true }]
            }] } });

class PopperModule {
}
PopperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PopperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
PopperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: PopperModule, declarations: [PopperComponent], imports: [CommonModule], exports: [PopperComponent] });
PopperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PopperModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: PopperModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule],
                    declarations: [PopperComponent],
                    exports: [PopperComponent]
                }]
        }] });

class SafePipe {
    constructor(sanitizer) {
        this.sanitizer = sanitizer;
    }
    transform(value, type) {
        switch (type) {
            case 'html':
                return this.sanitizer.bypassSecurityTrustHtml(value);
            case 'style':
                return this.sanitizer.bypassSecurityTrustStyle(value);
            case 'url':
                return this.sanitizer.bypassSecurityTrustUrl(value);
            default:
                throw new Error(`Unable to bypass security for invalid type: ${type}`);
        }
    }
}
SafePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
SafePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SafePipe, name: "safe" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SafePipe, decorators: [{
            type: Pipe,
            args: [{ name: 'safe' }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });

class SafePipeModule {
}
SafePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SafePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
SafePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SafePipeModule, declarations: [SafePipe], exports: [SafePipe] });
SafePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SafePipeModule });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SafePipeModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [SafePipe],
                    exports: [SafePipe]
                }]
        }] });

class TreeUtils {
    // 动态添加styles
    static addElStyles(el, styles) {
        if (styles instanceof Object) {
            for (const s in styles) {
                if (Object.prototype.hasOwnProperty.call(styles, s)) {
                    if (Array.isArray(styles[s])) {
                        // 用于支持兼容渐退
                        styles[s].forEach(val => {
                            el.style[s] = val;
                        });
                    }
                    else {
                        el.style[s] = styles[s];
                    }
                }
            }
        }
    }
}

/**
 * Generated bundle index. Do not edit.
 */

export { AnimationCurves, AnimationDuration, AppendToBodyDirectionsConfig, DefaultDateConverter, DevConfigService, DevUIGlobalConfigToken, HighlightComponent, HighlightModule, LazyLoadDirective, LazyLoadModule, PopperComponent, PopperModule, SafePipe, SafePipeModule, TreeUtils, WithConfig, addClassToOrigin, backdropFadeInOut, centerWindowPosition, cornerFadeInOut, directionFadeInOut, easeInOutCubic, expandCollapse, expandCollapseForDomDestroy, fadeInOut, flyInOut, formWithDropDown, formatDate, isValidDate, openClose, parseDate, popInOut, removeClassFromOrigin, scrollAnimate, stopPropagationIfExist, unshiftString, wipeInOutAnimation };
//# sourceMappingURL=ng-devui-utils.mjs.map
