/*!
 * filename: ej2.js
 * version : 18.4.46
 * Copyright Syncfusion Inc. 2001 - 2021. All rights reserved.
 * Use of this code is subject to the terms of our license.
 * A copy of the current license can be obtained at any time by e-mailing
 * licensing@syncfusion.com. Any infringement will be prosecuted under
 * applicable laws.
 */
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./crg-resources/18.4.46/src/ej2-1615469772130/script.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./crg-resources/18.4.46/src/ej2-1615469772130/copy.js":
/*!*************************************************************!*\
  !*** ./crg-resources/18.4.46/src/ej2-1615469772130/copy.js ***!
  \*************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

function copy(copied, first, second, deep) {
    var result = copied || {};
    var length = arguments.length;
    if (deep) {
        length = length - 1;
    }
    var _loop_1 = function (i) {
         if (!arguments_1[i]) {
            return "continue";
        }
        var obj1 = arguments_1[i];
        Object.keys(obj1).forEach(function (key) {
            var src = result[key];
            var copyObj = obj1[key];
            var clone;
            if (deep && (ejs.base.isObject(copyObj) || Array.isArray(copyObj))) {
                if (ejs.base.isObject(copyObj)) {
                    clone = src ? src : {};
                    result[key] = copy({}, clone, copyObj, deep);
                }
                else {
                    clone = src ? src : [];
                    result[key] = copy([], clone, copyObj, deep);
                }
            }
            else {
                result[key] = copyObj;
            }
        });
    };
    var arguments_1 = arguments;
    for (var i = 1; i < length; i++) {
        _loop_1(i);
    }
    return result;
}
exports.copy = copy;

/***/ }),

/***/ "./crg-resources/18.4.46/src/ej2-1615469772130/schedule.js":
/*!*****************************************************************!*\
  !*** ./crg-resources/18.4.46/src/ej2-1615469772130/schedule.js ***!
  \*****************************************************************/
/*! exports provided: schedule1, base1, data1, inputs1, buttons1, lists1, popups1, calendars1, dropdowns1, navigations1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schedule1", function() { return schedule1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base1", function() { return base1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "data1", function() { return data1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputs1", function() { return inputs1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buttons1", function() { return buttons1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lists1", function() { return lists1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "popups1", function() { return popups1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calendars1", function() { return calendars1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropdowns1", function() { return dropdowns1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "navigations1", function() { return navigations1; });
/* harmony import */ var _copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./copy */ "./crg-resources/18.4.46/src/ej2-1615469772130/copy.js");
/* harmony import */ var _copy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_copy__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-schedule */ "./ej2-resources/18.4.46/scripts/ej2-schedule/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_inputs_form_validator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-inputs/form-validator */ "./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_inputs_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-inputs/input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_inputs_numerictextbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox */ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_buttons_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-buttons/button */ "./ej2-resources/18.4.46/scripts/ej2-buttons/button/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_buttons_check_box__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-buttons/check-box */ "./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_lists_common_list_base__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-lists/common/list-base */ "./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_popups__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_calendars_calendar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-calendars/calendar */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_calendars_datepicker__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-calendars/datepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_calendars_datetimepicker__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_dropdowns_drop_down_list__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_dropdowns_multi_select__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_navigations_toolbar__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-navigations/toolbar */ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/index.js");
/* harmony import */ var _ej2_resources_18_4_46_scripts_ej2_navigations_treeview__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../ej2-resources/18.4.46/scripts/ej2-navigations/treeview */ "./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/index.js");



















var schedule1 = {};
var base1 = {};
var data1 = {};
var inputs1 = {};
var buttons1 = {};
var lists1 = {};
var popups1 = {};
var calendars1 = {};
var dropdowns1 = {};
var navigations1 = {};

_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Schedule"].Inject(_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Day"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Week"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["WorkWeek"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Month"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Year"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Agenda"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["MonthAgenda"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineViews"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineMonth"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineYear"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Resize"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["DragAndDrop"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ExcelExport"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ICalendarExport"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ICalendarImport"],_ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Print"]);

Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(schedule1, {Schedule: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Schedule"],Day: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Day"], Week: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Week"], WorkWeek: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["WorkWeek"], Month: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Month"], Year: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Year"], Agenda: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Agenda"], MonthAgenda: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["MonthAgenda"], TimelineViews: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineViews"], TimelineMonth: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineMonth"], TimelineYear: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["TimelineYear"], Resize: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Resize"], DragAndDrop: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["DragAndDrop"], ExcelExport: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ExcelExport"], ICalendarExport: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ICalendarExport"], ICalendarImport: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["ICalendarImport"], Print: _ej2_resources_18_4_46_scripts_ej2_schedule__WEBPACK_IMPORTED_MODULE_1__["Print"]});
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(base1, _ej2_resources_18_4_46_scripts_ej2_base__WEBPACK_IMPORTED_MODULE_2__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(data1, _ej2_resources_18_4_46_scripts_ej2_data__WEBPACK_IMPORTED_MODULE_3__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(inputs1, _ej2_resources_18_4_46_scripts_ej2_inputs_form_validator__WEBPACK_IMPORTED_MODULE_4__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(inputs1, _ej2_resources_18_4_46_scripts_ej2_inputs_input__WEBPACK_IMPORTED_MODULE_5__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(inputs1, _ej2_resources_18_4_46_scripts_ej2_inputs_numerictextbox__WEBPACK_IMPORTED_MODULE_6__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(buttons1, _ej2_resources_18_4_46_scripts_ej2_buttons_button__WEBPACK_IMPORTED_MODULE_7__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(buttons1, _ej2_resources_18_4_46_scripts_ej2_buttons_check_box__WEBPACK_IMPORTED_MODULE_8__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(lists1, _ej2_resources_18_4_46_scripts_ej2_lists_common_list_base__WEBPACK_IMPORTED_MODULE_9__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(popups1, _ej2_resources_18_4_46_scripts_ej2_popups__WEBPACK_IMPORTED_MODULE_10__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(calendars1, _ej2_resources_18_4_46_scripts_ej2_calendars_calendar__WEBPACK_IMPORTED_MODULE_11__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(calendars1, _ej2_resources_18_4_46_scripts_ej2_calendars_datepicker__WEBPACK_IMPORTED_MODULE_12__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(calendars1, _ej2_resources_18_4_46_scripts_ej2_calendars_datetimepicker__WEBPACK_IMPORTED_MODULE_13__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(dropdowns1, _ej2_resources_18_4_46_scripts_ej2_dropdowns_drop_down_list__WEBPACK_IMPORTED_MODULE_14__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(dropdowns1, _ej2_resources_18_4_46_scripts_ej2_dropdowns_multi_select__WEBPACK_IMPORTED_MODULE_15__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(navigations1, _ej2_resources_18_4_46_scripts_ej2_navigations_toolbar__WEBPACK_IMPORTED_MODULE_16__);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(navigations1, _ej2_resources_18_4_46_scripts_ej2_navigations_treeview__WEBPACK_IMPORTED_MODULE_17__);



/***/ }),

/***/ "./crg-resources/18.4.46/src/ej2-1615469772130/script.js":
/*!***************************************************************!*\
  !*** ./crg-resources/18.4.46/src/ej2-1615469772130/script.js ***!
  \***************************************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./copy */ "./crg-resources/18.4.46/src/ej2-1615469772130/copy.js");
/* harmony import */ var _copy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_copy__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _schedule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schedule */ "./crg-resources/18.4.46/src/ej2-1615469772130/schedule.js");



var schedule = {};
var base = {};
var data = {};
var inputs = {};
var buttons = {};
var lists = {};
var popups = {};
var calendars = {};
var dropdowns = {};
var navigations = {};

Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(schedule, _schedule__WEBPACK_IMPORTED_MODULE_1__["schedule1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(base, _schedule__WEBPACK_IMPORTED_MODULE_1__["base1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(data, _schedule__WEBPACK_IMPORTED_MODULE_1__["data1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(inputs, _schedule__WEBPACK_IMPORTED_MODULE_1__["inputs1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(buttons, _schedule__WEBPACK_IMPORTED_MODULE_1__["buttons1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(lists, _schedule__WEBPACK_IMPORTED_MODULE_1__["lists1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(popups, _schedule__WEBPACK_IMPORTED_MODULE_1__["popups1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(calendars, _schedule__WEBPACK_IMPORTED_MODULE_1__["calendars1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(dropdowns, _schedule__WEBPACK_IMPORTED_MODULE_1__["dropdowns1"]);
Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(navigations, _schedule__WEBPACK_IMPORTED_MODULE_1__["navigations1"]);

var ejs = { schedule:schedule,base:base,data:data,inputs:inputs,buttons:buttons,lists:lists,popups:popups,calendars:calendars,dropdowns:dropdowns,navigations:navigations }

if (window.ejs) { Object(_copy__WEBPACK_IMPORTED_MODULE_0__["copy"])(ejs, window.ejs, null, true); }
window.ejs = ejs;
window.ej = ejs;

/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/ajax.js":
/*!********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/ajax.js ***!
  \********************************************************/
/*! exports provided: Ajax */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ajax", function() { return Ajax; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");

var headerRegex = /^(.*?):[ \t]*([^\r\n]*)$/gm;
var defaultType = 'GET';
/**
 * Ajax class provides ability to make asynchronous HTTP request to the server
 * ```typescript
 *   var ajax = new Ajax("index.html", "GET", true);
 *   ajax.send().then(
 *               function (value) {
 *                   console.log(value);
 *               },
 *               function (reason) {
 *                   console.log(reason);
 *               });
 * ```
 */
var Ajax = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for Ajax class
     * @param  {string|Object} options?
     * @param  {string} type?
     * @param  {boolean} async?
     * @returns defaultType
     */
    function Ajax(options, type, async, contentType) {
        /**
         * A boolean value indicating whether the request should be sent asynchronous or not.
         * @default true
         */
        this.mode = true;
        /**
         * A boolean value indicating whether to ignore the promise reject.
         * @private
         * @default true
         */
        this.emitError = true;
        this.options = {};
        if (typeof options === 'string') {
            this.url = options;
            this.type = type ? type.toUpperCase() : defaultType;
            this.mode = !Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(async) ? async : true;
        }
        else if (typeof options === 'object') {
            this.options = options;
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(this, this.options);
        }
        this.type = this.type ? this.type.toUpperCase() : defaultType;
        this.contentType = (this.contentType !== undefined) ? this.contentType : contentType;
    }
    /**
     * Send the request to server.
     * @param {any} data - To send the user data
     * @return {Promise}
     */
    Ajax.prototype.send = function (data) {
        var _this = this;
        this.data = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data) ? this.data : data;
        var eventArgs = {
            cancel: false,
            httpRequest: null
        };
        var promise = new Promise(function (resolve, reject) {
            _this.httpRequest = new XMLHttpRequest();
            _this.httpRequest.onreadystatechange = function () { _this.stateChange(resolve, reject); };
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.onLoad)) {
                _this.httpRequest.onload = _this.onLoad;
            }
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.onProgress)) {
                _this.httpRequest.onprogress = _this.onProgress;
            }
            /* istanbul ignore next */
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.onAbort)) {
                _this.httpRequest.onabort = _this.onAbort;
            }
            /* istanbul ignore next */
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.onError)) {
                _this.httpRequest.onerror = _this.onError;
            }
            //** Upload Events **/
            /* istanbul ignore next */
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.onUploadProgress)) {
                _this.httpRequest.upload.onprogress = _this.onUploadProgress;
            }
            _this.httpRequest.open(_this.type, _this.url, _this.mode);
            // Set default headers
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.data) && _this.contentType !== null) {
                _this.httpRequest.setRequestHeader('Content-Type', _this.contentType || 'application/json; charset=utf-8');
            }
            if (_this.beforeSend) {
                eventArgs.httpRequest = _this.httpRequest;
                _this.beforeSend(eventArgs);
            }
            if (!eventArgs.cancel) {
                _this.httpRequest.send(!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.data) ? _this.data : null);
            }
        });
        return promise;
    };
    Ajax.prototype.successHandler = function (data) {
        if (this.onSuccess) {
            this.onSuccess(data, this);
        }
        return data;
    };
    Ajax.prototype.failureHandler = function (reason) {
        if (this.onFailure) {
            this.onFailure(this.httpRequest);
        }
        return reason;
    };
    Ajax.prototype.stateChange = function (resolve, reject) {
        var data = this.httpRequest.responseText;
        if (this.dataType && this.dataType.toLowerCase() === 'json') {
            if (data === '') {
                data = undefined;
            }
            else {
                try {
                    data = JSON.parse(data);
                }
                catch (error) {
                    // no exception handle
                }
            }
        }
        if (this.httpRequest.readyState === 4) {
            //success range should be 200 to 299
            if ((this.httpRequest.status >= 200 && this.httpRequest.status <= 299) || this.httpRequest.status === 304) {
                resolve(this.successHandler(data));
            }
            else {
                if (this.emitError) {
                    reject(new Error(this.failureHandler(this.httpRequest.statusText)));
                }
                else {
                    resolve();
                }
            }
        }
    };
    /**
     * To get the response header from XMLHttpRequest
     * @param  {string} key Key to search in the response header
     * @returns {string}
     */
    Ajax.prototype.getResponseHeader = function (key) {
        var responseHeaders;
        var header;
        responseHeaders = {};
        var headers = headerRegex.exec(this.httpRequest.getAllResponseHeaders());
        while (headers) {
            responseHeaders[headers[1].toLowerCase()] = headers[2];
            headers = headerRegex.exec(this.httpRequest.getAllResponseHeaders());
        }
        header = responseHeaders[key.toLowerCase()];
        return Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(header) ? null : header;
    };
    return Ajax;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/animation.js":
/*!*************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/animation.js ***!
  \*************************************************************/
/*! exports provided: Animation, rippleEffect, isRippleEnabled, enableRipple */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return Animation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rippleEffect", function() { return rippleEffect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRippleEnabled", function() { return isRippleEnabled; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableRipple", function() { return enableRipple; });
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");
/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};





/**
 * The Animation framework provide options to animate the html DOM elements
 * ```typescript
 *   let animeObject = new Animation({
 *      name: 'SlideLeftIn',
 *      duration: 1000
 *   });
 *   animeObject.animate('#anime1');
 *   animeObject.animate('#anime2', { duration: 500 });
 * ```
 */
var Animation = /** @__PURE__ @class */ (function (_super) {
    __extends(Animation, _super);
    function Animation(options) {
        var _this = _super.call(this, options, undefined) || this;
        /**
         * @private
         */
        _this.easing = {
            ease: 'cubic-bezier(0.250, 0.100, 0.250, 1.000)',
            linear: 'cubic-bezier(0.250, 0.250, 0.750, 0.750)',
            easeIn: 'cubic-bezier(0.420, 0.000, 1.000, 1.000)',
            easeOut: 'cubic-bezier(0.000, 0.000, 0.580, 1.000)',
            easeInOut: 'cubic-bezier(0.420, 0.000, 0.580, 1.000)',
            elasticInOut: 'cubic-bezier(0.5,-0.58,0.38,1.81)',
            elasticIn: 'cubic-bezier(0.17,0.67,0.59,1.81)',
            elasticOut: 'cubic-bezier(0.7,-0.75,0.99,1.01)'
        };
        return _this;
    }
    Animation_1 = Animation;
    /**
     * Applies animation to the current element.
     * @param {string | HTMLElement} element - Element which needs to be animated.
     * @param {AnimationModel} options - Overriding default animation settings.
     * @return {void}
     */
    Animation.prototype.animate = function (element, options) {
        options = !options ? {} : options;
        var model = this.getModel(options);
        if (typeof element === 'string') {
            var elements = Array.prototype.slice.call(Object(_dom__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(element, document));
            for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
                var element_1 = elements_1[_i];
                model.element = element_1;
                Animation_1.delayAnimation(model);
            }
        }
        else {
            model.element = element;
            Animation_1.delayAnimation(model);
        }
    };
    /**
     * Stop the animation effect on animated element.
     * @param {HTMLElement} element - Element which needs to be stop the animation.
     * @param {AnimationOptions} model - Handling the animation model at stop function.
     * @return {void}
     */
    Animation.stop = function (element, model) {
        element.style.animation = '';
        element.removeAttribute('e-animate');
        var animationId = element.getAttribute('e-animation-id');
        if (animationId) {
            var frameId = parseInt(animationId, 10);
            cancelAnimationFrame(frameId);
            element.removeAttribute('e-animation-id');
        }
        if (model && model.end) {
            model.end.call(this, model);
        }
    };
    /**
     * Set delay to animation element
     * @param {AnimationModel} model
     * @returns {void}
     */
    Animation.delayAnimation = function (model) {
        if (model.delay) {
            setTimeout(function () { Animation_1.applyAnimation(model); }, model.delay);
        }
        else {
            Animation_1.applyAnimation(model);
        }
    };
    /**
     * Triggers animation
     * @param {AnimationModel} model
     * @returns {void}
     */
    Animation.applyAnimation = function (model) {
        var _this = this;
        model.timeStamp = 0;
        var step = 0;
        var timerId = 0;
        var startTime = 0;
        var prevTimeStamp = 0;
        var duration = model.duration;
        model.element.setAttribute('e-animate', 'true');
        var startAnimation = function (timeStamp) {
            try {
                if (timeStamp) {
                    // let step: number = model.timeStamp = timeStamp - startTime;
                    /** phantomjs workaround for timestamp fix */
                    prevTimeStamp = prevTimeStamp === 0 ? timeStamp : prevTimeStamp;
                    model.timeStamp = (timeStamp + model.timeStamp) - prevTimeStamp;
                    prevTimeStamp = timeStamp;
                    /** phantomjs workaround end */
                    // trigger animation begin event
                    if (!step && model.begin) {
                        model.begin.call(_this, model);
                    }
                    step = step + 1;
                    var avg = model.timeStamp / step;
                    if (model.timeStamp < duration && model.timeStamp + avg < duration && model.element.getAttribute('e-animate')) {
                        // apply animation effect to the current element                
                        model.element.style.animation = model.name + ' ' + model.duration + 'ms ' + model.timingFunction;
                        if (model.progress) {
                            model.progress.call(_this, model);
                        }
                        // repeat requestAnimationFrame 
                        requestAnimationFrame(startAnimation);
                    }
                    else {
                        // clear requestAnimationFrame
                        cancelAnimationFrame(timerId);
                        model.element.removeAttribute('e-animation-id');
                        model.element.removeAttribute('e-animate');
                        model.element.style.animation = '';
                        if (model.end) {
                            model.end.call(_this, model);
                        }
                    }
                }
                else {
                    startTime = performance.now();
                    // set initial requestAnimationFrame
                    timerId = requestAnimationFrame(startAnimation);
                    model.element.setAttribute('e-animation-id', timerId.toString());
                }
            }
            catch (e) {
                cancelAnimationFrame(timerId);
                model.element.removeAttribute('e-animation-id');
                if (model.fail) {
                    model.fail.call(_this, e);
                }
            }
        };
        startAnimation();
    };
    /**
     * Returns Animation Model
     * @param {AnimationModel} options
     * @returns {AnimationModel}
     */
    Animation.prototype.getModel = function (options) {
        return {
            name: options.name || this.name,
            delay: options.delay || this.delay,
            duration: (options.duration !== undefined ? options.duration : this.duration),
            begin: options.begin || this.begin,
            end: options.end || this.end,
            fail: options.fail || this.fail,
            progress: options.progress || this.progress,
            timingFunction: this.easing[options.timingFunction] ? this.easing[options.timingFunction] :
                (options.timingFunction || this.easing[this.timingFunction])
        };
    };
    /**
     * @private
     */
    Animation.prototype.onPropertyChanged = function (newProp, oldProp) {
        // no code needed
    };
    /**
     * Returns module name as animation
     * @private
     */
    Animation.prototype.getModuleName = function () {
        return 'animation';
    };
    /**
     * @private
     */
    Animation.prototype.destroy = function () {
        //Override base destroy;
    };
    var Animation_1;
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Property"])('FadeIn')
    ], Animation.prototype, "name", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Property"])(400)
    ], Animation.prototype, "duration", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Property"])('ease')
    ], Animation.prototype, "timingFunction", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Property"])(0)
    ], Animation.prototype, "delay", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Event"])()
    ], Animation.prototype, "progress", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Event"])()
    ], Animation.prototype, "begin", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Event"])()
    ], Animation.prototype, "end", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_4__["Event"])()
    ], Animation.prototype, "fail", void 0);
    Animation = Animation_1 = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_4__["NotifyPropertyChanges"]
    ], Animation);
    return Animation;
}(_base__WEBPACK_IMPORTED_MODULE_1__["Base"]));

/**
 * Ripple provides material theme's wave effect when an element is clicked
 * ```html
 * <div id='ripple'></div>
 * <script>
 *   rippleEffect(document.getElementById('ripple'));
 * </script>
 * ```
 * @private
 * @param HTMLElement element - Target element
 * @param RippleOptions rippleOptions - Ripple options .
 */
function rippleEffect(element, rippleOptions, done) {
    var rippleModel = getRippleModel(rippleOptions);
    if (rippleModel.rippleFlag === false || (rippleModel.rippleFlag === undefined && !isRippleEnabled)) {
        return Function;
    }
    element.setAttribute('data-ripple', 'true');
    _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].add(element, 'mousedown', rippleHandler, { parent: element, rippleOptions: rippleModel });
    _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].add(element, 'mouseup', rippleUpHandler, { parent: element, rippleOptions: rippleModel, done: done });
    _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].add(element, 'mouseleave', rippleLeaveHandler, { parent: element, rippleOptions: rippleModel });
    if (_browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].isPointer) {
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].add(element, 'transitionend', rippleLeaveHandler, { parent: element, rippleOptions: rippleModel });
    }
    return (function () {
        element.removeAttribute('data-ripple');
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].remove(element, 'mousedown', rippleHandler);
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].remove(element, 'mouseup', rippleUpHandler);
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].remove(element, 'mouseleave', rippleLeaveHandler);
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].remove(element, 'transitionend', rippleLeaveHandler);
    });
}
function getRippleModel(rippleOptions) {
    var rippleModel = {
        selector: rippleOptions && rippleOptions.selector ? rippleOptions.selector : null,
        ignore: rippleOptions && rippleOptions.ignore ? rippleOptions.ignore : null,
        rippleFlag: rippleOptions && rippleOptions.rippleFlag,
        isCenterRipple: rippleOptions && rippleOptions.isCenterRipple,
        duration: rippleOptions && rippleOptions.duration ? rippleOptions.duration : 350
    };
    return rippleModel;
}
/**
 * Handler for ripple event
 * @param {MouseEvent} e
 * @returns {void}
 * @private
 */
function rippleHandler(e) {
    var target = (e.target);
    var selector = this.rippleOptions.selector;
    var element = selector ? Object(_dom__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, selector) : target;
    if (!element || (this.rippleOptions && Object(_dom__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, this.rippleOptions.ignore))) {
        return;
    }
    var offset = element.getBoundingClientRect();
    var offsetX = e.pageX - document.body.scrollLeft;
    var offsetY = e.pageY - ((!document.body.scrollTop && document.documentElement) ?
        document.documentElement.scrollTop : document.body.scrollTop);
    var pageX = Math.max(Math.abs(offsetX - offset.left), Math.abs(offsetX - offset.right));
    var pageY = Math.max(Math.abs(offsetY - offset.top), Math.abs(offsetY - offset.bottom));
    var radius = Math.sqrt(pageX * pageX + pageY * pageY);
    var diameter = radius * 2 + 'px';
    var x = offsetX - offset.left - radius;
    var y = offsetY - offset.top - radius;
    if (this.rippleOptions && this.rippleOptions.isCenterRipple) {
        x = 0;
        y = 0;
        diameter = '100%';
    }
    element.classList.add('e-ripple');
    var duration = this.rippleOptions.duration.toString();
    var styles = 'width: ' + diameter + ';height: ' + diameter + ';left: ' + x + 'px;top: ' + y + 'px;' +
        'transition-duration: ' + duration + 'ms;';
    var rippleElement = Object(_dom__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-ripple-element', styles: styles });
    element.appendChild(rippleElement);
    window.getComputedStyle(rippleElement).getPropertyValue('opacity');
    rippleElement.style.transform = 'scale(1)';
    if (element !== this.parent) {
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].add(element, 'mouseleave', rippleLeaveHandler, { parent: this.parent, rippleOptions: this.rippleOptions });
    }
}
/**
 * Handler for ripple element mouse up event
 * @param {MouseEvent} e
 * @returns {void}
 * @private
 */
function rippleUpHandler(e) {
    removeRipple(e, this);
}
/**
 * Handler for ripple element mouse move event
 * @param {MouseEvent} e
 * @returns {void}
 * @private
 */
function rippleLeaveHandler(e) {
    removeRipple(e, this);
}
/**
 * Handler for removing ripple element
 * @param {MouseEvent} e
 * @param {rippleArgs} eventArgs
 * @returns {void}
 * @private
 */
function removeRipple(e, eventArgs) {
    var duration = eventArgs.rippleOptions.duration;
    var target = (e.target);
    var selector = eventArgs.rippleOptions.selector;
    var element = selector ? Object(_dom__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, selector) : target;
    if (!element || (element && element.className.indexOf('e-ripple') === -1)) {
        return;
    }
    var rippleElements = Object(_dom__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-ripple-element', element);
    var rippleElement = rippleElements[rippleElements.length - 1];
    if (rippleElement) {
        rippleElement.style.opacity = '0.5';
    }
    if (eventArgs.parent !== element) {
        _event_handler__WEBPACK_IMPORTED_MODULE_3__["EventHandler"].remove(element, 'mouseleave', rippleLeaveHandler);
    }
    /* tslint:disable:align */
    setTimeout(function () {
        if (rippleElement && rippleElement.parentNode) {
            rippleElement.parentNode.removeChild(rippleElement);
        }
        if (!element.getElementsByClassName('e-ripple-element').length) {
            element.classList.remove('e-ripple');
        }
        if (eventArgs.done) {
            eventArgs.done(e);
        }
    }, duration);
}
var isRippleEnabled = false;
/**
 * Animation Module provides support to enable ripple effect functionality to Essential JS 2 components.
 * @param {boolean} isRipple Specifies the boolean value to enable or disable ripple effect.
 * @returns {boolean}
 */
function enableRipple(isRipple) {
    isRippleEnabled = isRipple;
    return isRippleEnabled;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/base.js":
/*!********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/base.js ***!
  \********************************************************/
/*! exports provided: Base, getComponent, removeChildInstance */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Base", function() { return Base; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getComponent", function() { return getComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeChildInstance", function() { return removeChildInstance; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./observer */ "./ej2-resources/18.4.46/scripts/ej2-base/observer.js");



var isColEName = new RegExp('\]');
/* tslint:enable:no-any */
/**
 * Base library module is common module for Framework modules like touch,keyboard and etc.,
 * @private
 */
var Base = /** @__PURE__ @class */ (function () {
    /**
     * Base constructor accept options and element
     */
    function Base(options, element) {
        this.isRendered = false;
        this.isComplexArraySetter = false;
        this.isServerRendered = false;
        this.allowServerDataBinding = true;
        this.isProtectedOnChange = true;
        this.properties = {};
        this.changedProperties = {};
        this.oldProperties = {};
        this.bulkChanges = {};
        this.refreshing = false;
        this.ignoreCollectionWatch = false;
        // tslint:disable-next-line:no-empty
        this.finalUpdate = function () { };
        this.childChangedProperties = {};
        this.modelObserver = new _observer__WEBPACK_IMPORTED_MODULE_2__["Observer"](this);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(element)) {
            if ('string' === typeof (element)) {
                this.element = document.querySelector(element);
            }
            else {
                this.element = element;
            }
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element)) {
                this.isProtectedOnChange = false;
                this.addInstance();
            }
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(options)) {
            this.setProperties(options, true);
        }
        this.isDestroyed = false;
    }
    /** Property base section */
    /**
     * Function used to set bunch of property at a time.
     * @private
     * @param  {Object} prop - JSON object which holds components properties.
     * @param  {boolean} muteOnChange? - Specifies to true when we set properties.
     */
    Base.prototype.setProperties = function (prop, muteOnChange) {
        var prevDetection = this.isProtectedOnChange;
        this.isProtectedOnChange = !!muteOnChange;
        Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(this, prop);
        if (muteOnChange !== true) {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(this.changedProperties, prop);
            this.dataBind();
        }
        else if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isRendered) {
            this.serverDataBind(prop);
        }
        this.finalUpdate();
        this.changedProperties = {};
        this.oldProperties = {};
        this.isProtectedOnChange = prevDetection;
    };
    ;
    /**
     * Calls for child element data bind
     * @param {Object} obj
     * @param {Object} parent
     * @returns {void}
     */
    // tslint:disable-next-line:no-any
    Base.callChildDataBind = function (obj, parent) {
        var keys = Object.keys(obj);
        for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
            var key = keys_1[_i];
            if (parent[key] instanceof Array) {
                for (var _a = 0, _b = parent[key]; _a < _b.length; _a++) {
                    var obj_1 = _b[_a];
                    if (obj_1.dataBind !== undefined) {
                        obj_1.dataBind();
                    }
                }
            }
            else {
                parent[key].dataBind();
            }
        }
    };
    Base.prototype.clearChanges = function () {
        this.finalUpdate();
        this.changedProperties = {};
        this.oldProperties = {};
        this.childChangedProperties = {};
    };
    /**
     * Bind property changes immediately to components
     */
    Base.prototype.dataBind = function () {
        Base.callChildDataBind(this.childChangedProperties, this);
        if (Object.getOwnPropertyNames(this.changedProperties).length) {
            var prevDetection = this.isProtectedOnChange;
            var newChanges = this.changedProperties;
            var oldChanges = this.oldProperties;
            this.clearChanges();
            this.isProtectedOnChange = true;
            this.onPropertyChanged(newChanges, oldChanges);
            this.isProtectedOnChange = prevDetection;
        }
    };
    ;
    /* tslint:disable:no-any */
    Base.prototype.serverDataBind = function (newChanges) {
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            return;
        }
        newChanges = newChanges ? newChanges : {};
        Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.bulkChanges, {}, newChanges, true);
        var sfBlazor = 'sfBlazor';
        if (this.allowServerDataBinding && window[sfBlazor].updateModel) {
            window[sfBlazor].updateModel(this);
            this.bulkChanges = {};
        }
    };
    /* tslint:enable:no-any */
    Base.prototype.saveChanges = function (key, newValue, oldValue) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            // tslint:disable-next-line:no-any
            var newChanges = {};
            newChanges[key] = newValue;
            this.serverDataBind(newChanges);
        }
        if (this.isProtectedOnChange) {
            return;
        }
        this.oldProperties[key] = oldValue;
        this.changedProperties[key] = newValue;
        this.finalUpdate();
        this.finalUpdate = Object(_util__WEBPACK_IMPORTED_MODULE_0__["setImmediate"])(this.dataBind.bind(this));
    };
    ;
    /** Event Base Section */
    /**
     * Adds the handler to the given event listener.
     * @param {string} eventName - A String that specifies the name of the event
     * @param {Function} listener - Specifies the call to run when the event occurs.
     * @return {void}
     */
    Base.prototype.addEventListener = function (eventName, handler) {
        this.modelObserver.on(eventName, handler);
    };
    /**
     * Removes the handler from the given event listener.
     * @param {string} eventName - A String that specifies the name of the event to remove
     * @param {Function} listener - Specifies the function to remove
     * @return {void}
     */
    Base.prototype.removeEventListener = function (eventName, handler) {
        this.modelObserver.off(eventName, handler);
    };
    /**
     * Triggers the handlers in the specified event.
     * @private
     * @param {string} eventName - Specifies the event to trigger for the specified component properties.
     * Can be a custom event, or any of the standard events.
     * @param {Event} eventProp - Additional parameters to pass on to the event properties
     * @param {Function} successHandler - this function will invoke after event successfully triggered
     * @param {Function} errorHandler - this function will invoke after event if it failured to call.
     * @return {void}
     */
    Base.prototype.trigger = function (eventName, eventProp, successHandler, errorHandler) {
        var _this = this;
        if (this.isDestroyed !== true) {
            var prevDetection = this.isProtectedOnChange;
            this.isProtectedOnChange = false;
            var data = this.modelObserver.notify(eventName, eventProp, successHandler, errorHandler);
            if (isColEName.test(eventName)) {
                var handler = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(eventName, this);
                if (handler) {
                    var blazor = 'Blazor';
                    if (window[blazor]) {
                        var promise = handler.call(this, eventProp);
                        if (promise && typeof promise.then === 'function') {
                            if (!successHandler) {
                                data = promise;
                            }
                            else {
                                promise.then(function (data) {
                                    if (successHandler) {
                                        data = typeof data === 'string' && _this.modelObserver.isJson(data) ?
                                            JSON.parse(data) : data;
                                        successHandler.call(_this, data);
                                    }
                                }).catch(function (data) {
                                    if (errorHandler) {
                                        data = typeof data === 'string' && _this.modelObserver.isJson(data) ? JSON.parse(data) : data;
                                        errorHandler.call(_this, data);
                                    }
                                });
                            }
                        }
                        else if (successHandler) {
                            successHandler.call(this, eventProp);
                        }
                    }
                    else {
                        handler.call(this, eventProp);
                        if (successHandler) {
                            successHandler.call(this, eventProp);
                        }
                    }
                }
                else if (successHandler) {
                    successHandler.call(this, eventProp);
                }
            }
            this.isProtectedOnChange = prevDetection;
            return data;
        }
    };
    /**
     * To maintain instance in base class
     */
    Base.prototype.addInstance = function () {
        // Add module class to the root element
        var moduleClass = 'e-' + this.getModuleName().toLowerCase();
        Object(_dom__WEBPACK_IMPORTED_MODULE_1__["addClass"])([this.element], ['e-lib', moduleClass]);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.ej2_instances)) {
            this.element.ej2_instances.push(this);
        }
        else {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', [this], this.element);
        }
    };
    /**
     * To remove the instance from the element
     */
    Base.prototype.destroy = function () {
        var _this = this;
        this.element.ej2_instances =
            this.element.ej2_instances.filter(function (i) { return i !== _this; });
        Object(_dom__WEBPACK_IMPORTED_MODULE_1__["removeClass"])([this.element], ['e-' + this.getModuleName()]);
        if (this.element.ej2_instances.length === 0) {
            // Remove module class from the root element
            Object(_dom__WEBPACK_IMPORTED_MODULE_1__["removeClass"])([this.element], ['e-lib']);
        }
        this.clearChanges();
        this.modelObserver.destroy();
        this.isDestroyed = true;
    };
    return Base;
}());

/**
 * Global function to get the component instance from the rendered element.
 * @param elem Specifies the HTMLElement or element id string.
 * @param comp Specifies the component module name or Component.
 */
// tslint:disable-next-line:no-any
function getComponent(elem, comp) {
    var instance;
    var i;
    var ele = typeof elem === 'string' ? document.getElementById(elem) : elem;
    for (i = 0; i < ele.ej2_instances.length; i++) {
        instance = ele.ej2_instances[i];
        if (typeof comp === 'string') {
            var compName = instance.getModuleName();
            if (comp === compName) {
                return instance;
            }
        }
        else {
            // tslint:disable-next-line:no-any
            if (instance instanceof comp) {
                return instance;
            }
        }
    }
    return undefined;
}
/**
 * Function to remove the child instances.
 * @return {void}
 * @private
 */
// tslint:disable-next-line:no-any
function removeChildInstance(element) {
    // tslint:disable-next-line:no-any
    var childEle = [].slice.call(element.getElementsByClassName('e-control'));
    for (var i = 0; i < childEle.length; i++) {
        var compName = childEle[i].classList[1].split('e-')[1];
        // tslint:disable-next-line:no-any
        var compInstance = getComponent(childEle[i], compName);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(compInstance)) {
            compInstance.destroy();
        }
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js":
/*!***********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/browser.js ***!
  \***********************************************************/
/*! exports provided: Browser */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Browser", function() { return Browser; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");

var REGX_MOBILE = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i;
var REGX_IE = /msie|trident/i;
var REGX_IE11 = /Trident\/7\./;
var REGX_IOS = /(ipad|iphone|ipod touch)/i;
var REGX_IOS7 = /(ipad|iphone|ipod touch);.*os 7_\d|(ipad|iphone|ipod touch);.*os 8_\d/i;
var REGX_ANDROID = /android/i;
var REGX_WINDOWS = /trident|windows phone|edge/i;
var REGX_VERSION = /(version)[ \/]([\w.]+)/i;
var REGX_BROWSER = {
    OPERA: /(opera|opr)(?:.*version|)[ \/]([\w.]+)/i,
    EDGE: /(edge)(?:.*version|)[ \/]([\w.]+)/i,
    CHROME: /(chrome|crios)[ \/]([\w.]+)/i,
    PANTHOMEJS: /(phantomjs)[ \/]([\w.]+)/i,
    SAFARI: /(safari)[ \/]([\w.]+)/i,
    WEBKIT: /(webkit)[ \/]([\w.]+)/i,
    MSIE: /(msie|trident) ([\w.]+)/i,
    MOZILLA: /(mozilla)(?:.*? rv:([\w.]+)|)/i
};
/* istanbul ignore else  */
if (typeof window !== 'undefined') {
    window.browserDetails = window.browserDetails || {};
}
/**
 * Get configuration details for Browser
 * @private
 */
var Browser = /** @__PURE__ @class */ (function () {
    function Browser() {
    }
    Browser.extractBrowserDetail = function () {
        var browserInfo = { culture: {} };
        var keys = Object.keys(REGX_BROWSER);
        var clientInfo = [];
        for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
            var key = keys_1[_i];
            clientInfo = Browser.userAgent.match(REGX_BROWSER[key]);
            if (clientInfo) {
                browserInfo.name = (clientInfo[1].toLowerCase() === 'opr' ? 'opera' : clientInfo[1].toLowerCase());
                browserInfo.name = (clientInfo[1].toLowerCase() === 'crios' ? 'chrome' : browserInfo.name);
                browserInfo.version = clientInfo[2];
                browserInfo.culture.name = browserInfo.culture.language = navigator.language;
                if (!!Browser.userAgent.match(REGX_IE11)) {
                    browserInfo.name = 'msie';
                    break;
                }
                var version = Browser.userAgent.match(REGX_VERSION);
                if (browserInfo.name === 'safari' && version) {
                    browserInfo.version = version[2];
                }
                break;
            }
        }
        return browserInfo;
    };
    /**
     * To get events from the browser
     * @param {string} event - type of event triggered.
     * @returns {Boolean}
     */
    Browser.getEvent = function (event) {
        // tslint:disable-next-line:no-any
        var events = {
            start: {
                isPointer: 'pointerdown', isTouch: 'touchstart', isDevice: 'mousedown'
            },
            move: {
                isPointer: 'pointermove', isTouch: 'touchmove', isDevice: 'mousemove'
            },
            end: {
                isPointer: 'pointerup', isTouch: 'touchend', isDevice: 'mouseup'
            },
            cancel: {
                isPointer: 'pointercancel', isTouch: 'touchcancel', isDevice: 'mouseleave'
            }
        };
        return (Browser.isPointer && !Browser.isWindows ? events[event].isPointer :
            (Browser.isTouch ? events[event].isTouch + (!Browser.isDevice ? ' ' + events[event].isDevice : '')
                : events[event].isDevice));
    };
    /**
     * To get the Touch start event from browser
     * @returns {string}
     */
    Browser.getTouchStartEvent = function () {
        return Browser.getEvent('start');
    };
    /**
     * To get the Touch end event from browser
     * @returns {string}
     */
    Browser.getTouchEndEvent = function () {
        return Browser.getEvent('end');
    };
    /**
     * To get the Touch move event from browser
     * @returns {string}
     */
    Browser.getTouchMoveEvent = function () {
        return Browser.getEvent('move');
    };
    /**
     * To cancel the touch event from browser
     * @returns {string}
     */
    Browser.getTouchCancelEvent = function () {
        return Browser.getEvent('cancel');
    };
    /**
     * To get the value based on provided key and regX
     * @param {string} key
     * @param {RegExp} regX
     * @returns {Object}
     */
    Browser.getValue = function (key, regX) {
        var browserDetails = window.browserDetails;
        if ('undefined' === typeof browserDetails[key]) {
            return browserDetails[key] = regX.test(Browser.userAgent);
        }
        return browserDetails[key];
    };
    Object.defineProperty(Browser, "userAgent", {
        get: function () {
            return Browser.uA;
        },
        //Properties 
        /**
         * Property specifies the userAgent of the browser. Default userAgent value is based on the browser.
         * Also we can set our own userAgent.
         */
        set: function (uA) {
            Browser.uA = uA;
            window.browserDetails = {};
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "info", {
        //Read Only Properties
        /**
         * Property is to get the browser information like Name, Version and Language
         * @returns BrowserInfo
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.info)) {
                return window.browserDetails.info = Browser.extractBrowserDetail();
            }
            return window.browserDetails.info;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isIE", {
        /**
         * Property is to get whether the userAgent is based IE.
         */
        get: function () {
            return Browser.getValue('isIE', REGX_IE);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isTouch", {
        /**
         * Property is to get whether the browser has touch support.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.isTouch)) {
                return (window.browserDetails.isTouch =
                    ('ontouchstart' in window.navigator) ||
                        (window &&
                            window.navigator &&
                            (window.navigator.maxTouchPoints > 0)) || ('ontouchstart' in window));
            }
            return window.browserDetails.isTouch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isPointer", {
        /**
         * Property is to get whether the browser has Pointer support.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.isPointer)) {
                return window.browserDetails.isPointer = ('pointerEnabled' in window.navigator);
            }
            return window.browserDetails.isPointer;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isMSPointer", {
        /**
         * Property is to get whether the browser has MSPointer support.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.isMSPointer)) {
                return window.browserDetails.isMSPointer = ('msPointerEnabled' in window.navigator);
            }
            return window.browserDetails.isMSPointer;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isDevice", {
        /**
         * Property is to get whether the userAgent is device based.
         */
        get: function () {
            return Browser.getValue('isDevice', REGX_MOBILE);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isIos", {
        /**
         * Property is to get whether the userAgent is IOS.
         */
        get: function () {
            return Browser.getValue('isIos', REGX_IOS);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isIos7", {
        /**
         * Property is to get whether the userAgent is Ios7.
         */
        get: function () {
            return Browser.getValue('isIos7', REGX_IOS7);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isAndroid", {
        /**
         * Property is to get whether the userAgent is Android.
         */
        get: function () {
            return Browser.getValue('isAndroid', REGX_ANDROID);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isWebView", {
        /**
         * Property is to identify whether application ran in web view.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.isWebView)) {
                window.browserDetails.isWebView = !(Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.cordova) && Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.PhoneGap)
                    && Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.phonegap) && window.forge !== 'object');
                return window.browserDetails.isWebView;
            }
            return window.browserDetails.isWebView;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "isWindows", {
        /**
         * Property is to get whether the userAgent is Windows.
         */
        get: function () {
            return Browser.getValue('isWindows', REGX_WINDOWS);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "touchStartEvent", {
        /**
         * Property is to get the touch start event. It returns event name based on browser.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.touchStartEvent)) {
                return window.browserDetails.touchStartEvent = Browser.getTouchStartEvent();
            }
            return window.browserDetails.touchStartEvent;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "touchMoveEvent", {
        /**
         * Property is to get the touch move event. It returns event name based on browser.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.touchMoveEvent)) {
                return window.browserDetails.touchMoveEvent = Browser.getTouchMoveEvent();
            }
            return window.browserDetails.touchMoveEvent;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "touchEndEvent", {
        /**
         * Property is to get the touch end event. It returns event name based on browser.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.touchEndEvent)) {
                return window.browserDetails.touchEndEvent = Browser.getTouchEndEvent();
            }
            return window.browserDetails.touchEndEvent;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Browser, "touchCancelEvent", {
        /**
         * Property is to cancel the touch end event.
         */
        get: function () {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(window.browserDetails.touchCancelEvent)) {
                return window.browserDetails.touchCancelEvent = Browser.getTouchCancelEvent();
            }
            return window.browserDetails.touchCancelEvent;
        },
        enumerable: true,
        configurable: true
    });
    /* istanbul ignore next */
    Browser.uA = typeof navigator !== 'undefined' ? navigator.userAgent : '';
    return Browser;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/child-property.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/child-property.js ***!
  \******************************************************************/
/*! exports provided: ChildProperty */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChildProperty", function() { return ChildProperty; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");


/**
 * To detect the changes for inner properties.
 * @private
 */
var ChildProperty = /** @__PURE__ @class */ (function () {
    function ChildProperty(parent, propName, defaultValue, isArray) {
        this.isComplexArraySetter = false;
        this.properties = {};
        this.changedProperties = {};
        this.childChangedProperties = {};
        this.oldProperties = {};
        // tslint:disable-next-line:no-empty
        this.finalUpdate = function () { };
        this.callChildDataBind = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('callChildDataBind', _base__WEBPACK_IMPORTED_MODULE_1__["Base"]);
        this.parentObj = parent;
        this.controlParent = this.parentObj.controlParent || this.parentObj;
        this.propName = propName;
        this.isParentArray = isArray;
        this.setProperties(defaultValue, true);
    }
    /**
     * Updates the property changes
     * @param {boolean} val
     * @param {string} propName
     * @returns {void}
     */
    ChildProperty.prototype.updateChange = function (val, propName) {
        if (val === true) {
            this.parentObj.childChangedProperties[propName] = val;
        }
        else {
            delete this.parentObj.childChangedProperties[propName];
        }
        if (this.parentObj.updateChange) {
            this.parentObj.updateChange(val, this.parentObj.propName);
        }
    };
    /**
     * Updates time out duration
     */
    ChildProperty.prototype.updateTimeOut = function () {
        if (this.parentObj.updateTimeOut) {
            this.parentObj.finalUpdate();
            this.parentObj.updateTimeOut();
        }
        else {
            var changeTime_1 = setTimeout(this.parentObj.dataBind.bind(this.parentObj));
            var clearUpdate = function () {
                clearTimeout(changeTime_1);
            };
            this.finalUpdate = clearUpdate;
        }
    };
    /**
     * Clears changed properties
     */
    ChildProperty.prototype.clearChanges = function () {
        this.finalUpdate();
        this.updateChange(false, this.propName);
        this.oldProperties = {};
        this.changedProperties = {};
    };
    /**
     * Set property changes
     * @param {Object} prop
     * @param {boolean} muteOnChange
     * {void}
     */
    ChildProperty.prototype.setProperties = function (prop, muteOnChange) {
        if (muteOnChange === true) {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(this, prop);
            this.updateChange(false, this.propName);
            this.clearChanges();
        }
        else {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(this, prop);
        }
    };
    /**
     * Binds data
     */
    ChildProperty.prototype.dataBind = function () {
        this.callChildDataBind(this.childChangedProperties, this);
        if (this.isParentArray) {
            var curIndex = this.parentObj[this.propName].indexOf(this);
            if (Object.keys(this.changedProperties).length) {
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.propName + '.' + curIndex, this.changedProperties, this.parentObj.changedProperties);
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.propName + '.' + curIndex, this.oldProperties, this.parentObj.oldProperties);
            }
        }
        else {
            this.parentObj.changedProperties[this.propName] = this.changedProperties;
            this.parentObj.oldProperties[this.propName] = this.oldProperties;
        }
        this.clearChanges();
    };
    /**
     * Saves changes to newer values
     * @param {string} key
     * @param {Object} newValue
     * @param {Object} oldValue
     * @returns {void}
     */
    ChildProperty.prototype.saveChanges = function (key, newValue, oldValue, restrictServerDataBind) {
        if (this.controlParent.isProtectedOnChange) {
            return;
        }
        if (!restrictServerDataBind) {
            this.serverDataBind(key, newValue, true);
        }
        this.oldProperties[key] = oldValue;
        this.changedProperties[key] = newValue;
        this.updateChange(true, this.propName);
        this.finalUpdate();
        this.updateTimeOut();
    };
    ChildProperty.prototype.serverDataBind = function (key, value, isSaveChanges, action) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.parentObj.isComplexArraySetter) {
            // tslint:disable-next-line:no-any
            var parent_1;
            var newChanges = {};
            var parentKey = isSaveChanges ? this.getParentKey(true) + '.' + key : key;
            /* istanbul ignore else  */
            if (parentKey.indexOf('.') !== -1) {
                var complexKeys = parentKey.split('.');
                parent_1 = newChanges;
                for (var i = 0; i < complexKeys.length; i++) {
                    var isFinal = i === complexKeys.length - 1;
                    parent_1[complexKeys[i]] = isFinal ? value : {};
                    parent_1 = isFinal ? parent_1 : parent_1[complexKeys[i]];
                }
            }
            else {
                newChanges[parentKey] = {};
                parent_1 = newChanges[parentKey];
                newChanges[parentKey][key] = value;
            }
            /* istanbul ignore next */
            if (this.isParentArray) {
                var actionProperty = 'ejsAction';
                parent_1[actionProperty] = action ? action : 'none';
            }
            this.controlParent.serverDataBind(newChanges);
        }
    };
    ChildProperty.prototype.getParentKey = function (isSaveChanges) {
        // tslint:disable-next-line:no-any
        var index = '';
        var propName = this.propName;
        /* istanbul ignore next */
        if (this.isParentArray) {
            index = this.parentObj[this.propName].indexOf(this);
            var valueLength = this.parentObj[this.propName].length;
            valueLength = isSaveChanges ? valueLength : (valueLength > 0 ? valueLength - 1 : 0);
            index = index !== -1 ? '-' + index : '-' + valueLength;
            propName = propName + index;
        }
        if (this.controlParent !== this.parentObj) {
            propName = this.parentObj.getParentKey() + '.' + this.propName + index;
        }
        return propName;
    };
    return ChildProperty;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/component.js":
/*!*************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/component.js ***!
  \*************************************************************/
/*! exports provided: versionBasedStatePersistence, enableVersionBasedPersistence, Component */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versionBasedStatePersistence", function() { return versionBasedStatePersistence; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableVersionBasedPersistence", function() { return enableVersionBasedPersistence; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _module_loader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./module-loader */ "./ej2-resources/18.4.46/scripts/ej2-base/module-loader.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./observer */ "./ej2-resources/18.4.46/scripts/ej2-base/observer.js");
/* harmony import */ var _child_property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./child-property */ "./ej2-resources/18.4.46/scripts/ej2-base/child-property.js");
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony import */ var _internationalization__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./internationalization */ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _virtual_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./virtual-dom */ "./ej2-resources/18.4.46/scripts/ej2-base/virtual-dom.js");
/* harmony import */ var _template_engine__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./template-engine */ "./ej2-resources/18.4.46/scripts/ej2-base/template-engine.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};










var componentCount = 0;
var lastPageID;
var lastHistoryLen = 0;
var versionBasedStatePersistence = false;
/**
 * To enable or disable version based statePersistence functionality for all components globally.
 * @param {boolean} status - Optional argument Specifies the status value to enable or disable versionBasedStatePersistence option.
 * @returns {void}
 */
/* istanbul ignore next */
function enableVersionBasedPersistence(status) {
    versionBasedStatePersistence = status;
}
/**
 * Base class for all Essential JavaScript components
 */
var Component = /** @__PURE__ @class */ (function (_super) {
    __extends(Component, _super);
    /**
     * Initialize the constructor for component base
     */
    function Component(options, selector) {
        var _this = _super.call(this, options, selector) || this;
        _this.randomId = Object(_util__WEBPACK_IMPORTED_MODULE_0__["uniqueID"])();
        /**
         * string template option for Blazor template rendering
         * @private
         */
        _this.isStringTemplate = false;
        _this.needsID = false;
        _this.isReactHybrid = false;
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.enableRtl)) {
            _this.setProperties({ 'enableRtl': _internationalization__WEBPACK_IMPORTED_MODULE_6__["rightToLeft"] }, true);
        }
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.locale)) {
            _this.setProperties({ 'locale': _internationalization__WEBPACK_IMPORTED_MODULE_6__["defaultCulture"] }, true);
        }
        _this.moduleLoader = new _module_loader__WEBPACK_IMPORTED_MODULE_1__["ModuleLoader"](_this);
        _this.localObserver = new _observer__WEBPACK_IMPORTED_MODULE_3__["Observer"](_this);
        // tslint:disable-next-line:no-function-constructor-with-string-args
        _internationalization__WEBPACK_IMPORTED_MODULE_6__["onIntlChange"].on('notifyExternalChange', _this.detectFunction, _this, _this.randomId);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(selector)) {
            _this.appendTo();
        }
        return _this;
    }
    Component.prototype.requiredModules = function () {
        return [];
    };
    ;
    /**
     * Destroys the sub modules while destroying the widget
     */
    Component.prototype.destroy = function () {
        if (this.isDestroyed) {
            return;
        }
        if (this.enablePersistence) {
            this.setPersistData();
        }
        this.localObserver.destroy();
        if (this.refreshing) {
            return;
        }
        Object(_dom__WEBPACK_IMPORTED_MODULE_7__["removeClass"])([this.element], ['e-control']);
        this.trigger('destroyed', { cancel: false });
        _super.prototype.destroy.call(this);
        this.moduleLoader.clean();
        _internationalization__WEBPACK_IMPORTED_MODULE_6__["onIntlChange"].off('notifyExternalChange', this.detectFunction, this.randomId);
    };
    /**
     * Applies all the pending property changes and render the component again.
     */
    Component.prototype.refresh = function () {
        this.refreshing = true;
        this.moduleLoader.clean();
        this.destroy();
        this.clearChanges();
        this.localObserver = new _observer__WEBPACK_IMPORTED_MODULE_3__["Observer"](this);
        this.preRender();
        this.injectModules();
        this.render();
        this.refreshing = false;
    };
    /* istanbul ignore next */
    Component.prototype.accessMount = function () {
        if (this.mount && !this.isReactHybrid) {
            this.mount();
        }
    };
    /**
     * Returns the route element of the component
     */
    /* istanbul ignore next */
    Component.prototype.getRootElement = function () {
        if (this.isReactHybrid) {
            return this.actualElement;
        }
        else {
            return this.element;
        }
    };
    /**
     * Returns the persistence data for component
     */
    /* istanbul ignore next */
    //tslint:disable:no-any
    Component.prototype.getLocalData = function () {
        var eleId = this.getModuleName() + this.element.id;
        if (versionBasedStatePersistence) {
            return window.localStorage.getItem(eleId + this.ej2StatePersistenceVersion);
        }
        else {
            return window.localStorage.getItem(eleId);
        }
    };
    /**
     * Appends the control within the given HTML element
     * @param {string | HTMLElement} selector - Target element where control needs to be appended
     */
    Component.prototype.appendTo = function (selector) {
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selector) && typeof (selector) === 'string') {
            this.element = Object(_dom__WEBPACK_IMPORTED_MODULE_7__["select"])(selector, document);
        }
        else if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selector)) {
            this.element = selector;
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element)) {
            var moduleClass = 'e-' + this.getModuleName().toLowerCase();
            Object(_dom__WEBPACK_IMPORTED_MODULE_7__["addClass"])([this.element], ['e-control', moduleClass]);
            this.isProtectedOnChange = false;
            if (this.needsID && !this.element.id) {
                this.element.id = this.getUniqueID(this.getModuleName());
            }
            if (this.enablePersistence) {
                this.mergePersistData();
                window.addEventListener('unload', this.setPersistData.bind(this));
            }
            var inst = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
            if (!inst || inst.indexOf(this) === -1) {
                _super.prototype.addInstance.call(this);
            }
            this.preRender();
            this.injectModules();
            this.render();
            if (!this.mount) {
                this.trigger('created');
            }
            else {
                this.accessMount();
            }
        }
    };
    /**
     * It is used to process the post rendering functionalities to a component.
     */
    Component.prototype.renderComplete = function (wrapperElement) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var sfBlazor = 'sfBlazor';
            // tslint:disable-next-line:no-any
            window[sfBlazor].renderComplete(this.element, wrapperElement);
        }
        this.isRendered = true;
    };
    /**
     * When invoked, applies the pending property changes immediately to the component.
     */
    Component.prototype.dataBind = function () {
        this.injectModules();
        _super.prototype.dataBind.call(this);
    };
    ;
    /**
     * Attach one or more  event handler to the current component context.
     * It is used for internal handling event internally within the component only.
     * @param {BoundOptions[]| string} event - It is  optional type either to  Set the collection of event list or the eventName.
     * @param {Function} handler - optional parameter Specifies the handler to run when the event occurs
     * @param {Object} context - optional parameter Specifies the context to be bind in the handler.
     * @return {void}
     * @private
     */
    Component.prototype.on = function (event, handler, context) {
        if (typeof event === 'string') {
            this.localObserver.on(event, handler, context);
        }
        else {
            for (var _i = 0, event_1 = event; _i < event_1.length; _i++) {
                var arg = event_1[_i];
                this.localObserver.on(arg.event, arg.handler, arg.context);
            }
        }
    };
    /**
     * To remove one or more event handler that has been attached with the on() method.
     * @param {BoundOptions[]| string} event - It is  optional type either to  Set the collection of event list or the eventName.
     * @param {Function} handler - optional parameter Specifies the function to run when the event occurs
     * @return {void}
     * @private
     */
    Component.prototype.off = function (event, handler) {
        if (typeof event === 'string') {
            this.localObserver.off(event, handler);
        }
        else {
            for (var _i = 0, event_2 = event; _i < event_2.length; _i++) {
                var arg = event_2[_i];
                this.localObserver.off(arg.event, arg.handler);
            }
        }
    };
    /**
     * To notify the handlers in the specified event.
     * @param {string} property - Specifies the event to be notify.
     * @param {Object} argument - Additional parameters to pass while calling the handler.
     * @return {void}
     * @private
     */
    Component.prototype.notify = function (property, argument) {
        if (this.isDestroyed !== true) {
            this.localObserver.notify(property, argument);
        }
    };
    /**
     * Get injected modules
     * @private
     */
    Component.prototype.getInjectedModules = function () {
        return this.injectedModules;
    };
    ;
    /**
     * Dynamically injects the required modules to the component.
     */
    Component.Inject = function () {
        var moduleList = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            moduleList[_i] = arguments[_i];
        }
        if (!this.prototype.injectedModules) {
            this.prototype.injectedModules = [];
        }
        for (var i = 0; i < moduleList.length; i++) {
            if (this.prototype.injectedModules.indexOf(moduleList[i]) === -1) {
                this.prototype.injectedModules.push(moduleList[i]);
            }
        }
    };
    /**
     * This is a instance method to create an element.
     * @private
     */
    /* istanbul ignore next */
    //tslint:disable:no-any
    Component.prototype.createElement = function (tagName, prop, isVDOM) {
        if (isVDOM && this.isReactHybrid) {
            if (prop) {
                prop = {};
            }
            prop['data-id'] = Object(_template_engine__WEBPACK_IMPORTED_MODULE_9__["getRandomId"])();
            return _virtual_dom__WEBPACK_IMPORTED_MODULE_8__["VirtualDOM"].createElement(tagName, prop);
        }
        else {
            return Object(_dom__WEBPACK_IMPORTED_MODULE_7__["createElement"])(tagName, prop);
        }
    };
    /**
     *
     * @param handler - handler to be triggered after state Updated.
     * @param argument - Arguments to be passed to caller.
     * @private
     */
    /* istanbul ignore next */
    //tslint:disable:no-any
    Component.prototype.triggerStateChange = function (handler, argument) {
        if (this.isReactHybrid) {
            //tslint:disable:no-any
            this.setState();
            this.currentContext = { calls: handler, args: argument };
        }
    };
    // tslint: enable: no-any
    Component.prototype.injectModules = function () {
        if (this.injectedModules && this.injectedModules.length) {
            this.moduleLoader.inject(this.requiredModules(), this.injectedModules);
        }
    };
    Component.prototype.detectFunction = function (args) {
        var prop = Object.keys(args);
        if (prop.length) {
            this[prop[0]] = args[prop[0]];
        }
    };
    Component.prototype.mergePersistData = function () {
        var data;
        if (versionBasedStatePersistence) {
            data = window.localStorage.getItem(this.getModuleName() + this.element.id + this.ej2StatePersistenceVersion);
        }
        else {
            data = window.localStorage.getItem(this.getModuleName() + this.element.id);
        }
        if (!(Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data) || (data === ''))) {
            this.setProperties(JSON.parse(data), true);
        }
    };
    Component.prototype.setPersistData = function () {
        if (!this.isDestroyed) {
            if (versionBasedStatePersistence) {
                window.localStorage.setItem(this.getModuleName() + this.element.id + this.ej2StatePersistenceVersion, this.getPersistData());
            }
            else {
                window.localStorage.setItem(this.getModuleName() + this.element.id, this.getPersistData());
            }
        }
    };
    //tslint:disable-next-line
    Component.prototype.renderReactTemplates = function () {
        //No Code
    };
    //tslint:disable-next-line
    Component.prototype.clearTemplate = function (templateName, index) {
        //No Code
    };
    Component.prototype.getUniqueID = function (definedName) {
        if (this.isHistoryChanged()) {
            componentCount = 0;
        }
        lastPageID = this.pageID(location.href);
        lastHistoryLen = history.length;
        return definedName + '_' + lastPageID + '_' + componentCount++;
    };
    Component.prototype.pageID = function (url) {
        var hash = 0;
        if (url.length === 0) {
            return hash;
        }
        for (var i = 0; i < url.length; i++) {
            var char = url.charCodeAt(i);
            hash = ((hash << 5) - hash) + char;
            hash = hash & hash; // Convert to 32bit integer
        }
        return Math.abs(hash);
    };
    Component.prototype.isHistoryChanged = function () {
        return lastPageID !== this.pageID(location.href) || lastHistoryLen !== history.length;
    };
    Component.prototype.addOnPersist = function (options) {
        var _this = this;
        var persistObj = {};
        for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
            var key = options_1[_i];
            var objValue = void 0;
            objValue = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(key, this);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(objValue)) {
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])(key, this.getActualProperties(objValue), persistObj);
            }
        }
        return JSON.stringify(persistObj, function (key, value) {
            return _this.getActualProperties(value);
        });
    };
    Component.prototype.getActualProperties = function (obj) {
        if (obj instanceof _child_property__WEBPACK_IMPORTED_MODULE_4__["ChildProperty"]) {
            return Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('properties', obj);
        }
        else {
            return obj;
        }
    };
    Component.prototype.ignoreOnPersist = function (options) {
        return JSON.stringify(this.iterateJsonProperties(this.properties, options));
    };
    Component.prototype.iterateJsonProperties = function (obj, ignoreList) {
        var newObj = {};
        var _loop_1 = function (key) {
            if (ignoreList.indexOf(key) === -1) {
                // tslint:disable-next-line:no-any
                var value = obj[key];
                if (typeof value === 'object' && !(value instanceof Array)) {
                    var newList = ignoreList.filter(function (str) {
                        return new RegExp(key + '.').test(str);
                    }).map(function (str) {
                        return str.replace(key + '.', '');
                    });
                    newObj[key] = this_1.iterateJsonProperties(this_1.getActualProperties(value), newList);
                }
                else {
                    newObj[key] = value;
                }
            }
        };
        var this_1 = this;
        for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {
            var key = _a[_i];
            _loop_1(key);
        }
        return newObj;
    };
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_5__["Property"])(false)
    ], Component.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_5__["Property"])()
    ], Component.prototype, "enableRtl", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_5__["Property"])()
    ], Component.prototype, "locale", void 0);
    Component = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_5__["NotifyPropertyChanges"]
    ], Component);
    return Component;
}(_base__WEBPACK_IMPORTED_MODULE_2__["Base"]));

//Function handling for page navigation detection 
/* istanbul ignore next */
(function () {
    if (typeof window !== 'undefined') {
        window.addEventListener('popstate', 
        /* istanbul ignore next */
        function () {
            componentCount = 0;
        });
    }
})();


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js":
/*!*******************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/dom.js ***!
  \*******************************************************/
/*! exports provided: createElement, addClass, removeClass, isVisible, prepend, append, detach, remove, attributes, select, selectAll, closest, siblings, getAttributeOrDefault, setStyleAttribute, classList, matches, includeInnerHTML, containsClass, cloneNode */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepend", function() { return prepend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "append", function() { return append; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detach", function() { return detach; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attributes", function() { return attributes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return select; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectAll", function() { return selectAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "siblings", function() { return siblings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAttributeOrDefault", function() { return getAttributeOrDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setStyleAttribute", function() { return setStyleAttribute; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classList", function() { return classList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includeInnerHTML", function() { return includeInnerHTML; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsClass", function() { return containsClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneNode", function() { return cloneNode; });
/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _virtual_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./virtual-dom */ "./ej2-resources/18.4.46/scripts/ej2-base/virtual-dom.js");
/**
 * Functions related to dom operations.
 */



var SVG_REG = /^svg|^path|^g/;
/**
 * Function to create Html element.
 * @param tagName - Name of the tag, id and class names.
 * @param properties - Object to set properties in the element.
 * @param properties.id - To set the id to the created element.
 * @param properties.className - To add classes to the element.
 * @param properties.innerHTML - To set the innerHTML to element.
 * @param properties.styles - To set the some custom styles to element.
 * @param properties.attrs - To set the attributes to element.
 * @private
 */
function createElement(tagName, properties) {
    //tslint:disable-next-line
    var element = (SVG_REG.test(tagName) ? document.createElementNS('http://www.w3.org/2000/svg', tagName) : document.createElement(tagName));
    if (typeof (properties) === 'undefined') {
        return element;
    }
    element.innerHTML = (properties.innerHTML ? properties.innerHTML : '');
    if (properties.className !== undefined) {
        element.className = properties.className;
    }
    if (properties.id !== undefined) {
        element.id = properties.id;
    }
    if (properties.styles !== undefined) {
        element.setAttribute('style', properties.styles);
    }
    if (properties.attrs !== undefined) {
        attributes(element, properties.attrs);
    }
    return element;
}
/**
 * The function used to add the classes to array of elements
 * @param  {Element[]|NodeList} elements - An array of elements that need to add a list of classes
 * @param  {string|string[]} classes - String or array of string that need to add an individual element as a class
 * @private
 */
function addClass(elements, classes) {
    var classList = getClassList(classes);
    for (var _i = 0, _a = elements; _i < _a.length; _i++) {
        var ele = _a[_i];
        if (ele && classList) {
            for (var _b = 0, classList_1 = classList; _b < classList_1.length; _b++) {
                var className = classList_1[_b];
                if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(ele)) {
                    var curClass = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('attributes.className', ele);
                    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(curClass)) {
                        Object(_util__WEBPACK_IMPORTED_MODULE_1__["setValue"])('attributes.className', className, ele);
                    }
                    else if (!new RegExp('\\b' + className + '\\b', 'i').test(curClass)) {
                        Object(_util__WEBPACK_IMPORTED_MODULE_1__["setValue"])('attributes.className', curClass + ' ' + className, ele);
                    }
                }
                else {
                    if (!ele.classList.contains(className)) {
                        ele.classList.add(className);
                    }
                }
            }
        }
    }
    return elements;
}
/**
 * The function used to add the classes to array of elements
 * @param  {Element[]|NodeList} elements - An array of elements that need to remove a list of classes
 * @param  {string|string[]} classes - String or array of string that need to add an individual element as a class
 * @private
 */
function removeClass(elements, classes) {
    var classList = getClassList(classes);
    for (var _i = 0, _a = elements; _i < _a.length; _i++) {
        var ele = _a[_i];
        if (ele && classList) {
            var flag = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(ele);
            var canRemove = flag ? Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('attributes.className', ele) : ele.className !== '';
            if (canRemove) {
                for (var _b = 0, classList_2 = classList; _b < classList_2.length; _b++) {
                    var className = classList_2[_b];
                    if (flag) {
                        var classes_1 = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('attributes.className', ele);
                        var classArr = classes_1.split(' ');
                        var index = classArr.indexOf(className);
                        if (index !== -1) {
                            classArr.splice(index, 1);
                        }
                        Object(_util__WEBPACK_IMPORTED_MODULE_1__["setValue"])('attributes.className', classArr.join(' '), ele);
                    }
                    else {
                        ele.classList.remove(className);
                    }
                }
            }
        }
    }
    return elements;
}
function getClassList(classes) {
    var classList = [];
    if (typeof classes === 'string') {
        classList.push(classes);
    }
    else {
        classList = classes;
    }
    return classList;
}
/**
 * The function used to check element is visible or not.
 * @param  {Element|Node} element - An element the need to check visibility
 * @private
 */
function isVisible(element) {
    var ele = element;
    return (ele.style.visibility === '' && ele.offsetWidth > 0);
}
/**
 * The function used to insert an array of elements into a first of the element.
 * @param  {Element[]|NodeList} fromElements - An array of elements that need to prepend.
 * @param  {Element} toElement - An element that is going to prepend.
 * @private
 */
function prepend(fromElements, toElement, isEval) {
    //tslint:disable:no-any
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(toElement)) {
        _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].prepend(fromElements, toElement);
    }
    else {
        var docFrag = document.createDocumentFragment();
        for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {
            var ele = _a[_i];
            docFrag.appendChild(ele);
        }
        toElement.insertBefore(docFrag, toElement.firstElementChild);
        if (isEval) {
            executeScript(toElement);
        }
    }
    return fromElements;
}
/**
 * The function used to insert an array of elements into last of the element.
 * @param  {Element[]|NodeList} fromElements - An array of elements that need to append.
 * @param  {Element} toElement - An element that is going to prepend.
 * @private
 */
function append(fromElements, toElement, isEval) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(toElement)) {
        _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].append(fromElements, toElement);
    }
    else {
        var docFrag = document.createDocumentFragment();
        for (var _i = 0, _a = fromElements; _i < _a.length; _i++) {
            var ele = _a[_i];
            docFrag.appendChild(ele);
        }
        toElement.appendChild(docFrag);
        if (isEval) {
            executeScript(toElement);
        }
    }
    return fromElements;
}
/**
 * The function is used to evaluate script from Ajax request
 * @param ele - An element is going to evaluate the script
 */
function executeScript(ele) {
    var eleArray = ele.querySelectorAll('script');
    eleArray.forEach(function (element) {
        var script = document.createElement('script');
        script.text = element.innerHTML;
        document.head.appendChild(script);
        detach(script);
    });
}
/**
 * The function used to remove the element from the
 * @param  {Element|Node|HTMLElement} element - An element that is going to detach from the Dom
 * @private
 */
function detach(element) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(element)) {
        return _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].detach(element);
    }
    else {
        var parentNode = element.parentNode;
        if (parentNode) {
            return parentNode.removeChild(element);
        }
    }
}
//tslint: enable:no-any
/**
 * The function used to remove the element from Dom also clear the bounded events
 * @param  {Element|Node|HTMLElement} element - An element remove from the Dom
 * @private
 */
function remove(element) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(element)) {
        _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].detach(element);
    }
    else {
        var parentNode = element.parentNode;
        _event_handler__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(element);
        parentNode.removeChild(element);
    }
}
/**
 * The function helps to set multiple attributes to an element
 * @param  {Element|Node} element - An element that need to set attributes.
 * @param  {{[key:string]:string}} attributes - JSON Object that is going to as attributes.
 * @private
 */
function attributes(element, attributes) {
    var keys = Object.keys(attributes);
    var ele = element;
    if (ele) {
        for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
            var key = keys_1[_i];
            if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(ele)) {
                var iKey = key;
                if (key === 'tabindex') {
                    iKey = 'tabIndex';
                }
                ele.attributes[iKey] = attributes[key];
            }
            else {
                ele.setAttribute(key, attributes[key]);
            }
        }
    }
    return ele;
}
/**
 * The function selects the element from giving context.
 * @param  {string} selector - Selector string need fetch element from the
 * @param  {Document|Element=document} context - It is an optional type, That specifies a Dom context.
 * @private
 */
//tslint:disable-next-line
function select(selector, context, needsVDOM) {
    if (context === void 0) { context = document; }
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(context) && needsVDOM) {
        //tslint:disable-next-line
        return _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].vDomSelector({ ele: context, selector: selector, selectAll: false });
    }
    else {
        selector = querySelectId(selector);
        return context.querySelector(selector);
    }
}
/**
 * The function selects an array of element from the given context.
 * @param  {string} selector - Selector string need fetch element from the
 * @param  {Document|Element=document} context - It is an optional type, That specifies a Dom context.
 * @private
 */
function selectAll(selector, context, needsVDOM) {
    if (context === void 0) { context = document; }
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(context) && !needsVDOM) {
        //tslint:disable-next-line
        return _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].vDomSelector({ ele: context, selector: selector, selectAll: true });
    }
    else {
        selector = querySelectId(selector);
        var nodeList = context.querySelectorAll(selector);
        return nodeList;
    }
}
function querySelectId(selector) {
    var charRegex = /(!|"|\$|%|&|'|\(|\)|\*|\/|:|;|<|=|\?|@|\]|\^|`|{|}|\||\+|~)/g;
    if (selector.match(/#[0-9]/g) || selector.match(charRegex)) {
        var idList = selector.split(',');
        for (var i = 0; i < idList.length; i++) {
            var list = idList[i].split(' ');
            for (var j = 0; j < list.length; j++) {
                if (list[j].indexOf('#') > -1) {
                    if (!list[j].match(/\[.*\]/)) {
                        var splitId = list[j].split('#');
                        if (splitId[1].match(/^\d/) || splitId[1].match(charRegex)) {
                            var setId = list[j].split('.');
                            setId[0] = setId[0].replace(/#/, '[id=\'') + '\']';
                            list[j] = setId.join('.');
                        }
                    }
                }
            }
            idList[i] = list.join(' ');
        }
        return idList.join(',');
    }
    return selector;
}
/**
 * Returns single closest parent element based on class selector.
 * @param  {Element} element - An element that need to find the closest element.
 * @param  {string} selector - A classSelector of closest element.
 * @private
 */
function closest(element, selector) {
    var el = element;
    if (typeof el.closest === 'function') {
        return el.closest(selector);
    }
    while (el && el.nodeType === 1) {
        if (matches(el, selector)) {
            return el;
        }
        el = el.parentNode;
    }
    return null;
}
/**
 * Returns all sibling elements of the given element.
 * @param  {Element|Node} element - An element that need to get siblings.
 * @private
 */
function siblings(element) {
    var siblings = [];
    var childNodes = Array.prototype.slice.call(element.parentNode.childNodes);
    for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) {
        var curNode = childNodes_1[_i];
        if (curNode.nodeType === Node.ELEMENT_NODE && element !== curNode) {
            siblings.push(curNode);
        }
    }
    return siblings;
}
/**
 * set the value if not exist. Otherwise set the existing value
 * @param  {HTMLElement} element - An element to which we need to set value.
 * @param  {string} property - Property need to get or set.
 * @param  {string} value - value need to set.
 * @private
 */
function getAttributeOrDefault(element, property, value) {
    var attrVal;
    var isObj = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(element);
    if (isObj) {
        attrVal = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('attributes.' + property, element);
    }
    else {
        attrVal = element.getAttribute(property);
    }
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(attrVal) && value) {
        if (!isObj) {
            element.setAttribute(property, value.toString());
        }
        else {
            element.attributes[property] = value;
        }
        attrVal = value;
    }
    return attrVal;
}
/**
 * Set the style attributes to Html element.
 * @param {HTMLElement} element - Element which we want to set attributes
 * @param {any} attrs - Set the given attributes to element
 * @return {void}
 * @private
 */
function setStyleAttribute(element, attrs) {
    if (attrs !== undefined) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(element)) {
            // tslint:disable-next-line:no-any
            _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].setStyleAttribute(element, attrs);
        }
        else {
            Object.keys(attrs).forEach(function (key) {
                // tslint:disable-next-line:no-any
                element.style[key] = attrs[key];
            });
        }
    }
}
/**
 * Method for add and remove classes to a dom element.
 * @param {Element} element - Element for add and remove classes
 * @param {string[]} addClasses - List of classes need to be add to the element
 * @param {string[]} removeClasses - List of classes need to be remove from the element
 * @return {void}
 * @private
 */
function classList(element, addClasses, removeClasses) {
    addClass([element], addClasses);
    removeClass([element], removeClasses);
}
/**
 * Method to check whether the element matches the given selector.
 * @param {Element} element - Element to compare with the selector.
 * @param {string} selector - String selector which element will satisfy.
 * @return {void}
 * @private
 */
function matches(element, selector) {
    //tslint:disable-next-line
    var matches = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;
    if (matches) {
        return matches.call(element, selector);
    }
    else {
        return [].indexOf.call(document.querySelectorAll(selector), element) !== -1;
    }
}
function includeInnerHTML(ele, innerHTML) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(ele)) {
        if (innerHTML === '') {
            ele.children = [];
        }
        else {
            var res = _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].ConvertHTMLToJSon(innerHTML);
            if (res.length) {
                _virtual_dom__WEBPACK_IMPORTED_MODULE_2__["VirtualDOM"].assignParent(res, ele);
                ele.children = res;
            }
        }
    }
    else {
        ele.innerHTML = innerHTML;
    }
}
//tslint:disable-next-line
function containsClass(ele, className) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(ele)) {
        // tslint:disable-next-line:no-any
        return new RegExp('\\b' + className + '\\b', 'i').test(ele.attributes.className);
    }
    else {
        return ele.classList.contains(className);
    }
}
/**
 * Method to check whether the element matches the given selector.
 * @param {} element - Element to compare with the selector.
 * @param {string} selector - String selector which element will satisfy.
 * @return {Element | VirtualObject}
 * @private
 */
//tslint:disable:no-any
function cloneNode(element, deep) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isObject"])(element)) {
        if (deep) {
            return Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])({}, {}, element, true);
        }
        else {
            return { tagName: element.tagName, attributes: element.attributes };
        }
    }
    else {
        return element.cloneNode(deep);
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/draggable.js":
/*!*************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/draggable.js ***!
  \*************************************************************/
/*! exports provided: Position, Draggable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Draggable", function() { return Draggable; });
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
/* harmony import */ var _child_property__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./child-property */ "./ej2-resources/18.4.46/scripts/ej2-base/child-property.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








var defaultPosition = { left: 0, top: 0, bottom: 0, right: 0 };
var positionProp = ['offsetLeft', 'offsetTop'];
var axisMapper = ['x', 'y'];
var axisValueMapper = ['left', 'top'];
var isDraggedObject = { isDragged: false };
/**
 * Specifies the position coordinates
 */
var Position = /** @__PURE__ @class */ (function (_super) {
    __extends(Position, _super);
    function Position() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(0)
    ], Position.prototype, "left", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(0)
    ], Position.prototype, "top", void 0);
    return Position;
}(_child_property__WEBPACK_IMPORTED_MODULE_5__["ChildProperty"]));

/**
 * Draggable Module provides support to enable draggable functionality in Dom Elements.
 * ```html
 * <div id='drag'>Draggable</div>
 * <script>
 * var ele = document.getElementById('drag');
 * var drag:Draggable = new Draggable(ele,{
 *     clone:false,
 *     drag: function(e) {
 *      //drag handler code.
 *      },
 *     handle:'.class'
 * });
 * </script>
 * ```
 */
var Draggable = /** @__PURE__ @class */ (function (_super) {
    __extends(Draggable, _super);
    function Draggable(element, options) {
        var _this = _super.call(this, options, element) || this;
        _this.dragLimit = Draggable_1.getDefaultPosition();
        _this.borderWidth = Draggable_1.getDefaultPosition();
        _this.padding = Draggable_1.getDefaultPosition();
        _this.diffX = 0;
        _this.prevLeft = 0;
        _this.prevTop = 0;
        _this.dragProcessStarted = false;
        /* tslint:disable no-any */
        _this.tapHoldTimer = 0;
        _this.externalInitialize = false;
        _this.diffY = 0;
        _this.parentScrollX = 0;
        _this.parentScrollY = 0;
        _this.droppables = {};
        _this.bind();
        return _this;
    }
    Draggable_1 = Draggable;
    Draggable.prototype.bind = function () {
        this.toggleEvents();
        if (_browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].isIE) {
            Object(_dom__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.element], 'e-block-touch');
        }
        this.droppables[this.scope] = {};
    };
    Draggable.getDefaultPosition = function () {
        return Object(_util__WEBPACK_IMPORTED_MODULE_6__["extend"])({}, defaultPosition);
    };
    Draggable.prototype.toggleEvents = function (isUnWire) {
        var ele;
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isUndefined"])(this.handle)) {
            ele = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["select"])(this.handle, this.element);
        }
        var handler = (this.enableTapHold && _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].isDevice && _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].isTouch) ? this.mobileInitialize : this.initialize;
        if (isUnWire) {
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(ele || this.element, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchStartEvent, handler);
        }
        else {
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(ele || this.element, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchStartEvent, handler, this);
        }
    };
    /* istanbul ignore next */
    Draggable.prototype.mobileInitialize = function (evt) {
        var _this = this;
        var target = evt.currentTarget;
        this.tapHoldTimer = setTimeout(function () {
            _this.externalInitialize = true;
            _this.removeTapholdTimer();
            _this.initialize(evt, target);
        }, this.tapHoldThreshold);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.removeTapholdTimer, this);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.removeTapholdTimer, this);
    };
    /* istanbul ignore next */
    Draggable.prototype.removeTapholdTimer = function () {
        clearTimeout(this.tapHoldTimer);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.removeTapholdTimer);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.removeTapholdTimer);
    };
    /* istanbul ignore next */
    Draggable.prototype.getScrollableParent = function (element, axis) {
        var scroll = { 'vertical': 'scrollHeight', 'horizontal': 'scrollWidth' };
        var client = { 'vertical': 'clientHeight', 'horizontal': 'clientWidth' };
        if (Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(element)) {
            return null;
        }
        if (element[scroll[axis]] > element[client[axis]]) {
            if (axis === 'vertical' ? element.scrollTop > 0 : element.scrollLeft > 0) {
                if (axis === 'vertical') {
                    this.parentScrollY = this.parentScrollY +
                        (this.parentScrollY === 0 ? element.scrollTop : element.scrollTop - this.parentScrollY);
                    this.tempScrollHeight = element.scrollHeight;
                }
                else {
                    this.parentScrollX = this.parentScrollX +
                        (this.parentScrollX === 0 ? element.scrollLeft : element.scrollLeft - this.parentScrollX);
                    this.tempScrollWidth = element.scrollWidth;
                }
                if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(element)) {
                    return this.getScrollableParent(element.parentNode, axis);
                }
                else {
                    return element;
                }
            }
            else {
                return this.getScrollableParent(element.parentNode, axis);
            }
        }
        else {
            return this.getScrollableParent(element.parentNode, axis);
        }
    };
    Draggable.prototype.getScrollableValues = function () {
        this.parentScrollX = 0;
        this.parentScrollY = 0;
        var isModalDialog = this.element.classList.contains('e-dialog') && this.element.classList.contains('e-dlg-modal');
        var verticalScrollParent = this.getScrollableParent(this.element.parentNode, 'vertical');
        var horizontalScrollParent = this.getScrollableParent(this.element.parentNode, 'horizontal');
    };
    Draggable.prototype.initialize = function (evt, curTarget) {
        this.currentStateTarget = evt.target;
        if (this.isDragStarted()) {
            return;
        }
        else {
            this.isDragStarted(true);
            this.externalInitialize = false;
        }
        this.target = (evt.currentTarget || curTarget);
        this.dragProcessStarted = false;
        if (this.abort) {
            /* tslint:disable no-any */
            var abortSelectors = this.abort;
            if (typeof abortSelectors === 'string') {
                abortSelectors = [abortSelectors];
            }
            for (var i = 0; i < abortSelectors.length; i++) {
                if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(Object(_dom__WEBPACK_IMPORTED_MODULE_2__["closest"])(evt.target, abortSelectors[i]))) {
                    /* istanbul ignore next */
                    if (this.isDragStarted()) {
                        this.isDragStarted(true);
                    }
                    return;
                }
            }
        }
        if (this.preventDefault && !Object(_util__WEBPACK_IMPORTED_MODULE_6__["isUndefined"])(evt.changedTouches) && evt.type !== 'touchstart') {
            evt.preventDefault();
        }
        this.element.setAttribute('aria-grabbed', 'true');
        var intCoord = this.getCoordinates(evt);
        this.initialPosition = { x: intCoord.pageX, y: intCoord.pageY };
        if (!this.clone) {
            var pos = this.element.getBoundingClientRect();
            this.getScrollableValues();
            if (evt.clientX === evt.pageX) {
                this.parentScrollX = 0;
            }
            if (evt.clientY === evt.pageY) {
                this.parentScrollY = 0;
            }
            this.relativeXPosition = intCoord.pageX - (pos.left + this.parentScrollX);
            this.relativeYPosition = intCoord.pageY - (pos.top + this.parentScrollY);
        }
        if (this.externalInitialize) {
            this.intDragStart(evt);
        }
        else {
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.intDragStart, this);
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDestroy, this);
        }
        this.toggleEvents(true);
        if (evt.type !== 'touchstart' && this.isPreventSelect) {
            document.body.classList.add('e-prevent-select');
        }
        this.externalInitialize = false;
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].trigger(document.documentElement, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchStartEvent, evt);
    };
    Draggable.prototype.intDragStart = function (evt) {
        this.removeTapholdTimer();
        var isChangeTouch = !Object(_util__WEBPACK_IMPORTED_MODULE_6__["isUndefined"])(evt.changedTouches);
        if (isChangeTouch && (evt.changedTouches.length !== 1)) {
            return;
        }
        if (isChangeTouch) {
            evt.preventDefault();
        }
        var intCordinate = this.getCoordinates(evt);
        var pos;
        var styleProp = getComputedStyle(this.element);
        this.margin = {
            left: parseInt(styleProp.marginLeft, 10),
            top: parseInt(styleProp.marginTop, 10),
            right: parseInt(styleProp.marginRight, 10),
            bottom: parseInt(styleProp.marginBottom, 10),
        };
        var element = this.element;
        if (this.clone && this.dragTarget) {
            var intClosest = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["closest"])(evt.target, this.dragTarget);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(intClosest)) {
                element = intClosest;
            }
        }
        /* istanbul ignore next */
        if (this.isReplaceDragEle) {
            element = this.currentStateCheck(evt.target, element);
        }
        this.offset = this.calculateParentPosition(element);
        this.position = this.getMousePosition(evt, this.isDragScroll);
        var x = this.initialPosition.x - intCordinate.pageX;
        var y = this.initialPosition.y - intCordinate.pageY;
        var distance = Math.sqrt((x * x) + (y * y));
        if ((distance >= this.distance || this.externalInitialize)) {
            var ele = this.getHelperElement(evt);
            if (!ele || Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(ele)) {
                return;
            }
            var dragTargetElement = this.helperElement = ele;
            this.parentClientRect = this.calculateParentPosition(dragTargetElement.offsetParent);
            if (this.dragStart) {
                var curTarget = this.getProperTargetElement(evt);
                var args = {
                    event: evt,
                    element: element,
                    target: curTarget,
                    bindEvents: Object(_util__WEBPACK_IMPORTED_MODULE_6__["isBlazor"])() ? this.bindDragEvents.bind(this) : null,
                    dragElement: dragTargetElement
                };
                this.trigger('dragStart', args);
            }
            if (this.dragArea) {
                this.setDragArea();
            }
            else {
                this.dragLimit = { left: 0, right: 0, bottom: 0, top: 0 };
                this.borderWidth = { top: 0, left: 0 };
            }
            pos = { left: this.position.left - this.parentClientRect.left, top: this.position.top - this.parentClientRect.top };
            if (this.clone && !this.enableTailMode) {
                this.diffX = this.position.left - this.offset.left;
                this.diffY = this.position.top - this.offset.top;
            }
            this.getScrollableValues();
            // when drag element has margin-top
            var styles = getComputedStyle(element);
            var marginTop = parseFloat(styles.marginTop);
            /* istanbul ignore next */
            if (this.clone && marginTop !== 0) {
                pos.top += marginTop;
            }
            var posValue = this.getProcessedPositionValue({
                top: (pos.top - this.diffY) + 'px',
                left: (pos.left - this.diffX) + 'px'
            });
            this.dragElePosition = { top: pos.top, left: pos.left };
            Object(_dom__WEBPACK_IMPORTED_MODULE_2__["setStyleAttribute"])(dragTargetElement, this.getDragPosition({ position: 'absolute', left: posValue.left, top: posValue.top }));
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.intDragStart);
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDestroy);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isBlazor"])()) {
                this.bindDragEvents(dragTargetElement);
            }
        }
    };
    Draggable.prototype.bindDragEvents = function (dragTargetElement) {
        if (Object(_dom__WEBPACK_IMPORTED_MODULE_2__["isVisible"])(dragTargetElement)) {
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.intDrag, this);
            _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDragStop, this);
            this.setGlobalDroppables(false, this.element, dragTargetElement);
        }
        else {
            this.toggleEvents();
            document.body.classList.remove('e-prevent-select');
        }
    };
    Draggable.prototype.elementInViewport = function (el) {
        this.top = el.offsetTop;
        this.left = el.offsetLeft;
        this.width = el.offsetWidth;
        this.height = el.offsetHeight;
        while (el.offsetParent) {
            el = el.offsetParent;
            this.top += el.offsetTop;
            this.left += el.offsetLeft;
        }
        return (this.top >= window.pageYOffset &&
            this.left >= window.pageXOffset &&
            (this.top + this.height) <= (window.pageYOffset + window.innerHeight) &&
            (this.left + this.width) <= (window.pageXOffset + window.innerWidth));
    };
    Draggable.prototype.getProcessedPositionValue = function (value) {
        if (this.queryPositionInfo) {
            return this.queryPositionInfo(value);
        }
        return value;
    };
    Draggable.prototype.calculateParentPosition = function (ele) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(ele)) {
            return { left: 0, top: 0 };
        }
        var rect = ele.getBoundingClientRect();
        var style = getComputedStyle(ele);
        return {
            left: (rect.left + window.pageXOffset) - parseInt(style.marginLeft, 10),
            top: (rect.top + window.pageYOffset) - parseInt(style.marginTop, 10)
        };
    };
    // tslint:disable-next-line:max-func-body-length
    Draggable.prototype.intDrag = function (evt) {
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isUndefined"])(evt.changedTouches) && (evt.changedTouches.length !== 1)) {
            return;
        }
        var left;
        var top;
        this.position = this.getMousePosition(evt, this.isDragScroll);
        var docHeight = this.getDocumentWidthHeight('Height');
        if (docHeight < this.position.top) {
            this.position.top = docHeight;
        }
        var docWidth = this.getDocumentWidthHeight('Width');
        if (docWidth < this.position.left) {
            this.position.left = docWidth;
        }
        if (this.drag) {
            var curTarget = this.getProperTargetElement(evt);
            this.trigger('drag', { event: evt, element: this.element, target: curTarget });
        }
        var eleObj = this.checkTargetElement(evt);
        if (eleObj.target && eleObj.instance) {
            /* tslint:disable no-any */
            var flag = true;
            if (this.hoverObject) {
                if (this.hoverObject.instance !== eleObj.instance) {
                    this.triggerOutFunction(evt, eleObj);
                }
                else {
                    flag = false;
                }
            }
            if (flag) {
                eleObj.instance.dragData[this.scope] = this.droppables[this.scope];
                eleObj.instance.intOver(evt, eleObj.target);
                this.hoverObject = eleObj;
            }
        }
        else if (this.hoverObject) {
            this.triggerOutFunction(evt, eleObj);
        }
        var helperElement = this.droppables[this.scope].helper;
        this.parentClientRect = this.calculateParentPosition(this.helperElement.offsetParent);
        var tLeft = this.parentClientRect.left;
        var tTop = this.parentClientRect.top;
        var intCoord = this.getCoordinates(evt);
        var pagex = intCoord.pageX;
        var pagey = intCoord.pageY;
        var dLeft = this.position.left - this.diffX;
        var dTop = this.position.top - this.diffY;
        var styles = getComputedStyle(helperElement);
        var marginTop = parseFloat(styles.marginTop);
        if (this.dragArea) {
            if (this.pageX !== pagex || this.skipDistanceCheck) {
                var helperWidth = helperElement.offsetWidth + (parseFloat(styles.marginLeft)
                    + parseFloat(styles.marginRight));
                if (this.dragLimit.left > dLeft && dLeft > 0) {
                    left = this.dragLimit.left;
                }
                else if (this.dragLimit.right + window.pageXOffset < dLeft + helperWidth && dLeft > 0) {
                    left = dLeft - (dLeft - this.dragLimit.right) + window.pageXOffset - helperWidth;
                }
                else {
                    left = dLeft < 0 ? this.dragLimit.left : dLeft;
                }
            }
            if (this.pageY !== pagey || this.skipDistanceCheck) {
                var helperHeight = helperElement.offsetHeight + (parseFloat(styles.marginTop)
                    + parseFloat(styles.marginBottom));
                if (this.dragLimit.top > dTop && dTop > 0) {
                    top = this.dragLimit.top;
                }
                else if (this.dragLimit.bottom + window.pageYOffset < dTop + helperHeight && dTop > 0) {
                    top = dTop - (dTop - this.dragLimit.bottom) + window.pageYOffset - helperHeight;
                }
                else {
                    top = dTop < 0 ? this.dragLimit.top : dTop;
                }
            }
        }
        else {
            left = dLeft;
            top = dTop;
        }
        var iTop = tTop + this.borderWidth.top;
        var iLeft = tLeft + this.borderWidth.left;
        if (this.dragProcessStarted) {
            if (Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(top)) {
                top = this.prevTop;
            }
            if (Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(left)) {
                left = this.prevLeft;
            }
        }
        var draEleTop;
        var draEleLeft;
        if (this.dragArea) {
            this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
            draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - iTop);
            draEleLeft = (left - iLeft) < 0 ? this.dragElePosition.left : (left - iLeft);
            // when drag-element has margin-top
            /* istanbul ignore next */
            if (marginTop > 0) {
                if (this.clone) {
                    draEleTop += this.element.offsetTop;
                    if (dTop < 0) {
                        if ((this.element.offsetTop + dTop) >= 0) {
                            draEleTop = this.element.offsetTop + dTop;
                        }
                        else {
                            draEleTop -= this.element.offsetTop;
                        }
                    }
                    draEleTop = (this.dragLimit.bottom < draEleTop) ? this.dragLimit.bottom : draEleTop;
                }
                if ((top - iTop) < 0) {
                    if (dTop + marginTop + (helperElement.offsetHeight - iTop) >= 0) {
                        var tempDraEleTop = this.dragLimit.top + dTop - iTop;
                        if ((tempDraEleTop + marginTop + iTop) < 0) {
                            draEleTop -= marginTop + iTop;
                        }
                        else {
                            draEleTop = tempDraEleTop;
                        }
                    }
                    else {
                        draEleTop -= marginTop + iTop;
                    }
                }
            }
        }
        else {
            draEleTop = top - iTop;
            draEleLeft = left - iLeft;
        }
        var dragValue = this.getProcessedPositionValue({ top: draEleTop + 'px', left: draEleLeft + 'px' });
        Object(_dom__WEBPACK_IMPORTED_MODULE_2__["setStyleAttribute"])(helperElement, this.getDragPosition(dragValue));
        if (!this.elementInViewport(helperElement) && this.enableAutoScroll) {
            this.helperElement.scrollIntoView();
        }
        this.dragProcessStarted = true;
        this.prevLeft = left;
        this.prevTop = top;
        this.position.left = left;
        this.position.top = top;
        this.pageX = pagex;
        this.pageY = pagey;
    };
    Draggable.prototype.triggerOutFunction = function (evt, eleObj) {
        this.hoverObject.instance.intOut(evt, eleObj.target);
        this.hoverObject.instance.dragData[this.scope] = null;
        this.hoverObject = null;
    };
    Draggable.prototype.getDragPosition = function (dragValue) {
        var temp = Object(_util__WEBPACK_IMPORTED_MODULE_6__["extend"])({}, dragValue);
        if (this.axis) {
            if (this.axis === 'x') {
                delete temp.top;
            }
            else if (this.axis === 'y') {
                delete temp.left;
            }
        }
        return temp;
    };
    Draggable.prototype.getDocumentWidthHeight = function (str) {
        var docBody = document.body;
        var docEle = document.documentElement;
        var returnValue = Math.max(docBody['scroll' + str], docEle['scroll' + str], docBody['offset' + str], docEle['offset' + str], docEle['client' + str]);
        return returnValue;
    };
    Draggable.prototype.intDragStop = function (evt) {
        this.dragProcessStarted = false;
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isUndefined"])(evt.changedTouches) && (evt.changedTouches.length !== 1)) {
            return;
        }
        var type = ['touchend', 'pointerup', 'mouseup'];
        if (type.indexOf(evt.type) !== -1) {
            if (this.dragStop) {
                var curTarget = this.getProperTargetElement(evt);
                this.trigger('dragStop', { event: evt, element: this.element, target: curTarget, helper: this.helperElement });
            }
            this.intDestroy(evt);
        }
        else {
            this.element.setAttribute('aria-grabbed', 'false');
        }
        var eleObj = this.checkTargetElement(evt);
        if (eleObj.target && eleObj.instance) {
            eleObj.instance.dragStopCalled = true;
            eleObj.instance.dragData[this.scope] = this.droppables[this.scope];
            eleObj.instance.intDrop(evt, eleObj.target);
        }
        this.setGlobalDroppables(true);
        document.body.classList.remove('e-prevent-select');
    };
    /**
     * @private
     */
    Draggable.prototype.intDestroy = function (evt) {
        this.dragProcessStarted = false;
        this.toggleEvents();
        document.body.classList.remove('e-prevent-select');
        this.element.setAttribute('aria-grabbed', 'false');
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.intDragStart);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDragStop);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDestroy);
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(document, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchMoveEvent, this.intDrag);
        if (this.isDragStarted()) {
            this.isDragStarted(true);
        }
    };
    // triggers when property changed
    Draggable.prototype.onPropertyChanged = function (newProp, oldProp) {
        //No Code to handle
    };
    Draggable.prototype.getModuleName = function () {
        return 'draggable';
    };
    Draggable.prototype.isDragStarted = function (change) {
        if (change) {
            isDraggedObject.isDragged = !isDraggedObject.isDragged;
        }
        return isDraggedObject.isDragged;
    };
    Draggable.prototype.setDragArea = function () {
        var eleWidthBound;
        var eleHeightBound;
        var top = 0;
        var left = 0;
        var ele;
        var type = typeof this.dragArea;
        if (type === 'string') {
            ele = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["select"])(this.dragArea);
        }
        else {
            ele = this.dragArea;
        }
        if (ele) {
            var elementArea = ele.getBoundingClientRect();
            eleWidthBound = ele.scrollWidth ? ele.scrollWidth : elementArea.right - elementArea.left;
            eleHeightBound = ele.scrollHeight ? ele.scrollHeight : elementArea.bottom - elementArea.top;
            var keys = ['Top', 'Left', 'Bottom', 'Right'];
            var styles = getComputedStyle(ele);
            for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                var tborder = styles['border' + key + 'Width'];
                var tpadding = styles['padding' + key];
                var lowerKey = key.toLowerCase();
                this.borderWidth[lowerKey] = isNaN(parseFloat(tborder)) ? 0 : parseFloat(tborder);
                this.padding[lowerKey] = isNaN(parseFloat(tpadding)) ? 0 : parseFloat(tpadding);
            }
            top = elementArea.top;
            left = elementArea.left;
            this.dragLimit.left = left + this.borderWidth.left + this.padding.left;
            this.dragLimit.top = ele.offsetTop + this.borderWidth.top + this.padding.top;
            this.dragLimit.right = left + eleWidthBound - (this.borderWidth.right + this.padding.right);
            this.dragLimit.bottom = top + eleHeightBound - (this.borderWidth.bottom + this.padding.bottom);
        }
    };
    Draggable.prototype.getProperTargetElement = function (evt) {
        var intCoord = this.getCoordinates(evt);
        var ele;
        var prevStyle = this.helperElement.style.pointerEvents || '';
        if (Object(_util__WEBPACK_IMPORTED_MODULE_6__["compareElementParent"])(evt.target, this.helperElement) || evt.type.indexOf('touch') !== -1) {
            this.helperElement.style.pointerEvents = 'none';
            ele = document.elementFromPoint(intCoord.clientX, intCoord.clientY);
            this.helperElement.style.pointerEvents = prevStyle;
        }
        else {
            ele = evt.target;
        }
        return ele;
    };
    /* istanbul ignore next */
    Draggable.prototype.currentStateCheck = function (ele, oldEle) {
        var elem;
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(this.currentStateTarget) && this.currentStateTarget !== ele) {
            elem = this.currentStateTarget;
        }
        else {
            elem = !Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(oldEle) ? oldEle : ele;
        }
        return elem;
    };
    Draggable.prototype.getMousePosition = function (evt, isdragscroll) {
        /* tslint:disable no-any */
        var dragEle = evt.srcElement !== undefined ? evt.srcElement : evt.target;
        var intCoord = this.getCoordinates(evt);
        var pageX;
        var pageY;
        var isOffsetParent = Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(dragEle.offsetParent);
        /* istanbul ignore next */
        if (isdragscroll) {
            pageX = this.clone ? intCoord.pageX :
                (intCoord.pageX + (isOffsetParent ? 0 : dragEle.offsetParent.scrollLeft)) - this.relativeXPosition;
            pageY = this.clone ? intCoord.pageY :
                (intCoord.pageY + (isOffsetParent ? 0 : dragEle.offsetParent.scrollTop)) - this.relativeYPosition;
        }
        else {
            pageX = this.clone ? intCoord.pageX : (intCoord.pageX + window.pageXOffset) - this.relativeXPosition;
            pageY = this.clone ? intCoord.pageY : (intCoord.pageY + window.pageYOffset) - this.relativeYPosition;
        }
        if (!this.clone) {
            this.getScrollableValues();
            pageY -= this.tempScrollHeight ? this.parentScrollY : 0;
            pageX -= this.tempScrollWidth ? this.parentScrollY : 0;
        }
        return {
            left: pageX - (this.margin.left + this.cursorAt.left),
            top: pageY - (this.margin.top + this.cursorAt.top)
        };
    };
    Draggable.prototype.getCoordinates = function (evt) {
        if (evt.type.indexOf('touch') > -1) {
            return evt.changedTouches[0];
        }
        return evt;
    };
    Draggable.prototype.getHelperElement = function (evt) {
        var element;
        if (this.clone) {
            if (this.helper) {
                element = this.helper({ sender: evt, element: this.target });
            }
            else {
                element = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["createElement"])('div', { className: 'e-drag-helper e-block-touch', innerHTML: 'Draggable' });
                document.body.appendChild(element);
            }
        }
        else {
            element = this.element;
        }
        return element;
    };
    Draggable.prototype.setGlobalDroppables = function (reset, drag, helper) {
        this.droppables[this.scope] = reset ? null : {
            draggable: drag,
            helper: helper,
            draggedElement: this.element
        };
    };
    Draggable.prototype.checkTargetElement = function (evt) {
        var target = this.getProperTargetElement(evt);
        var dropIns = this.getDropInstance(target);
        if (!dropIns && target && !Object(_util__WEBPACK_IMPORTED_MODULE_6__["isNullOrUndefined"])(target.parentNode)) {
            var parent_1 = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["closest"])(target.parentNode, '.e-droppable') || target.parentElement;
            if (parent_1) {
                dropIns = this.getDropInstance(parent_1);
            }
        }
        return { target: target, instance: dropIns };
    };
    Draggable.prototype.getDropInstance = function (ele) {
        var name = 'getModuleName';
        var drop;
        var eleInst = ele && ele.ej2_instances;
        if (eleInst) {
            for (var _i = 0, eleInst_1 = eleInst; _i < eleInst_1.length; _i++) {
                var inst = eleInst_1[_i];
                if (inst[name]() === 'droppable') {
                    drop = inst;
                    break;
                }
            }
        }
        return drop;
    };
    Draggable.prototype.destroy = function () {
        this.toggleEvents(true);
        _super.prototype.destroy.call(this);
    };
    var Draggable_1;
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Complex"])({}, Position)
    ], Draggable.prototype, "cursorAt", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(true)
    ], Draggable.prototype, "clone", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "dragArea", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "isDragScroll", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "isReplaceDragEle", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(true)
    ], Draggable.prototype, "isPreventSelect", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Draggable.prototype, "drag", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Draggable.prototype, "dragStart", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Draggable.prototype, "dragStop", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(1)
    ], Draggable.prototype, "distance", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "handle", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "abort", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "helper", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])('default')
    ], Draggable.prototype, "scope", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])('')
    ], Draggable.prototype, "dragTarget", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "axis", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Draggable.prototype, "queryPositionInfo", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(false)
    ], Draggable.prototype, "enableTailMode", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(false)
    ], Draggable.prototype, "skipDistanceCheck", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(true)
    ], Draggable.prototype, "preventDefault", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(false)
    ], Draggable.prototype, "enableAutoScroll", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(false)
    ], Draggable.prototype, "enableTapHold", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])(750)
    ], Draggable.prototype, "tapHoldThreshold", void 0);
    Draggable = Draggable_1 = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_3__["NotifyPropertyChanges"]
    ], Draggable);
    return Draggable;
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/droppable.js":
/*!*************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/droppable.js ***!
  \*************************************************************/
/*! exports provided: Droppable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Droppable", function() { return Droppable; });
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






/**
 * Droppable Module provides support to enable droppable functionality in Dom Elements.
 * ```html
 * <div id='drop'>Droppable</div>
 * <script>
 * let ele:HTMLElement = document.getElementById('drop');
 * var drag:Droppable = new Droppable(ele,{
 *     accept:'.drop',
 *     drop: function(e) {
 *      //drop handler code.
 *     }
 * });
 * </script>
 * ```
 */
var Droppable = /** @__PURE__ @class */ (function (_super) {
    __extends(Droppable, _super);
    function Droppable(element, options) {
        var _this = _super.call(this, options, element) || this;
        _this.mouseOver = false;
        _this.dragData = {};
        _this.dragStopCalled = false;
        _this.bind();
        return _this;
    }
    Droppable.prototype.bind = function () {
        this.wireEvents();
    };
    Droppable.prototype.wireEvents = function () {
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].add(this.element, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDrop, this);
    };
    // triggers when property changed
    Droppable.prototype.onPropertyChanged = function (newProp, oldProp) {
        //No Code to handle
    };
    Droppable.prototype.getModuleName = function () {
        return 'droppable';
    };
    Droppable.prototype.intOver = function (event, element) {
        if (!this.mouseOver) {
            var drag = this.dragData[this.scope];
            this.trigger('over', { event: event, target: element, dragData: drag });
            this.mouseOver = true;
        }
    };
    Droppable.prototype.intOut = function (event, element) {
        if (this.mouseOver) {
            this.trigger('out', { evt: event, target: element });
            this.mouseOver = false;
        }
    };
    Droppable.prototype.intDrop = function (evt, element) {
        if (!this.dragStopCalled) {
            return;
        }
        else {
            this.dragStopCalled = false;
        }
        var accept = true;
        var drag = this.dragData[this.scope];
        var isDrag = drag ? (drag.helper && Object(_dom__WEBPACK_IMPORTED_MODULE_2__["isVisible"])(drag.helper)) : false;
        var area;
        if (isDrag) {
            area = this.isDropArea(evt, drag.helper, element);
            if (this.accept) {
                accept = Object(_dom__WEBPACK_IMPORTED_MODULE_2__["matches"])(drag.helper, this.accept);
            }
        }
        if (isDrag && this.drop && area.canDrop && accept) {
            this.trigger('drop', { event: evt, target: area.target, droppedElement: drag.helper, dragData: drag });
        }
        this.mouseOver = false;
    };
    Droppable.prototype.isDropArea = function (evt, helper, element) {
        var area = { canDrop: true, target: element || evt.target };
        var isTouch = evt.type === 'touchend';
        if (isTouch || area.target === helper) {
            helper.style.display = 'none';
            var coord = isTouch ? (evt.changedTouches[0]) : evt;
            var ele = document.elementFromPoint(coord.clientX, coord.clientY);
            area.canDrop = false;
            area.canDrop = Object(_util__WEBPACK_IMPORTED_MODULE_5__["compareElementParent"])(ele, this.element);
            if (area.canDrop) {
                area.target = ele;
            }
            helper.style.display = '';
        }
        return area;
    };
    Droppable.prototype.destroy = function () {
        _event_handler__WEBPACK_IMPORTED_MODULE_4__["EventHandler"].remove(this.element, _browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].touchEndEvent, this.intDrop);
        _super.prototype.destroy.call(this);
    };
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])()
    ], Droppable.prototype, "accept", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Property"])('default')
    ], Droppable.prototype, "scope", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Droppable.prototype, "drop", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Droppable.prototype, "over", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_3__["Event"])()
    ], Droppable.prototype, "out", void 0);
    Droppable = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_3__["NotifyPropertyChanges"]
    ], Droppable);
    return Droppable;
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js ***!
  \*****************************************************************/
/*! exports provided: EventHandler */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventHandler", function() { return EventHandler; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");


/**
 * EventHandler class provides option to add, remove, clear and trigger events to a HTML DOM element
 * @private
 * ```html
 * <div id="Eventdiv">  </div>
 * <script>
 *   let node: HTMLElement = document.querySelector("#Eventdiv");
 *   EventHandler.addEventListener(node, "click", function(){
 *       // click handler function code
 *   });
 *   EventHandler.addEventListener(node, "onmouseover", function(){
 *       // mouseover handler function code
 *   });
 *   EventHandler.removeEventListener(node, "click", function(){
 *       // click handler function code
 *   });
 *   eventObj.clearEvents();
 * </script>
 * ```
 */
var EventHandler = /** @__PURE__ @class */ (function () {
    function EventHandler() {
    }
    // to get the event data based on element
    EventHandler.addOrGetEventData = function (element) {
        if (element) {
            if ('__eventList' in element) {
                return element.__eventList.events;
            }
            else {
                element.__eventList = {};
                return element.__eventList.events = [];
            }
        }
        else {
            return [];
        }
    };
    /**
     * Add an event to the specified DOM element.
     * @param {any} element - Target HTML DOM element
     * @param {string} eventName - A string that specifies the name of the event
     * @param {Function} listener - Specifies the function to run when the event occurs
     * @param {Object} bindTo - A object that binds 'this' variable in the event handler
     * @param {number} debounce - Specifies at what interval given event listener should be triggered.
     * @return {Function}
     */
    EventHandler.add = function (element, eventName, listener, bindTo, intDebounce) {
        var eventData = EventHandler.addOrGetEventData(element);
        var debounceListener;
        if (intDebounce) {
            debounceListener = Object(_util__WEBPACK_IMPORTED_MODULE_0__["debounce"])(listener, intDebounce);
        }
        else {
            debounceListener = listener;
        }
        if (bindTo) {
            debounceListener = debounceListener.bind(bindTo);
        }
        var event = eventName.split(' ');
        for (var i = 0; i < event.length; i++) {
            eventData.push({
                name: event[i],
                listener: listener,
                debounce: debounceListener
            });
            if (_browser__WEBPACK_IMPORTED_MODULE_1__["Browser"].isIE) {
                element.addEventListener(event[i], debounceListener);
            }
            else {
                element.addEventListener(event[i], debounceListener, { passive: false });
            }
        }
        return debounceListener;
    };
    /**
     * Remove an event listener that has been attached before.
     * @param {any} element - Specifies the target html element to remove the event
     * @param {string} eventName - A string that specifies the name of the event to remove
     * @param {Function} listener - Specifies the function to remove
     * @return {void}
     */
    EventHandler.remove = function (element, eventName, listener) {
        var eventData = EventHandler.addOrGetEventData(element);
        var event = eventName.split(' ');
        var _loop_1 = function (j) {
            var index = -1;
            var debounceListener;
            if (eventData && eventData.length !== 0) {
                eventData.some(function (x, i) {
                    return x.name === event[j] && x.listener === listener ?
                        (index = i, debounceListener = x.debounce, true) : false;
                });
            }
            if (index !== -1) {
                eventData.splice(index, 1);
            }
            if (debounceListener) {
                element.removeEventListener(event[j], debounceListener);
            }
        };
        for (var j = 0; j < event.length; j++) {
            _loop_1(j);
        }
    };
    /**
     * Clear all the event listeners that has been previously attached to the element.
     * @param {any} element - Specifies the target html element to clear the events
     * @return {void}
     */
    EventHandler.clearEvents = function (element) {
        var eventData;
        var copyData;
        eventData = EventHandler.addOrGetEventData(element);
        copyData = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])([], copyData, eventData);
        for (var i = 0; i < copyData.length; i++) {
            element.removeEventListener(copyData[i].name, copyData[i].debounce);
            eventData.shift();
        }
    };
    /**
     * Trigger particular event of the element.
     * @param {any} element - Specifies the target html element to trigger the events
     * @param {string} eventName - Specifies the event to trigger for the specified element.
     * Can be a custom event, or any of the standard events.
     * @param {any} eventProp - Additional parameters to pass on to the event properties
     * @return {void}
     */
    EventHandler.trigger = function (element, eventName, eventProp) {
        var eventData = EventHandler.addOrGetEventData(element);
        var fn = null;
        for (var _i = 0, eventData_1 = eventData; _i < eventData_1.length; _i++) {
            var event_1 = eventData_1[_i];
            if (event_1.name === eventName) {
                event_1.debounce.call(this, eventProp);
            }
        }
    };
    return EventHandler;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/hijri-parser.js":
/*!****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/hijri-parser.js ***!
  \****************************************************************/
/*! exports provided: HijriParser */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HijriParser", function() { return HijriParser; });
/***
 * Hijri parser
 */
var HijriParser;
(function (HijriParser) {
    /* tslint:disable */
    var dateCorrection = [28607, 28636, 28665, 28695, 28724, 28754, 28783, 28813, 28843, 28872, 28901, 28931, 28960, 28990, 29019, 29049, 29078, 29108, 29137, 29167,
        29196, 29226, 29255, 29285, 29315, 29345, 29375, 29404, 29434, 29463, 29492, 29522, 29551, 29580, 29610, 29640, 29669, 29699, 29729, 29759,
        29788, 29818, 29847, 29876, 29906, 29935, 29964, 29994, 30023, 30053, 30082, 30112, 30141, 30171, 30200, 30230, 30259, 30289, 30318, 30348,
        30378, 30408, 30437, 30467, 30496, 30526, 30555, 30585, 30614, 30644, 30673, 30703, 30732, 30762, 30791, 30821, 30850, 30880, 30909, 30939,
        30968, 30998, 31027, 31057, 31086, 31116, 31145, 31175, 31204, 31234, 31263, 31293, 31322, 31352, 31381, 31411, 31441, 31471, 31500, 31530,
        31559, 31589, 31618, 31648, 31676, 31706, 31736, 31766, 31795, 31825, 31854, 31884, 31913, 31943, 31972, 32002, 32031, 32061, 32090, 32120,
        32150, 32180, 32209, 32239, 32268, 32298, 32327, 32357, 32386, 32416, 32445, 32475, 32504, 32534, 32563, 32593, 32622, 32652, 32681, 32711,
        32740, 32770, 32799, 32829, 32858, 32888, 32917, 32947, 32976, 33006, 33035, 33065, 33094, 33124, 33153, 33183, 33213, 33243, 33272, 33302,
        33331, 33361, 33390, 33420, 33450, 33479, 33509, 33539, 33568, 33598, 33627, 33657, 33686, 33716, 33745, 33775, 33804, 33834, 33863, 33893,
        33922, 33952, 33981, 34011, 34040, 34069, 34099, 34128, 34158, 34187, 34217, 34247, 34277, 34306, 34336, 34365, 34395, 34424, 34454, 34483,
        34512, 34542, 34571, 34601, 34631, 34660, 34690, 34719, 34749, 34778, 34808, 34837, 34867, 34896, 34926, 34955, 34985, 35015, 35044, 35074,
        35103, 35133, 35162, 35192, 35222, 35251, 35280, 35310, 35340, 35370, 35399, 35429, 35458, 35488, 35517, 35547, 35576, 35605, 35635, 35665,
        35694, 35723, 35753, 35782, 35811, 35841, 35871, 35901, 35930, 35960, 35989, 36019, 36048, 36078, 36107, 36136, 36166, 36195, 36225, 36254,
        36284, 36314, 36343, 36373, 36403, 36433, 36462, 36492, 36521, 36551, 36580, 36610, 36639, 36669, 36698, 36728, 36757, 36786, 36816, 36845,
        36875, 36904, 36934, 36963, 36993, 37022, 37052, 37081, 37111, 37141, 37170, 37200, 37229, 37259, 37288, 37318, 37347, 37377, 37406, 37436,
        37465, 37495, 37524, 37554, 37584, 37613, 37643, 37672, 37701, 37731, 37760, 37790, 37819, 37849, 37878, 37908, 37938, 37967, 37997, 38027,
        38056, 38085, 38115, 38144, 38174, 38203, 38233, 38262, 38292, 38322, 38351, 38381, 38410, 38440, 38469, 38499, 38528, 38558, 38587, 38617,
        38646, 38676, 38705, 38735, 38764, 38794, 38823, 38853, 38882, 38912, 38941, 38971, 39001, 39030, 39059, 39089, 39118, 39148, 39178, 39208,
        39237, 39267, 39297, 39326, 39355, 39385, 39414, 39444, 39473, 39503, 39532, 39562, 39592, 39621, 39650, 39680, 39709, 39739, 39768, 39798,
        39827, 39857, 39886, 39916, 39946, 39975, 40005, 40035, 40064, 40094, 40123, 40153, 40182, 40212, 40241, 40271, 40300, 40330, 40359, 40389,
        40418, 40448, 40477, 40507, 40536, 40566, 40595, 40625, 40655, 40685, 40714, 40744, 40773, 40803, 40832, 40862, 40892, 40921, 40951, 40980,
        41009, 41039, 41068, 41098, 41127, 41157, 41186, 41216, 41245, 41275, 41304, 41334, 41364, 41393, 41422, 41452, 41481, 41511, 41540, 41570,
        41599, 41629, 41658, 41688, 41718, 41748, 41777, 41807, 41836, 41865, 41894, 41924, 41953, 41983, 42012, 42042, 42072, 42102, 42131, 42161,
        42190, 42220, 42249, 42279, 42308, 42337, 42367, 42397, 42426, 42456, 42485, 42515, 42545, 42574, 42604, 42633, 42662, 42692, 42721, 42751,
        42780, 42810, 42839, 42869, 42899, 42929, 42958, 42988, 43017, 43046, 43076, 43105, 43135, 43164, 43194, 43223, 43253, 43283, 43312, 43342,
        43371, 43401, 43430, 43460, 43489, 43519, 43548, 43578, 43607, 43637, 43666, 43696, 43726, 43755, 43785, 43814, 43844, 43873, 43903, 43932,
        43962, 43991, 44021, 44050, 44080, 44109, 44139, 44169, 44198, 44228, 44258, 44287, 44317, 44346, 44375, 44405, 44434, 44464, 44493, 44523,
        44553, 44582, 44612, 44641, 44671, 44700, 44730, 44759, 44788, 44818, 44847, 44877, 44906, 44936, 44966, 44996, 45025, 45055, 45084, 45114,
        45143, 45172, 45202, 45231, 45261, 45290, 45320, 45350, 45380, 45409, 45439, 45468, 45498, 45527, 45556, 45586, 45615, 45644, 45674, 45704,
        45733, 45763, 45793, 45823, 45852, 45882, 45911, 45940, 45970, 45999, 46028, 46058, 46088, 46117, 46147, 46177, 46206, 46236, 46265, 46295,
        46324, 46354, 46383, 46413, 46442, 46472, 46501, 46531, 46560, 46590, 46620, 46649, 46679, 46708, 46738, 46767, 46797, 46826, 46856, 46885,
        46915, 46944, 46974, 47003, 47033, 47063, 47092, 47122, 47151, 47181, 47210, 47240, 47269, 47298, 47328, 47357, 47387, 47417, 47446, 47476,
        47506, 47535, 47565, 47594, 47624, 47653, 47682, 47712, 47741, 47771, 47800, 47830, 47860, 47890, 47919, 47949, 47978, 48008, 48037, 48066,
        48096, 48125, 48155, 48184, 48214, 48244, 48273, 48303, 48333, 48362, 48392, 48421, 48450, 48480, 48509, 48538, 48568, 48598, 48627, 48657,
        48687, 48717, 48746, 48776, 48805, 48834, 48864, 48893, 48922, 48952, 48982, 49011, 49041, 49071, 49100, 49130, 49160, 49189, 49218, 49248,
        49277, 49306, 49336, 49365, 49395, 49425, 49455, 49484, 49514, 49543, 49573, 49602, 49632, 49661, 49690, 49720, 49749, 49779, 49809, 49838,
        49868, 49898, 49927, 49957, 49986, 50016, 50045, 50075, 50104, 50133, 50163, 50192, 50222, 50252, 50281, 50311, 50340, 50370, 50400, 50429,
        50459, 50488, 50518, 50547, 50576, 50606, 50635, 50665, 50694, 50724, 50754, 50784, 50813, 50843, 50872, 50902, 50931, 50960, 50990, 51019,
        51049, 51078, 51108, 51138, 51167, 51197, 51227, 51256, 51286, 51315, 51345, 51374, 51403, 51433, 51462, 51492, 51522, 51552, 51582, 51611,
        51641, 51670, 51699, 51729, 51758, 51787, 51816, 51846, 51876, 51906, 51936, 51965, 51995, 52025, 52054, 52083, 52113, 52142, 52171, 52200,
        52230, 52260, 52290, 52319, 52349, 52379, 52408, 52438, 52467, 52497, 52526, 52555, 52585, 52614, 52644, 52673, 52703, 52733, 52762, 52792,
        52822, 52851, 52881, 52910, 52939, 52969, 52998, 53028, 53057, 53087, 53116, 53146, 53176, 53205, 53235, 53264, 53294, 53324, 53353, 53383,
        53412, 53441, 53471, 53500, 53530, 53559, 53589, 53619, 53648, 53678, 53708, 53737, 53767, 53796, 53825, 53855, 53884, 53913, 53943, 53973,
        54003, 54032, 54062, 54092, 54121, 54151, 54180, 54209, 54239, 54268, 54297, 54327, 54357, 54387, 54416, 54446, 54476, 54505, 54535, 54564,
        54593, 54623, 54652, 54681, 54711, 54741, 54770, 54800, 54830, 54859, 54889, 54919, 54948, 54977, 55007, 55036, 55066, 55095, 55125, 55154,
        55184, 55213, 55243, 55273, 55302, 55332, 55361, 55391, 55420, 55450, 55479, 55508, 55538, 55567, 55597, 55627, 55657, 55686, 55716, 55745,
        55775, 55804, 55834, 55863, 55892, 55922, 55951, 55981, 56011, 56040, 56070, 56100, 56129, 56159, 56188, 56218, 56247, 56276, 56306, 56335,
        56365, 56394, 56424, 56454, 56483, 56513, 56543, 56572, 56601, 56631, 56660, 56690, 56719, 56749, 56778, 56808, 56837, 56867, 56897, 56926,
        56956, 56985, 57015, 57044, 57074, 57103, 57133, 57162, 57192, 57221, 57251, 57280, 57310, 57340, 57369, 57399, 57429, 57458, 57487, 57517,
        57546, 57576, 57605, 57634, 57664, 57694, 57723, 57753, 57783, 57813, 57842, 57871, 57901, 57930, 57959, 57989, 58018, 58048, 58077, 58107,
        58137, 58167, 58196, 58226, 58255, 58285, 58314, 58343, 58373, 58402, 58432, 58461, 58491, 58521, 58551, 58580, 58610, 58639, 58669, 58698,
        58727, 58757, 58786, 58816, 58845, 58875, 58905, 58934, 58964, 58994, 59023, 59053, 59082, 59111, 59141, 59170, 59200, 59229, 59259, 59288,
        59318, 59348, 59377, 59407, 59436, 59466, 59495, 59525, 59554, 59584, 59613, 59643, 59672, 59702, 59731, 59761, 59791, 59820, 59850, 59879,
        59909, 59939, 59968, 59997, 60027, 60056, 60086, 60115, 60145, 60174, 60204, 60234, 60264, 60293, 60323, 60352, 60381, 60411, 60440, 60469,
        60499, 60528, 60558, 60588, 60618, 60648, 60677, 60707, 60736, 60765, 60795, 60824, 60853, 60883, 60912, 60942, 60972, 61002, 61031, 61061,
        61090, 61120, 61149, 61179, 61208, 61237, 61267, 61296, 61326, 61356, 61385, 61415, 61445, 61474, 61504, 61533, 61563, 61592, 61621, 61651,
        61680, 61710, 61739, 61769, 61799, 61828, 61858, 61888, 61917, 61947, 61976, 62006, 62035, 62064, 62094, 62123, 62153, 62182, 62212, 62242,
        62271, 62301, 62331, 62360, 62390, 62419, 62448, 62478, 62507, 62537, 62566, 62596, 62625, 62655, 62685, 62715, 62744, 62774, 62803, 62832,
        62862, 62891, 62921, 62950, 62980, 63009, 63039, 63069, 63099, 63128, 63157, 63187, 63216, 63246, 63275, 63305, 63334, 63363, 63393, 63423,
        63453, 63482, 63512, 63541, 63571, 63600, 63630, 63659, 63689, 63718, 63747, 63777, 63807, 63836, 63866, 63895, 63925, 63955, 63984, 64014,
        64043, 64073, 64102, 64131, 64161, 64190, 64220, 64249, 64279, 64309, 64339, 64368, 64398, 64427, 64457, 64486, 64515, 64545, 64574, 64603,
        64633, 64663, 64692, 64722, 64752, 64782, 64811, 64841, 64870, 64899, 64929, 64958, 64987, 65017, 65047, 65076, 65106, 65136, 65166, 65195,
        65225, 65254, 65283, 65313, 65342, 65371, 65401, 65431, 65460, 65490, 65520, 65549, 65579, 65608, 65638, 65667, 65697, 65726, 65755, 65785,
        65815, 65844, 65874, 65903, 65933, 65963, 65992, 66022, 66051, 66081, 66110, 66140, 66169, 66199, 66228, 66258, 66287, 66317, 66346, 66376,
        66405, 66435, 66465, 66494, 66524, 66553, 66583, 66612, 66641, 66671, 66700, 66730, 66760, 66789, 66819, 66849, 66878, 66908, 66937, 66967,
        66996, 67025, 67055, 67084, 67114, 67143, 67173, 67203, 67233, 67262, 67292, 67321, 67351, 67380, 67409, 67439, 67468, 67497, 67527, 67557,
        67587, 67617, 67646, 67676, 67705, 67735, 67764, 67793, 67823, 67852, 67882, 67911, 67941, 67971, 68000, 68030, 68060, 68089, 68119, 68148,
        68177, 68207, 68236, 68266, 68295, 68325, 68354, 68384, 68414, 68443, 68473, 68502, 68532, 68561, 68591, 68620, 68650, 68679, 68708, 68738,
        68768, 68797, 68827, 68857, 68886, 68916, 68946, 68975, 69004, 69034, 69063, 69092, 69122, 69152, 69181, 69211, 69240, 69270, 69300, 69330,
        69359, 69388, 69418, 69447, 69476, 69506, 69535, 69565, 69595, 69624, 69654, 69684, 69713, 69743, 69772, 69802, 69831, 69861, 69890, 69919,
        69949, 69978, 70008, 70038, 70067, 70097, 70126, 70156, 70186, 70215, 70245, 70274, 70303, 70333, 70362, 70392, 70421, 70451, 70481, 70510,
        70540, 70570, 70599, 70629, 70658, 70687, 70717, 70746, 70776, 70805, 70835, 70864, 70894, 70924, 70954, 70983, 71013, 71042, 71071, 71101,
        71130, 71159, 71189, 71218, 71248, 71278, 71308, 71337, 71367, 71397, 71426, 71455, 71485, 71514, 71543, 71573, 71602, 71632, 71662, 71691,
        71721, 71751, 71781, 71810, 71839, 71869, 71898, 71927, 71957, 71986, 72016, 72046, 72075, 72105, 72135, 72164, 72194, 72223, 72253, 72282,
        72311, 72341, 72370, 72400, 72429, 72459, 72489, 72518, 72548, 72577, 72607, 72637, 72666, 72695, 72725, 72754, 72784, 72813, 72843, 72872,
        72902, 72931, 72961, 72991, 73020, 73050, 73080, 73109, 73139, 73168, 73197, 73227, 73256, 73286, 73315, 73345, 73375, 73404, 73434, 73464,
        73493, 73523, 73552, 73581, 73611, 73640, 73669, 73699, 73729, 73758, 73788, 73818, 73848, 73877, 73907, 73936, 73965, 73995, 74024, 74053,
        74083, 74113, 74142, 74172, 74202, 74231, 74261, 74291, 74320, 74349, 74379, 74408, 74437, 74467, 74497, 74526, 74556, 74586, 74615, 74645,
        74675, 74704, 74733, 74763, 74792, 74822, 74851, 74881, 74910, 74940, 74969, 74999, 75029, 75058, 75088, 75117, 75147, 75176, 75206, 75235,
        75264, 75294, 75323, 75353, 75383, 75412, 75442, 75472, 75501, 75531, 75560, 75590, 75619, 75648, 75678, 75707, 75737, 75766, 75796, 75826,
        75856, 75885, 75915, 75944, 75974, 76003, 76032, 76062, 76091, 76121, 76150, 76180, 76210, 76239, 76269, 76299, 76328, 76358, 76387, 76416,
        76446, 76475, 76505, 76534, 76564, 76593, 76623, 76653, 76682, 76712, 76741, 76771, 76801, 76830, 76859, 76889, 76918, 76948, 76977, 77007,
        77036, 77066, 77096, 77125, 77155, 77185, 77214, 77243, 77273, 77302, 77332, 77361, 77390, 77420, 77450, 77479, 77509, 77539, 77569, 77598,
        77627, 77657, 77686, 77715, 77745, 77774, 77804, 77833, 77863, 77893, 77923, 77952, 77982, 78011, 78041, 78070, 78099, 78129, 78158, 78188,
        78217, 78247, 78277, 78307, 78336, 78366, 78395, 78425, 78454, 78483, 78513, 78542, 78572, 78601, 78631, 78661, 78690, 78720, 78750, 78779,
        78808, 78838, 78867, 78897, 78926, 78956, 78985, 79015, 79044, 79074, 79104, 79133, 79163, 79192, 79222, 79251, 79281, 79310, 79340, 79369,
        79399, 79428, 79458, 79487, 79517, 79546, 79576, 79606, 79635, 79665, 79695, 79724, 79753, 79783, 79812, 79841, 79871, 79900, 79930, 79960,
        79990];
    /* tslint:enable */
    function getHijriDate(gDate) {
        var day = gDate.getDate();
        var month = gDate.getMonth();
        var year = gDate.getFullYear();
        var tMonth = month + 1;
        var tYear = year;
        if (tMonth < 3) {
            tYear -= 1;
            tMonth += 12;
        }
        var yPrefix = Math.floor(tYear / 100.);
        var julilanOffset = yPrefix - Math.floor(yPrefix / 4.) - 2;
        var julianNumber = Math.floor(365.25 * (tYear + 4716)) + Math.floor(30.6001 * (tMonth + 1)) + day - julilanOffset - 1524;
        yPrefix = Math.floor((julianNumber - 1867216.25) / 36524.25);
        julilanOffset = yPrefix - Math.floor(yPrefix / 4.) + 1;
        var b = julianNumber + julilanOffset + 1524;
        var c = Math.floor((b - 122.1) / 365.25);
        var d = Math.floor(365.25 * c);
        var tempMonth = Math.floor((b - d) / 30.6001);
        day = (b - d) - Math.floor(30.6001 * tempMonth);
        month = Math.floor((b - d) / 20.6001);
        if (month > 13) {
            c += 1;
            month -= 12;
        }
        month -= 1;
        year = c - 4716;
        var modifiedJulianDate = julianNumber - 2400000;
        // date calculation for year after 2077
        var iyear = 10631. / 30.;
        var z = julianNumber - 1948084;
        var cyc = Math.floor(z / 10631.);
        z = z - 10631 * cyc;
        var j = Math.floor((z - 0.1335) / iyear);
        var iy = 30 * cyc + j;
        z = z - Math.floor(j * iyear + 0.1335);
        var im = Math.floor((z + 28.5001) / 29.5);
        /* istanbul ignore next */
        if (im === 13) {
            im = 12;
        }
        var tempDay = z - Math.floor(29.5001 * im - 29);
        var i = 0;
        for (; i < dateCorrection.length; i++) {
            if (dateCorrection[i] > modifiedJulianDate) {
                break;
            }
        }
        var iln = i + 16260;
        var ii = Math.floor((iln - 1) / 12);
        var hYear = ii + 1;
        var hmonth = iln - 12 * ii;
        var hDate = modifiedJulianDate - dateCorrection[i - 1] + 1;
        if ((hDate + '').length > 2) {
            hDate = tempDay;
            hmonth = im;
            hYear = iy;
        }
        return { year: hYear, month: hmonth, date: hDate };
    }
    HijriParser.getHijriDate = getHijriDate;
    function toGregorian(year, month, day) {
        var iy = year;
        var im = month;
        var id = day;
        var ii = iy - 1;
        var iln = (ii * 12) + 1 + (im - 1);
        var i = iln - 16260;
        var mcjdn = id + dateCorrection[i - 1] - 1;
        var julianDate = mcjdn + 2400000;
        var z = Math.floor(julianDate + 0.5);
        var a = Math.floor((z - 1867216.25) / 36524.25);
        a = z + 1 + a - Math.floor(a / 4);
        var b = a + 1524;
        var c = Math.floor((b - 122.1) / 365.25);
        var d = Math.floor(365.25 * c);
        var e = Math.floor((b - d) / 30.6001);
        var gDay = b - d - Math.floor(e * 30.6001);
        var gMonth = e - (e > 13.5 ? 13 : 1);
        var gYear = c - (gMonth > 2.5 ? 4716 : 4715);
        /* istanbul ignore next */
        if (gYear <= 0) {
            gMonth--;
        } // No year zero
        return new Date(gYear + '/' + (gMonth) + '/' + gDay);
    }
    HijriParser.toGregorian = toGregorian;
})(HijriParser || (HijriParser = {}));


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/index.js":
/*!*********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/index.js ***!
  \*********************************************************/
/*! exports provided: blazorCultureFormats, IntlBase, Ajax, Animation, rippleEffect, isRippleEnabled, enableRipple, Base, getComponent, removeChildInstance, Browser, versionBasedStatePersistence, enableVersionBasedPersistence, Component, ChildProperty, Position, Draggable, Droppable, EventHandler, onIntlChange, rightToLeft, cldrData, defaultCulture, defaultCurrencyCode, Internationalization, setCulture, setCurrencyCode, loadCldr, enableRtl, getNumericObject, getNumberDependable, getDefaultDateObject, KeyboardEvents, L10n, ModuleLoader, Property, Complex, ComplexFactory, Collection, CollectionFactory, Event, NotifyPropertyChanges, CreateBuilder, SwipeSettings, Touch, HijriParser, blazorTemplates, getRandomId, compile, updateBlazorTemplate, resetBlazorTemplate, setTemplateEngine, getTemplateEngine, disableBlazorMode, createInstance, setImmediate, getValue, setValue, deleteObject, isObject, getEnumValue, merge, extend, isNullOrUndefined, isUndefined, getUniqueID, debounce, queryParams, isObjectArray, compareElementParent, throwError, print, formatUnit, enableBlazorMode, isBlazor, getElement, getInstance, addInstance, uniqueID, createElement, addClass, removeClass, isVisible, prepend, append, detach, remove, attributes, select, selectAll, closest, siblings, getAttributeOrDefault, setStyleAttribute, classList, matches, includeInnerHTML, containsClass, cloneNode, Observer, SanitizeHtmlHelper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _intl_intl_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intl/intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blazorCultureFormats", function() { return _intl_intl_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntlBase", function() { return _intl_intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"]; });

/* harmony import */ var _ajax__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ajax */ "./ej2-resources/18.4.46/scripts/ej2-base/ajax.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Ajax", function() { return _ajax__WEBPACK_IMPORTED_MODULE_1__["Ajax"]; });

/* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./animation */ "./ej2-resources/18.4.46/scripts/ej2-base/animation.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return _animation__WEBPACK_IMPORTED_MODULE_2__["Animation"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rippleEffect", function() { return _animation__WEBPACK_IMPORTED_MODULE_2__["rippleEffect"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRippleEnabled", function() { return _animation__WEBPACK_IMPORTED_MODULE_2__["isRippleEnabled"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableRipple", function() { return _animation__WEBPACK_IMPORTED_MODULE_2__["enableRipple"]; });

/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Base", function() { return _base__WEBPACK_IMPORTED_MODULE_3__["Base"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getComponent", function() { return _base__WEBPACK_IMPORTED_MODULE_3__["getComponent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeChildInstance", function() { return _base__WEBPACK_IMPORTED_MODULE_3__["removeChildInstance"]; });

/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Browser", function() { return _browser__WEBPACK_IMPORTED_MODULE_4__["Browser"]; });

/* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./component */ "./ej2-resources/18.4.46/scripts/ej2-base/component.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "versionBasedStatePersistence", function() { return _component__WEBPACK_IMPORTED_MODULE_5__["versionBasedStatePersistence"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableVersionBasedPersistence", function() { return _component__WEBPACK_IMPORTED_MODULE_5__["enableVersionBasedPersistence"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return _component__WEBPACK_IMPORTED_MODULE_5__["Component"]; });

/* harmony import */ var _child_property__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./child-property */ "./ej2-resources/18.4.46/scripts/ej2-base/child-property.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChildProperty", function() { return _child_property__WEBPACK_IMPORTED_MODULE_6__["ChildProperty"]; });

/* harmony import */ var _draggable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./draggable */ "./ej2-resources/18.4.46/scripts/ej2-base/draggable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _draggable__WEBPACK_IMPORTED_MODULE_7__["Position"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Draggable", function() { return _draggable__WEBPACK_IMPORTED_MODULE_7__["Draggable"]; });

/* harmony import */ var _droppable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./droppable */ "./ej2-resources/18.4.46/scripts/ej2-base/droppable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Droppable", function() { return _droppable__WEBPACK_IMPORTED_MODULE_8__["Droppable"]; });

/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EventHandler", function() { return _event_handler__WEBPACK_IMPORTED_MODULE_9__["EventHandler"]; });

/* harmony import */ var _internationalization__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internationalization */ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onIntlChange", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["onIntlChange"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rightToLeft", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["rightToLeft"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cldrData", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["cldrData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultCulture", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["defaultCulture"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultCurrencyCode", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["defaultCurrencyCode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Internationalization", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["Internationalization"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setCulture", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["setCulture"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setCurrencyCode", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["setCurrencyCode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "loadCldr", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["loadCldr"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableRtl", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["enableRtl"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getNumericObject", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["getNumericObject"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getNumberDependable", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["getNumberDependable"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDefaultDateObject", function() { return _internationalization__WEBPACK_IMPORTED_MODULE_10__["getDefaultDateObject"]; });

/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./keyboard */ "./ej2-resources/18.4.46/scripts/ej2-base/keyboard.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeyboardEvents", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_11__["KeyboardEvents"]; });

/* harmony import */ var _l10n__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./l10n */ "./ej2-resources/18.4.46/scripts/ej2-base/l10n.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "L10n", function() { return _l10n__WEBPACK_IMPORTED_MODULE_12__["L10n"]; });

/* harmony import */ var _module_loader__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./module-loader */ "./ej2-resources/18.4.46/scripts/ej2-base/module-loader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleLoader", function() { return _module_loader__WEBPACK_IMPORTED_MODULE_13__["ModuleLoader"]; });

/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["Property"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Complex", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["Complex"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComplexFactory", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["ComplexFactory"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["Collection"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CollectionFactory", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["CollectionFactory"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["Event"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NotifyPropertyChanges", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["NotifyPropertyChanges"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CreateBuilder", function() { return _notify_property_change__WEBPACK_IMPORTED_MODULE_14__["CreateBuilder"]; });

/* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./touch */ "./ej2-resources/18.4.46/scripts/ej2-base/touch.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SwipeSettings", function() { return _touch__WEBPACK_IMPORTED_MODULE_15__["SwipeSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _touch__WEBPACK_IMPORTED_MODULE_15__["Touch"]; });

/* harmony import */ var _hijri_parser__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./hijri-parser */ "./ej2-resources/18.4.46/scripts/ej2-base/hijri-parser.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HijriParser", function() { return _hijri_parser__WEBPACK_IMPORTED_MODULE_16__["HijriParser"]; });

/* harmony import */ var _template_engine__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./template-engine */ "./ej2-resources/18.4.46/scripts/ej2-base/template-engine.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blazorTemplates", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["blazorTemplates"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRandomId", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["getRandomId"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compile", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["compile"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateBlazorTemplate", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["updateBlazorTemplate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resetBlazorTemplate", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["resetBlazorTemplate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTemplateEngine", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["setTemplateEngine"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTemplateEngine", function() { return _template_engine__WEBPACK_IMPORTED_MODULE_17__["getTemplateEngine"]; });

/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "disableBlazorMode", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["disableBlazorMode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createInstance", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["createInstance"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["setImmediate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getValue", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["getValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setValue", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["setValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deleteObject", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["deleteObject"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["isObject"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEnumValue", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["getEnumValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["merge"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["extend"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNullOrUndefined", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["isNullOrUndefined"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["isUndefined"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getUniqueID", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["getUniqueID"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["debounce"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queryParams", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["queryParams"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectArray", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["isObjectArray"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compareElementParent", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["compareElementParent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["throwError"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "print", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["print"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatUnit", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["formatUnit"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "enableBlazorMode", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["enableBlazorMode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBlazor", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["isBlazor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getElement", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["getElement"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["getInstance"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addInstance", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["addInstance"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueID", function() { return _util__WEBPACK_IMPORTED_MODULE_18__["uniqueID"]; });

/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["createElement"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["addClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["removeClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["isVisible"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepend", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["prepend"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "append", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["append"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "detach", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["detach"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["remove"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attributes", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["attributes"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "select", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["select"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAll", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["selectAll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["closest"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "siblings", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["siblings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getAttributeOrDefault", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["getAttributeOrDefault"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setStyleAttribute", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["setStyleAttribute"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classList", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["classList"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["matches"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includeInnerHTML", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["includeInnerHTML"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "containsClass", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["containsClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneNode", function() { return _dom__WEBPACK_IMPORTED_MODULE_19__["cloneNode"]; });

/* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./observer */ "./ej2-resources/18.4.46/scripts/ej2-base/observer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return _observer__WEBPACK_IMPORTED_MODULE_20__["Observer"]; });

/* harmony import */ var _sanitize_helper__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./sanitize-helper */ "./ej2-resources/18.4.46/scripts/ej2-base/sanitize-helper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SanitizeHtmlHelper", function() { return _sanitize_helper__WEBPACK_IMPORTED_MODULE_21__["SanitizeHtmlHelper"]; });

/**
 * Base modules
 */
























/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js ***!
  \************************************************************************/
/*! exports provided: onIntlChange, rightToLeft, cldrData, defaultCulture, defaultCurrencyCode, Internationalization, setCulture, setCurrencyCode, loadCldr, enableRtl, getNumericObject, getNumberDependable, getDefaultDateObject */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onIntlChange", function() { return onIntlChange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rightToLeft", function() { return rightToLeft; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cldrData", function() { return cldrData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultCulture", function() { return defaultCulture; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultCurrencyCode", function() { return defaultCurrencyCode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Internationalization", function() { return Internationalization; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCulture", function() { return setCulture; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCurrencyCode", function() { return setCurrencyCode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadCldr", function() { return loadCldr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableRtl", function() { return enableRtl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumericObject", function() { return getNumericObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNumberDependable", function() { return getNumberDependable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDefaultDateObject", function() { return getDefaultDateObject; });
/* harmony import */ var _intl_date_formatter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intl/date-formatter */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-formatter.js");
/* harmony import */ var _intl_number_formatter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intl/number-formatter */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/number-formatter.js");
/* harmony import */ var _intl_date_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intl/date-parser */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-parser.js");
/* harmony import */ var _intl_number_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./intl/number-parser */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/number-parser.js");
/* harmony import */ var _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./intl/intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./observer */ "./ej2-resources/18.4.46/scripts/ej2-base/observer.js");







/**
 * Specifies the observer used for external change detection.
 */
var onIntlChange = new _observer__WEBPACK_IMPORTED_MODULE_6__["Observer"]();
/**
 * Specifies the default rtl status for EJ2 components.
 */
var rightToLeft = false;
/**
 * Specifies the CLDR data loaded for internationalization functionalities.
 * @private
 */
var cldrData = {};
/**
 * Specifies the default culture value to be considered.
 * @private
 */
var defaultCulture = 'en-US';
/**
 * Specifies default currency code to be considered
 * @private
 */
var defaultCurrencyCode = 'USD';
var mapper = ['numericObject', 'dateObject'];
/**
 * Internationalization class provides support to parse and format the number and date object to the desired format.
 * ```typescript
 * // To set the culture globally
 * setCulture('en-GB');
 *
 * // To set currency code globally
 * setCurrencyCode('EUR');
 *
 * //Load cldr data
 * loadCldr(gregorainData);
 * loadCldr(timeZoneData);
 * loadCldr(numbersData);
 * loadCldr(numberSystemData);
 *
 * // To use formatter in component side
 * let Intl:Internationalization = new Internationalization();
 *
 * // Date formatting
 * let dateFormatter: Function = Intl.getDateFormat({skeleton:'long',type:'dateTime'});
 * dateFormatter(new Date('11/2/2016'));
 * dateFormatter(new Date('25/2/2030'));
 * Intl.formatDate(new Date(),{skeleton:'E'});
 *
 * //Number formatting
 * let numberFormatter: Function = Intl.getNumberFormat({skeleton:'C5'})
 * numberFormatter(24563334);
 * Intl.formatNumber(123123,{skeleton:'p2'});
 *
 * // Date parser
 * let dateParser: Function = Intl.getDateParser({skeleton:'short',type:'time'});
 * dateParser('10:30 PM');
 * Intl.parseDate('10',{skeleton:'H'});
 * ```
 */
var Internationalization = /** @__PURE__ @class */ (function () {
    function Internationalization(cultureName) {
        if (cultureName) {
            this.culture = cultureName;
        }
    }
    /**
     * Returns the format function for given options.
     * @param {DateFormatOptions} options - Specifies the format options in which the format function will return.
     * @returns {Function}
     */
    Internationalization.prototype.getDateFormat = function (options) {
        return _intl_date_formatter__WEBPACK_IMPORTED_MODULE_0__["DateFormat"].dateFormat(this.getCulture(), options || { type: 'date', skeleton: 'short' }, cldrData);
    };
    /**
     * Returns the format function for given options.
     * @param {NumberFormatOptions} options - Specifies the format options in which the format function will return.
     * @returns {Function}
     */
    Internationalization.prototype.getNumberFormat = function (options) {
        if (options && !options.currency) {
            options.currency = defaultCurrencyCode;
        }
        if (Object(_util__WEBPACK_IMPORTED_MODULE_5__["isBlazor"])() && options && !options.format) {
            options.minimumFractionDigits = 0;
        }
        return _intl_number_formatter__WEBPACK_IMPORTED_MODULE_1__["NumberFormat"].numberFormatter(this.getCulture(), options || {}, cldrData);
    };
    /**
     * Returns the parser function for given options.
     * @param {DateFormatOptions} options - Specifies the format options in which the parser function will return.
     * @returns {Function}
     */
    Internationalization.prototype.getDateParser = function (options) {
        return _intl_date_parser__WEBPACK_IMPORTED_MODULE_2__["DateParser"].dateParser(this.getCulture(), options || { skeleton: 'short', type: 'date' }, cldrData);
    };
    /**
     * Returns the parser function for given options.
     * @param {NumberFormatOptions} options - Specifies the format options in which the parser function will return.
     * @returns {Function}
     */
    Internationalization.prototype.getNumberParser = function (options) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_5__["isBlazor"])() && options && !options.format) {
            options.minimumFractionDigits = 0;
        }
        return _intl_number_parser__WEBPACK_IMPORTED_MODULE_3__["NumberParser"].numberParser(this.getCulture(), options || { format: 'N' }, cldrData);
    };
    /**
     * Returns the formatted string based on format options.
     * @param {Number} value - Specifies the number to format.
     * @param {NumberFormatOptions} option - Specifies the format options in which the number will be formatted.
     * @returns {string}
     */
    Internationalization.prototype.formatNumber = function (value, option) {
        return this.getNumberFormat(option)(value);
    };
    /**
     * Returns the formatted date string based on format options.
     * @param {Number} value - Specifies the number to format.
     * @param {DateFormatOptions} option - Specifies the format options in which the number will be formatted.
     * @returns {string}
     */
    Internationalization.prototype.formatDate = function (value, option) {
        return this.getDateFormat(option)(value);
    };
    /**
     * Returns the date object for given date string and options.
     * @param {string} value - Specifies the string to parse.
     * @param {DateFormatOptions} option - Specifies the parse options in which the date string will be parsed.
     * @returns {Date}
     */
    Internationalization.prototype.parseDate = function (value, option) {
        return this.getDateParser(option)(value);
    };
    /**
     * Returns the number object from the given string value and options.
     * @param {string} value - Specifies the string to parse.
     * @param {NumberFormatOptions} option - Specifies the parse options in which the  string number  will be parsed.
     * @returns {number}
     */
    Internationalization.prototype.parseNumber = function (value, option) {
        return this.getNumberParser(option)(value);
    };
    /**
     * Returns Native Date Time Pattern
     * @param {DateFormatOptions} option - Specifies the parse options for resultant date time pattern.
     * @param {boolean} isExcelFormat - Specifies format value to be converted to excel pattern.
     * @returns {string}
     * @private
     */
    Internationalization.prototype.getDatePattern = function (option, isExcelFormat) {
        return _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getActualDateTimeFormat(this.getCulture(), option, cldrData, isExcelFormat);
    };
    /**
     * Returns Native Number Pattern
     * @param {NumberFormatOptions} option - Specifies the parse options for resultant number pattern.
     * @returns {string}
     * @private
     */
    Internationalization.prototype.getNumberPattern = function (option, isExcel) {
        return _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getActualNumberFormat(this.getCulture(), option, cldrData, isExcel);
    };
    /**
     * Returns the First Day of the Week
     * @returns {number}
     */
    Internationalization.prototype.getFirstDayOfWeek = function () {
        return _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getWeekData(this.getCulture(), cldrData);
    };
    Internationalization.prototype.getCulture = function () {
        return this.culture || defaultCulture;
    };
    return Internationalization;
}());

/**
 * Set the default culture to all EJ2 components
 * @param {string} cultureName - Specifies the culture name to be set as default culture.
 */
function setCulture(cultureName) {
    defaultCulture = cultureName;
    onIntlChange.notify('notifyExternalChange', { 'locale': defaultCulture });
}
/**
 * Set the default currency code to all EJ2 components
 * @param {string} currencyCode Specifies the culture name to be set as default culture.
 * @returns {void}
 */
function setCurrencyCode(currencyCode) {
    defaultCurrencyCode = currencyCode;
    onIntlChange.notify('notifyExternalChange', { 'currencyCode': defaultCurrencyCode });
}
/**
 * Load the CLDR data into context
 * @param {Object[]} obj Specifies the CLDR data's to be used for formatting and parser.
 * @returns {void}
 */
function loadCldr() {
    var data = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        data[_i] = arguments[_i];
    }
    for (var _a = 0, data_1 = data; _a < data_1.length; _a++) {
        var obj = data_1[_a];
        Object(_util__WEBPACK_IMPORTED_MODULE_5__["extend"])(cldrData, obj, {}, true);
    }
}
/**
 * To enable or disable RTL functionality for all components globally.
 * @param {boolean} status - Optional argument Specifies the status value to enable or disable rtl option.
 * @returns {void}
 */
function enableRtl(status) {
    if (status === void 0) { status = true; }
    rightToLeft = status;
    onIntlChange.notify('notifyExternalChange', { enableRtl: rightToLeft });
}
/**
 * To get the numeric CLDR object for given culture
 * @param {string} locale - Specifies the locale for which numericObject to be returned.
 * @ignore
 * @private
 */
function getNumericObject(locale, type) {
    /* tslint:disable no-any */
    var numObject = _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getDependables(cldrData, locale, '', true)[mapper[0]];
    var dateObject = _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getDependables(cldrData, locale, '')[mapper[1]];
    var numSystem = Object(_util__WEBPACK_IMPORTED_MODULE_5__["getValue"])('defaultNumberingSystem', numObject);
    var symbPattern = Object(_util__WEBPACK_IMPORTED_MODULE_5__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_5__["getValue"])('numberSymbols', numObject) : Object(_util__WEBPACK_IMPORTED_MODULE_5__["getValue"])('symbols-numberSystem-' + numSystem, numObject);
    var pattern = _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getSymbolPattern(type || 'decimal', numSystem, numObject, false);
    return Object(_util__WEBPACK_IMPORTED_MODULE_5__["extend"])(symbPattern, _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getFormatData(pattern, true, '', true), { 'dateSeparator': _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getDateSeparator(dateObject) });
}
/**
 * To get the numeric CLDR  number base object for given culture
 * @param {string} locale - Specifies the locale for which numericObject to be returned.
 * @param {string} currency - Specifies the currency for which numericObject to be returned.
 * @ignore
 * @private
 */
function getNumberDependable(locale, currency) {
    var numObject = _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getDependables(cldrData, locale, '', true);
    return _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getCurrencySymbol(numObject.numericObject, currency);
}
/**
 * To get the default date CLDR object.
 * @ignore
 * @private
 */
function getDefaultDateObject(mode) {
    return _intl_intl_base__WEBPACK_IMPORTED_MODULE_4__["IntlBase"].getDependables(cldrData, '', mode, false)[mapper[1]];
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-formatter.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/date-formatter.js ***!
  \***********************************************************************/
/*! exports provided: basicPatterns, datePartMatcher, DateFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basicPatterns", function() { return basicPatterns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "datePartMatcher", function() { return datePartMatcher; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateFormat", function() { return DateFormat; });
/* harmony import */ var _parser_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parser-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js");
/* harmony import */ var _intl_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _hijri_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hijri-parser */ "./ej2-resources/18.4.46/scripts/ej2-base/hijri-parser.js");





var abbreviateRegexGlobal = /\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi;
var standalone = 'stand-alone';
var weekdayKey = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
var basicPatterns = ['short', 'medium', 'long', 'full'];
var timeSetter = {
    m: 'getMinutes',
    h: 'getHours',
    H: 'getHours',
    s: 'getSeconds',
    d: 'getDate',
    f: 'getMilliseconds'
};
var datePartMatcher = {
    'M': 'month',
    'd': 'day',
    'E': 'weekday',
    'c': 'weekday',
    'y': 'year',
    'm': 'minute',
    'h': 'hour',
    'H': 'hour',
    's': 'second',
    'L': 'month',
    'a': 'designator',
    'z': 'timeZone',
    'Z': 'timeZone',
    'G': 'era',
    'f': 'milliseconds'
};
var timeSeparator = 'timeSeparator';
/* tslint:disable no-any */
/**
 * Date Format is a framework provides support for date formatting.
 * @private
 */
var DateFormat = /** @__PURE__ @class */ (function () {
    function DateFormat() {
    }
    /**
     * Returns the formatter function for given skeleton.
     * @param {string} -  Specifies the culture name to be which formatting.
     * @param {DateFormatOptions} - Specific the format in which date  will format.
     * @param {cldr} - Specifies the global cldr data collection.
     * @return Function.
     */
    DateFormat.dateFormat = function (culture, option, cldr) {
        var _this = this;
        var dependable = _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].getDependables(cldr, culture, option.calendar);
        var numObject = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('parserObject.numbers', dependable);
        var dateObject = dependable.dateObject;
        var formatOptions = { isIslamic: _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].islamicRegex.test(option.calendar) };
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && option.isServerRendered) {
            option = _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].compareBlazorDateFormats(option, culture);
        }
        var resPattern = option.format ||
            _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].getResultantPattern(option.skeleton, dependable.dateObject, option.type, false, Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ? culture : '');
        formatOptions.dateSeperator = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dateSeperator', dateObject) : _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].getDateSeparator(dependable.dateObject);
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(resPattern)) {
            Object(_util__WEBPACK_IMPORTED_MODULE_2__["throwError"])('Format options or type given must be invalid');
        }
        else {
            resPattern = _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].ConvertDateToWeekFormat(resPattern);
            if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                resPattern = resPattern.replace(/tt/, 'a');
            }
            formatOptions.pattern = resPattern;
            formatOptions.numMapper = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ?
                Object(_util__WEBPACK_IMPORTED_MODULE_2__["extend"])({}, numObject) : _parser_base__WEBPACK_IMPORTED_MODULE_0__["ParserBase"].getNumberMapper(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_0__["ParserBase"].getNumberingSystem(cldr));
            var patternMatch = resPattern.match(abbreviateRegexGlobal) || [];
            for (var _i = 0, patternMatch_1 = patternMatch; _i < patternMatch_1.length; _i++) {
                var str = patternMatch_1[_i];
                var len = str.length;
                var char = str[0];
                if (char === 'K') {
                    char = 'h';
                }
                /* tslint:disable no-any */
                var charKey = datePartMatcher[char];
                switch (char) {
                    case 'E':
                    case 'c':
                        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                            formatOptions.weekday = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('days.' + _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].monthIndex[len], dateObject);
                        }
                        else {
                            formatOptions.weekday = dependable.dateObject[_intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].days][standalone][_intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].monthIndex[len]];
                        }
                        break;
                    case 'M':
                    case 'L':
                        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                            formatOptions.month = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('months.' + _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].monthIndex[len], dateObject);
                        }
                        else {
                            formatOptions.month = dependable.dateObject[_intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].month][standalone][_intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].monthIndex[len]];
                        }
                        break;
                    case 'a':
                        formatOptions.designator = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ?
                            Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dayPeriods', dateObject) : Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dayPeriods.format.wide', dateObject);
                        break;
                    case 'G':
                        var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';
                        formatOptions.era = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('eras', dateObject) : Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('eras.' + eText, dependable.dateObject);
                        break;
                    case 'z':
                        formatOptions.timeZone = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dates.timeZoneNames', dependable.parserObject);
                        break;
                }
            }
        }
        return function (value) {
            if (isNaN(value.getDate())) {
                return null;
            }
            return _this.intDateFormatter(value, formatOptions);
        };
    };
    /**
     * Returns formatted date string based on options passed.
     * @param {Date} value
     * @param {FormatOptions} options
     */
    // tslint:disable-next-line:max-func-body-length
    DateFormat.intDateFormatter = function (value, options) {
        var pattern = options.pattern;
        var ret = '';
        var matches = pattern.match(_intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].dateParseRegex);
        var dObject = this.getCurrentDateValue(value, options.isIslamic);
        for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) {
            var match = matches_1[_i];
            var length_1 = match.length;
            var char = match[0];
            if (char === 'K') {
                char = 'h';
            }
            var curval = void 0;
            var curvalstr = '';
            var isNumber = void 0;
            var processNumber = void 0;
            var curstr = '';
            switch (char) {
                case 'M':
                case 'L':
                    curval = dObject.month;
                    if (length_1 > 2) {
                        ret += options.month[curval];
                    }
                    else {
                        isNumber = true;
                    }
                    break;
                case 'E':
                case 'c':
                    ret += options.weekday[weekdayKey[value.getDay()]];
                    break;
                case 'H':
                case 'h':
                case 'm':
                case 's':
                case 'd':
                case 'f':
                    isNumber = true;
                    if (char === 'd') {
                        curval = dObject.date;
                    }
                    else if (char === 'f') {
                        isNumber = false;
                        processNumber = true;
                        curvalstr = value[timeSetter[char]]().toString();
                        curvalstr = curvalstr.substring(0, length_1);
                        var curlength = curvalstr.length;
                        if (length_1 !== curlength) {
                            if (length_1 > 3) {
                                continue;
                            }
                            for (var i = 0; i < length_1 - curlength; i++) {
                                curvalstr = '0' + curvalstr.toString();
                            }
                        }
                        curstr += curvalstr;
                    }
                    else {
                        curval = value[timeSetter[char]]();
                    }
                    if (char === 'h') {
                        curval = curval % 12 || 12;
                    }
                    break;
                case 'y':
                    processNumber = true;
                    curstr += dObject.year;
                    if (length_1 === 2) {
                        curstr = curstr.substr(curstr.length - 2);
                    }
                    break;
                case 'a':
                    var desig = value.getHours() < 12 ? 'am' : 'pm';
                    ret += options.designator[desig];
                    break;
                case 'G':
                    var dec = value.getFullYear() < 0 ? 0 : 1;
                    var retu = options.era[dec];
                    if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(retu)) {
                        retu = options.era[dec ? 0 : 1];
                    }
                    ret += retu || '';
                    break;
                case '\'':
                    ret += (match === '\'\'') ? '\'' : match.replace(/\'/g, '');
                    break;
                case 'z':
                    var timezone = value.getTimezoneOffset();
                    var pattern_1 = (length_1 < 4) ? '+H;-H' : options.timeZone.hourFormat;
                    pattern_1 = pattern_1.replace(/:/g, options.numMapper.timeSeparator);
                    if (timezone === 0) {
                        ret += options.timeZone.gmtZeroFormat;
                    }
                    else {
                        processNumber = true;
                        curstr = this.getTimeZoneValue(timezone, pattern_1);
                    }
                    curstr = options.timeZone.gmtFormat.replace(/\{0\}/, curstr);
                    break;
                case ':':
                    ret += options.numMapper.numberSymbols[timeSeparator];
                    /* tslint:enable no-any */
                    break;
                case '/':
                    ret += options.dateSeperator;
                    break;
                case 'W':
                    isNumber = true;
                    curval = _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].getWeekOfYear(value);
                    break;
                default:
                    ret += match;
            }
            if (isNumber) {
                processNumber = true;
                curstr = this.checkTwodigitNumber(curval, length_1);
            }
            if (processNumber) {
                ret += _parser_base__WEBPACK_IMPORTED_MODULE_0__["ParserBase"].convertValueParts(curstr, _intl_base__WEBPACK_IMPORTED_MODULE_1__["IntlBase"].latnParseRegex, options.numMapper.mapper);
            }
        }
        return ret;
    };
    DateFormat.getCurrentDateValue = function (value, isIslamic) {
        if (isIslamic) {
            return _hijri_parser__WEBPACK_IMPORTED_MODULE_3__["HijriParser"].getHijriDate(value);
        }
        return { year: value.getFullYear(), month: value.getMonth() + 1, date: value.getDate() };
    };
    /**
     * Returns two digit numbers for given value and length
     */
    DateFormat.checkTwodigitNumber = function (val, len) {
        var ret = val + '';
        if (len === 2 && ret.length !== 2) {
            return '0' + ret;
        }
        return ret;
    };
    /**
     * Returns the value of the Time Zone.
     * @param {number} tVal
     * @param {string} pattern
     * @private
     */
    DateFormat.getTimeZoneValue = function (tVal, pattern) {
        var _this = this;
        var splt = pattern.split(';');
        var curPattern = splt[tVal > 0 ? 1 : 0];
        var no = Math.abs(tVal);
        return curPattern = curPattern.replace(/HH?|mm/g, function (str) {
            var len = str.length;
            var ishour = str.indexOf('H') !== -1;
            return _this.checkTwodigitNumber(Math.floor(ishour ? (no / 60) : (no % 60)), len);
        });
    };
    return DateFormat;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-parser.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/date-parser.js ***!
  \********************************************************************/
/*! exports provided: DateParser */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateParser", function() { return DateParser; });
/* harmony import */ var _intl_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");
/* harmony import */ var _parser_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _date_formatter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date-formatter */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-formatter.js");
/* harmony import */ var _hijri_parser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hijri-parser */ "./ej2-resources/18.4.46/scripts/ej2-base/hijri-parser.js");





var number = 'numbers';
var defNoSystem = 'defaultNumberingSystem';
var noSystem = 'numberingSystem';
var standalone = 'stand-alone';
var curWeekDay = 'curWeekDay';
var latnRegex = /^[0-9]*$/;
var abbreviateRegex = /\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|ccc/;
var timeSetter = {
    minute: 'setMinutes',
    hour: 'setHours',
    second: 'setSeconds',
    day: 'setDate',
    month: 'setMonth',
    milliseconds: 'setMilliseconds'
};
var month = 'months';
/* tslint:disable no-any */
/**
 * Date Parser.
 * @private
 */
var DateParser = /** @__PURE__ @class */ (function () {
    function DateParser() {
    }
    /**
     * Returns the parser function for given skeleton.
     * @param {string} -  Specifies the culture name to be which formatting.
     * @param {DateFormatOptions} - Specific the format in which string date  will be parsed.
     * @param {cldr} - Specifies the global cldr data collection.
     *  @return Function.
     */
    // tslint:disable-next-line:max-func-body-length
    DateParser.dateParser = function (culture, option, cldr) {
        var _this = this;
        var dependable = _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].getDependables(cldr, culture, option.calendar);
        // tslint:disable-next-line
        var numOptions = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getCurrentNumericOptions(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getNumberingSystem(cldr), false, Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])());
        var parseOptions = {};
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && option.isServerRendered) {
            option = _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].compareBlazorDateFormats(option, culture);
        }
        var resPattern = option.format ||
            _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].getResultantPattern(option.skeleton, dependable.dateObject, option.type, false, Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ? culture : '');
        var regexString = '';
        var hourOnly;
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(resPattern)) {
            Object(_util__WEBPACK_IMPORTED_MODULE_2__["throwError"])('Format options or type given must be invalid');
        }
        else {
            resPattern = _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].ConvertDateToWeekFormat(resPattern);
            parseOptions = { isIslamic: _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].islamicRegex.test(option.calendar), pattern: resPattern, evalposition: {}, culture: culture };
            var patternMatch = resPattern.match(_intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].dateParseRegex) || [];
            var length_1 = patternMatch.length;
            var gmtCorrection = 0;
            var zCorrectTemp = 0;
            var isgmtTraversed = false;
            var nRegx = numOptions.numericRegex;
            // tslint:disable-next-line
            var numMapper = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ? dependable.parserObject.numbers :
                _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getNumberMapper(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getNumberingSystem(cldr));
            for (var i = 0; i < length_1; i++) {
                var str = patternMatch[i];
                var len = str.length;
                var char = (str[0] === 'K') ? 'h' : str[0];
                var isNumber = void 0;
                var canUpdate = void 0;
                // tslint:disable-next-line
                var charKey = _date_formatter__WEBPACK_IMPORTED_MODULE_3__["datePartMatcher"][char];
                var optional = (len === 2) ? '' : '?';
                if (isgmtTraversed) {
                    gmtCorrection = zCorrectTemp;
                    isgmtTraversed = false;
                }
                switch (char) {
                    case 'E':
                    case 'c':
                        // tslint:disable
                        var weekData = void 0;
                        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                            weekData = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('days.' + _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].monthIndex[len], dependable.dateObject);
                        }
                        else {
                            weekData = dependable.dateObject[_intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].days][standalone][_intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].monthIndex[len]];
                        }
                        var weekObject = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].reverseObject(weekData);
                        // tslint:enable
                        regexString += '(' + Object.keys(weekObject).join('|') + ')';
                        break;
                    case 'M':
                    case 'L':
                    case 'd':
                    case 'm':
                    case 's':
                    case 'h':
                    case 'H':
                    case 'f':
                        canUpdate = true;
                        if ((char === 'M' || char === 'L') && len > 2) {
                            var monthData = void 0;
                            if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                                /* tslint:disable no-any */
                                monthData = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('months.' + _intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].monthIndex[len], dependable.dateObject);
                            }
                            else {
                                /* tslint:disable no-any */
                                monthData = dependable.dateObject[month][standalone][_intl_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].monthIndex[len]];
                            }
                            // tslint:disable-next-line
                            parseOptions[charKey] = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].reverseObject(monthData);
                            /* tslint:disable no-any */
                            regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + ')';
                        }
                        else if (char === 'f') {
                            if (len > 3) {
                                continue;
                            }
                            isNumber = true;
                            regexString += '(' + nRegx + nRegx + '?' + nRegx + '?' + ')';
                        }
                        else {
                            isNumber = true;
                            regexString += '(' + nRegx + nRegx + optional + ')';
                        }
                        if (char === 'h') {
                            parseOptions.hour12 = true;
                        }
                        break;
                    case 'W':
                        var opt = len === 1 ? '?' : '';
                        regexString += '(' + nRegx + opt + nRegx + ')';
                        break;
                    case 'y':
                        canUpdate = isNumber = true;
                        if (len === 2) {
                            regexString += '(' + nRegx + nRegx + ')';
                        }
                        else {
                            regexString += '(' + nRegx + '{' + len + ',})';
                        }
                        break;
                    case 'a':
                        canUpdate = true;
                        var periodValur = Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ?
                            Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dayPeriods', dependable.dateObject) :
                            Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dayPeriods.format.wide', dependable.dateObject);
                        parseOptions[charKey] = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].reverseObject(periodValur);
                        regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + ')';
                        break;
                    case 'G':
                        canUpdate = true;
                        var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';
                        parseOptions[charKey] = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].reverseObject(Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() ?
                            Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('eras', dependable.dateObject) : Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('eras.' + eText, dependable.dateObject));
                        regexString += '(' + Object.keys(parseOptions[charKey]).join('|') + '?)';
                        break;
                    case 'z':
                        var tval = new Date().getTimezoneOffset();
                        canUpdate = (tval !== 0);
                        parseOptions[charKey] = Object(_util__WEBPACK_IMPORTED_MODULE_2__["getValue"])('dates.timeZoneNames', dependable.parserObject);
                        var tzone = parseOptions[charKey];
                        hourOnly = (len < 4);
                        var hpattern = hourOnly ? '+H;-H' : tzone.hourFormat;
                        hpattern = hpattern.replace(/:/g, numMapper.timeSeparator);
                        regexString += '(' + this.parseTimeZoneRegx(hpattern, tzone, nRegx) + ')?';
                        isgmtTraversed = true;
                        zCorrectTemp = hourOnly ? 6 : 12;
                        break;
                    case '\'':
                        var iString = str.replace(/\'/g, '');
                        regexString += '(' + iString + ')?';
                        break;
                    default:
                        regexString += '([\\D])';
                        break;
                }
                if (canUpdate) {
                    parseOptions.evalposition[charKey] = { isNumber: isNumber, pos: i + 1 + gmtCorrection, hourOnly: hourOnly };
                }
                if (i === length_1 - 1 && !Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(regexString)) {
                    parseOptions.parserRegex = new RegExp('^' + regexString + '$', 'i');
                }
            }
        }
        return function (value) {
            var parsedDateParts = _this.internalDateParse(value, parseOptions, numOptions);
            if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(parsedDateParts) || !Object.keys(parsedDateParts).length) {
                return null;
            }
            if (parseOptions.isIslamic) {
                var dobj = {};
                var tYear = parsedDateParts.year;
                var tDate = parsedDateParts.day;
                var tMonth = parsedDateParts.month;
                var ystrig = tYear ? (tYear + '') : '';
                var is2DigitYear = (ystrig.length === 2);
                if (!tYear || !tMonth || !tDate || is2DigitYear) {
                    dobj = _hijri_parser__WEBPACK_IMPORTED_MODULE_4__["HijriParser"].getHijriDate(new Date());
                }
                if (is2DigitYear) {
                    tYear = parseInt((dobj.year + '').slice(0, 2) + ystrig, 10);
                }
                // tslint:disable-next-line
                var dateObject = _hijri_parser__WEBPACK_IMPORTED_MODULE_4__["HijriParser"].toGregorian(tYear || dobj.year, tMonth || dobj.month, tDate || dobj.date);
                parsedDateParts.year = dateObject.getFullYear();
                parsedDateParts.month = dateObject.getMonth() + 1;
                parsedDateParts.day = dateObject.getDate();
            }
            return _this.getDateObject(parsedDateParts);
        };
    };
    /* tslint:disable */
    /**
     * Returns date object for provided date options
     * @param {DateParts} options
     * @param {Date} value
     * @returns {Date}
     */
    DateParser.getDateObject = function (options, value) {
        var res = value || new Date();
        res.setMilliseconds(0);
        var tKeys = ['hour', 'minute', 'second', 'milliseconds', 'month', 'day'];
        var y = options.year;
        var desig = options.designator;
        var tzone = options.timeZone;
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(y)) {
            var len = (y + '').length;
            if (len <= 2) {
                var century = Math.floor(res.getFullYear() / 100) * 100;
                y += century;
            }
            res.setFullYear(y);
        }
        for (var _i = 0, tKeys_1 = tKeys; _i < tKeys_1.length; _i++) {
            var key = tKeys_1[_i];
            var tValue = options[key];
            if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(tValue) && key === "day") {
                res.setDate(1);
            }
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(tValue)) {
                if (key === 'month') {
                    tValue -= 1;
                    if (tValue < 0 || tValue > 11) {
                        return new Date('invalid');
                    }
                    var pDate = res.getDate();
                    res.setDate(1);
                    res[timeSetter[key]](tValue);
                    var lDate = new Date(res.getFullYear(), tValue + 1, 0).getDate();
                    res.setDate(pDate < lDate ? pDate : lDate);
                }
                else {
                    if (key === 'day') {
                        var lastDay = new Date(res.getFullYear(), res.getMonth() + 1, 0).getDate();
                        if ((tValue < 1 || tValue > lastDay)) {
                            return null;
                        }
                    }
                    res[timeSetter[key]](tValue);
                }
            }
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(desig)) {
            var hour = res.getHours();
            if (desig === 'pm') {
                res.setHours(hour + (hour === 12 ? 0 : 12));
            }
            else if (hour === 12) {
                res.setHours(0);
            }
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(tzone)) {
            var tzValue = tzone - res.getTimezoneOffset();
            if (tzValue !== 0) {
                res.setMinutes(res.getMinutes() + tzValue);
            }
        }
        return res;
    };
    /**
     * Returns date parsing options for provided value along with parse and numeric options
     * @param {string} value
     * @param {ParseOptions} parseOptions
     * @param {NumericOptions} num
     * @returns {DateParts}
     */
    DateParser.internalDateParse = function (value, parseOptions, num) {
        var matches = value.match(parseOptions.parserRegex);
        var retOptions = { 'hour': 0, 'minute': 0, 'second': 0 };
        var nRegx = num.numericRegex;
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(matches)) {
            return null;
        }
        else {
            var props = Object.keys(parseOptions.evalposition);
            for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {
                var prop = props_1[_i];
                var curObject = parseOptions.evalposition[prop];
                var matchString = matches[curObject.pos];
                if (curObject.isNumber) {
                    retOptions[prop] = this.internalNumberParser(matchString, num);
                }
                else {
                    if (prop === 'timeZone' && !Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(matchString)) {
                        var pos = curObject.pos;
                        var val = void 0;
                        var tmatch = matches[pos + 1];
                        var flag = !Object(_util__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(tmatch);
                        if (curObject.hourOnly) {
                            val = this.getZoneValue(flag, tmatch, matches[pos + 4], num) * 60;
                        }
                        else {
                            val = this.getZoneValue(flag, tmatch, matches[pos + 7], num) * 60;
                            val += this.getZoneValue(flag, matches[pos + 4], matches[pos + 10], num);
                        }
                        if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(val)) {
                            retOptions[prop] = val;
                        }
                    }
                    else {
                        matchString = ((prop === 'month') && (!parseOptions.isIslamic) && (parseOptions.culture === 'en' || parseOptions.culture === 'en-GB' || parseOptions.culture === 'en-US'))
                            ? matchString[0].toUpperCase() + matchString.substring(1).toLowerCase() : matchString;
                        retOptions[prop] = parseOptions[prop][matchString];
                    }
                }
            }
            if (parseOptions.hour12) {
                retOptions.hour12 = true;
            }
        }
        return retOptions;
    };
    /**
     * Returns parsed number for provided Numeric string and Numeric Options
     * @param {string} value
     * @param {NumericOptions} option
     * @returns {number}
     */
    DateParser.internalNumberParser = function (value, option) {
        value = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].convertValueParts(value, option.numberParseRegex, option.numericPair);
        if (latnRegex.test(value)) {
            return +value;
        }
        return null;
    };
    /**
     * Returns parsed time zone RegExp for provided hour format and time zone
     * @param {string} hourFormat
     * @param {base.TimeZoneOptions} tZone
     * @param {string} nRegex
     * @returns {string}
     */
    DateParser.parseTimeZoneRegx = function (hourFormat, tZone, nRegex) {
        var pattern = tZone.gmtFormat;
        var ret;
        var result;
        var cRegex = '(' + nRegex + ')' + '(' + nRegex + ')';
        var splitStr;
        ret = hourFormat.replace('+', '\\+');
        if (hourFormat.indexOf('HH') !== -1) {
            ret = ret.replace(/HH|mm/g, '(' + cRegex + ')');
        }
        else {
            ret = ret.replace(/H|m/g, '(' + cRegex + '?)');
        }
        splitStr = (ret.split(';').map(function (str) {
            return pattern.replace('{0}', str);
        }));
        ret = splitStr.join('|') + '|' + tZone.gmtZeroFormat;
        return ret;
    };
    /**
     * Returns zone based value.
     * @param {boolean} flag
     * @param {string} val1
     * @param {string} val2
     * @param {NumericOptions} num
     * @returns {number}
     */
    DateParser.getZoneValue = function (flag, val1, val2, num) {
        var ival = flag ? val1 : val2;
        if (!ival) {
            return 0;
        }
        var value = this.internalNumberParser(ival, num);
        if (flag) {
            return -value;
        }
        return value;
    };
    return DateParser;
}());

/* tslint:enable */


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js ***!
  \******************************************************************/
/*! exports provided: blazorCultureFormats, IntlBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blazorCultureFormats", function() { return blazorCultureFormats; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntlBase", function() { return IntlBase; });
/* harmony import */ var _internationalization__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../internationalization */ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _parser_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js");
/* harmony import */ var _date_formatter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date-formatter */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/date-formatter.js");
/* harmony import */ var _number_formatter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number-formatter */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/number-formatter.js");






var blazorCultureFormats = {
    'en-US': {
        'd': 'M/d/y',
        'D': 'EEEE, MMMM d, y',
        'f': 'EEEE, MMMM d, y h:mm a',
        'F': 'EEEE, MMMM d, y h:mm:s a',
        'g': 'M/d/y h:mm a',
        'G': 'M/d/yyyy h:mm:ss tt',
        'm': 'MMMM d',
        'M': 'MMMM d',
        'r': 'ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'',
        'R': 'ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'',
        's': 'yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss',
        't': 'h:mm tt',
        'T': 'h:m:s tt',
        'u': 'yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'',
        'U': 'dddd, MMMM d, yyyy h:mm:ss tt',
        'y': 'MMMM yyyy',
        'Y': 'MMMM yyyy'
    }
};
/**
 * Date base common constants and function for date parser and formatter.
 */
var IntlBase;
(function (IntlBase) {
    // tslint:disable-next-line:max-line-length
    IntlBase.negativeDataRegex = /^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;
    IntlBase.customRegex = /^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/;
    IntlBase.latnParseRegex = /0|1|2|3|4|5|6|7|8|9/g;
    var fractionRegex = /[0-9]/g;
    IntlBase.defaultCurrency = '$';
    var mapper = ['infinity', 'nan', 'group', 'decimal'];
    var patternRegex = /G|M|L|H|c|'| a|yy|y|EEEE|E/g;
    var patternMatch = {
        'G': '',
        'M': 'm',
        'L': 'm',
        'H': 'h',
        'c': 'd',
        '\'': '"',
        ' a': ' AM/PM',
        'yy': 'yy',
        'y': 'yyyy',
        'EEEE': 'dddd',
        'E': 'ddd'
    };
    IntlBase.dateConverterMapper = /dddd|ddd/ig;
    var defaultFirstDay = 'sun';
    IntlBase.islamicRegex = /^islamic/;
    var firstDayMapper = {
        'sun': 0,
        'mon': 1,
        'tue': 2,
        'wed': 3,
        'thu': 4,
        'fri': 5,
        'sat': 6
    };
    IntlBase.formatRegex = /(^[ncpae]{1})([0-1]?[0-9]|20)?$/i;
    IntlBase.currencyFormatRegex = /(^[ca]{1})([0-1]?[0-9]|20)?$/i;
    IntlBase.curWithoutNumberRegex = /(c|a)$/ig;
    var typeMapper = {
        '$': 'isCurrency',
        '%': 'isPercent',
        '-': 'isNegative',
        0: 'nlead',
        1: 'nend'
    };
    IntlBase.dateParseRegex = /([a-z])\1*|'([^']|'')+'|''|./gi;
    IntlBase.basicPatterns = ['short', 'medium', 'long', 'full'];
    /* tslint:disable:quotemark */
    IntlBase.defaultObject = {
        'dates': {
            'calendars': {
                'gregorian': {
                    'months': {
                        'stand-alone': {
                            'abbreviated': {
                                '1': 'Jan',
                                '2': 'Feb',
                                '3': 'Mar',
                                '4': 'Apr',
                                '5': 'May',
                                '6': 'Jun',
                                '7': 'Jul',
                                '8': 'Aug',
                                '9': 'Sep',
                                '10': 'Oct',
                                '11': 'Nov',
                                '12': 'Dec'
                            },
                            'narrow': {
                                '1': 'J',
                                '2': 'F',
                                '3': 'M',
                                '4': 'A',
                                '5': 'M',
                                '6': 'J',
                                '7': 'J',
                                '8': 'A',
                                '9': 'S',
                                '10': 'O',
                                '11': 'N',
                                '12': 'D'
                            },
                            'wide': {
                                '1': 'January',
                                '2': 'February',
                                '3': 'March',
                                '4': 'April',
                                '5': 'May',
                                '6': 'June',
                                '7': 'July',
                                '8': 'August',
                                '9': 'September',
                                '10': 'October',
                                '11': 'November',
                                '12': 'December'
                            }
                        }
                    },
                    "days": {
                        "stand-alone": {
                            "abbreviated": {
                                "sun": "Sun",
                                "mon": "Mon",
                                "tue": "Tue",
                                "wed": "Wed",
                                "thu": "Thu",
                                "fri": "Fri",
                                "sat": "Sat"
                            },
                            "narrow": {
                                "sun": "S",
                                "mon": "M",
                                "tue": "T",
                                "wed": "W",
                                "thu": "T",
                                "fri": "F",
                                "sat": "S"
                            },
                            "short": {
                                "sun": "Su",
                                "mon": "Mo",
                                "tue": "Tu",
                                "wed": "We",
                                "thu": "Th",
                                "fri": "Fr",
                                "sat": "Sa"
                            },
                            "wide": {
                                "sun": "Sunday",
                                "mon": "Monday",
                                "tue": "Tuesday",
                                "wed": "Wednesday",
                                "thu": "Thursday",
                                "fri": "Friday",
                                "sat": "Saturday"
                            }
                        }
                    },
                    "dayPeriods": {
                        "format": {
                            "wide": {
                                "am": "AM",
                                "pm": "PM"
                            }
                        }
                    },
                    'eras': {
                        'eraNames': {
                            '0': 'Before Christ',
                            '0-alt-variant': 'Before Common Era',
                            '1': 'Anno Domini',
                            "1-alt-variant": "Common Era"
                        },
                        'eraAbbr': {
                            '0': 'BC',
                            '0-alt-variant': 'BCE',
                            '1': 'AD',
                            '1-alt-variant': 'CE'
                        },
                        'eraNarrow': {
                            '0': 'B',
                            '0-alt-variant': 'BCE',
                            '1': 'A',
                            '1-alt-variant': 'CE'
                        }
                    },
                    'dateFormats': {
                        'full': 'EEEE, MMMM d, y',
                        'long': 'MMMM d, y',
                        'medium': 'MMM d, y',
                        'short': 'M/d/yy'
                    },
                    'timeFormats': {
                        'full': 'h:mm:ss a zzzz',
                        'long': 'h:mm:ss a z',
                        'medium': 'h:mm:ss a',
                        'short': 'h:mm a'
                    },
                    'dateTimeFormats': {
                        'full': "{1} 'at' {0}",
                        'long': "{1} 'at' {0}",
                        'medium': '{1}, {0}',
                        'short': '{1}, {0}',
                        'availableFormats': {
                            'd': 'd',
                            'E': 'ccc',
                            'Ed': 'd E',
                            'Ehm': 'E h:mm a',
                            'EHm': 'E HH:mm',
                            'Ehms': 'E h:mm:ss a',
                            'EHms': 'E HH:mm:ss',
                            'Gy': 'y G',
                            'GyMMM': 'MMM y G',
                            'GyMMMd': 'MMM d, y G',
                            'GyMMMEd': 'E, MMM d, y G',
                            'h': 'h a',
                            'H': 'HH',
                            'hm': 'h:mm a',
                            'Hm': 'HH:mm',
                            'hms': 'h:mm:ss a',
                            'Hms': 'HH:mm:ss',
                            'hmsv': 'h:mm:ss a v',
                            'Hmsv': 'HH:mm:ss v',
                            'hmv': 'h:mm a v',
                            'Hmv': 'HH:mm v',
                            'M': 'L',
                            'Md': 'M/d',
                            'MEd': 'E, M/d',
                            'MMM': 'LLL',
                            'MMMd': 'MMM d',
                            'MMMEd': 'E, MMM d',
                            'MMMMd': 'MMMM d',
                            'ms': 'mm:ss',
                            'y': 'y',
                            'yM': 'M/y',
                            'yMd': 'M/d/y',
                            'yMEd': 'E, M/d/y',
                            'yMMM': 'MMM y',
                            'yMMMd': 'MMM d, y',
                            'yMMMEd': 'E, MMM d, y',
                            'yMMMM': 'MMMM y',
                        },
                    }
                },
                "islamic": {
                    "months": {
                        "stand-alone": {
                            "abbreviated": {
                                "1": "Muh.",
                                "2": "Saf.",
                                "3": "Rab. I",
                                "4": "Rab. II",
                                "5": "Jum. I",
                                "6": "Jum. II",
                                "7": "Raj.",
                                "8": "Sha.",
                                "9": "Ram.",
                                "10": "Shaw.",
                                "11": "Dhuʻl-Q.",
                                "12": "Dhuʻl-H."
                            },
                            "narrow": {
                                "1": "1",
                                "2": "2",
                                "3": "3",
                                "4": "4",
                                "5": "5",
                                "6": "6",
                                "7": "7",
                                "8": "8",
                                "9": "9",
                                "10": "10",
                                "11": "11",
                                "12": "12"
                            },
                            "wide": {
                                "1": "Muharram",
                                "2": "Safar",
                                "3": "Rabiʻ I",
                                "4": "Rabiʻ II",
                                "5": "Jumada I",
                                "6": "Jumada II",
                                "7": "Rajab",
                                "8": "Shaʻban",
                                "9": "Ramadan",
                                "10": "Shawwal",
                                "11": "Dhuʻl-Qiʻdah",
                                "12": "Dhuʻl-Hijjah"
                            }
                        }
                    },
                    "days": {
                        "stand-alone": {
                            "abbreviated": {
                                "sun": "Sun",
                                "mon": "Mon",
                                "tue": "Tue",
                                "wed": "Wed",
                                "thu": "Thu",
                                "fri": "Fri",
                                "sat": "Sat"
                            },
                            "narrow": {
                                "sun": "S",
                                "mon": "M",
                                "tue": "T",
                                "wed": "W",
                                "thu": "T",
                                "fri": "F",
                                "sat": "S"
                            },
                            "short": {
                                "sun": "Su",
                                "mon": "Mo",
                                "tue": "Tu",
                                "wed": "We",
                                "thu": "Th",
                                "fri": "Fr",
                                "sat": "Sa"
                            },
                            "wide": {
                                "sun": "Sunday",
                                "mon": "Monday",
                                "tue": "Tuesday",
                                "wed": "Wednesday",
                                "thu": "Thursday",
                                "fri": "Friday",
                                "sat": "Saturday"
                            }
                        }
                    },
                    "dayPeriods": {
                        "format": {
                            "wide": {
                                "am": "AM",
                                "pm": "PM"
                            }
                        }
                    },
                    "eras": {
                        "eraNames": {
                            "0": "AH"
                        },
                        "eraAbbr": {
                            "0": "AH"
                        },
                        "eraNarrow": {
                            "0": "AH"
                        }
                    },
                    "dateFormats": {
                        "full": "EEEE, MMMM d, y G",
                        "long": "MMMM d, y G",
                        "medium": "MMM d, y G",
                        "short": "M/d/y GGGGG"
                    },
                    "timeFormats": {
                        "full": "h:mm:ss a zzzz",
                        "long": "h:mm:ss a z",
                        "medium": "h:mm:ss a",
                        "short": "h:mm a"
                    },
                    "dateTimeFormats": {
                        "full": "{1} 'at' {0}",
                        "long": "{1} 'at' {0}",
                        "medium": "{1}, {0}",
                        "short": "{1}, {0}",
                        "availableFormats": {
                            "d": "d",
                            "E": "ccc",
                            "Ed": "d E",
                            "Ehm": "E h:mm a",
                            "EHm": "E HH:mm",
                            "Ehms": "E h:mm:ss a",
                            "EHms": "E HH:mm:ss",
                            "Gy": "y G",
                            "GyMMM": "MMM y G",
                            "GyMMMd": "MMM d, y G",
                            "GyMMMEd": "E, MMM d, y G",
                            "h": "h a",
                            "H": "HH",
                            "hm": "h:mm a",
                            "Hm": "HH:mm",
                            "hms": "h:mm:ss a",
                            "Hms": "HH:mm:ss",
                            "M": "L",
                            "Md": "M/d",
                            "MEd": "E, M/d",
                            "MMM": "LLL",
                            "MMMd": "MMM d",
                            "MMMEd": "E, MMM d",
                            "MMMMd": "MMMM d",
                            "ms": "mm:ss",
                            "y": "y G",
                            "yyyy": "y G",
                            "yyyyM": "M/y GGGGG",
                            "yyyyMd": "M/d/y GGGGG",
                            "yyyyMEd": "E, M/d/y GGGGG",
                            "yyyyMMM": "MMM y G",
                            "yyyyMMMd": "MMM d, y G",
                            "yyyyMMMEd": "E, MMM d, y G",
                            "yyyyMMMM": "MMMM y G",
                            "yyyyQQQ": "QQQ y G",
                            "yyyyQQQQ": "QQQQ y G"
                        }
                    }
                }
            },
            'timeZoneNames': {
                "hourFormat": "+HH:mm;-HH:mm",
                "gmtFormat": "GMT{0}",
                "gmtZeroFormat": "GMT",
            }
        },
        'numbers': {
            'currencies': {
                'USD': {
                    'displayName': 'US Dollar',
                    'symbol': '$',
                    'symbol-alt-narrow': '$'
                },
                'EUR': {
                    'displayName': 'Euro',
                    'symbol': '€',
                    'symbol-alt-narrow': '€'
                },
                'GBP': {
                    'displayName': 'British Pound',
                    'symbol-alt-narrow': '£'
                },
            },
            'defaultNumberingSystem': 'latn',
            'minimumGroupingDigits': '1',
            'symbols-numberSystem-latn': {
                'decimal': '.',
                'group': ',',
                'list': ';',
                'percentSign': '%',
                'plusSign': '+',
                'minusSign': '-',
                'exponential': 'E',
                'superscriptingExponent': '×',
                'perMille': '‰',
                'infinity': '∞',
                'nan': 'NaN',
                'timeSeparator': ':'
            },
            'decimalFormats-numberSystem-latn': {
                'standard': '#,##0.###',
            },
            'percentFormats-numberSystem-latn': {
                'standard': '#,##0%'
            },
            'currencyFormats-numberSystem-latn': {
                'standard': '¤#,##0.00',
                'accounting': '¤#,##0.00;(¤#,##0.00)'
            },
            'scientificFormats-numberSystem-latn': {
                'standard': '#E0'
            }
        }
    };
    IntlBase.blazorDefaultObject = {
        "numbers": {
            "mapper": {
                "0": "0",
                "1": "1",
                "2": "2",
                "3": "3",
                "4": "4",
                "5": "5",
                "6": "6",
                "7": "7",
                "8": "8",
                "9": "9"
            },
            "mapperDigits": "0123456789",
            "numberSymbols": {
                "decimal": ".",
                "group": ",",
                "plusSign": "+",
                "minusSign": "-",
                "percentSign": "%",
                "nan": "NaN",
                "timeSeparator": ":",
                "infinity": "∞"
            },
            "timeSeparator": ":",
            "currencySymbol": "$",
            "currencypData": {
                "nlead": "$",
                "nend": "",
                "groupSeparator": ",",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            },
            "percentpData": {
                "nlead": "",
                "nend": "%",
                "groupSeparator": ",",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            },
            "percentnData": {
                "nlead": "-",
                "nend": "%",
                "groupSeparator": ",",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            },
            "currencynData": {
                "nlead": "($",
                "nend": ")",
                "groupSeparator": ",",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            },
            "decimalnData": {
                "nlead": "-",
                "nend": "",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            },
            "decimalpData": {
                "nlead": "",
                "nend": "",
                "groupData": {
                    "primary": 3
                },
                "maximumFraction": 2,
                "minimumFraction": 2
            }
        },
        "dates": {
            "dayPeriods": {
                "am": "AM",
                "pm": "PM"
            },
            "dateSeperator": "/",
            "days": {
                "abbreviated": {
                    "sun": "Sun",
                    "mon": "Mon",
                    "tue": "Tue",
                    "wed": "Wed",
                    "thu": "Thu",
                    "fri": "Fri",
                    "sat": "Sat"
                },
                "short": {
                    "sun": "Su",
                    "mon": "Mo",
                    "tue": "Tu",
                    "wed": "We",
                    "thu": "Th",
                    "fri": "Fr",
                    "sat": "Sa"
                },
                "wide": {
                    "sun": "Sunday",
                    "mon": "Monday",
                    "tue": "Tuesday",
                    "wed": "Wednesday",
                    "thu": "Thursday",
                    "fri": "Friday",
                    "sat": "Saturday"
                }
            },
            "months": {
                "abbreviated": {
                    "1": "Jan",
                    "2": "Feb",
                    "3": "Mar",
                    "4": "Apr",
                    "5": "May",
                    "6": "Jun",
                    "7": "Jul",
                    "8": "Aug",
                    "9": "Sep",
                    "10": "Oct",
                    "11": "Nov",
                    "12": "Dec"
                },
                "wide": {
                    "1": "January",
                    "2": "February",
                    "3": "March",
                    "4": "April",
                    "5": "May",
                    "6": "June",
                    "7": "July",
                    "8": "August",
                    "9": "September",
                    "10": "October",
                    "11": "November",
                    "12": "December"
                }
            },
            "eras": {
                "1": "AD"
            }
        }
    };
    /* tslint:enable:quotemark */
    IntlBase.monthIndex = {
        3: 'abbreviated',
        4: 'wide',
        5: 'narrow',
        1: 'abbreviated'
    };
    /**
     *
     */
    IntlBase.month = 'months';
    IntlBase.days = 'days';
    /**
     * Default numerber Object
     */
    IntlBase.patternMatcher = {
        C: 'currency',
        P: 'percent',
        N: 'decimal',
        A: 'currency',
        E: 'scientific'
    };
    /**
     * Returns the resultant pattern based on the skeleton, dateObject and the type provided
     * @private
     * @param {string} skeleton
     * @param {Object} dateObject
     * @param {string} type
     * @returns {string}
     */
    function getResultantPattern(skeleton, dateObject, type, isIslamic, blazorCulture) {
        var resPattern;
        var iType = type || 'date';
        if (blazorCulture) {
            resPattern = compareBlazorDateFormats({ skeleton: skeleton }, blazorCulture).format ||
                compareBlazorDateFormats({ skeleton: 'd' }, 'en-US').format;
        }
        else {
            if (IntlBase.basicPatterns.indexOf(skeleton) !== -1) {
                resPattern = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(iType + 'Formats.' + skeleton, dateObject);
                if (iType === 'dateTime') {
                    var dPattern = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('dateFormats.' + skeleton, dateObject);
                    var tPattern = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('timeFormats.' + skeleton, dateObject);
                    resPattern = resPattern.replace('{1}', dPattern).replace('{0}', tPattern);
                }
            }
            else {
                resPattern = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('dateTimeFormats.availableFormats.' + skeleton, dateObject);
            }
            if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isUndefined"])(resPattern) && skeleton === 'yMd') {
                resPattern = 'M/d/y';
            }
        }
        return resPattern;
    }
    IntlBase.getResultantPattern = getResultantPattern;
    /**
     * Returns the dependable object for provided cldr data and culture
     * @private
     * @param {Object} cldr
     * @param {string} culture
     * @param {boolean} isNumber
     * @returns {Dependables}
     */
    function getDependables(cldr, culture, mode, isNumber) {
        var ret = {};
        var calendartype = mode || 'gregorian';
        ret.parserObject = _parser_base__WEBPACK_IMPORTED_MODULE_2__["ParserBase"].getMainObject(cldr, culture) || (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? IntlBase.blazorDefaultObject : IntlBase.defaultObject);
        if (isNumber) {
            ret.numericObject = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('numbers', ret.parserObject);
        }
        else {
            var dateString = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? 'dates' : ('dates.calendars.' + calendartype);
            ret.dateObject = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(dateString, ret.parserObject);
        }
        return ret;
    }
    IntlBase.getDependables = getDependables;
    /**
     * Returns the symbol pattern for provided parameters
     * @private
     * @param {string} type
     * @param {string} numSystem
     * @param {Object} obj
     * @param {boolean} isAccount
     * @returns {string}
     */
    function getSymbolPattern(type, numSystem, obj, isAccount) {
        return Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(type + 'Formats-numberSystem-' +
            numSystem + (isAccount ? '.accounting' : '.standard'), obj) || (isAccount ? Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(type + 'Formats-numberSystem-' +
            numSystem + '.standard', obj) : '');
    }
    IntlBase.getSymbolPattern = getSymbolPattern;
    function ConvertDateToWeekFormat(format) {
        var convertMapper = format.match(IntlBase.dateConverterMapper);
        if (convertMapper && Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
            var tempString = convertMapper[0].length === 3 ? 'EEE' : 'EEEE';
            return format.replace(IntlBase.dateConverterMapper, tempString);
        }
        return format;
    }
    IntlBase.ConvertDateToWeekFormat = ConvertDateToWeekFormat;
    function compareBlazorDateFormats(formatOptions, culture) {
        var format = formatOptions.format || formatOptions.skeleton;
        var curFormatMapper = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])((culture || 'en-US') + '.' + format, blazorCultureFormats);
        if (!curFormatMapper) {
            curFormatMapper = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('en-US.' + format, blazorCultureFormats);
        }
        if (curFormatMapper) {
            curFormatMapper = ConvertDateToWeekFormat(curFormatMapper);
            formatOptions.format = curFormatMapper.replace(/tt/, 'a');
        }
        return formatOptions;
    }
    IntlBase.compareBlazorDateFormats = compareBlazorDateFormats;
    /**
     * Returns proper numeric skeleton
     * @private
     * @param {string} skeleton
     * @returns {NumericSkeleton}
     */
    function getProperNumericSkeleton(skeleton) {
        var matches = skeleton.match(IntlBase.formatRegex);
        var ret = {};
        var pattern = matches[1].toUpperCase();
        ret.isAccount = (pattern === 'A');
        /* tslint:disable no-any */
        ret.type = IntlBase.patternMatcher[pattern];
        if (skeleton.length > 1) {
            ret.fractionDigits = parseInt(matches[2], 10);
        }
        return ret;
    }
    IntlBase.getProperNumericSkeleton = getProperNumericSkeleton;
    /**
     * Returns format data for number formatting like minimum fraction, maximum fraction, etc..,
     * @private
     * @param {string} pattern
     * @param {boolean} needFraction
     * @param {string} cSymbol
     * @param {boolean} fractionOnly
     * @returns {NegativeData}
     */
    function getFormatData(pattern, needFraction, cSymbol, fractionOnly) {
        var nData = fractionOnly ? {} : { nlead: '', nend: '' };
        var match = pattern.match(IntlBase.customRegex);
        if (match) {
            if (!fractionOnly) {
                nData.nlead = changeCurrencySymbol(match[1], cSymbol);
                nData.nend = changeCurrencySymbol(match[10], cSymbol);
                nData.groupPattern = match[4];
            }
            var fraction = match[7];
            if (fraction && needFraction) {
                var fmatch = fraction.match(fractionRegex);
                if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(fmatch)) {
                    nData.minimumFraction = fmatch.length;
                }
                else {
                    nData.minimumFraction = 0;
                }
                nData.maximumFraction = fraction.length - 1;
            }
        }
        return nData;
    }
    IntlBase.getFormatData = getFormatData;
    /**
     * Changes currency symbol
     * @private
     * @param {string} val
     * @param {string} sym
     * @returns {string}
     */
    function changeCurrencySymbol(val, sym) {
        if (val) {
            return val.replace(IntlBase.defaultCurrency, sym);
        }
        return '';
    }
    /**
     * Returns currency symbol based on currency code
     * @private
     * @param {Object} numericObject
     * @param {string} currencyCode
     * @returns {string}
     */
    function getCurrencySymbol(numericObject, currencyCode, altSymbol) {
        var symbol = altSymbol ? ('.' + altSymbol) : '.symbol';
        var getCurrency = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('currencies.' + currencyCode + symbol, numericObject) ||
            Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('currencies.' + currencyCode + '.symbol-alt-narrow', numericObject) || '$';
        return getCurrency;
    }
    IntlBase.getCurrencySymbol = getCurrencySymbol;
    /**
     * Returns formatting options for custom number format
     * @private
     * @param {string} format
     * @param {CommonOptions} dOptions
     * @param {Dependables} obj
     * @returns {GenericFormatOptions}
     */
    function customFormat(format, dOptions, obj) {
        var options = {};
        var formatSplit = format.split(';');
        var data = ['pData', 'nData', 'zeroData'];
        for (var i = 0; i < formatSplit.length; i++) {
            options[data[i]] = customNumberFormat(formatSplit[i], dOptions, obj);
        }
        if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(options.nData)) {
            options.nData = Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])({}, options.pData);
            options.nData.nlead = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(dOptions) ? '-' + options.nData.nlead : dOptions.minusSymbol + options.nData.nlead;
        }
        return options;
    }
    IntlBase.customFormat = customFormat;
    /**
     * Returns custom formatting options
     * @private
     * @param {string} format
     * @param {CommonOptions} dOptions
     * @param {Object} numObject
     * @returns {NegativeData}
     */
    function customNumberFormat(format, dOptions, numObject) {
        var cOptions = { type: 'decimal', minimumFractionDigits: 0, maximumFractionDigits: 0 };
        var pattern = format.match(IntlBase.customRegex);
        if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(pattern) || (pattern[5] === '' && format !== 'N/A')) {
            cOptions.type = undefined;
            return cOptions;
        }
        cOptions.nlead = pattern[1];
        cOptions.nend = pattern[10];
        var integerPart = pattern[6];
        cOptions.useGrouping = integerPart.indexOf(',') !== -1;
        integerPart = integerPart.replace(/,/g, '');
        var fractionPart = pattern[7];
        if (integerPart.indexOf('0') !== -1) {
            cOptions.minimumIntegerDigits = integerPart.length - integerPart.indexOf('0');
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(fractionPart)) {
            cOptions.minimumFractionDigits = fractionPart.lastIndexOf('0');
            cOptions.maximumFractionDigits = fractionPart.lastIndexOf('#');
            if (cOptions.minimumFractionDigits === -1) {
                cOptions.minimumFractionDigits = 0;
            }
            if (cOptions.maximumFractionDigits === -1 || cOptions.maximumFractionDigits < cOptions.minimumFractionDigits) {
                cOptions.maximumFractionDigits = cOptions.minimumFractionDigits;
            }
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(dOptions)) {
            Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '$', dOptions.currencySymbol));
            if (!cOptions.isCurrency) {
                Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '%', dOptions.percentSymbol));
            }
        }
        else {
            Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])(cOptions, isCurrencyPercent([cOptions.nlead, cOptions.nend], '%', '%'));
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(numObject)) {
            var symbolPattern = getSymbolPattern(cOptions.type, dOptions.numberMapper.numberSystem, numObject, false);
            if (cOptions.useGrouping) {
                cOptions.groupSeparator = dOptions.numberMapper.numberSymbols[mapper[2]];
                cOptions.groupData = _number_formatter__WEBPACK_IMPORTED_MODULE_4__["NumberFormat"].getGroupingDetails(symbolPattern.split(';')[0]);
            }
            cOptions.nlead = cOptions.nlead.replace(/\'/g, '');
            cOptions.nend = cOptions.nend.replace(/\'/g, '');
        }
        return cOptions;
    }
    /**
     * Returns formatting options for currency or percent type
     * @private
     * @param {string[]} parts
     * @param {string} actual
     * @param {string} symbol
     * @returns {NegativeData}
     */
    function isCurrencyPercent(parts, actual, symbol) {
        var options = { nlead: parts[0], nend: parts[1] };
        for (var i = 0; i < 2; i++) {
            var part = parts[i];
            var loc = part.indexOf(actual);
            if ((loc !== -1) && ((loc < part.indexOf('\'')) || (loc > part.lastIndexOf('\'')))) {
                options[typeMapper[i]] = part.substr(0, loc) + symbol + part.substr(loc + 1);
                options[typeMapper[actual]] = true;
                options.type = options.isCurrency ? 'currency' : 'percent';
                break;
            }
        }
        return options;
    }
    IntlBase.isCurrencyPercent = isCurrencyPercent;
    /**
     * Returns culture based date separator
     * @private
     * @param {Object} dateObj
     * @returns {string}
     */
    function getDateSeparator(dateObj) {
        var value = (Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('dateFormats.short', dateObj) || '').match(/[d‏M‏]([^d‏M])[d‏M‏]/i);
        return value ? value[1] : '/';
    }
    IntlBase.getDateSeparator = getDateSeparator;
    /**
     * Returns Native Date Time pattern
     * @private
     * @param {string} culture
     * @param {DateFormatOptions} options
     * @param {Object} cldr
     * @returns {string}
     */
    function getActualDateTimeFormat(culture, options, cldr, isExcelFormat) {
        var dependable = getDependables(cldr, culture, options.calendar);
        if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
            options = compareBlazorDateFormats(options, culture);
        }
        var actualPattern = options.format || getResultantPattern(options.skeleton, dependable.dateObject, options.type);
        if (isExcelFormat) {
            actualPattern = actualPattern.replace(patternRegex, function (pattern) {
                return patternMatch[pattern];
            });
            if (actualPattern.indexOf('z') !== -1) {
                var tLength = actualPattern.match(/z/g).length;
                var timeZonePattern = void 0;
                var options_1 = { 'timeZone': {} };
                options_1.numMapper = _parser_base__WEBPACK_IMPORTED_MODULE_2__["ParserBase"].getNumberMapper(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_2__["ParserBase"].getNumberingSystem(cldr));
                options_1.timeZone = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('dates.timeZoneNames', dependable.parserObject);
                var value = new Date();
                var timezone = value.getTimezoneOffset();
                var pattern = (tLength < 4) ? '+H;-H' : options_1.timeZone.hourFormat;
                pattern = pattern.replace(/:/g, options_1.numMapper.timeSeparator);
                if (timezone === 0) {
                    timeZonePattern = options_1.timeZone.gmtZeroFormat;
                }
                else {
                    timeZonePattern = _date_formatter__WEBPACK_IMPORTED_MODULE_3__["DateFormat"].getTimeZoneValue(timezone, pattern);
                    timeZonePattern = options_1.timeZone.gmtFormat.replace(/\{0\}/, timeZonePattern);
                }
                actualPattern = actualPattern.replace(/[z]+/, '"' + timeZonePattern + '"');
            }
            actualPattern = actualPattern.replace(/ $/, '');
        }
        return actualPattern;
    }
    IntlBase.getActualDateTimeFormat = getActualDateTimeFormat;
    // tslint:disable-next-line:no-any
    function processSymbol(actual, option) {
        if (actual.indexOf(',') !== -1) {
            // tslint:disable-next-line:no-any
            var split = actual.split(',');
            actual = (split[0] + Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('numberMapper.numberSymbols.group', option) +
                split[1].replace('.', Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('numberMapper.numberSymbols.decimal', option)));
        }
        else {
            actual = actual.replace('.', Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('numberMapper.numberSymbols.decimal', option));
        }
        return actual;
    }
    /**
     * Returns Native Number pattern
     * @private
     * @param {string} culture
     * @param {NumberFormatOptions} options
     * @param {Object} cldr
     * @returns {string}
     */
    function getActualNumberFormat(culture, options, cldr, isExcel) {
        var dependable = getDependables(cldr, culture, '', true);
        var parseOptions = { custom: true };
        var numrericObject = dependable.numericObject;
        var minFrac;
        var curObj = {};
        var curMatch = (options.format || '').match(IntlBase.currencyFormatRegex);
        var type = IntlBase.formatRegex.test(options.format) ? getProperNumericSkeleton(options.format || 'N') : {};
        var dOptions = {};
        if (curMatch) {
            dOptions.numberMapper = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ?
                Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])({}, dependable.numericObject) :
                _parser_base__WEBPACK_IMPORTED_MODULE_2__["ParserBase"].getNumberMapper(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_2__["ParserBase"].getNumberingSystem(cldr), true);
            var curCode = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('currencySymbol', dependable.numericObject) :
                getCurrencySymbol(dependable.numericObject, options.currency || _internationalization__WEBPACK_IMPORTED_MODULE_0__["defaultCurrencyCode"], options.altSymbol);
            var symbolPattern = getSymbolPattern('currency', dOptions.numberMapper.numberSystem, dependable.numericObject, (/a/i).test(options.format));
            symbolPattern = symbolPattern.replace(/\u00A4/g, curCode);
            var split = symbolPattern.split(';');
            curObj.hasNegativePattern = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? true : (split.length > 1);
            curObj.nData = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(type.type + 'nData', numrericObject) :
                getFormatData(split[1] || '-' + split[0], true, curCode);
            curObj.pData = Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(type.type + 'pData', numrericObject) :
                getFormatData(split[0], false, curCode);
            if (!curMatch[2] && !options.minimumFractionDigits && !options.maximumFractionDigits) {
                minFrac = getFormatData(symbolPattern.split(';')[0], true, '', true).minimumFraction;
            }
        }
        var actualPattern;
        if ((IntlBase.formatRegex.test(options.format)) || !(options.format)) {
            Object(_util__WEBPACK_IMPORTED_MODULE_1__["extend"])(parseOptions, getProperNumericSkeleton(options.format || 'N'));
            parseOptions.custom = false;
            actualPattern = '###0';
            if (parseOptions.fractionDigits || options.minimumFractionDigits || options.maximumFractionDigits || minFrac) {
                var defaultMinimum = 0;
                if (parseOptions.fractionDigits) {
                    options.minimumFractionDigits = options.maximumFractionDigits = parseOptions.fractionDigits;
                }
                actualPattern = fractionDigitsPattern(actualPattern, minFrac || parseOptions.fractionDigits ||
                    options.minimumFractionDigits || defaultMinimum, options.maximumFractionDigits || defaultMinimum);
            }
            if (options.minimumIntegerDigits) {
                actualPattern = minimumIntegerPattern(actualPattern, options.minimumIntegerDigits);
            }
            if (options.useGrouping) {
                actualPattern = groupingPattern(actualPattern);
            }
            if (parseOptions.type === 'currency' || (parseOptions.type && Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])())) {
                if (Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && parseOptions.type !== 'currency') {
                    curObj.pData = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(parseOptions.type + 'pData', numrericObject);
                    curObj.nData = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])(parseOptions.type + 'nData', numrericObject);
                }
                var cPattern = actualPattern;
                actualPattern = curObj.pData.nlead + cPattern + curObj.pData.nend;
                if (curObj.hasNegativePattern || Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
                    actualPattern += ';' + curObj.nData.nlead + cPattern + curObj.nData.nend;
                }
            }
            if (parseOptions.type === 'percent' && !Object(_util__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
                actualPattern += ' %';
            }
        }
        else {
            actualPattern = options.format.replace(/\'/g, '"');
        }
        if (Object.keys(dOptions).length > 0) {
            actualPattern = !isExcel ? processSymbol(actualPattern, dOptions) : actualPattern;
        }
        return actualPattern;
    }
    IntlBase.getActualNumberFormat = getActualNumberFormat;
    function fractionDigitsPattern(pattern, minDigits, maxDigits) {
        pattern += '.';
        for (var a = 0; a < minDigits; a++) {
            pattern += '0';
        }
        if (minDigits < maxDigits) {
            var diff = maxDigits - minDigits;
            for (var b = 0; b < diff; b++) {
                pattern += '#';
            }
        }
        return pattern;
    }
    function minimumIntegerPattern(pattern, digits) {
        var temp = pattern.split('.');
        var integer = '';
        for (var x = 0; x < digits; x++) {
            integer += '0';
        }
        return temp[1] ? (integer + '.' + temp[1]) : integer;
    }
    function groupingPattern(pattern) {
        var temp = pattern.split('.');
        var integer = temp[0];
        var no = 3 - integer.length % 3;
        var hash = (no && no === 1) ? '#' : (no === 2 ? '##' : '');
        integer = hash + integer;
        pattern = '';
        for (var x = integer.length - 1; x > 0; x = x - 3) {
            pattern = ',' + integer[x - 2] + integer[x - 1] + integer[x] + pattern;
        }
        pattern = pattern.slice(1);
        return temp[1] ? (pattern + '.' + temp[1]) : pattern;
    }
    function getWeekData(culture, cldr) {
        var firstDay = defaultFirstDay;
        var mapper = Object(_util__WEBPACK_IMPORTED_MODULE_1__["getValue"])('supplemental.weekData.firstDay', cldr);
        var iCulture = culture;
        if ((/en-/).test(iCulture)) {
            iCulture = iCulture.slice(3);
        }
        iCulture = iCulture.slice(0, 2).toUpperCase() + iCulture.substr(2);
        if (mapper) {
            firstDay = mapper[iCulture] || defaultFirstDay;
        }
        return firstDayMapper[firstDay];
    }
    IntlBase.getWeekData = getWeekData;
    /**
     * @private
     * @param pData
     * @param aCurrency
     * @param rCurrency
     */
    function replaceBlazorCurrency(pData, aCurrency, rCurrency) {
        var iCurrency = Object(_parser_base__WEBPACK_IMPORTED_MODULE_2__["getBlazorCurrencySymbol"])(rCurrency);
        if (aCurrency !== iCurrency) {
            for (var _i = 0, pData_1 = pData; _i < pData_1.length; _i++) {
                var data = pData_1[_i];
                data.nend = data.nend.replace(aCurrency, iCurrency);
                data.nlead = data.nlead.replace(aCurrency, iCurrency);
            }
        }
    }
    IntlBase.replaceBlazorCurrency = replaceBlazorCurrency;
    /**
     * @private
     */
    function getWeekOfYear(date) {
        var newYear = new Date(date.getFullYear(), 0, 1);
        var day = newYear.getDay();
        var weeknum;
        day = (day >= 0 ? day : day + 7);
        var daynum = Math.floor((date.getTime() - newYear.getTime() -
            (date.getTimezoneOffset() - newYear.getTimezoneOffset()) * 60000) / 86400000) + 1;
        if (day < 4) {
            weeknum = Math.floor((daynum + day - 1) / 7) + 1;
            if (weeknum > 52) {
                var nYear = new Date(this.getFullYear() + 1, 0, 1);
                var nday = nYear.getDay();
                nday = nday >= 0 ? nday : nday + 7;
                weeknum = nday < 4 ? 1 : 53;
            }
        }
        else {
            weeknum = Math.floor((daynum + day - 1) / 7);
        }
        return weeknum;
    }
    IntlBase.getWeekOfYear = getWeekOfYear;
})(IntlBase || (IntlBase = {}));


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/number-formatter.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/number-formatter.js ***!
  \*************************************************************************/
/*! exports provided: NumberFormat */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFormat", function() { return NumberFormat; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _internationalization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../internationalization */ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js");
/* harmony import */ var _intl_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");
/* harmony import */ var _parser_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js");




var errorText = {
    'ms': 'minimumSignificantDigits',
    'ls': 'maximumSignificantDigits',
    'mf': 'minimumFractionDigits',
    'lf': 'maximumFractionDigits',
};
var integerError = 'minimumIntegerDigits';
var percentSign = 'percentSign';
var minusSign = 'minusSign';
var spaceRegex = /\s/;
var mapper = ['infinity', 'nan', 'group', 'decimal', 'exponential'];
var infinity = 'infinity';
var nan = 'nan';
/**
 * Module for number formatting.
 * @private
 */
var NumberFormat = /** @__PURE__ @class */ (function () {
    function NumberFormat() {
    }
    /**
     * Returns the formatter function for given skeleton.
     * @param {string} culture -  Specifies the culture name to be which formatting.
     * @param {NumberFormatOptions} option - Specific the format in which number  will format.
     * @param {Object} object- Specifies the global cldr data collection.
     * @return Function.
     */
    NumberFormat.numberFormatter = function (culture, option, cldr) {
        var _this = this;
        var fOptions = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, option);
        var cOptions = {};
        var dOptions = {};
        var symbolPattern;
        var dependable = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getDependables(cldr, culture, '', true);
        var numObject = dependable.numericObject;
        dOptions.numberMapper = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, numObject) :
            _parser_base__WEBPACK_IMPORTED_MODULE_3__["ParserBase"].getNumberMapper(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_3__["ParserBase"].getNumberingSystem(cldr), true);
        dOptions.currencySymbol = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('currencySymbol', numObject) : _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getCurrencySymbol(dependable.numericObject, fOptions.currency || _internationalization__WEBPACK_IMPORTED_MODULE_1__["defaultCurrencyCode"], option.altSymbol);
        /* tslint:disable no-any */
        dOptions.percentSymbol = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('numberSymbols.percentSign', numObject) :
            dOptions.numberMapper.numberSymbols[percentSign];
        dOptions.minusSymbol = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('numberSymbols.minusSign', numObject) :
            dOptions.numberMapper.numberSymbols[minusSign];
        var symbols = dOptions.numberMapper.numberSymbols;
        if ((option.format) && !(_intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].formatRegex.test(option.format))) {
            cOptions = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].customFormat(option.format, dOptions, dependable.numericObject);
        }
        else {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(fOptions, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getProperNumericSkeleton(option.format || 'N'));
            fOptions.isCurrency = fOptions.type === 'currency';
            fOptions.isPercent = fOptions.type === 'percent';
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                symbolPattern = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getSymbolPattern(fOptions.type, dOptions.numberMapper.numberSystem, dependable.numericObject, fOptions.isAccount);
            }
            fOptions.groupOne = this.checkValueRange(fOptions.maximumSignificantDigits, fOptions.minimumSignificantDigits, true);
            this.checkValueRange(fOptions.maximumFractionDigits, fOptions.minimumFractionDigits, false, true);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(fOptions.fractionDigits)) {
                fOptions.minimumFractionDigits = fOptions.maximumFractionDigits = fOptions.fractionDigits;
            }
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(fOptions.useGrouping)) {
                fOptions.useGrouping = true;
            }
            if (fOptions.isCurrency && !Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                symbolPattern = symbolPattern.replace(/\u00A4/g, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].defaultCurrency);
            }
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                var split = symbolPattern.split(';');
                cOptions.nData = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getFormatData(split[1] || '-' + split[0], true, dOptions.currencySymbol);
                cOptions.pData = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getFormatData(split[0], false, dOptions.currencySymbol);
                if (fOptions.useGrouping) {
                    fOptions.groupSeparator = symbols[mapper[2]];
                    fOptions.groupData = this.getGroupingDetails(split[0]);
                }
            }
            else {
                cOptions.nData = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fOptions.type + 'nData', numObject));
                cOptions.pData = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fOptions.type + 'pData', numObject));
                if (fOptions.type === 'currency' && option.currency) {
                    _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].replaceBlazorCurrency([cOptions.pData, cOptions.nData], dOptions.currencySymbol, option.currency);
                }
            }
            var minFrac = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(fOptions.minimumFractionDigits);
            if (minFrac) {
                fOptions.minimumFractionDigits = cOptions.nData.minimumFraction;
            }
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(fOptions.maximumFractionDigits)) {
                var mval = cOptions.nData.maximumFraction;
                fOptions.maximumFractionDigits = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(mval) && fOptions.isPercent ? 0 : mval;
            }
            var mfrac = fOptions.minimumFractionDigits;
            var lfrac = fOptions.maximumFractionDigits;
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(mfrac) && !Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(lfrac)) {
                if (mfrac > lfrac) {
                    fOptions.maximumFractionDigits = mfrac;
                }
            }
        }
        Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(cOptions.nData, fOptions);
        Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(cOptions.pData, fOptions);
        return function (value) {
            if (isNaN(value)) {
                return symbols[mapper[1]];
            }
            else if (!isFinite(value)) {
                return symbols[mapper[0]];
            }
            return _this.intNumberFormatter(value, cOptions, dOptions);
        };
    };
    /**
     * Returns grouping details for the pattern provided
     * @param {string} pattern
     * @returns {GroupDetails}
     */
    NumberFormat.getGroupingDetails = function (pattern) {
        var ret = {};
        var match = pattern.match(_intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].negativeDataRegex);
        if (match && match[4]) {
            var pattern_1 = match[4];
            var p = pattern_1.lastIndexOf(',');
            if (p !== -1) {
                var temp = pattern_1.split('.')[0];
                ret.primary = (temp.length - p) - 1;
                var s = pattern_1.lastIndexOf(',', p - 1);
                if (s !== -1) {
                    ret.secondary = p - 1 - s;
                }
            }
        }
        return ret;
    };
    /**
     * Returns if the provided integer range is valid.
     * @param {number} val1
     * @param {number} val2
     * @param {boolean} checkbothExist
     * @param {boolean} isFraction
     * @returns {boolean}
     */
    NumberFormat.checkValueRange = function (val1, val2, checkbothExist, isFraction) {
        var decide = isFraction ? 'f' : 's';
        var dint = 0;
        var str1 = errorText['l' + decide];
        var str2 = errorText['m' + decide];
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(val1)) {
            this.checkRange(val1, str1, isFraction);
            dint++;
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(val2)) {
            this.checkRange(val2, str2, isFraction);
            dint++;
        }
        if (dint === 2) {
            if (val1 < val2) {
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["throwError"])(str2 + 'specified must be less than the' + str1);
            }
            else {
                return true;
            }
        }
        else if (checkbothExist && dint === 1) {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["throwError"])('Both' + str2 + 'and' + str2 + 'must be present');
        }
        return false;
    };
    /**
     * Check if the provided fraction range is valid
     * @param {number} val
     * @param {string} text
     * @param {boolean} isFraction
     * @returns {void}
     */
    NumberFormat.checkRange = function (val, text, isFraction) {
        var range = isFraction ? [0, 20] : [1, 21];
        if (val < range[0] || val > range[1]) {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["throwError"])(text + 'value must be within the range' + range[0] + 'to' + range[1]);
        }
    };
    /**
     * Returns formatted numeric string for provided formatting options
     * @param {number} value
     * @param {base.GenericFormatOptions} fOptions
     * @param {CommonOptions} dOptions
     * @returns {string}
     */
    NumberFormat.intNumberFormatter = function (value, fOptions, dOptions) {
        var curData;
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(fOptions.nData.type)) {
            return undefined;
        }
        else {
            if (value < 0) {
                value = value * -1;
                curData = fOptions.nData;
            }
            else if (value === 0) {
                curData = fOptions.zeroData || fOptions.pData;
            }
            else {
                curData = fOptions.pData;
            }
            var fValue = '';
            if (curData.isPercent) {
                value = value * 100;
            }
            if (curData.groupOne) {
                fValue = this.processSignificantDigits(value, curData.minimumSignificantDigits, curData.maximumSignificantDigits);
            }
            else {
                fValue = this.processFraction(value, curData.minimumFractionDigits, curData.maximumFractionDigits);
                if (curData.minimumIntegerDigits) {
                    fValue = this.processMinimumIntegers(fValue, curData.minimumIntegerDigits);
                }
            }
            if (curData.type === 'scientific') {
                fValue = value.toExponential(curData.maximumFractionDigits);
                fValue = fValue.replace('e', dOptions.numberMapper.numberSymbols[mapper[4]]);
            }
            fValue = fValue.replace('.', dOptions.numberMapper.numberSymbols[mapper[3]]);
            if (curData.useGrouping) {
                fValue = this.groupNumbers(fValue, curData.groupData.primary, curData.groupSeparator || ',', dOptions.numberMapper.numberSymbols[mapper[3]] || '.', curData.groupData.secondary);
            }
            fValue = _parser_base__WEBPACK_IMPORTED_MODULE_3__["ParserBase"].convertValueParts(fValue, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].latnParseRegex, dOptions.numberMapper.mapper);
            if (curData.nlead === 'N/A') {
                return curData.nlead;
            }
            else {
                return curData.nlead + fValue + curData.nend;
            }
        }
    };
    /**
     * Returns significant digits processed numeric string
     * @param {number} value
     * @param {number} min
     * @param {number} max
     * @returns {string}
     */
    NumberFormat.processSignificantDigits = function (value, min, max) {
        var temp = value + '';
        var tn;
        var length = temp.length;
        if (length < min) {
            return value.toPrecision(min);
        }
        else {
            temp = value.toPrecision(max);
            tn = +temp;
            return tn + '';
        }
    };
    /**
     * Returns grouped numeric string
     * @param {string} val
     * @param {number} level1
     * @param {string} sep
     * @param {string} decimalSymbol
     * @param {number} level2
     * @returns {string}
     */
    NumberFormat.groupNumbers = function (val, level1, sep, decimalSymbol, level2) {
        var flag = !Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(level2) && level2 !== 0;
        var split = val.split(decimalSymbol);
        var prefix = split[0];
        var length = prefix.length;
        var str = '';
        while (length > level1) {
            str = prefix.slice(length - level1, length) + (str.length ?
                (sep + str) : '');
            length -= level1;
            if (flag) {
                level1 = level2;
                flag = false;
            }
        }
        split[0] = prefix.slice(0, length) + (str.length ? sep : '') + str;
        return split.join(decimalSymbol);
    };
    /**
     * Returns fraction processed numeric string
     * @param {number} value
     * @param {number} min
     * @param {number} max
     * @returns {string}
     */
    NumberFormat.processFraction = function (value, min, max) {
        var temp = (value + '').split('.')[1];
        var length = temp ? temp.length : 0;
        if (min && length < min) {
            var ret = '';
            if (length === 0) {
                ret = value.toFixed(min);
            }
            else {
                ret += value;
                for (var j = 0; j < min - length; j++) {
                    ret += '0';
                }
                return ret;
            }
            return value.toFixed(min);
        }
        else if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(max) && (length > max || max === 0)) {
            return value.toFixed(max);
        }
        return value + '';
    };
    /**
     * Returns integer processed numeric string
     * @param {string} value
     * @param {number} min
     * @returns {string}
     */
    NumberFormat.processMinimumIntegers = function (value, min) {
        var temp = value.split('.');
        var lead = temp[0];
        var len = lead.length;
        if (len < min) {
            for (var i = 0; i < min - len; i++) {
                lead = '0' + lead;
            }
            temp[0] = lead;
        }
        return temp.join('.');
    };
    return NumberFormat;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/number-parser.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/number-parser.js ***!
  \**********************************************************************/
/*! exports provided: NumberParser */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberParser", function() { return NumberParser; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _parser_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js");
/* harmony import */ var _intl_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intl-base */ "./ej2-resources/18.4.46/scripts/ej2-base/intl/intl-base.js");



var formatRegex = /(^[ncpa]{1})([0-1]?[0-9]|20)?$/i;
var parseRegex = /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)([Ee][+-]?[0-9]+)?([^0-9]*)$/;
var groupRegex = /,/g;
var latnDecimalRegex = /^[0-9]*(\.[0-9]+)?$/;
var keys = ['minusSign', 'infinity'];
/**
 * Module for Number Parser.
 * @private
 */
var NumberParser = /** @__PURE__ @class */ (function () {
    function NumberParser() {
    }
    /**
     * Returns the parser function for given skeleton.
     * @param {string} -  Specifies the culture name to be which formatting.
     * @param {NumberFormatOptions} - Specific the format in which number  will parsed.
     * @param {cldr} - Specifies the global cldr data collection.
     * @return Function.
     */
    NumberParser.numberParser = function (culture, option, cldr) {
        var _this = this;
        var dependable = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getDependables(cldr, culture, '', true);
        var parseOptions = { custom: true };
        var numOptions;
        if ((_intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].formatRegex.test(option.format)) || !(option.format)) {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(parseOptions, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getProperNumericSkeleton(option.format || 'N'));
            parseOptions.custom = false;
            if (!parseOptions.fractionDigits) {
                if (option.maximumFractionDigits) {
                    parseOptions.maximumFractionDigits = option.maximumFractionDigits;
                }
            }
        }
        else {
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(parseOptions, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].customFormat(option.format, null, null));
        }
        var numbers = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('numbers', dependable.parserObject);
        numOptions = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getCurrentNumericOptions(dependable.parserObject, _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getNumberingSystem(cldr), true, Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])());
        parseOptions.symbolRegex = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].getSymbolRegex(Object.keys(numOptions.symbolMatch));
        // tslint:disable-next-line:no-any
        parseOptions.infinity = numOptions.symbolNumberSystem[keys[1]];
        var symbolpattern;
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            symbolpattern = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getSymbolPattern(parseOptions.type, numOptions.numberSystem, dependable.numericObject, parseOptions.isAccount);
            if (symbolpattern) {
                symbolpattern = symbolpattern.replace(/\u00A4/g, _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].defaultCurrency);
                var split = symbolpattern.split(';');
                parseOptions.nData = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getFormatData(split[1] || '-' + split[0], true, '');
                parseOptions.pData = _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].getFormatData(split[0], true, '');
            }
        }
        else {
            parseOptions.nData = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(parseOptions.type + 'nData', numbers));
            parseOptions.pData = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(parseOptions.type + 'pData', numbers));
            if (parseOptions.type === 'currency' && option.currency) {
                _intl_base__WEBPACK_IMPORTED_MODULE_2__["IntlBase"].replaceBlazorCurrency([parseOptions.pData, parseOptions.nData], Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('currencySymbol', numbers), option.currency);
            }
        }
        return function (value) {
            return _this.getParsedNumber(value, parseOptions, numOptions);
        };
    };
    /**
     * Returns parsed number for the provided formatting options
     * @param {string} value
     * @param {NumericParts} options
     * @param {NumericOptions} numOptions
     * @returns {number}
     */
    NumberParser.getParsedNumber = function (value, options, numOptions) {
        var isNegative;
        var isPercent;
        var tempValue;
        var lead;
        var end;
        var ret;
        if (value.indexOf(options.infinity) !== -1) {
            return Infinity;
        }
        else {
            value = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].convertValueParts(value, options.symbolRegex, numOptions.symbolMatch);
            value = _parser_base__WEBPACK_IMPORTED_MODULE_1__["ParserBase"].convertValueParts(value, numOptions.numberParseRegex, numOptions.numericPair);
            if (value.indexOf('.') === 0) {
                value = '0' + value;
            }
            var matches = value.match(parseRegex);
            if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(matches)) {
                return NaN;
            }
            lead = matches[1];
            tempValue = matches[2];
            var exponent = matches[5];
            end = matches[6];
            isNegative = options.custom ? ((lead === options.nData.nlead) && (end === options.nData.nend)) :
                ((lead.indexOf(options.nData.nlead) !== -1) && (end.indexOf(options.nData.nend) !== -1));
            isPercent = isNegative ?
                options.nData.isPercent :
                options.pData.isPercent;
            tempValue = tempValue.replace(groupRegex, '');
            if (exponent) {
                tempValue += exponent;
            }
            ret = +tempValue;
            if (options.type === 'percent' || isPercent) {
                ret = ret / 100;
            }
            if (options.custom || options.fractionDigits) {
                ret = parseFloat(ret.toFixed(options.custom ?
                    (isNegative ? options.nData.maximumFractionDigits : options.pData.maximumFractionDigits) : options.fractionDigits));
            }
            if (options.maximumFractionDigits) {
                ret = this.convertMaxFracDigits(tempValue, options, ret, isNegative);
            }
            if (isNegative) {
                ret *= -1;
            }
            return ret;
        }
    };
    NumberParser.convertMaxFracDigits = function (value, options, ret, isNegative) {
        var decimalSplitValue = value.split('.');
        if (decimalSplitValue[1] && decimalSplitValue[1].length > options.maximumFractionDigits) {
            ret = +(ret.toFixed(options.custom ?
                (isNegative ? options.nData.maximumFractionDigits : options.pData.maximumFractionDigits) : options.maximumFractionDigits));
        }
        return ret;
    };
    return NumberParser;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/intl/parser-base.js ***!
  \********************************************************************/
/*! exports provided: ParserBase, getBlazorCurrencySymbol */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParserBase", function() { return ParserBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlazorCurrencySymbol", function() { return getBlazorCurrencySymbol; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/**
 * Parser
 */
var defaultNumberingSystem = {
    'latn': {
        '_digits': '0123456789',
        '_type': 'numeric'
    }
};

var latnRegex = /^[0-9]*$/;
var defaultNumberSymbols = {
    'decimal': '.',
    'group': ',',
    'percentSign': '%',
    'plusSign': '+',
    'minusSign': '-',
    'infinity': '∞',
    'nan': 'NaN',
    'exponential': 'E'
};
var latnNumberSystem = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
/**
 * Interface for parser base
 * @private
 */
var ParserBase = /** @__PURE__ @class */ (function () {
    function ParserBase() {
    }
    /**
     * Returns the cldr object for the culture specifies
     * @param {Object} obj - Specifies the object from which culture object to be acquired.
     * @param {string} cName - Specifies the culture name.
     * @returns {Object}
     */
    ParserBase.getMainObject = function (obj, cName) {
        var value = Object(_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? cName : 'main.' + cName;
        return Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(value, obj);
    };
    /**
     * Returns the numbering system object from given cldr data.
     * @param {Object} obj - Specifies the object from which number system is acquired.
     * @returns {Object}
     */
    ParserBase.getNumberingSystem = function (obj) {
        return Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('supplemental.numberingSystems', obj) || this.numberingSystems;
    };
    /**
     * Returns the reverse of given object keys or keys specified.
     * @param {Object} prop - Specifies the object to be reversed.
     * @param {number[]} keys - Optional parameter specifies the custom keyList for reversal.
     * @returns {Object}
     */
    ParserBase.reverseObject = function (prop, keys) {
        var propKeys = keys || Object.keys(prop);
        var res = {};
        for (var _i = 0, propKeys_1 = propKeys; _i < propKeys_1.length; _i++) {
            var key = propKeys_1[_i];
            /* tslint:disable no-any */
            if (!res.hasOwnProperty(prop[key])) {
                res[prop[key]] = key;
            }
        }
        return res;
    };
    /**
     * Returns the symbol regex by skipping the escape sequence.
     * @param {string[]} props - Specifies the array values to be skipped.
     * @returns {RegExp}
     */
    ParserBase.getSymbolRegex = function (props) {
        var regexStr = props.map(function (str) {
            return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
        }).join('|');
        return new RegExp(regexStr, 'g');
    };
    ParserBase.getSymbolMatch = function (prop) {
        var matchKeys = Object.keys(defaultNumberSymbols);
        var ret = {};
        for (var _i = 0, matchKeys_1 = matchKeys; _i < matchKeys_1.length; _i++) {
            var key = matchKeys_1[_i];
            ret[prop[key]] = defaultNumberSymbols[key];
        }
        return ret;
    };
    /**
     * Returns regex string for provided value
     * @param {string} val
     * @returns {string}
     */
    ParserBase.constructRegex = function (val) {
        var len = val.length;
        var ret = '';
        for (var i = 0; i < len; i++) {
            if (i !== len - 1) {
                ret += val[i] + '|';
            }
            else {
                ret += val[i];
            }
        }
        return ret;
    };
    /**
     * Returns the replaced value of matching regex and obj mapper.
     * @param {string} value - Specifies the  values to be replaced.
     * @param {RegExp} regex - Specifies the  regex to search.
     * @param {Object} obj - Specifies the  object matcher to be replace value parts.
     * @returns {string}
     */
    ParserBase.convertValueParts = function (value, regex, obj) {
        return value.replace(regex, function (str) {
            return obj[str];
        });
    };
    /**
     * Returns default numbering system object for formatting from cldr data
     * @param {Object} obj
     * @returns {NumericObject}
     */
    ParserBase.getDefaultNumberingSystem = function (obj) {
        var ret = {};
        ret.obj = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('numbers', obj);
        ret.nSystem = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('defaultNumberingSystem', ret.obj);
        return ret;
    };
    /**
     * Returns the replaced value of matching regex and obj mapper.
     */
    ParserBase.getCurrentNumericOptions = function (curObj, numberSystem, needSymbols, blazorMode) {
        var ret = {};
        var cur = this.getDefaultNumberingSystem(curObj);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(cur.nSystem) || blazorMode) {
            var digits = blazorMode ? Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('obj.mapperDigits', cur) : Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(cur.nSystem + '._digits', numberSystem);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(digits)) {
                ret.numericPair = this.reverseObject(digits, latnNumberSystem);
                ret.numberParseRegex = new RegExp(this.constructRegex(digits), 'g');
                ret.numericRegex = '[' + digits[0] + '-' + digits[9] + ']';
                if (needSymbols) {
                    ret.numericRegex = digits[0] + '-' + digits[9];
                    ret.symbolNumberSystem = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(blazorMode ? 'numberSymbols' : 'symbols-numberSystem-' + cur.nSystem, cur.obj);
                    ret.symbolMatch = this.getSymbolMatch(ret.symbolNumberSystem);
                    ret.numberSystem = cur.nSystem;
                }
            }
        }
        return ret;
    };
    /**
     * Returns number mapper object for the provided cldr data
     * @param {Object} curObj
     * @param {Object} numberSystem
     * @param {boolean} isNumber
     * @returns {NumberMapper}
     */
    ParserBase.getNumberMapper = function (curObj, numberSystem, isNumber) {
        var ret = { mapper: {} };
        var cur = this.getDefaultNumberingSystem(curObj);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(cur.nSystem)) {
            ret.numberSystem = cur.nSystem;
            ret.numberSymbols = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('symbols-numberSystem-' + cur.nSystem, cur.obj);
            ret.timeSeparator = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeSeparator', ret.numberSymbols);
            var digits = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(cur.nSystem + '._digits', numberSystem);
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(digits)) {
                for (var _i = 0, latnNumberSystem_1 = latnNumberSystem; _i < latnNumberSystem_1.length; _i++) {
                    var i = latnNumberSystem_1[_i];
                    ret.mapper[i] = digits[i];
                }
            }
        }
        return ret;
    };
    ParserBase.nPair = 'numericPair';
    ParserBase.nRegex = 'numericRegex';
    ParserBase.numberingSystems = defaultNumberingSystem;
    return ParserBase;
}());

/**
 * @private
 */
var blazorCurrencyData = {
    'DJF': 'Fdj',
    'ERN': 'Nfk',
    'ETB': 'Br',
    'NAD': '$',
    'ZAR': 'R',
    'XAF': 'FCFA',
    'GHS': 'GH₵',
    'XDR': 'XDR',
    'AED': 'د.إ.‏',
    'BHD': 'د.ب.‏',
    'DZD': 'د.ج.‏',
    'EGP': 'ج.م.‏',
    'ILS': '₪',
    'IQD': 'د.ع.‏',
    'JOD': 'د.ا.‏',
    'KMF': 'CF',
    'KWD': 'د.ك.‏',
    'LBP': 'ل.ل.‏',
    'LYD': 'د.ل.‏',
    'MAD': 'د.م.‏',
    'MRU': 'أ.م.',
    'OMR': 'ر.ع.‏',
    'QAR': 'ر.ق.‏',
    'SAR': 'ر.س.‏',
    'SDG': 'ج.س.',
    'SOS': 'S',
    'SSP': '£',
    'SYP': 'ل.س.‏',
    'TND': 'د.ت.‏',
    'YER': 'ر.ي.‏',
    'CLP': '$',
    'INR': '₹',
    'TZS': 'TSh',
    'EUR': '€',
    'AZN': '₼',
    'RUB': '₽',
    'BYN': 'Br',
    'ZMW': 'K',
    'BGN': 'лв.',
    'NGN': '₦',
    'XOF': 'CFA',
    'BDT': '৳',
    'CNY': '¥',
    'BAM': 'КМ',
    'UGX': 'USh',
    'USD': '$',
    'CZK': 'Kč',
    'GBP': '£',
    'DKK': 'kr.',
    'KES': 'Ksh',
    'CHF': 'CHF',
    'MVR': 'ރ.',
    'BTN': 'Nu.',
    'XCD': 'EC$',
    'AUD': '$',
    'BBD': '$',
    'BIF': 'FBu',
    'BMD': '$',
    'BSD': '$',
    'BWP': 'P',
    'BZD': '$',
    'CAD': '$',
    'NZD': '$',
    'FJD': '$',
    'FKP': '£',
    'GIP': '£',
    'GMD': 'D',
    'GYD': '$',
    'HKD': '$',
    'IDR': 'Rp',
    'JMD': '$',
    'KYD': '$',
    'LRD': '$',
    'MGA': 'Ar',
    'MOP': 'MOP$',
    'MUR': 'Rs',
    'MWK': 'MK',
    'MYR': 'RM',
    'PGK': 'K',
    'PHP': '₱',
    'PKR': 'Rs',
    'RWF': 'RF',
    'SBD': '$',
    'SCR': 'SR',
    'SEK': 'kr',
    'SGD': '$',
    'SHP': '£',
    'SLL': 'Le',
    'ANG': 'NAf.',
    'SZL': 'E',
    'TOP': 'T$',
    'TTD': '$',
    'VUV': 'VT',
    'WST': 'WS$',
    'ARS': '$',
    'BOB': 'Bs',
    'BRL': 'R$',
    'COP': '$',
    'CRC': '₡',
    'CUP': '$',
    'DOP': '$',
    'GTQ': 'Q',
    'HNL': 'L',
    'MXN': '$',
    'NIO': 'C$',
    'PAB': 'B/.',
    'PEN': 'S/',
    'PYG': '₲',
    'UYU': '$',
    'VES': 'Bs.S',
    'IRR': 'ريال',
    'GNF': 'FG',
    'CDF': 'FC',
    'HTG': 'G',
    'XPF': 'FCFP',
    'HRK': 'kn',
    'HUF': 'Ft',
    'AMD': '֏',
    'ISK': 'kr',
    'JPY': '¥',
    'GEL': '₾',
    'CVE': '​',
    'KZT': '₸',
    'KHR': '៛',
    'KPW': '₩',
    'KRW': '₩',
    'KGS': 'сом',
    'AOA': 'Kz',
    'LAK': '₭',
    'MZN': 'MTn',
    'MKD': 'ден',
    'MNT': '₮',
    'BND': '$',
    'MMK': 'K',
    'NOK': 'kr',
    'NPR': 'रु',
    'AWG': 'Afl.',
    'SRD': '$',
    'PLN': 'zł',
    'AFN': '؋',
    'STN': 'Db',
    'MDL': 'L',
    'RON': 'lei',
    'UAH': '₴',
    'LKR': 'රු.',
    'ALL': 'Lekë',
    'RSD': 'дин.',
    'TJS': 'смн',
    'THB': '฿',
    'TMT': 'm.',
    'TRY': '₺',
    'UZS': 'сўм',
    'VND': '₫',
    'TWD': 'NT$'
};
function getBlazorCurrencySymbol(currencyCode) {
    return Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(currencyCode || '', blazorCurrencyData);
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/keyboard.js":
/*!************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/keyboard.js ***!
  \************************************************************/
/*! exports provided: KeyboardEvents */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyboardEvents", function() { return KeyboardEvents; });
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};


var keyCode = {
    'backspace': 8,
    'tab': 9,
    'enter': 13,
    'shift': 16,
    'control': 17,
    'alt': 18,
    'pause': 19,
    'capslock': 20,
    'space': 32,
    'escape': 27,
    'pageup': 33,
    'pagedown': 34,
    'end': 35,
    'home': 36,
    'leftarrow': 37,
    'uparrow': 38,
    'rightarrow': 39,
    'downarrow': 40,
    'insert': 45,
    'delete': 46,
    'f1': 112,
    'f2': 113,
    'f3': 114,
    'f4': 115,
    'f5': 116,
    'f6': 117,
    'f7': 118,
    'f8': 119,
    'f9': 120,
    'f10': 121,
    'f11': 122,
    'f12': 123,
    'semicolon': 186,
    'plus': 187,
    'comma': 188,
    'minus': 189,
    'dot': 190,
    'forwardslash': 191,
    'graveaccent': 192,
    'openbracket': 219,
    'backslash': 220,
    'closebracket': 221,
    'singlequote': 222
};
/**
 * KeyboardEvents class enables you to bind key action desired key combinations for ex., Ctrl+A, Delete, Alt+Space etc.
 * ```html
 * <div id='testEle'>  </div>;
 * <script>
 *   let node: HTMLElement = document.querySelector('#testEle');
 *   let kbInstance = new KeyboardEvents({
 *       element: node,
 *       keyConfigs:{ selectAll : 'ctrl+a' },
 *       keyAction: function (e:KeyboardEvent, action:string) {
 *           // handler function code
 *       }
 *   });
 * </script>
 * ```
 */
var KeyboardEvents = /** @__PURE__ @class */ (function (_super) {
    __extends(KeyboardEvents, _super);
    /**
     * Initializes the KeyboardEvents
     * @param {HTMLElement} element
     * @param {KeyboardEventsModel} options
     */
    function KeyboardEvents(element, options) {
        var _this = _super.call(this, options, element) || this;
        /**
         * To handle a key press event returns null
         */
        _this.keyPressHandler = function (e) {
            var isAltKey = e.altKey;
            var isCtrlKey = e.ctrlKey;
            var isShiftKey = e.shiftKey;
            var curkeyCode = e.which;
            var keys = Object.keys(_this.keyConfigs);
            for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
                var key = keys_1[_i];
                var configCollection = _this.keyConfigs[key].split(',');
                for (var _a = 0, configCollection_1 = configCollection; _a < configCollection_1.length; _a++) {
                    var rconfig = configCollection_1[_a];
                    var rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());
                    if (isAltKey === rKeyObj.altKey && isCtrlKey === rKeyObj.ctrlKey &&
                        isShiftKey === rKeyObj.shiftKey && curkeyCode === rKeyObj.keyCode) {
                        e.action = key;
                        if (_this.keyAction) {
                            _this.keyAction(e);
                        }
                    }
                }
            }
        };
        _this.bind();
        return _this;
    }
    KeyboardEvents_1 = KeyboardEvents;
    /**
     * Unwire bound events and destroy the instance.
     * @return {void}
     */
    KeyboardEvents.prototype.destroy = function () {
        this.unwireEvents();
        _super.prototype.destroy.call(this);
    };
    /**
     * Function can be used to specify certain action if a property is changed
     * @param newProp
     * @param oldProp
     * @returns {void}
     * @private
     */
    KeyboardEvents.prototype.onPropertyChanged = function (newProp, oldProp) {
        // No code are needed
    };
    ;
    KeyboardEvents.prototype.bind = function () {
        this.wireEvents();
    };
    /**
     * To get the module name, returns 'keyboard'.
     * @private
     */
    KeyboardEvents.prototype.getModuleName = function () {
        return 'keyboard';
    };
    /**
     * Wiring event handlers to events
     */
    KeyboardEvents.prototype.wireEvents = function () {
        this.element.addEventListener(this.eventName, this.keyPressHandler);
    };
    /**
     * Unwiring event handlers to events
     */
    KeyboardEvents.prototype.unwireEvents = function () {
        this.element.removeEventListener(this.eventName, this.keyPressHandler);
    };
    /**
     * To get the key configuration data
     * @param {string} config - configuration data
     * returns {KeyData}
     */
    KeyboardEvents.getKeyConfigData = function (config) {
        if (config in this.configCache) {
            return this.configCache[config];
        }
        var keys = config.toLowerCase().split('+');
        var keyData = {
            altKey: (keys.indexOf('alt') !== -1 ? true : false),
            ctrlKey: (keys.indexOf('ctrl') !== -1 ? true : false),
            shiftKey: (keys.indexOf('shift') !== -1 ? true : false),
            keyCode: null
        };
        if (keys[keys.length - 1].length > 1 && !!Number(keys[keys.length - 1])) {
            keyData.keyCode = Number(keys[keys.length - 1]);
        }
        else {
            keyData.keyCode = KeyboardEvents_1.getKeyCode(keys[keys.length - 1]);
        }
        KeyboardEvents_1.configCache[config] = keyData;
        return keyData;
    };
    // Return the keycode value as string 
    KeyboardEvents.getKeyCode = function (keyVal) {
        return keyCode[keyVal] || keyVal.toUpperCase().charCodeAt(0);
    };
    var KeyboardEvents_1;
    KeyboardEvents.configCache = {};
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], KeyboardEvents.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_0__["Property"])('keyup')
    ], KeyboardEvents.prototype, "eventName", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], KeyboardEvents.prototype, "keyAction", void 0);
    KeyboardEvents = KeyboardEvents_1 = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], KeyboardEvents);
    return KeyboardEvents;
}(_base__WEBPACK_IMPORTED_MODULE_1__["Base"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/l10n.js":
/*!********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/l10n.js ***!
  \********************************************************/
/*! exports provided: L10n */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L10n", function() { return L10n; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _internationalization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internationalization */ "./ej2-resources/18.4.46/scripts/ej2-base/internationalization.js");


/**
 * L10n modules provides localized text for different culture.
 * ```typescript
 * import {setCulture} from '../ts-base-library';
 * //load global locale object common for all components.
 * L10n.load({
 *    'fr-BE': {
 *       'button': {
 *            'check': 'vérifié'
 *        }
 *    }
 * });
 * //set globale default locale culture.
 * setCulture('fr-BE');
 * let instance: L10n = new L10n('button', {
 *    check: 'checked'
 * });
 * //Get locale text for current property.
 * instance.getConstant('check');
 * //Change locale culture in a component.
 * instance.setLocale('en-US');
 * ```
 */
var L10n = /** @__PURE__ @class */ (function () {
    /**
     * Constructor
     */
    function L10n(controlName, localeStrings, locale) {
        this.controlName = controlName;
        this.localeStrings = localeStrings;
        this.setLocale(locale || _internationalization__WEBPACK_IMPORTED_MODULE_1__["defaultCulture"]);
    }
    /**
     * Sets the locale text
     * @param {string} locale
     * @returns {void}
     */
    L10n.prototype.setLocale = function (locale) {
        var intLocale = this.intGetControlConstant(L10n.locale, locale);
        this.currentLocale = intLocale || this.localeStrings;
    };
    /**
     * Sets the global locale for all components.
     * @param {Object} localeObject - specifies the localeObject to be set as global locale.
     */
    L10n.load = function (localeObject) {
        this.locale = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.locale, localeObject, {}, true);
    };
    /**
     * Returns current locale text for the property based on the culture name and control name.
     * @param {string} propertyName - specifies the property for which localize text to be returned.
     * @return string
     */
    L10n.prototype.getConstant = function (prop) {
        // Removed conditional operator because this method does not return correct value when passing 0 as value in localization
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.currentLocale[prop])) {
            return this.currentLocale[prop];
        }
        else {
            return this.localeStrings[prop] || '';
        }
    };
    /**
     * Returns the control constant object for current object and the locale specified.
     * @param {Object} curObject
     * @param {string} locale
     * @returns {Object}
     */
    L10n.prototype.intGetControlConstant = function (curObject, locale) {
        if ((curObject)[locale]) {
            return (curObject)[locale][this.controlName];
        }
        return null;
    };
    L10n.locale = {};
    return L10n;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/module-loader.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/module-loader.js ***!
  \*****************************************************************/
/*! exports provided: ModuleLoader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleLoader", function() { return ModuleLoader; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/**
 * Module loading operations
 */

var MODULE_SUFFIX = 'Module';
var ModuleLoader = /** @__PURE__ @class */ (function () {
    function ModuleLoader(parent) {
        this.loadedModules = [];
        this.parent = parent;
    }
    ;
    /**
     * Inject required modules in component library
     * @return {void}
     * @param {ModuleDeclaration[]} requiredModules - Array of modules to be required
     * @param {Function[]} moduleList - Array of modules to be injected from sample side
     */
    ModuleLoader.prototype.inject = function (requiredModules, moduleList) {
        var reqLength = requiredModules.length;
        if (reqLength === 0) {
            this.clean();
            return;
        }
        if (this.loadedModules.length) {
            this.clearUnusedModule(requiredModules);
        }
        for (var i = 0; i < reqLength; i++) {
            var modl = requiredModules[i];
            for (var _i = 0, moduleList_1 = moduleList; _i < moduleList_1.length; _i++) {
                var module = moduleList_1[_i];
                var modName = modl.member;
                if (module.prototype.getModuleName() === modl.member && !this.isModuleLoaded(modName)) {
                    var moduleObject = Object(_util__WEBPACK_IMPORTED_MODULE_0__["createInstance"])(module, modl.args);
                    var memberName = this.getMemberName(modName);
                    if (modl.isProperty) {
                        Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])(memberName, module, this.parent);
                    }
                    else {
                        Object(_util__WEBPACK_IMPORTED_MODULE_0__["setValue"])(memberName, moduleObject, this.parent);
                    }
                    var loadedModule = modl;
                    loadedModule.member = memberName;
                    this.loadedModules.push(loadedModule);
                }
            }
        }
    };
    /**
     * To remove the created object while destroying the control
     * @return {void}
     */
    ModuleLoader.prototype.clean = function () {
        for (var _i = 0, _a = this.loadedModules; _i < _a.length; _i++) {
            var modules = _a[_i];
            if (!modules.isProperty) {
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(modules.member, this.parent).destroy();
            }
        }
        this.loadedModules = [];
    };
    /**
     * Removes all unused modules
     * @param {ModuleDeclaration[]} moduleList
     * @returns {void}
     */
    ModuleLoader.prototype.clearUnusedModule = function (moduleList) {
        var _this = this;
        var usedModules = moduleList.map(function (arg) { return _this.getMemberName(arg.member); });
        var removableModule = this.loadedModules.filter(function (module) {
            return usedModules.indexOf(module.member) === -1;
        });
        for (var _i = 0, removableModule_1 = removableModule; _i < removableModule_1.length; _i++) {
            var mod = removableModule_1[_i];
            if (!mod.isProperty) {
                Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mod.member, this.parent).destroy();
            }
            this.loadedModules.splice(this.loadedModules.indexOf(mod), 1);
            Object(_util__WEBPACK_IMPORTED_MODULE_0__["deleteObject"])(this.parent, mod.member);
        }
    };
    /**
     * To get the name of the member.
     * @param {string} name
     * @returns {string}
     */
    ModuleLoader.prototype.getMemberName = function (name) {
        return name[0].toLowerCase() + name.substring(1) + MODULE_SUFFIX;
    };
    /**
     * Returns boolean based on whether the module specified is loaded or not
     * @param {string} modName
     * @returns {boolean}
     */
    ModuleLoader.prototype.isModuleLoaded = function (modName) {
        for (var _i = 0, _a = this.loadedModules; _i < _a.length; _i++) {
            var mod = _a[_i];
            if (mod.member === this.getMemberName(modName)) {
                return true;
            }
        }
        return false;
    };
    return ModuleLoader;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js ***!
  \**************************************************************************/
/*! exports provided: Property, Complex, ComplexFactory, Collection, CollectionFactory, Event, NotifyPropertyChanges, CreateBuilder */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return Property; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Complex", function() { return Complex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComplexFactory", function() { return ComplexFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Collection", function() { return Collection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CollectionFactory", function() { return CollectionFactory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotifyPropertyChanges", function() { return NotifyPropertyChanges; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateBuilder", function() { return CreateBuilder; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");

/**
 * Returns the Class Object
 * @param {ClassObject} instance - instance of ClassObject
 * @param {string} curKey - key of the current instance
 * @param {Object} defaultValue - default Value
 * @param {Object[]} type
 */
function getObject(instance, curKey, defaultValue, type) {
    if (!instance.properties.hasOwnProperty(curKey) || !(instance.properties[curKey] instanceof type)) {
        instance.properties[curKey] = Object(_util__WEBPACK_IMPORTED_MODULE_0__["createInstance"])(type, [instance, curKey, defaultValue]);
    }
    return instance.properties[curKey];
}
/**
 * Returns object array
 * @param {ClassObject} instance
 * @param {string} curKey
 * @param {Object[]} defaultValue
 * @param type
 * @param {boolean} isSetter
 * @returns {Object[]}
 */
function getObjectArray(instance, curKey, defaultValue, type, isSetter, isFactory) {
    var result = [];
    var len = defaultValue ? defaultValue.length : 0;
    for (var i = 0; i < len; i++) {
        var curType = type;
        if (isFactory) {
            curType = type(defaultValue[i], instance);
        }
        if (isSetter) {
            var inst = Object(_util__WEBPACK_IMPORTED_MODULE_0__["createInstance"])(curType, [instance, curKey, {}, true]);
            inst.setProperties(defaultValue[i], true);
            result.push(inst);
        }
        else {
            result.push(Object(_util__WEBPACK_IMPORTED_MODULE_0__["createInstance"])(curType, [instance, curKey, defaultValue[i], false]));
        }
    }
    return result;
}
/**
 * Returns the properties of the object
 * @param {Object} defaultValue
 * @param {string} curKey
 */
function propertyGetter(defaultValue, curKey) {
    return function () {
        if (!this.properties.hasOwnProperty(curKey)) {
            this.properties[curKey] = defaultValue;
        }
        return this.properties[curKey];
    };
}
/**
 * Set the properties for the object
 * @param {Object} defaultValue
 * @param {string} curKey
 */
function propertySetter(defaultValue, curKey) {
    return function (newValue) {
        if (this.properties[curKey] !== newValue) {
            var oldVal = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
            this.saveChanges(curKey, newValue, oldVal);
            this.properties[curKey] = newValue;
        }
    };
}
/**
 * Returns complex objects
 */
function complexGetter(defaultValue, curKey, type) {
    return function () {
        return getObject(this, curKey, defaultValue, type);
    };
}
/**
 * Sets complex objects
 */
function complexSetter(defaultValue, curKey, type) {
    return function (newValue) {
        getObject(this, curKey, defaultValue, type).setProperties(newValue);
    };
}
function complexFactoryGetter(defaultValue, curKey, type) {
    return function () {
        var curType = type({});
        if (this.properties.hasOwnProperty(curKey)) {
            return this.properties[curKey];
        }
        else {
            return getObject(this, curKey, defaultValue, curType);
        }
    };
}
function complexFactorySetter(defaultValue, curKey, type) {
    return function (newValue) {
        var curType = type(newValue, this);
        getObject(this, curKey, defaultValue, curType).setProperties(newValue);
    };
}
function complexArrayGetter(defaultValue, curKey, type) {
    return function () {
        var _this = this;
        if (!this.properties.hasOwnProperty(curKey)) {
            var defCollection = getObjectArray(this, curKey, defaultValue, type, false);
            this.properties[curKey] = defCollection;
        }
        var ignore = ((this.controlParent !== undefined && this.controlParent.ignoreCollectionWatch)
            || this.ignoreCollectionWatch);
        if (!this.properties[curKey].hasOwnProperty('push') && !ignore) {
            ['push', 'pop'].forEach(function (extendFunc) {
                var descriptor = {
                    value: complexArrayDefinedCallback(extendFunc, curKey, type, _this.properties[curKey]).bind(_this),
                    configurable: true
                };
                Object.defineProperty(_this.properties[curKey], extendFunc, descriptor);
            });
        }
        if (!this.properties[curKey].hasOwnProperty('isComplexArray')) {
            Object.defineProperty(this.properties[curKey], 'isComplexArray', { value: true });
        }
        return this.properties[curKey];
    };
}
function complexArraySetter(defaultValue, curKey, type) {
    return function (newValue) {
        this.isComplexArraySetter = true;
        var oldValueCollection = getObjectArray(this, curKey, defaultValue, type, false);
        var newValCollection = getObjectArray(this, curKey, newValue, type, true);
        this.isComplexArraySetter = false;
        this.saveChanges(curKey, newValCollection, oldValueCollection);
        this.properties[curKey] = newValCollection;
    };
}
function complexArrayFactorySetter(defaultValue, curKey, type) {
    return function (newValue) {
        var oldValueCollection = this.properties.hasOwnProperty(curKey) ? this.properties[curKey] : defaultValue;
        var newValCollection = getObjectArray(this, curKey, newValue, type, true, true);
        this.saveChanges(curKey, newValCollection, oldValueCollection);
        this.properties[curKey] = newValCollection;
    };
}
function complexArrayFactoryGetter(defaultValue, curKey, type) {
    return function () {
        var curType = type({});
        if (!this.properties.hasOwnProperty(curKey)) {
            var defCollection = getObjectArray(this, curKey, defaultValue, curType, false);
            this.properties[curKey] = defCollection;
        }
        return this.properties[curKey];
    };
}
function complexArrayDefinedCallback(dFunc, curKey, type, prop) {
    /* tslint:disable no-function-expression */
    return function () {
        var newValue = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            newValue[_i] = arguments[_i];
        }
        var keyString = this.propName ? this.getParentKey() + '.' + curKey + '-' : curKey + '-';
        switch (dFunc) {
            case 'push':
                for (var i = 0; i < newValue.length; i++) {
                    Array.prototype[dFunc].apply(prop, [newValue[i]]);
                    var model_1 = getArrayModel(keyString + (prop.length - 1), newValue[i], !this.controlParent, dFunc);
                    this.serverDataBind(model_1, newValue[i], false, dFunc);
                }
                break;
            case 'pop':
                Array.prototype[dFunc].apply(prop);
                var model = getArrayModel(keyString + prop.length, null, !this.controlParent, dFunc);
                this.serverDataBind(model, { ejsAction: 'pop' }, false, dFunc);
                break;
        }
        return prop;
    };
    /* tslint:enable no-function-expression */
}
function getArrayModel(keyString, value, isControlParent, arrayFunction) {
    var modelObject = keyString;
    if (isControlParent) {
        modelObject = {};
        modelObject[keyString] = value;
        if (value && typeof value === 'object') {
            var action = 'ejsAction';
            modelObject[keyString][action] = arrayFunction;
        }
    }
    return modelObject;
}
/**
 * Method used to create property. General syntax below.
 * @param  {T} defaultValue? - Specifies the default value of property.
 * ```
 * @Property('TypeScript')
 * propertyName: Type;
 * ```
 * @private
 */
function Property(defaultValue) {
    return function (target, key) {
        var propertyDescriptor = {
            set: propertySetter(defaultValue, key),
            get: propertyGetter(defaultValue, key),
            enumerable: true,
            configurable: true
        };
        //new property creation
        Object.defineProperty(target, key, propertyDescriptor);
        addPropertyCollection(target, key, 'prop', defaultValue);
    };
}
/**
 * Method used to create complex property. General syntax below.
 * @param  {T} defaultValue - Specifies the default value of property.
 * @param  {Function} type - Specifies the class type of complex object.
 * ```
 * @Complex<Type>({},Type)
 * propertyName: Type;
 * ```
 * @private
 */
function Complex(defaultValue, type) {
    return function (target, key) {
        var propertyDescriptor = {
            set: complexSetter(defaultValue, key, type),
            get: complexGetter(defaultValue, key, type),
            enumerable: true,
            configurable: true
        };
        //new property creation
        Object.defineProperty(target, key, propertyDescriptor);
        addPropertyCollection(target, key, 'complexProp', defaultValue, type);
    };
}
/**
 * Method used to create complex Factory property. General syntax below.
 * @param  {Function} defaultType - Specifies the default value of property.
 * @param  {Function} type - Specifies the class factory type of complex object.
 * ```
 * @ComplexFactory(defaultType, factoryFunction)
 * propertyName: Type1 | Type2;
 * ```
 * @private
 */
function ComplexFactory(type) {
    return function (target, key) {
        var propertyDescriptor = {
            set: complexFactorySetter({}, key, type),
            get: complexFactoryGetter({}, key, type),
            enumerable: true,
            configurable: true
        };
        //new property creation
        Object.defineProperty(target, key, propertyDescriptor);
        addPropertyCollection(target, key, 'complexProp', {}, type);
    };
}
/**
 * Method used to create complex array property. General syntax below.
 * @param  {T[]} defaultValue - Specifies the default value of property.
 * @param  {Function} type - Specifies the class type of complex object.
 * ```
 * @Collection([], Type);
 * propertyName: Type;
 * ```
 * @private
 */
function Collection(defaultValue, type) {
    return function (target, key) {
        var propertyDescriptor = {
            set: complexArraySetter(defaultValue, key, type),
            get: complexArrayGetter(defaultValue, key, type),
            enumerable: true,
            configurable: true
        };
        //new property creation
        Object.defineProperty(target, key, propertyDescriptor);
        addPropertyCollection(target, key, 'colProp', defaultValue, type);
    };
}
/**
 * Method used to create complex factory array property. General syntax below.
 * @param  {T[]} defaultType - Specifies the default type of property.
 * @param  {Function} type - Specifies the class type of complex object.
 * ```
 * @Collection([], Type);
 * propertyName: Type;
 * ```
 * @private
 */
function CollectionFactory(type) {
    return function (target, key) {
        var propertyDescriptor = {
            set: complexArrayFactorySetter([], key, type),
            get: complexArrayFactoryGetter([], key, type),
            enumerable: true,
            configurable: true
        };
        //new property creation
        Object.defineProperty(target, key, propertyDescriptor);
        addPropertyCollection(target, key, 'colProp', {}, type);
    };
}
/**
 * Method used to create event property. General syntax below.
 * @param  {Function} defaultValue? - Specifies the default value of property.
 * @param  {boolean} isComplex? - Specifies the whether it is complex object.
 * ```
 * @Event(()=>{return true;})
 * ```
 * @private
 */
function Event() {
    return function (target, key) {
        var eventDescriptor = {
            set: function (newValue) {
                var oldValue = this.properties[key];
                if (oldValue !== newValue) {
                    var finalContext = getParentContext(this, key);
                    if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(oldValue) === false) {
                        finalContext.context.removeEventListener(finalContext.prefix, oldValue);
                    }
                    finalContext.context.addEventListener(finalContext.prefix, newValue);
                    this.properties[key] = newValue;
                }
            },
            get: propertyGetter(undefined, key),
            enumerable: true,
            configurable: true
        };
        Object.defineProperty(target, key, eventDescriptor);
        addPropertyCollection(target, key, 'event');
    };
}
/**
 * NotifyPropertyChanges is triggers the call back when the property has been changed.
 *
 * ```
 *  @NotifyPropertyChanges
 * class DemoClass implements INotifyPropertyChanged {
 *
 *     @Property()
 *     property1: string;
 *
 *     dataBind: () => void;
 *
 *     constructor() { }
 *
 *     onPropertyChanged(newProp: any, oldProp: any) {
 *         // Called when property changed
 *     }
 * }
 * ```
 * @private
 */
function NotifyPropertyChanges(classConstructor) {
    /** Need to code */
}
/**
 * Method  used to create the builderObject for the target component.
 * @private
 */
function addPropertyCollection(target, key, propertyType, defaultValue, type) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(target.propList)) {
        target.propList = {
            props: [],
            complexProps: [],
            colProps: [],
            events: [],
            propNames: [],
            complexPropNames: [],
            colPropNames: [],
            eventNames: []
        };
    }
    /* tslint:disable no-any */
    target.propList[propertyType + 's'].push({
        propertyName: key,
        defaultValue: defaultValue,
        type: type
    });
    target.propList[propertyType + 'Names'].push(key);
    /* tslint:enable no-any */
}
/**
 * Returns an object containing the builder properties
 * @param {Function} component
 * @private
 */
function getBuilderProperties(component) {
    if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(component.prototype.builderObject)) {
        component.prototype.builderObject = {
            properties: {}, propCollections: [], add: function () {
                this.isPropertyArray = true;
                this.propCollections.push(Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.properties, {}));
            }
        };
        var rex = /complex/;
        for (var _i = 0, _a = Object.keys(component.prototype.propList); _i < _a.length; _i++) {
            var key = _a[_i];
            var _loop_1 = function (prop) {
                if (rex.test(key)) {
                    component.prototype.builderObject[prop.propertyName] = function (value) {
                        var childType = {};
                        Object(_util__WEBPACK_IMPORTED_MODULE_0__["merge"])(childType, getBuilderProperties(prop.type));
                        value(childType);
                        var tempValue;
                        if (!childType.isPropertyArray) {
                            tempValue = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, childType.properties, {});
                        }
                        else {
                            tempValue = childType.propCollections;
                        }
                        this.properties[prop.propertyName] = tempValue;
                        childType.properties = {};
                        childType.propCollections = [];
                        childType.isPropertyArray = false;
                        return this;
                    };
                }
                else {
                    component.prototype.builderObject[prop.propertyName] = function (value) {
                        this.properties[prop.propertyName] = value;
                        return this;
                    };
                }
            };
            for (var _b = 0, _c = component.prototype.propList[key]; _b < _c.length; _b++) {
                var prop = _c[_b];
                _loop_1(prop);
            }
        }
    }
    return component.prototype.builderObject;
}
/**
 * Method used to create builder for the components
 * @param {any} component -specifies the target component for which builder to be created.
 * @private
 */
function CreateBuilder(component) {
    var builderFunction = function (element) {
        this.element = element;
        return this;
    };
    var instanceFunction = function (element) {
        if (!builderFunction.prototype.hasOwnProperty('create')) {
            builderFunction.prototype = getBuilderProperties(component);
            builderFunction.prototype.create = function () {
                var temp = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, this.properties);
                this.properties = {};
                return new component(temp, this.element);
            };
        }
        return new builderFunction(element);
    };
    return instanceFunction;
}
/**
 * Returns parent options for the object
 * @param {Object} context
 * @param {string} prefix
 * @private
 */
function getParentContext(context, prefix) {
    if (context.hasOwnProperty('parentObj') === false) {
        return { context: context, prefix: prefix };
    }
    else {
        var curText = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('propName', context);
        if (curText) {
            prefix = curText + '-' + prefix;
        }
        return getParentContext(Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])('parentObj', context), prefix);
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/observer.js":
/*!************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/observer.js ***!
  \************************************************************/
/*! exports provided: Observer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observer", function() { return Observer; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");

var Observer = /** @__PURE__ @class */ (function () {
    function Observer(context) {
        this.ranArray = [];
        this.boundedEvents = {};
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(context)) {
            return;
        }
        this.context = context;
    }
    ;
    /**
     * To attach handler for given property in current context.
     * @param {string} property - specifies the name of the event.
     * @param {Function} handler - Specifies the handler function to be called while event notified.
     * @param {Object} context - Specifies the context binded to the handler.
     * @param {string} id - specifies the random generated id.
     * @return {void}
     */
    Observer.prototype.on = function (property, handler, context, id) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(handler)) {
            return;
        }
        var cntxt = context || this.context;
        if (this.notExist(property)) {
            this.boundedEvents[property] = [{ handler: handler, context: cntxt }];
            return;
        }
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
            if (this.ranArray.indexOf(id) === -1) {
                this.ranArray.push(id);
                this.boundedEvents[property].push({ handler: handler, context: cntxt, id: id });
            }
        }
        else if (!this.isHandlerPresent(this.boundedEvents[property], handler)) {
            this.boundedEvents[property].push({ handler: handler, context: cntxt });
        }
    };
    /**
     * To remove handlers from a event attached using on() function.
     * @param {string} eventName - specifies the name of the event.
     * @param {Function} handler - Optional argument specifies the handler function to be called while event notified.
     * @param {string} id - specifies the random generated id.
     * @return {void}
     */
    Observer.prototype.off = function (property, handler, id) {
        if (this.notExist(property)) {
            return;
        }
        var curObject = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(property, this.boundedEvents);
        if (handler) {
            for (var i = 0; i < curObject.length; i++) {
                if (id) {
                    if (curObject[i].id === id) {
                        curObject.splice(i, 1);
                        var indexLocation = this.ranArray.indexOf(id);
                        if (indexLocation !== -1) {
                            this.ranArray.splice(indexLocation, 1);
                        }
                        break;
                    }
                }
                else if (handler === curObject[i].handler) {
                    curObject.splice(i, 1);
                    break;
                }
            }
        }
        else {
            delete this.boundedEvents[property];
        }
    };
    /**
     * To notify the handlers in the specified event.
     * @param {string} property - Specifies the event to be notify.
     * @param {Object} args - Additional parameters to pass while calling the handler.
     * @param {Function} successHandler - this function will invoke after event successfully triggered
     * @param {Function} errorHandler - this function will invoke after event if it was failure to call.
     * @return {void}
     */
    Observer.prototype.notify = function (property, argument, successHandler, errorHandler) {
        if (this.notExist(property)) {
            if (successHandler) {
                successHandler.call(this, argument);
            }
            return;
        }
        if (argument) {
            argument.name = property;
        }
        var blazor = 'Blazor';
        var curObject = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(property, this.boundedEvents).slice(0);
        if (window[blazor]) {
            return this.blazorCallback(curObject, argument, successHandler, errorHandler, 0);
        }
        else {
            for (var _i = 0, curObject_1 = curObject; _i < curObject_1.length; _i++) {
                var cur = curObject_1[_i];
                cur.handler.call(cur.context, argument);
            }
            if (successHandler) {
                successHandler.call(this, argument);
            }
        }
    };
    Observer.prototype.blazorCallback = function (objs, argument, successHandler, errorHandler, index) {
        var _this = this;
        var isTrigger = index === objs.length - 1;
        if (index < objs.length) {
            var obj_1 = objs[index];
            var promise = obj_1.handler.call(obj_1.context, argument);
            if (promise && typeof promise.then === 'function') {
                if (!successHandler) {
                    return promise;
                }
                promise.then(function (data) {
                    data = typeof data === 'string' && _this.isJson(data) ? JSON.parse(data, _this.dateReviver) : data;
                    Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(argument, argument, data, true);
                    if (successHandler && isTrigger) {
                        successHandler.call(obj_1.context, argument);
                    }
                    else {
                        return _this.blazorCallback(objs, argument, successHandler, errorHandler, index + 1);
                    }
                }).catch(function (data) {
                    if (errorHandler) {
                        errorHandler.call(obj_1.context, typeof data === 'string' &&
                            _this.isJson(data) ? JSON.parse(data, _this.dateReviver) : data);
                    }
                });
            }
            else if (successHandler && isTrigger) {
                successHandler.call(obj_1.context, argument);
            }
            else {
                return this.blazorCallback(objs, argument, successHandler, errorHandler, index + 1);
            }
        }
    };
    // tslint:disable-next-line:no-any
    Observer.prototype.dateReviver = function (key, value) {
        var dPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
        if (_util__WEBPACK_IMPORTED_MODULE_0__["isBlazor"] && typeof value === 'string' && value.match(dPattern) !== null) {
            return (new Date(value));
        }
        return (value);
    };
    Observer.prototype.isJson = function (value) {
        try {
            JSON.parse(value);
        }
        catch (e) {
            return false;
        }
        return true;
    };
    /**
     * To destroy handlers in the event
     */
    Observer.prototype.destroy = function () {
        this.boundedEvents = this.context = undefined;
    };
    /**
     * Returns if the property exists.
     */
    Observer.prototype.notExist = function (prop) {
        return this.boundedEvents.hasOwnProperty(prop) === false || this.boundedEvents[prop].length <= 0;
    };
    /**
     * Returns if the handler is present.
     */
    Observer.prototype.isHandlerPresent = function (boundedEvents, handler) {
        for (var _i = 0, boundedEvents_1 = boundedEvents; _i < boundedEvents_1.length; _i++) {
            var cur = boundedEvents_1[_i];
            if (cur.handler === handler) {
                return true;
            }
        }
        return false;
    };
    return Observer;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/sanitize-helper.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/sanitize-helper.js ***!
  \*******************************************************************/
/*! exports provided: SanitizeHtmlHelper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SanitizeHtmlHelper", function() { return SanitizeHtmlHelper; });
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/**
 * SanitizeHtmlHelper for sanitize the value.
 */

var removeTags = [
    'script',
    'style',
    'iframe[src]',
    'link[href*="javascript:"]',
    'object[type="text/x-scriptlet"]',
    'object[data^="data:text/html;base64"]',
    'img[src^="data:text/html;base64"]',
    '[src^="javascript:"]',
    '[dynsrc^="javascript:"]',
    '[lowsrc^="javascript:"]',
    '[type^="application/x-shockwave-flash"]'
];
var removeAttrs = [
    { attribute: 'href', selector: '[href*="javascript:"]' },
    { attribute: 'background', selector: '[background^="javascript:"]' },
    { attribute: 'style', selector: '[style*="javascript:"]' },
    { attribute: 'style', selector: '[style*="expression("]' },
    { attribute: 'href', selector: 'a[href^="data:text/html;base64"]' }
];
var jsEvents = ['onchange',
    'onclick',
    'onmouseover',
    'onmouseout',
    'onkeydown',
    'onload',
    'onerror',
    'onblur',
    'onfocus',
    'onbeforeload',
    'onbeforeunload',
    'onkeyup',
    'onsubmit',
    'onafterprint',
    'onbeforeonload',
    'onbeforeprint',
    'onblur',
    'oncanplay',
    'oncanplaythrough',
    'onchange',
    'onclick',
    'oncontextmenu',
    'ondblclick',
    'ondrag',
    'ondragend',
    'ondragenter',
    'ondragleave',
    'ondragover',
    'ondragstart',
    'ondrop',
    'ondurationchange',
    'onemptied',
    'onended',
    'onerror',
    'onerror',
    'onfocus',
    'onformchange',
    'onforminput',
    'onhaschange',
    'oninput',
    'oninvalid',
    'onkeydown',
    'onkeypress',
    'onkeyup',
    'onload',
    'onloadeddata',
    'onloadedmetadata',
    'onloadstart',
    'onmessage',
    'onmousedown',
    'onmousemove',
    'onmouseout',
    'onmouseover',
    'onmouseup',
    'onmousewheel',
    'onoffline',
    'onoine',
    'ononline',
    'onpagehide',
    'onpageshow',
    'onpause',
    'onplay',
    'onplaying',
    'onpopstate',
    'onprogress',
    'onratechange',
    'onreadystatechange',
    'onredo',
    'onresize',
    'onscroll',
    'onseeked',
    'onseeking',
    'onselect',
    'onstalled',
    'onstorage',
    'onsubmit',
    'onsuspend',
    'ontimeupdate',
    'onundo',
    'onunload',
    'onvolumechange',
    'onwaiting',
    'onmouseenter',
    'onmouseleave',
    'onmousewheel',
    'onstart',
    'onpropertychange'
];
var SanitizeHtmlHelper = /** @__PURE__ @class */ (function () {
    function SanitizeHtmlHelper() {
    }
    SanitizeHtmlHelper.beforeSanitize = function () {
        return {
            selectors: {
                tags: removeTags,
                attributes: removeAttrs
            }
        };
    };
    ;
    SanitizeHtmlHelper.sanitize = function (value) {
        var item = this.beforeSanitize();
        var output = this.serializeValue(item, value);
        return output;
    };
    SanitizeHtmlHelper.serializeValue = function (item, value) {
        this.removeAttrs = item.selectors.attributes;
        this.removeTags = item.selectors.tags;
        this.wrapElement = document.createElement('div');
        this.wrapElement.innerHTML = value;
        this.removeXssTags();
        this.removeJsEvents();
        this.removeXssAttrs();
        var tempEleValue = this.wrapElement.innerHTML;
        this.removeElement();
        return tempEleValue;
    };
    SanitizeHtmlHelper.removeElement = function () {
        // Removes an element's attibute to avoid html tag validation
        var nodes = this.wrapElement.children;
        for (var j = 0; j < nodes.length; j++) {
            var attribute = nodes[j].attributes;
            for (var i = 0; i < attribute.length; i++) {
                this.wrapElement.children[j].removeAttribute(attribute[i].localName);
            }
        }
    };
    SanitizeHtmlHelper.removeXssTags = function () {
        var elements = this.wrapElement.querySelectorAll(this.removeTags.join(','));
        if (elements.length > 0) {
            elements.forEach(function (element) {
                Object(_dom__WEBPACK_IMPORTED_MODULE_0__["detach"])(element);
            });
        }
        else {
            return;
        }
    };
    SanitizeHtmlHelper.removeJsEvents = function () {
        var elements = this.wrapElement.querySelectorAll('[' + jsEvents.join('],[') + ']');
        if (elements.length > 0) {
            elements.forEach(function (element) {
                jsEvents.forEach(function (attr) {
                    if (element.hasAttribute(attr)) {
                        element.removeAttribute(attr);
                    }
                });
            });
        }
        else {
            return;
        }
    };
    SanitizeHtmlHelper.removeXssAttrs = function () {
        var _this = this;
        this.removeAttrs.forEach(function (item, index) {
            var elements = _this.wrapElement.querySelectorAll(item.selector);
            if (elements.length > 0) {
                elements.forEach(function (element) {
                    element.removeAttribute(item.attribute);
                });
            }
        });
    };
    return SanitizeHtmlHelper;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/template-engine.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/template-engine.js ***!
  \*******************************************************************/
/*! exports provided: blazorTemplates, getRandomId, compile, updateBlazorTemplate, resetBlazorTemplate, setTemplateEngine, getTemplateEngine */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blazorTemplates", function() { return blazorTemplates; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRandomId", function() { return getRandomId; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compile", function() { return compile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateBlazorTemplate", function() { return updateBlazorTemplate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetBlazorTemplate", function() { return resetBlazorTemplate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTemplateEngine", function() { return setTemplateEngine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTemplateEngine", function() { return getTemplateEngine; });
/* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./template */ "./ej2-resources/18.4.46/scripts/ej2-base/template.js");
/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom */ "./ej2-resources/18.4.46/scripts/ej2-base/dom.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/**
 * Template Engine Bridge
 */



var HAS_ROW = /^[\n\r.]+\<tr|^\<tr/;
var HAS_SVG = /^[\n\r.]+\<svg|^\<path|^\<g/;
var blazorTemplates = {};
function getRandomId() {
    return '-' + Math.random().toString(36).substr(2, 5);
}
/**
 * Compile the template string into template function.
 * @param  {string} templateString - The template string which is going to convert.
 * @param  {Object} helper? - Helper functions as an object.
 * @private
 */
//tslint:disable-next-line
function compile(templateString, helper) {
    var compiler = engineObj.compile(templateString, helper);
    //tslint:disable-next-line
    return function (data, component, propName, templateId, isStringTemplate, index, element) {
        var result = compiler(data, component, propName, element);
        var blazor = 'Blazor';
        var blazorTemplateId = 'BlazorTemplateId';
        if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && !isStringTemplate) {
            var randomId = getRandomId();
            var blazorId = templateId + randomId;
            if (!blazorTemplates[templateId]) {
                blazorTemplates[templateId] = [];
            }
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(index)) {
                var keys = Object.keys(blazorTemplates[templateId][index]);
                for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
                    var key = keys_1[_i];
                    if (key !== blazorTemplateId && data[key]) {
                        blazorTemplates[templateId][index][key] = data[key];
                    }
                    if (key === blazorTemplateId) {
                        blazorId = blazorTemplates[templateId][index][key];
                    }
                }
            }
            else {
                data[blazorTemplateId] = blazorId;
                blazorTemplates[templateId].push(data);
            }
            // tslint:disable-next-line:no-any
            return propName === 'rowTemplate' ? [Object(_dom__WEBPACK_IMPORTED_MODULE_1__["createElement"])('tr', { id: blazorId, className: 'e-blazor-template' })] :
                // tslint:disable-next-line:no-any
                [Object(_dom__WEBPACK_IMPORTED_MODULE_1__["createElement"])('div', { id: blazorId, className: 'e-blazor-template' })];
        }
        if (typeof result === 'string') {
            if (HAS_SVG.test(result)) {
                var ele = Object(_dom__WEBPACK_IMPORTED_MODULE_1__["createElement"])('svg', { innerHTML: result });
                return ele.childNodes;
            }
            else {
                var ele = Object(_dom__WEBPACK_IMPORTED_MODULE_1__["createElement"])((HAS_ROW.test(result) ? 'table' : 'div'), { innerHTML: result });
                return ele.childNodes;
            }
        }
        else {
            return result;
        }
    };
}
function updateBlazorTemplate(templateId, templateName, comp, isEmpty, callBack) {
    var blazor = 'Blazor';
    if (Object(_util__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
        var ejsIntrop = 'sfBlazor';
        window[ejsIntrop].updateTemplate(templateName, blazorTemplates[templateId], templateId, comp, callBack);
        if (isEmpty !== false) {
            blazorTemplates[templateId] = [];
        }
    }
}
function resetBlazorTemplate(templateId, templateName, index) {
    var templateDiv = document.getElementById(templateId);
    if (templateDiv) {
        // tslint:disable-next-line:no-any
        var innerTemplates = templateDiv.getElementsByClassName('blazor-inner-template');
        for (var i = 0; i < innerTemplates.length; i++) {
            var tempId = ' ';
            if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(index)) {
                tempId = innerTemplates[index].getAttribute('data-templateId');
            }
            else {
                tempId = innerTemplates[i].getAttribute('data-templateId');
            }
            var tempElement = document.getElementById(tempId);
            if (tempElement) {
                var length_1 = tempElement.childNodes.length;
                for (var j = 0; j < length_1; j++) {
                    if (!Object(_util__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(index)) {
                        innerTemplates[index].appendChild(tempElement.childNodes[0]);
                        i = innerTemplates.length;
                    }
                    else {
                        innerTemplates[i].appendChild(tempElement.childNodes[0]);
                    }
                }
            }
        }
    }
}
/**
 * Set your custom template engine for template rendering.
 * @param  {ITemplateEngine} classObj - Class object for custom template.
 * @private
 */
function setTemplateEngine(classObj) {
    engineObj.compile = classObj.compile;
}
/**
 * Get current template engine for template rendering
 * @param  {ITemplateEngine} classObj - Class object for custom template.
 * @private
 */
function getTemplateEngine() {
    return engineObj.compile;
}
//Default Engine Class
var Engine = /** @__PURE__ @class */ (function () {
    function Engine() {
    }
    Engine.prototype.compile = function (templateString, helper) {
        if (helper === void 0) { helper = {}; }
        return Object(_template__WEBPACK_IMPORTED_MODULE_0__["compile"])(templateString, helper);
    };
    return Engine;
}());
var engineObj = { compile: new Engine().compile };


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/template.js":
/*!************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/template.js ***!
  \************************************************************/
/*! exports provided: expression, compile */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expression", function() { return expression; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compile", function() { return compile; });
/**
 * Template Engine
 */
var LINES = new RegExp('\\n|\\r|\\s\\s+', 'g');
var QUOTES = new RegExp(/'|"/g);
var IF_STMT = new RegExp('if ?\\(');
var ELSEIF_STMT = new RegExp('else if ?\\(');
var ELSE_STMT = new RegExp('else');
var FOR_STMT = new RegExp('for ?\\(');
var IF_OR_FOR = new RegExp('(\/if|\/for)');
var CALL_FUNCTION = new RegExp('\\((.*)\\)', '');
var NOT_NUMBER = new RegExp('^[0-9]+$', 'g');
var WORD = new RegExp('[\\w"\'.\\s+]+', 'g');
var DBL_QUOTED_STR = new RegExp('"(.*?)"', 'g');
var WORDIF = new RegExp('[\\w"\'@#$.\\s+]+', 'g');
var exp = new RegExp('\\${([^}]*)}', 'g');
// let cachedTemplate: Object = {};
var ARR_OBJ = /^\..*/gm;
var SINGLE_SLASH = /\\/gi;
var DOUBLE_SLASH = /\\\\/gi;
var WORDFUNC = new RegExp('[\\w"\'@#$.\\s+]+', 'g');
var WINDOWFUNC = /\window\./gm;
/**
 * The function to set regular expression for template expression string.
 * @param  {RegExp} value - Value expression.
 * @private
 */
function expression(value) {
    if (value) {
        exp = value;
    }
    return exp;
}
// /**
//  * To render the template string from the given data.
//  * @param  {string} template - String Template.
//  * @param  {Object[]|JSON} data - DataSource for the template.
//  * @param  {Object} helper? - custom helper object.
//  */
// export function template(template: string, data: JSON, helper?: Object): string {
//     let hash: string = hashCode(template);
//     let tmpl: Function;
//     if (!cachedTemplate[hash]) {
//         tmpl = cachedTemplate[hash] = compile(template, helper);
//     } else {
//         tmpl = cachedTemplate[hash];
//     }
//     return tmpl(data);
// }
/**
 * Compile the template string into template function.
 * @param  {string} template - The template string which is going to convert.
 * @param  {Object} helper? - Helper functions as an object.
 * @private
 */
function compile(template, helper) {
    var argName = 'data';
    var evalExpResult = evalExp(template, argName, helper);
    var fnCode = "var str=\"" + evalExpResult + "\"; return str;";
    // tslint:disable-next-line:no-function-constructor-with-string-args
    var fn = new Function(argName, fnCode);
    return fn.bind(helper);
}
// function used to evaluate the function expression
function evalExp(str, nameSpace, helper) {
    var varCOunt = 0;
    /**
     * Variable containing Local Keys
     */
    var localKeys = [];
    var isClass = str.match(/class="([^\"]+|)\s{2}/g);
    var singleSpace = '';
    if (isClass) {
        isClass.forEach(function (value) {
            singleSpace = value.replace(/\s\s+/g, ' ');
            str = str.replace(value, singleSpace);
        });
    }
    return str.replace(LINES, '').replace(DBL_QUOTED_STR, '\'$1\'').replace(exp, function (match, cnt, offset, matchStr) {
        var SPECIAL_CHAR = /\@|\#|\$/gm;
        var matches = cnt.match(CALL_FUNCTION);
        // matches to detect any function calls
        if (matches) {
            var rlStr = matches[1];
            if (ELSEIF_STMT.test(cnt)) {
                //handling else-if condition
                cnt = '";} ' + cnt.replace(matches[1], rlStr.replace(WORD, function (str) {
                    str = str.trim();
                    return addNameSpace(str, !(QUOTES.test(str)) && (localKeys.indexOf(str) === -1), nameSpace, localKeys);
                })) + '{ \n str = str + "';
            }
            else if (IF_STMT.test(cnt)) {
                //handling if condition
                cnt = '"; ' + cnt.replace(matches[1], rlStr.replace(WORDIF, function (strs) {
                    return HandleSpecialCharArrObj(strs, nameSpace, localKeys, true);
                })) + '{ \n str = str + "';
            }
            else if (FOR_STMT.test(cnt)) {
                //handling for condition
                var rlStr_1 = matches[1].split(' of ');
                // replace for each into actual JavaScript
                cnt = '"; ' + cnt.replace(matches[1], function (mtc) {
                    localKeys.push(rlStr_1[0]);
                    localKeys.push(rlStr_1[0] + 'Index');
                    varCOunt = varCOunt + 1;
                    // tslint:disable-next-line
                    return 'var i' + varCOunt + '=0; i' + varCOunt + ' < ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys) + '.length; i' + varCOunt + '++';
                }) + '{ \n ' + 'var ' + rlStr_1[0] + '= ' + addNameSpace(rlStr_1[1], true, nameSpace, localKeys)
                    + '[i' + varCOunt + ']; \n var ' + rlStr_1[0] + 'Index=i' + varCOunt + '; \n str = str + "';
            }
            else {
                //helper function handling
                var fnStr = cnt.split('(');
                var fNameSpace = (helper && helper.hasOwnProperty(fnStr[0]) ? 'this.' : 'global');
                fNameSpace = (/\./.test(fnStr[0]) ? '' : fNameSpace);
                var ftArray = matches[1].split(',');
                if (matches[1].length !== 0 && !(/data/).test(ftArray[0]) && !(/window./).test(ftArray[0])) {
                    matches[1] = (fNameSpace === 'global' ? nameSpace + '.' + matches[1] : matches[1]);
                }
                var splRegexp = /\@|\$|\#/gm;
                var arrObj = /\]\./gm;
                if (WINDOWFUNC.test(cnt) && arrObj.test(cnt) || splRegexp.test(cnt)) {
                    var splArrRegexp = /\@|\$|\#|\]\./gm;
                    if (splArrRegexp.test(cnt)) {
                        // tslint:disable-next-line
                        cnt = '"+ ' + (fNameSpace === 'global' ? '' : fNameSpace) + cnt.replace(matches[1], rlStr.replace(WORDFUNC, function (strs) {
                            return HandleSpecialCharArrObj(strs, nameSpace, localKeys);
                        })) + '+ "';
                    }
                }
                else {
                    cnt = '" + ' + (fNameSpace === 'global' ? '' : fNameSpace) +
                        cnt.replace(rlStr, addNameSpace(matches[1].replace(/,( |)data.|,/gi, ',' + nameSpace + '.').replace(/,( |)data.window/gi, ',window'), (fNameSpace === 'global' ? false : true), nameSpace, localKeys)) +
                        '+"';
                }
            }
        }
        else if (ELSE_STMT.test(cnt)) {
            // handling else condition
            cnt = '"; ' + cnt.replace(ELSE_STMT, '} else { \n str = str + "');
        }
        else if (!!cnt.match(IF_OR_FOR)) {
            // close condition 
            cnt = cnt.replace(IF_OR_FOR, '"; \n } \n str = str + "');
        }
        else if (SPECIAL_CHAR.test(cnt)) {
            // template string with double slash with special character
            if (cnt.match(SINGLE_SLASH)) {
                cnt = SlashReplace(cnt);
            }
            cnt = '"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '"]+"';
        }
        else {
            // template string with double slash
            if (cnt.match(SINGLE_SLASH)) {
                cnt = SlashReplace(cnt);
                cnt = '"+' + NameSpaceForspecialChar(cnt, (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '"]+"';
            }
            else {
                // evaluate normal expression
                cnt = '"+' + addNameSpace(cnt.replace(/\,/gi, '+' + nameSpace + '.'), (localKeys.indexOf(cnt) === -1), nameSpace, localKeys) + '+"';
            }
        }
        return cnt;
    });
}
function addNameSpace(str, addNS, nameSpace, ignoreList, emptyStrCheck) {
    /* istanbul ignore next */
    if (emptyStrCheck && str === '') {
        return str;
    }
    return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '.' + str : str);
}
function NameSpaceArrObj(str, addNS, nameSpace, ignoreList) {
    var arrObjReg = /^\..*/gm;
    return ((addNS && !(NOT_NUMBER.test(str)) &&
        ignoreList.indexOf(str.split('.')[0]) === -1 && !(arrObjReg.test(str))) ? nameSpace + '.' + str : str);
}
// // Create hashCode for template string to storeCached function
// function hashCode(str: string): string {
//     return str.split('').reduce((a: number, b: string) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0).toString();
// }
function NameSpaceForspecialChar(str, addNS, nameSpace, ignoreList) {
    return ((addNS && !(NOT_NUMBER.test(str)) && ignoreList.indexOf(str.split('.')[0]) === -1) ? nameSpace + '["' + str : str);
}
// tslint:disable-next-line
function SlashReplace(tempStr) {
    // tslint:disable-next-line
    var double = "\\\\";
    if (tempStr.match(DOUBLE_SLASH)) {
        tempStr = tempStr;
    }
    else {
        tempStr = tempStr.replace(SINGLE_SLASH, double);
    }
    return tempStr;
}
function HandleSpecialCharArrObj(str, nameSpaceNew, keys, emptyStrCheck) {
    str = str.trim();
    var windowFunc = /\window\./gm;
    if (!windowFunc.test(str)) {
        var quotes = /'|"/gm;
        var splRegexp = /\@|\$|\#/gm;
        if (splRegexp.test(str)) {
            str = NameSpaceForspecialChar(str, (keys.indexOf(str) === -1), nameSpaceNew, keys) + '"]';
        }
        if (ARR_OBJ.test(str)) {
            return NameSpaceArrObj(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys);
        }
        else {
            return addNameSpace(str, !(quotes.test(str)) && (keys.indexOf(str) === -1), nameSpaceNew, keys, emptyStrCheck);
        }
    }
    else {
        return str;
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/touch.js":
/*!*********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/touch.js ***!
  \*********************************************************/
/*! exports provided: SwipeSettings, Touch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwipeSettings", function() { return SwipeSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _notify_property_change__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./notify-property-change */ "./ej2-resources/18.4.46/scripts/ej2-base/notify-property-change.js");
/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser */ "./ej2-resources/18.4.46/scripts/ej2-base/browser.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ "./ej2-resources/18.4.46/scripts/ej2-base/base.js");
/* harmony import */ var _child_property__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./child-property */ "./ej2-resources/18.4.46/scripts/ej2-base/child-property.js");
/* harmony import */ var _event_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./event-handler */ "./ej2-resources/18.4.46/scripts/ej2-base/event-handler.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






/**
 * SwipeSettings is a framework module that provides support to handle swipe event like swipe up, swipe right, etc..,
 */
var SwipeSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(SwipeSettings, _super);
    function SwipeSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Property"])(50)
    ], SwipeSettings.prototype, "swipeThresholdDistance", void 0);
    return SwipeSettings;
}(_child_property__WEBPACK_IMPORTED_MODULE_4__["ChildProperty"]));

var swipeRegex = /(Up|Down)/;
/**
 * Touch class provides support to handle the touch event like tap, double tap, tap hold, etc..,
 * ```typescript
 *    let node: HTMLElement;
 * let touchObj: Touch = new Touch({
 *    element: node,
 *    tap: function (e) {
 *        // tap handler function code
 *    }
 *    tapHold: function (e) {
 *        // tap hold handler function code
 *    }
 *    scroll: function (e) {
 *        // scroll handler function code
 *    }
 *    swipe: function (e) {
 *        // swipe handler function code
 *    }
 * });
 * ```
 */
var Touch = /** @__PURE__ @class */ (function (_super) {
    __extends(Touch, _super);
    /* End-Properties */
    function Touch(element, options) {
        var _this = _super.call(this, options, element) || this;
        _this.touchAction = true;
        _this.tapCount = 0;
        _this.startEvent = function (evt) {
            if (_this.touchAction === true) {
                var point = _this.updateChangeTouches(evt);
                if (evt.changedTouches !== undefined) {
                    _this.touchAction = false;
                }
                _this.isTouchMoved = false;
                _this.movedDirection = '';
                _this.startPoint = _this.lastMovedPoint = { clientX: point.clientX, clientY: point.clientY };
                _this.startEventData = point;
                _this.hScrollLocked = _this.vScrollLocked = false;
                _this.tStampStart = Date.now();
                _this.timeOutTapHold = setTimeout(function () { _this.tapHoldEvent(evt); }, _this.tapHoldThreshold);
                _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].add(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchMoveEvent, _this.moveEvent, _this);
                _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].add(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchEndEvent, _this.endEvent, _this);
                _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].add(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchCancelEvent, _this.cancelEvent, _this);
            }
        };
        _this.moveEvent = function (evt) {
            var point = _this.updateChangeTouches(evt);
            _this.movedPoint = point;
            _this.isTouchMoved = !(point.clientX === _this.startPoint.clientX && point.clientY === _this.startPoint.clientY);
            var eScrollArgs = {};
            if (_this.isTouchMoved) {
                clearTimeout(_this.timeOutTapHold);
                _this.calcScrollPoints(evt);
                var scrollArg = {
                    startEvents: _this.startEventData,
                    originalEvent: evt, startX: _this.startPoint.clientX,
                    startY: _this.startPoint.clientY, distanceX: _this.distanceX,
                    distanceY: _this.distanceY, scrollDirection: _this.scrollDirection,
                    velocity: _this.getVelocity(point)
                };
                eScrollArgs = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(eScrollArgs, {}, scrollArg);
                _this.trigger('scroll', eScrollArgs);
                _this.lastMovedPoint = { clientX: point.clientX, clientY: point.clientY };
            }
        };
        _this.cancelEvent = function (evt) {
            clearTimeout(_this.timeOutTapHold);
            clearTimeout(_this.timeOutTap);
            _this.tapCount = 0;
            _this.swipeFn(evt);
            _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchCancelEvent, _this.cancelEvent);
        };
        _this.endEvent = function (evt) {
            _this.swipeFn(evt);
            if (!_this.isTouchMoved) {
                if (typeof _this.tap === 'function') {
                    _this.trigger('tap', { originalEvent: evt, tapCount: ++_this.tapCount });
                    _this.timeOutTap = setTimeout(function () {
                        _this.tapCount = 0;
                    }, _this.tapThreshold);
                }
            }
            _this.modeclear();
        };
        _this.swipeFn = function (evt) {
            clearTimeout(_this.timeOutTapHold);
            clearTimeout(_this.timeOutTap);
            var point = _this.updateChangeTouches(evt);
            var diffX = point.clientX - _this.startPoint.clientX;
            var diffY = point.clientY - _this.startPoint.clientY;
            diffX = Math.floor(diffX < 0 ? -1 * diffX : diffX);
            diffY = Math.floor(diffY < 0 ? -1 * diffY : diffX);
            _this.isTouchMoved = diffX > 1 || diffY > 1;
            // tslint:disable-next-line:no-any
            var isFirefox = (/Mozilla|Firefox/).test(_browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].userAgent);
            if (isFirefox && point.clientX === 0 && point.clientY === 0 && evt.type === 'mouseup') {
                _this.isTouchMoved = false;
            }
            _this.endPoint = point;
            _this.calcPoints(evt);
            var swipeArgs = {
                originalEvent: evt,
                startEvents: _this.startEventData,
                startX: _this.startPoint.clientX,
                startY: _this.startPoint.clientY,
                distanceX: _this.distanceX, distanceY: _this.distanceY, swipeDirection: _this.movedDirection,
                velocity: _this.getVelocity(point)
            };
            if (_this.isTouchMoved) {
                var eSwipeArgs = void 0;
                var tDistance = _this.swipeSettings.swipeThresholdDistance;
                eSwipeArgs = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(eSwipeArgs, _this.defaultArgs, swipeArgs);
                var canTrigger = false;
                var ele = _this.element;
                var scrollBool = _this.isScrollable(ele);
                var moved = swipeRegex.test(_this.movedDirection);
                if ((tDistance < _this.distanceX && !moved) || (tDistance < _this.distanceY && moved)) {
                    if (!scrollBool) {
                        canTrigger = true;
                    }
                    else {
                        canTrigger = _this.checkSwipe(ele, moved);
                    }
                }
                if (canTrigger) {
                    _this.trigger('swipe', eSwipeArgs);
                }
            }
            _this.modeclear();
        };
        _this.modeclear = function () {
            _this.modeClear = setTimeout(function () {
                _this.touchAction = true;
            }, (typeof _this.tap !== 'function' ? 0 : 20));
            _this.lastTapTime = new Date().getTime();
            _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchMoveEvent, _this.moveEvent);
            _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchEndEvent, _this.endEvent);
            _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(_this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchCancelEvent, _this.cancelEvent);
        };
        _this.bind();
        return _this;
    }
    // triggers when property changed 
    /**
     * @private
     * @param newProp
     * @param oldProp
     */
    Touch.prototype.onPropertyChanged = function (newProp, oldProp) {
        //No Code to handle
    };
    Touch.prototype.bind = function () {
        this.wireEvents();
        if (_browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE) {
            this.element.classList.add('e-block-touch');
        }
    };
    /**
     * To destroy the touch instance.
     * @return {void}
     */
    Touch.prototype.destroy = function () {
        this.unwireEvents();
        _super.prototype.destroy.call(this);
    };
    // Need to changes the event binding once we updated the event handler.
    Touch.prototype.wireEvents = function () {
        _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].add(this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchStartEvent, this.startEvent, this);
    };
    Touch.prototype.unwireEvents = function () {
        _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchStartEvent, this.startEvent);
    };
    /**
     * Returns module name as touch
     * @returns {string}
     * @private
     */
    Touch.prototype.getModuleName = function () {
        return 'touch';
    };
    /**
     * Returns if the HTML element is Scrollable.
     * @param {HTMLElement} element - HTML Element to check if Scrollable.
     * @returns {boolean}
     */
    Touch.prototype.isScrollable = function (element) {
        var eleStyle = getComputedStyle(element);
        var style = eleStyle.overflow + eleStyle.overflowX + eleStyle.overflowY;
        if ((/(auto|scroll)/).test(style)) {
            return true;
        }
        return false;
    };
    Touch.prototype.tapHoldEvent = function (evt) {
        this.tapCount = 0;
        this.touchAction = true;
        var eTapArgs;
        _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchMoveEvent, this.moveEvent);
        _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchEndEvent, this.endEvent);
        eTapArgs = { originalEvent: evt };
        this.trigger('tapHold', eTapArgs);
        _event_handler__WEBPACK_IMPORTED_MODULE_5__["EventHandler"].remove(this.element, _browser__WEBPACK_IMPORTED_MODULE_2__["Browser"].touchCancelEvent, this.cancelEvent);
    };
    Touch.prototype.calcPoints = function (evt) {
        var point = this.updateChangeTouches(evt);
        this.defaultArgs = { originalEvent: evt };
        this.distanceX = Math.abs((Math.abs(point.clientX) - Math.abs(this.startPoint.clientX)));
        this.distanceY = Math.abs((Math.abs(point.clientY) - Math.abs(this.startPoint.clientY)));
        if (this.distanceX > this.distanceY) {
            this.movedDirection = (point.clientX > this.startPoint.clientX) ? 'Right' : 'Left';
        }
        else {
            this.movedDirection = (point.clientY < this.startPoint.clientY) ? 'Up' : 'Down';
        }
    };
    Touch.prototype.calcScrollPoints = function (evt) {
        var point = this.updateChangeTouches(evt);
        this.defaultArgs = { originalEvent: evt };
        this.distanceX = Math.abs((Math.abs(point.clientX) - Math.abs(this.lastMovedPoint.clientX)));
        this.distanceY = Math.abs((Math.abs(point.clientY) - Math.abs(this.lastMovedPoint.clientY)));
        if ((this.distanceX > this.distanceY || this.hScrollLocked === true) && this.vScrollLocked === false) {
            this.scrollDirection = (point.clientX > this.lastMovedPoint.clientX) ? 'Right' : 'Left';
            this.hScrollLocked = true;
        }
        else {
            this.scrollDirection = (point.clientY < this.lastMovedPoint.clientY) ? 'Up' : 'Down';
            this.vScrollLocked = true;
        }
    };
    Touch.prototype.getVelocity = function (pnt) {
        var newX = pnt.clientX;
        var newY = pnt.clientY;
        var newT = Date.now();
        var xDist = newX - this.startPoint.clientX;
        var yDist = newY - this.startPoint.clientX;
        var interval = newT - this.tStampStart;
        return Math.sqrt(xDist * xDist + yDist * yDist) / interval;
    };
    // tslint:disable-next-line:no-any
    Touch.prototype.checkSwipe = function (ele, flag) {
        var keys = ['scroll', 'offset'];
        var temp = flag ? ['Height', 'Top'] : ['Width', 'Left'];
        if ((ele[keys[0] + temp[0]] <= ele[keys[1] + temp[0]])) {
            return true;
        }
        return (ele[keys[0] + temp[1]] === 0) ||
            (ele[keys[1] + temp[0]] + ele[keys[0] + temp[1]] >= ele[keys[0] + temp[0]]);
    };
    Touch.prototype.updateChangeTouches = function (evt) {
        // tslint:disable-next-line:max-line-length
        var point = evt.changedTouches && evt.changedTouches.length !== 0 ? evt.changedTouches[0] : evt;
        return point;
    };
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], Touch.prototype, "tap", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], Touch.prototype, "tapHold", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], Touch.prototype, "swipe", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], Touch.prototype, "scroll", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Property"])(350)
    ], Touch.prototype, "tapThreshold", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Property"])(750)
    ], Touch.prototype, "tapHoldThreshold", void 0);
    __decorate([
        Object(_notify_property_change__WEBPACK_IMPORTED_MODULE_1__["Complex"])({}, SwipeSettings)
    ], Touch.prototype, "swipeSettings", void 0);
    Touch = __decorate([
        _notify_property_change__WEBPACK_IMPORTED_MODULE_1__["NotifyPropertyChanges"]
    ], Touch);
    return Touch;
}(_base__WEBPACK_IMPORTED_MODULE_3__["Base"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/util.js":
/*!********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/util.js ***!
  \********************************************************/
/*! exports provided: disableBlazorMode, createInstance, setImmediate, getValue, setValue, deleteObject, isObject, getEnumValue, merge, extend, isNullOrUndefined, isUndefined, getUniqueID, debounce, queryParams, isObjectArray, compareElementParent, throwError, print, formatUnit, enableBlazorMode, isBlazor, getElement, getInstance, addInstance, uniqueID */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableBlazorMode", function() { return disableBlazorMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInstance", function() { return createInstance; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValue", function() { return getValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setValue", function() { return setValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteObject", function() { return deleteObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnumValue", function() { return getEnumValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNullOrUndefined", function() { return isNullOrUndefined; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getUniqueID", function() { return getUniqueID; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queryParams", function() { return queryParams; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObjectArray", function() { return isObjectArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareElementParent", function() { return compareElementParent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "print", function() { return print; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatUnit", function() { return formatUnit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableBlazorMode", function() { return enableBlazorMode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlazor", function() { return isBlazor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElement", function() { return getElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addInstance", function() { return addInstance; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueID", function() { return uniqueID; });
var instances = 'ej2_instances';
var uid = 0;
var isBlazorPlatform = false;
/**
 * Function to check whether the platform is blazor or not.
 * @return {boolean} result
 * @private
 */
function disableBlazorMode() {
    isBlazorPlatform = false;
}
/**
 * Create Instance from constructor function with desired parameters.
 * @param {Function} classFunction - Class function to which need to create instance
 * @param {any[]} params - Parameters need to passed while creating instance
 * @return {any}
 * @private
 */
function createInstance(classFunction, params) {
    var arrayParam = params;
    arrayParam.unshift(undefined);
    return new (Function.prototype.bind.apply(classFunction, arrayParam));
}
/**
 * To run a callback function immediately after the browser has completed other operations.
 * @param {Function} handler - callback function to be triggered.
 * @return {Function}
 * @private
 */
function setImmediate(handler) {
    var unbind;
    var num = new Uint16Array(5);
    var intCrypto = window.msCrypto || window.crypto;
    intCrypto.getRandomValues(num);
    var secret = 'ej2' + combineArray(num);
    var messageHandler = function (event) {
        if (event.source === window && typeof event.data === 'string' && event.data.length <= 32 && event.data === secret) {
            handler();
            unbind();
        }
    };
    window.addEventListener('message', messageHandler, false);
    window.postMessage(secret, '*');
    return unbind = function () {
        window.removeEventListener('message', messageHandler);
        handler = messageHandler = secret = undefined;
    };
}
/**
 * To get nameSpace value from the desired object.
 * @param {string} nameSpace - String value to the get the inner object
 * @param {any} obj - Object to get the inner object value.
 * @return {any}
 * @private
 */
function getValue(nameSpace, obj) {
    /* tslint:disable no-any */
    var value = obj;
    var splits = nameSpace.replace(/\[/g, '.').replace(/\]/g, '').split('.');
    for (var i = 0; i < splits.length && !isUndefined(value); i++) {
        value = value[splits[i]];
    }
    return value;
}
/**
 * To set value for the nameSpace in desired object.
 * @param {string} nameSpace - String value to the get the inner object
 * @param {any} value - Value that you need to set.
 * @param {any} obj - Object to get the inner object value.
 * @return {void}
 * @private
 */
function setValue(nameSpace, value, obj) {
    var keys = nameSpace.replace(/\[/g, '.').replace(/\]/g, '').split('.');
    var start = obj || {};
    var fromObj = start;
    var i;
    var length = keys.length;
    var key;
    for (i = 0; i < length; i++) {
        key = keys[i];
        if (i + 1 === length) {
            fromObj[key] = value === undefined ? {} : value;
        }
        else if (isNullOrUndefined(fromObj[key])) {
            fromObj[key] = {};
        }
        fromObj = fromObj[key];
    }
    return start;
}
/**
 * Delete an item from Object
 * @param {any} obj - Object in which we need to delete an item.
 * @param {string} params - String value to the get the inner object
 * @return {void}
 * @private
 */
function deleteObject(obj, key) {
    delete obj[key];
}
/**
 * Check weather the given argument is only object.
 * @param {any} obj - Object which is need to check.
 * @return {boolean}
 * @private
 */
function isObject(obj) {
    var objCon = {};
    return (!isNullOrUndefined(obj) && obj.constructor === objCon.constructor);
}
/**
 * To get enum value by giving the string.
 * @param {any} enumObject - Enum object.
 * @param {string} enumValue - Enum value to be searched
 * @return {any}
 * @private
 */
function getEnumValue(enumObject, enumValue) {
    return enumObject[enumValue];
}
/**
 * Merge the source object into destination object.
 * @param {any} source - source object which is going to merge with destination object
 * @param {any} destination - object need to be merged
 * @return {void}
 * @private
 */
function merge(source, destination) {
    if (!isNullOrUndefined(destination)) {
        var temrObj = source;
        var tempProp = destination;
        var keys = Object.keys(destination);
        var deepmerge = 'deepMerge';
        for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
            var key = keys_1[_i];
            if (!isNullOrUndefined(temrObj[deepmerge]) && (temrObj[deepmerge].indexOf(key) !== -1) &&
                (isObject(tempProp[key]) || Array.isArray(tempProp[key]))) {
                extend(temrObj[key], temrObj[key], tempProp[key], true);
            }
            else {
                temrObj[key] = tempProp[key];
            }
        }
    }
}
/**
 * Extend the two object with newer one.
 * @param {any} copied - Resultant object after merged
 * @param {Object} first - First object need to merge
 * @param {Object} second - Second object need to merge
 * @return {Object}
 * @private
 */
function extend(copied, first, second, deep) {
    var result = copied && typeof copied === 'object' ? copied : {};
    var length = arguments.length;
    if (deep) {
        length = length - 1;
    }
    var _loop_1 = function (i) {
        if (!arguments_1[i]) {
            return "continue";
        }
        var obj1 = arguments_1[i];
        Object.keys(obj1).forEach(function (key) {
            var src = result[key];
            var copy = obj1[key];
            var clone;
            var isArrayChanged = Array.isArray(copy) && Array.isArray(src) && (copy.length !== src.length);
            var blazorEventExtend = isBlazor() ? (!(src instanceof Event) && !isArrayChanged) : true;
            if (deep && blazorEventExtend && (isObject(copy) || Array.isArray(copy))) {
                if (isObject(copy)) {
                    clone = src ? src : {};
                    if (Array.isArray(clone) && clone.hasOwnProperty('isComplexArray')) {
                        extend(clone, {}, copy, deep);
                    }
                    else {
                        result[key] = extend(clone, {}, copy, deep);
                    }
                }
                else {
                    /* istanbul ignore next */
                    clone = isBlazor() ? src && Object.keys(copy).length : src ? src : [];
                    result[key] = extend([], clone, copy, deep);
                }
            }
            else {
                result[key] = copy;
            }
        });
    };
    var arguments_1 = arguments;
    for (var i = 1; i < length; i++) {
        _loop_1(i);
    }
    return result;
}
/**
 * To check whether the object is null or undefined.
 * @param {Object} value - To check the object is null or undefined
 * @return {boolean}
 * @private
 */
function isNullOrUndefined(value) {
    return value === undefined || value === null;
}
/**
 * To check whether the object is undefined.
 * @param {Object} value - To check the object is undefined
 * @return {boolean}
 * @private
 */
function isUndefined(value) {
    return ('undefined' === typeof value);
}
/**
 * To return the generated unique name
 * @param {string} definedName - To concatenate the unique id to provided name
 * @return {string}
 * @private
 */
function getUniqueID(definedName) {
    return definedName + '_' + uid++;
}
/**
 * It limits the rate at which a function can fire. The function will fire only once every provided second instead of as quickly.
 * @param {Function} eventFunction - Specifies the function to run when the event occurs
 * @param {number} delay - A number that specifies the milliseconds for function delay call option
 * @return {Function}
 * @private
 */
function debounce(eventFunction, delay) {
    var out;
    // tslint:disable-next-line
    return function () {
        var _this = this;
        var args = arguments;
        var later = function () {
            out = null;
            return eventFunction.apply(_this, args);
        };
        clearTimeout(out);
        out = setTimeout(later, delay);
    };
}
// Added since lint ignored after added '//tslint:disable-next-line' 
/* tslint:disable:no-any */
/**
 * To convert the object to string for query url
 * @param  {Object} data
 * @returns string
 * @private
 */
function queryParams(data) {
    var array = [];
    var keys = Object.keys(data);
    for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
        var key = keys_2[_i];
        array.push(encodeURIComponent(key) + '=' + encodeURIComponent('' + data[key]));
    }
    return array.join('&');
}
/**
 * To check whether the given array contains object.
 * @param {T[]} value- Specifies the T type array to be checked.
 * @private
 */
function isObjectArray(value) {
    var parser = Object.prototype.toString;
    if (parser.call(value) === '[object Array]') {
        if (parser.call(value[0]) === '[object Object]') {
            return true;
        }
    }
    return false;
}
/**
 * To check whether the  child element is descendant to parent element or parent and child are same element.
 * @param{Element} - Specifies the child element to compare with parent.
 * @param{Element} - Specifies the parent element.
 * @return boolean
 * @private
 */
function compareElementParent(child, parent) {
    var node = child;
    if (node === parent) {
        return true;
    }
    else if (node === document || !node) {
        return false;
    }
    else {
        return compareElementParent(node.parentNode, parent);
    }
}
/**
 * To throw custom error message.
 * @param{string} - Specifies the error message to be thrown.
 * @private
 */
function throwError(message) {
    try {
        throw new Error(message);
    }
    catch (e) {
        throw e.message + '\n' + e.stack;
    }
}
/**
 * This function is used to print given element
 * @param{Element} element - Specifies the print content element.
 * @param{Window} printWindow - Specifies the print window.
 * @private
 */
function print(element, printWindow) {
    var div = document.createElement('div');
    var links = [].slice.call(document.getElementsByTagName('head')[0].querySelectorAll('base, link, style'));
    var reference = '';
    if (isNullOrUndefined(printWindow)) {
        printWindow = window.open('', 'print', 'height=452,width=1024,tabbar=no');
    }
    div.appendChild(element.cloneNode(true));
    for (var i = 0, len = links.length; i < len; i++) {
        reference += links[i].outerHTML;
    }
    printWindow.document.write('<!DOCTYPE html> <html><head>' + reference + '</head><body>' + div.innerHTML +
        '<script> (function() { window.ready = true; })(); </script>' + '</body></html>');
    printWindow.document.close();
    printWindow.focus();
    // tslint:disable-next-line
    var interval = setInterval(function () {
        if (printWindow.ready) {
            printWindow.print();
            printWindow.close();
            clearInterval(interval);
        }
    }, 500);
    return printWindow;
}
/**
 * Function to normalize the units applied to the element.
 * @param  {number|string} value
 * @return {string} result
 * @private
 */
function formatUnit(value) {
    var result = value + '';
    if (result.match(/auto|%|px|vh|vm|vmax|vmin|em/)) {
        return result;
    }
    return result + 'px';
}
/**
 * Function to check whether the platform is blazor or not.
 * @return {boolean} result
 * @private
 */
function enableBlazorMode() {
    isBlazorPlatform = true;
}
/**
 * Function to check whether the platform is blazor or not.
 * @return {boolean} result
 * @private
 */
function isBlazor() {
    return isBlazorPlatform;
}
/**
 * Function to convert xPath to DOM element in blazor platform
 * @return {HTMLElement} result
 * @param {HTMLElement | object} element
 * @private
 */
function getElement(element) {
    var xPath = 'xPath';
    if (!(element instanceof Node) && isBlazor() && !isNullOrUndefined(element[xPath])) {
        return document.evaluate(element[xPath], document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    }
    return element;
}
/**
 * Function to fetch the Instances of a HTML element for the given component.
 * @param {string | HTMLElement} element
 * @param {any} component
 * @return {Object} inst
 * @private
 */
// tslint:disable-next-line
function getInstance(element, component) {
    // tslint:disable-next-line:no-any
    var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;
    if (elem[instances]) {
        for (var _i = 0, _a = elem[instances]; _i < _a.length; _i++) {
            var inst = _a[_i];
            if (inst instanceof component) {
                return inst;
            }
        }
    }
    return null;
}
/**
 * Function to add instances for the given element.
 * @param {string | HTMLElement} element
 * @param {Object} instance
 * @return {void}
 * @private
 */
function addInstance(element, instance) {
    // tslint:disable-next-line:no-any
    var elem = (typeof (element) === 'string') ? document.querySelector(element) : element;
    if (elem[instances]) {
        elem[instances].push(instance);
    }
    else {
        elem[instances] = [instance];
    }
}
/**
 * Function to generate the unique id.
 * @return {any}
 * @private
 */
// tslint:disable-next-line:no-any
function uniqueID() {
    // tslint:disable-next-line:no-any
    if ((typeof window) === 'undefined') {
        return;
    }
    // tslint:disable-next-line:no-any
    var num = new Uint16Array(5);
    var intCrypto = window.msCrypto || window.crypto;
    return intCrypto.getRandomValues(num);
}
function combineArray(num) {
    var ret = '';
    for (var i = 0; i < 5; i++) {
        ret += (i ? ',' : '') + num[i];
    }
    return ret;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-base/virtual-dom.js":
/*!***************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-base/virtual-dom.js ***!
  \***************************************************************/
/*! exports provided: VirtualDOM */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualDOM", function() { return VirtualDOM; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-base/util.js");
/* harmony import */ var _template_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./template-engine */ "./ej2-resources/18.4.46/scripts/ej2-base/template-engine.js");


var simpleRegex = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/;
var multipleSplitRegex = /(?:#([\w-]+)|(\w+)|\.([\w-]+))/g;
var idClassSelector = /^(\.|#)/;
var selectMapper = {
    '.': 'className',
    '#': 'id'
};
var classRegexString = '(?=.*?\\b{value}\\b)';
var assigner = { className: 'attributes.className', id: 'attributes.id', tagName: 'tagName' };
var emptyElements = ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input',
    'link', 'meta', 'param', 'embed', 'command', 'keygen', 'source', 'track', 'wbr'];
var blockElements = ['a', 'address', 'article', 'applet', 'aside', 'audio', 'blockquote',
    'button', 'canvas', 'center', 'dd', 'del', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure',
    'footer', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'iframe', 'ins',
    'isindex', 'li', 'map', 'menu', 'noframes', 'noscript', 'object', 'ol', 'output', 'p', 'pre', 'section',
    'script', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul', 'video'];
var inlineElement = ['abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo', 'big', 'br', 'button',
    'cite', 'code', 'del', 'dfn', 'em', 'font', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map',
    'object', 'q', 's', 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'textarea',
    'tt', 'u', 'var'];
var selfClosingElements = ['colgroup', 'dd', 'dt', 'li', 'options', 'p', 'td', 'tfoot', 'th',
    'thead', 'tr'];
var fillAttrs = ['checked', 'compact', 'declare', 'defer', 'disabled', 'ismap', 'multiple',
    'nohref', 'noresize', 'noshade', 'nowrap', 'readonly', 'selected'];
var cspElement = ['Script', 'style'];
var nameMapper = { 'tabindex': 'tabIndex' };
var startRegex = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
var endRegex = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
var attributeRegex = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
/**
 * Namespace for VirtualDOM
 * @private
 */
var VirtualDOM;
(function (VirtualDOM) {
    //tslint:disable:no-any
    function createElement(tagName, properties) {
        var children = [];
        var extended = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, properties, true);
        if (!Object(_util__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties)) {
            var keys = Object.keys(properties);
            if (keys.length) {
                if (extended.innerHTML) {
                    children = ConvertHTMLToJSon(extended.innerHTML);
                    delete extended.innerHTML;
                }
                if (extended.attrs) {
                    Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(extended, extended.attrs);
                    delete extended.attrs;
                }
                if (extended.styles) {
                    var valArr = extended.styles.split(';');
                    var vObj = {};
                    for (var i = 0, length_1 = valArr.length; i < length_1; i++) {
                        var cVal = valArr[i];
                        var styleSplit = cVal.split(':');
                        vObj[styleSplit[0]] = styleSplit[1];
                    }
                    delete extended.styles;
                    extended.style = vObj;
                }
            }
        }
        return {
            tagName: tagName,
            attributes: extended || {},
            children: children
        };
    }
    VirtualDOM.createElement = createElement;
    function assignParent(childrens, parent) {
        if (parent && childrens) {
            childrens.forEach(function (child) {
                if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isObject"])(child)) {
                    if (child.parent) {
                        detach(child);
                    }
                    child.parent = parent;
                }
                return child;
            });
        }
    }
    VirtualDOM.assignParent = assignParent;
    function append(fromElements, toElement) {
        assignParent(fromElements, toElement);
        if (toElement.children) {
            toElement.children = toElement.children.concat(fromElements);
        }
        else {
            toElement.children = [].concat(fromElements);
        }
    }
    VirtualDOM.append = append;
    function prepend(child, toElement) {
        assignParent(child, toElement);
        if (!toElement.children || !toElement.children.length) {
            toElement.children = [];
            toElement.children.concat(child);
        }
        else {
            for (var i = child.length - 1; i >= 0; i--) {
                toElement.children.unshift(child[i]);
            }
        }
    }
    VirtualDOM.prepend = prepend;
    function detach(element) {
        var parent = element.parent;
        if (parent) {
            var index = parent.children.indexOf(element);
            if (index !== -1) {
                parent.children.splice(index);
            }
        }
        return parent;
    }
    VirtualDOM.detach = detach;
    //tslint:disable-next-line
    function vDomSelector(_a) {
        var ele = _a.ele, selector = _a.selector, selectAll = _a.selectAll, immediateParent = _a.immediateParent;
        var iSelector = selector.split(' ');
        var curColl = ele;
        for (var i = 0, length_2 = iSelector.length; i < length_2; i++) {
            var isDescendant = false;
            var parent_2 = curColl;
            var curSelector = iSelector[i];
            var simpleSelector = false;
            var mapper = [];
            if (simpleRegex.test(curSelector)) {
                simpleSelector = true;
                processSelector(curSelector, mapper);
            }
            else if (curSelector.indexOf('>') === -1) {
                var splitSelector = curSelector.match(multipleSplitRegex);
                for (var _i = 0, splitSelector_1 = splitSelector; _i < splitSelector_1.length; _i++) {
                    var curMap = splitSelector_1[_i];
                    processSelector(curMap, mapper);
                }
            }
            else if (curSelector.indexOf('>') !== -1) {
                isDescendant = true;
                var dSelector = curSelector.split('>');
                //tslint:disable-next-line
                var dParent = ele;
                var descendent = void 0;
                var flag = 0;
                for (var _b = 0, dSelector_1 = dSelector; _b < dSelector_1.length; _b++) {
                    var sel = dSelector_1[_b];
                    if (!dParent) {
                        break;
                    }
                    if (dParent.length) {
                        var descendentChild = [];
                        for (var _c = 0, dParent_1 = dParent; _c < dParent_1.length; _c++) {
                            var child = dParent_1[_c];
                            descendentChild = descendentChild.concat(vDomSelector({
                                ele: child, selector: sel,
                                selectAll: selectAll, immediateParent: !!flag
                            }));
                        }
                        descendent = descendentChild;
                    }
                    else {
                        descendent = vDomSelector({ ele: dParent, selector: sel, selectAll: selectAll, immediateParent: !!flag });
                    }
                    flag++;
                    dParent = descendent;
                }
                if (descendent) {
                    curColl = descendent;
                }
            }
            if (!isDescendant) {
                if (parent_2.length) {
                    var iCurSelector = [];
                    for (var _d = 0, parent_1 = parent_2; _d < parent_1.length; _d++) {
                        var curParent = parent_1[_d];
                        iCurSelector = iCurSelector.concat(accessElement(curParent, mapper, selectAll, immediateParent));
                    }
                    curColl = iCurSelector;
                }
                else {
                    curColl = accessElement(parent_2, mapper, selectAll, immediateParent);
                }
            }
        }
        if (selectAll) {
            return curColl;
        }
        else {
            return curColl[0] || null;
        }
    }
    VirtualDOM.vDomSelector = vDomSelector;
    function processSelector(selector, mapper) {
        var match = selector.match(idClassSelector);
        var obj = {};
        if (match) {
            var curMapper = selectMapper[match[0]];
            if (curMapper === 'className') {
                var curObj = mapper.filter(function (obj) { return obj.hasOwnProperty('className'); })[0];
                var canPush = false;
                if (!curObj) {
                    canPush = true;
                    curObj = {};
                }
                var existValue = curObj[curMapper] || '';
                curObj[curMapper] = existValue + classRegexString.replace('{value}', selector.replace('.', ''));
                if (canPush) {
                    mapper.push(curObj);
                }
            }
            else {
                obj[curMapper] = selector.replace(match[0], '');
                mapper.push(obj);
            }
        }
        else {
            mapper.push({ tagName: selector });
        }
    }
    //tslint:disable-next-line
    function accessElement(ele, mapper, selectAll, immediateParent) {
        if (ele.children) {
            //tslint:disable-next-line
            var temp_1 = ele.children.filter(function (child) {
                if (typeof (child) !== 'string') {
                    var matched = true;
                    for (var _i = 0, mapper_1 = mapper; _i < mapper_1.length; _i++) {
                        var map = mapper_1[_i];
                        var key = Object.keys(map)[0];
                        var expected = map[key];
                        var actualValue = Object(_util__WEBPACK_IMPORTED_MODULE_0__["getValue"])(assigner[key], child);
                        if (key === 'className') {
                            if (!(new RegExp('^' + expected + '.*$').test(actualValue))) {
                                matched = false;
                                break;
                            }
                        }
                        else if (actualValue !== expected) {
                            matched = false;
                            break;
                        }
                    }
                    return matched;
                }
                else {
                    return false;
                }
            });
            if (!immediateParent && (!temp_1.length || selectAll)) {
                ele.children.forEach(function (child) {
                    if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isObject"])(child)) {
                        temp_1 = temp_1.concat(accessElement(child, mapper, selectAll));
                    }
                });
            }
            return temp_1;
        }
        else {
            return [];
        }
    }
    VirtualDOM.accessElement = accessElement;
    function ConvertHTMLToJSon(htmlString) {
        var results = [];
        var isText;
        var tagArray = [];
        var backup = htmlString;
        var nodeArray = [];
        while (htmlString) {
            isText = true;
            var lastVal = getLastValue(tagArray);
            if (!lastVal || !contains(cspElement, lastVal)) {
                if (htmlString.indexOf('</') === 0) {
                    var match = htmlString.match(endRegex);
                    if (match) {
                        htmlString = htmlString.substring(match[0].length);
                        //tslint:disable-next-line
                        match[0].replace(endRegex, iterateEndTag);
                    }
                    isText = false;
                }
                else if (htmlString.indexOf('<') === 0) {
                    var match = htmlString.match(startRegex);
                    if (match) {
                        htmlString = htmlString.substring(match[0].length);
                        //tslint:disable-next-line
                        match[0].replace(startRegex, iterateStartTag);
                    }
                    isText = false;
                }
                if (isText) {
                    var tagIndex = htmlString.indexOf('<');
                    var text = tagIndex < 0 ? htmlString : htmlString.substring(0, tagIndex);
                    htmlString = tagIndex < 0 ? '' : htmlString.substring(tagIndex);
                    iterateText(text);
                }
            }
            else {
                //tslint:disable-next-line
                htmlString = htmlString.replace(new RegExp('([\\s\\S]*?)<\/' + getLastValue(nodeArray) + '[^>]*>'), function (all, text) {
                    text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, '$1$2');
                    iterateText(text);
                    return '';
                });
                iterateEndTag('', getLastValue(tagArray));
            }
            backup = htmlString;
        }
        function iterateStartTag(start, tagName, rest) {
            tagName = tagName.toLowerCase();
            if (contains(blockElements, tagName)) {
                while (getLastValue(tagArray) && contains(inlineElement, getLastValue(tagArray))) {
                    iterateEndTag('', getLastValue(tagArray));
                }
            }
            if (contains(selfClosingElements, tagName) && getLastValue(tagArray)) {
                iterateEndTag('', tagName);
            }
            var isSelfTag = contains(emptyElements, tagName);
            if (!isSelfTag) {
                tagArray.push(tagName);
            }
            var attrs = {};
            //tslint:disable-next-line
            rest.replace(attributeRegex, function (match, name) {
                var names = [];
                for (var _i = 2; _i < arguments.length; _i++) {
                    names[_i - 2] = arguments[_i];
                }
                //tslint:disable-next-line
                var val = names[2] ? names[2] :
                    names[3] ? names[3] :
                        names[4] ? names[4] :
                            contains(fillAttrs, name) ? name : '';
                if (name === 'style') {
                    var valArr = val.split(';');
                    var vObj = {};
                    for (var i = 0, length_3 = valArr.length; i < length_3; i++) {
                        var cVal = valArr[i];
                        var styleSplit = cVal.split(':');
                        vObj[styleSplit[0]] = styleSplit[1];
                    }
                    val = vObj;
                }
                name = nameMapper[name] || name;
                attrs[name] = val;
                //tslint:disable-next-line
            });
            attrs['data-id'] = Object(_template_engine__WEBPACK_IMPORTED_MODULE_1__["getRandomId"])();
            var tagObject = {
                tagName: tagName,
                attributes: attrs
            };
            if (isSelfTag) {
                var parent_3 = (nodeArray[0] || results);
                if (parent_3.children === undefined) {
                    parent_3.children = [];
                }
                tagObject.parent = parent_3;
                parent_3.children.push(tagObject);
            }
            else {
                nodeArray.unshift(tagObject);
            }
        }
        function iterateEndTag(start, tagName) {
            var pos;
            if (!tagName) {
                pos = 0;
            }
            else {
                for (pos = tagArray.length - 1; pos >= 0; pos--) {
                    if (tagArray[pos] === tagName) {
                        break;
                    }
                }
            }
            if (pos >= 0) {
                for (var j = nodeArray.length - 1; j >= pos; j--) {
                    //tslint:disable-next-line
                    var node = nodeArray.shift();
                    if (nodeArray.length === 0) {
                        results.push(node);
                    }
                    else {
                        var parent_4 = nodeArray[0];
                        if (parent_4.children === undefined) {
                            parent_4.children = [];
                        }
                        node.parent = parent_4;
                        parent_4.children.push(node);
                    }
                }
                tagArray.length = pos;
            }
        }
        function iterateText(text) {
            if (nodeArray.length === 0) {
                results.push(text);
            }
            else {
                var parent_5 = nodeArray[0];
                if (parent_5.children === undefined) {
                    parent_5.children = [];
                }
                parent_5.children.push(text);
            }
        }
        return results;
    }
    VirtualDOM.ConvertHTMLToJSon = ConvertHTMLToJSon;
    //tslint:disable-next-line 
    function getLastValue(arr) {
        return arr[arr.length - 1];
    }
    function contains(arr, key) {
        return arr.indexOf(key) !== -1;
    }
    //tslint:disable-next-line
    function cloneNode(ele, deep) {
        if (Object(_util__WEBPACK_IMPORTED_MODULE_0__["isObject"])(ele)) {
            if (deep) {
                return Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, ele, true);
            }
            else {
                return { tagName: ele.tagName, attributes: ele.attributes };
            }
        }
        else {
            return ele.cloneNode(deep);
        }
    }
    VirtualDOM.cloneNode = cloneNode;
    function setStyleAttribute(element, attrs) {
        if (element.attributes.style) {
            (element.attributes).style = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, attrs);
        }
        else {
            element.attributes.style = Object(_util__WEBPACK_IMPORTED_MODULE_0__["extend"])(element.attributes.style, attrs);
        }
    }
    VirtualDOM.setStyleAttribute = setStyleAttribute;
    //tslint:enable:no-any
})(VirtualDOM || (VirtualDOM = {}));


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/button/button.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/button/button.js ***!
  \********************************************************************/
/*! exports provided: buttonObserver, Button */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buttonObserver", function() { return buttonObserver; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return Button; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var buttonObserver = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Observer"]();
var cssClassName = {
    RTL: 'e-rtl',
    BUTTON: 'e-btn',
    PRIMARY: 'e-primary',
    ICONBTN: 'e-icon-btn'
};
/**
 * The Button is a graphical user interface element that triggers an event on its click action. It can contain a text, an image, or both.
 * ```html
 * <button id="button">Button</button>
 * ```
 * ```typescript
 * <script>
 * var btnObj = new Button();
 * btnObj.appendTo("#button");
 * </script>
 * ```
 */
var Button = /** @__PURE__ @class */ (function (_super) {
    __extends(Button, _super);
    /**
     * Constructor for creating the widget
     * @param  {ButtonModel} options?
     * @param  {string|HTMLButtonElement} element?
     */
    function Button(options, element) {
        return _super.call(this, options, element) || this;
    }
    Button.prototype.preRender = function () {
        // pre render code snippets
    };
    /**
     * Initialize the control rendering
     * @returns void
     * @private
     */
    Button.prototype.render = function () {
        this.initialize();
        this.removeRippleEffect = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, { selector: '.' + cssClassName.BUTTON });
        this.renderComplete();
    };
    Button.prototype.initialize = function () {
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.cssClass.split(' '));
        }
        if (this.isPrimary) {
            this.element.classList.add(cssClassName.PRIMARY);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.getModuleName() !== 'progress-btn')) {
            if (this.content) {
                var tempContent = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.content) : this.content;
                this.element.innerHTML = tempContent;
            }
            this.setIconCss();
        }
        if (this.enableRtl) {
            this.element.classList.add(cssClassName.RTL);
        }
        if (this.disabled) {
            this.controlStatus(this.disabled);
        }
        else {
            this.wireEvents();
        }
    };
    Button.prototype.controlStatus = function (disabled) {
        this.element.disabled = disabled;
    };
    Button.prototype.setIconCss = function () {
        if (this.iconCss) {
            var span = this.createElement('span', { className: 'e-btn-icon ' + this.iconCss });
            if (!this.element.textContent.trim()) {
                this.element.classList.add(cssClassName.ICONBTN);
            }
            else {
                span.classList.add('e-icon-' + this.iconPosition.toLowerCase());
                if (this.iconPosition === 'Top' || this.iconPosition === 'Bottom') {
                    this.element.classList.add('e-' + this.iconPosition.toLowerCase() + '-icon-btn');
                }
            }
            var node = this.element.childNodes[0];
            if (node && (this.iconPosition === 'Left' || this.iconPosition === 'Top')) {
                this.element.insertBefore(span, node);
            }
            else {
                this.element.appendChild(span);
            }
        }
    };
    Button.prototype.wireEvents = function () {
        if (this.isToggle) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.btnClickHandler, this);
        }
    };
    Button.prototype.unWireEvents = function () {
        if (this.isToggle) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.btnClickHandler);
        }
    };
    Button.prototype.btnClickHandler = function () {
        if (this.element.classList.contains('e-active')) {
            this.element.classList.remove('e-active');
        }
        else {
            this.element.classList.add('e-active');
        }
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    Button.prototype.destroy = function () {
        var span;
        var classList = [cssClassName.PRIMARY, cssClassName.RTL, cssClassName.ICONBTN, 'e-success', 'e-info', 'e-danger',
            'e-warning', 'e-flat', 'e-outline', 'e-small', 'e-bigger', 'e-active', 'e-round',
            'e-top-icon-btn', 'e-bottom-icon-btn'];
        if (this.cssClass) {
            classList = classList.concat(this.cssClass.split(' '));
        }
        _super.prototype.destroy.call(this);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], classList);
        if (!this.element.getAttribute('class')) {
            this.element.removeAttribute('class');
        }
        if (this.disabled) {
            this.element.removeAttribute('disabled');
        }
        if (this.content) {
            this.element.innerHTML = this.element.innerHTML.replace(this.content, '');
        }
        span = this.element.querySelector('span.e-btn-icon');
        if (span) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(span);
        }
        this.unWireEvents();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            this.removeRippleEffect();
        }
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    Button.prototype.getModuleName = function () {
        return 'btn';
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     * @private
     */
    Button.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * Dynamically injects the required modules to the component.
     * @private
     */
    Button.Inject = function () {
        // Inject code snippets
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {ButtonModel} newProp
     * @param  {ButtonModel} oldProp
     * @returns void
     * @private
     */
    Button.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'isPrimary':
                    if (newProp.isPrimary) {
                        this.element.classList.add(cssClassName.PRIMARY);
                    }
                    else {
                        this.element.classList.remove(cssClassName.PRIMARY);
                    }
                    break;
                case 'disabled':
                    this.controlStatus(newProp.disabled);
                    break;
                case 'iconCss':
                    var span = this.element.querySelector('span.e-btn-icon');
                    if (span) {
                        if (newProp.iconCss) {
                            span.className = 'e-btn-icon ' + newProp.iconCss;
                            if (this.element.textContent.trim()) {
                                if (this.iconPosition === 'Left') {
                                    span.classList.add('e-icon-left');
                                }
                                else {
                                    span.classList.add('e-icon-right');
                                }
                            }
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(span);
                        }
                    }
                    else {
                        this.setIconCss();
                    }
                    break;
                case 'iconPosition':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], ['e-top-icon-btn', 'e-bottom-icon-btn']);
                    span = this.element.querySelector('span.e-btn-icon');
                    if (span) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(span);
                    }
                    this.setIconCss();
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newProp.cssClass.split(' '));
                    }
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        this.element.classList.add(cssClassName.RTL);
                    }
                    else {
                        this.element.classList.remove(cssClassName.RTL);
                    }
                    break;
                case 'content':
                    var node = Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["getTextNode"])(this.element);
                    if (!node) {
                        this.element.classList.remove(cssClassName.ICONBTN);
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered && this.getModuleName() !== 'progress-btn')) {
                        if (this.enableHtmlSanitizer) {
                            newProp.content = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(newProp.content);
                        }
                        this.element.innerHTML = newProp.content;
                        this.setIconCss();
                    }
                    break;
                case 'isToggle':
                    if (newProp.isToggle) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.btnClickHandler, this);
                    }
                    else {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.btnClickHandler);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], ['e-active']);
                    }
                    break;
            }
        }
    };
    /**
     * Click the button element
     * its native method
     * @public
     */
    Button.prototype.click = function () {
        this.element.click();
    };
    /**
     * Sets the focus to Button
     * its native method
     * @public
     */
    Button.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], Button.prototype, "iconPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Button.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Button.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Button.prototype, "isPrimary", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Button.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Button.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Button.prototype, "isToggle", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Button.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Button.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Button.prototype, "created", void 0);
    Button = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Button);
    return Button;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/button/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/button/index.js ***!
  \*******************************************************************/
/*! exports provided: buttonObserver, Button */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./button */ "./ej2-resources/18.4.46/scripts/ej2-buttons/button/button.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buttonObserver", function() { return _button__WEBPACK_IMPORTED_MODULE_0__["buttonObserver"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return _button__WEBPACK_IMPORTED_MODULE_0__["Button"]; });

/**
 * Button modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/check-box.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/check-box.js ***!
  \**************************************************************************/
/*! exports provided: CheckBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckBox", function() { return CheckBox; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../common/common */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var CHECK = 'e-check';
var DISABLED = 'e-checkbox-disabled';
var FRAME = 'e-frame';
var INDETERMINATE = 'e-stop';
var LABEL = 'e-label';
var RIPPLE = 'e-ripple-container';
var RIPPLECHECK = 'e-ripple-check';
var RIPPLEINDETERMINATE = 'e-ripple-stop';
var RTL = 'e-rtl';
var WRAPPER = 'e-checkbox-wrapper';
var containerAttr = ['title', 'class', 'style', 'disabled', 'readonly', 'name', 'value'];
/**
 * The CheckBox is a graphical user interface element that allows you to select one or more options from the choices.
 * It contains checked, unchecked, and indeterminate states.
 * ```html
 * <input type="checkbox" id="checkbox"/>
 * <script>
 * var checkboxObj = new CheckBox({ label: "Default" });
 * checkboxObj.appendTo("#checkbox");
 * </script>
 * ```
 */
var CheckBox = /** @__PURE__ @class */ (function (_super) {
    __extends(CheckBox, _super);
    /**
     * Constructor for creating the widget
     * @private
     */
    function CheckBox(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isFocused = false;
        _this.isMouseClick = false;
        return _this;
    }
    CheckBox.prototype.changeState = function (state) {
        var ariaState;
        var rippleSpan;
        var frameSpan = this.getWrapper().getElementsByClassName(FRAME)[0];
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];
        }
        if (state === 'check') {
            frameSpan.classList.remove(INDETERMINATE);
            frameSpan.classList.add(CHECK);
            if (rippleSpan) {
                rippleSpan.classList.remove(RIPPLEINDETERMINATE);
                rippleSpan.classList.add(RIPPLECHECK);
            }
            ariaState = 'true';
            this.element.checked = true;
        }
        else if (state === 'uncheck') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([frameSpan], [CHECK, INDETERMINATE]);
            if (rippleSpan) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([rippleSpan], [RIPPLECHECK, RIPPLEINDETERMINATE]);
            }
            ariaState = 'false';
            this.element.checked = false;
        }
        else {
            frameSpan.classList.remove(CHECK);
            frameSpan.classList.add(INDETERMINATE);
            if (rippleSpan) {
                rippleSpan.classList.remove(RIPPLECHECK);
                rippleSpan.classList.add(RIPPLEINDETERMINATE);
            }
            ariaState = 'mixed';
            this.element.indeterminate = true;
        }
        this.getWrapper().setAttribute('aria-checked', ariaState);
    };
    CheckBox.prototype.clickHandler = function (event) {
        if (this.isMouseClick) {
            this.focusOutHandler();
            this.isMouseClick = false;
        }
        if (this.indeterminate) {
            this.changeState(this.checked ? 'check' : 'uncheck');
            this.indeterminate = false;
            this.element.indeterminate = false;
        }
        else if (this.checked) {
            this.changeState('uncheck');
            this.checked = false;
        }
        else {
            this.changeState('check');
            this.checked = true;
        }
        var changeEventArgs = { checked: this.updateVueArrayModel(false), event: event };
        this.trigger('change', changeEventArgs);
        event.stopPropagation();
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    CheckBox.prototype.destroy = function () {
        var _this = this;
        var wrapper = this.getWrapper();
        _super.prototype.destroy.call(this);
        if (this.wrapper) {
            wrapper = this.wrapper;
            if (!this.disabled) {
                this.unWireEvents();
            }
            if (this.tagName === 'INPUT') {
                if (this.getWrapper() && wrapper.parentNode) {
                    wrapper.parentNode.insertBefore(this.element, wrapper);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(wrapper);
                this.element.checked = false;
                if (this.indeterminate) {
                    this.element.indeterminate = false;
                }
                ['name', 'value', 'disabled'].forEach(function (key) {
                    _this.element.removeAttribute(key);
                });
            }
            else {
                ['role', 'aria-checked', 'class'].forEach(function (key) {
                    wrapper.removeAttribute(key);
                });
                wrapper.innerHTML = '';
            }
        }
    };
    CheckBox.prototype.focusHandler = function () {
        this.isFocused = true;
    };
    CheckBox.prototype.focusOutHandler = function () {
        var wrapper = this.getWrapper();
        if (wrapper) {
            wrapper.classList.remove('e-focus');
        }
        this.isFocused = false;
    };
    /**
     * Gets the module name.
     * @private
     */
    CheckBox.prototype.getModuleName = function () {
        return 'checkbox';
    };
    /**
     * Gets the properties to be maintained in the persistence state.
     * @private
     */
    CheckBox.prototype.getPersistData = function () {
        return this.addOnPersist(['checked', 'indeterminate']);
    };
    CheckBox.prototype.getWrapper = function () {
        if (this.element && this.element.parentElement) {
            return this.element.parentElement.parentElement;
        }
        else {
            return null;
        }
    };
    CheckBox.prototype.initialize = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initialCheckedValue)) {
            this.initialCheckedValue = this.checked;
        }
        if (this.name) {
            this.element.setAttribute('name', this.name);
        }
        if (this.value) {
            this.element.setAttribute('value', this.value);
            if (this.isVue && typeof this.value === 'boolean' && this.value === true) {
                this.setProperties({ 'checked': true }, true);
            }
        }
        if (this.checked) {
            this.changeState('check');
        }
        if (this.indeterminate) {
            this.changeState();
        }
        if (this.disabled) {
            this.setDisabled();
        }
    };
    CheckBox.prototype.initWrapper = function () {
        var wrapper = this.element.parentElement;
        if (!wrapper.classList.contains(WRAPPER)) {
            wrapper = this.createElement('div', {
                className: WRAPPER, attrs: { 'role': 'checkbox', 'aria-checked': 'false' }
            });
            this.element.parentNode.insertBefore(wrapper, this.element);
        }
        var label = this.createElement('label', { attrs: { for: this.element.id } });
        var frameSpan = this.createElement('span', { className: 'e-icons ' + FRAME });
        wrapper.classList.add('e-wrapper');
        if (this.enableRtl) {
            wrapper.classList.add(RTL);
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.cssClass.split(' '));
        }
        wrapper.appendChild(label);
        label.appendChild(this.element);
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["setHiddenInput"])(this, label);
        label.appendChild(frameSpan);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            var rippleSpan = this.createElement('span', { className: RIPPLE });
            if (this.labelPosition === 'Before') {
                label.appendChild(rippleSpan);
            }
            else {
                label.insertBefore(rippleSpan, frameSpan);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(rippleSpan, { duration: 400, isCenterRipple: true });
        }
        if (this.label) {
            this.setText(this.label);
        }
    };
    CheckBox.prototype.keyUpHandler = function () {
        if (this.isFocused) {
            this.getWrapper().classList.add('e-focus');
        }
    };
    CheckBox.prototype.labelMouseHandler = function (e) {
        this.isMouseClick = true;
        var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["rippleMouseHandler"])(e, rippleSpan);
    };
    /**
     * Called internally if any of the property value changes.
     * @private
     */
    CheckBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        var wrapper = this.getWrapper();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'checked':
                    this.indeterminate = false;
                    this.element.indeterminate = false;
                    this.changeState(newProp.checked ? 'check' : 'uncheck');
                    break;
                case 'indeterminate':
                    if (newProp.indeterminate) {
                        this.changeState();
                    }
                    else {
                        this.element.indeterminate = false;
                        this.changeState(this.checked ? 'check' : 'uncheck');
                    }
                    break;
                case 'disabled':
                    if (newProp.disabled) {
                        this.setDisabled();
                        this.wrapper = this.getWrapper();
                        this.unWireEvents();
                    }
                    else {
                        this.element.disabled = false;
                        wrapper.classList.remove(DISABLED);
                        wrapper.setAttribute('aria-disabled', 'false');
                        this.wireEvents();
                    }
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([wrapper], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], newProp.cssClass.split(' '));
                    }
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        wrapper.classList.add(RTL);
                    }
                    else {
                        wrapper.classList.remove(RTL);
                    }
                    break;
                case 'label':
                    this.setText(newProp.label);
                    break;
                case 'labelPosition':
                    var label = wrapper.getElementsByClassName(LABEL)[0];
                    var labelWrap = wrapper.getElementsByTagName('label')[0];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(label);
                    if (newProp.labelPosition === 'After') {
                        labelWrap.appendChild(label);
                    }
                    else {
                        labelWrap.insertBefore(label, wrapper.getElementsByClassName(FRAME)[0]);
                    }
                    break;
                case 'name':
                    this.element.setAttribute('name', newProp.name);
                    break;
                case 'value':
                    if (this.isVue && typeof newProp.value === 'object') {
                        break;
                    }
                    this.element.setAttribute('value', newProp.value);
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttributeToWrapper();
                    break;
            }
        }
    };
    /**
     * Initialize Angular, React and Unique ID support.
     * @private
     */
    CheckBox.prototype.preRender = function () {
        var element = this.element;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        this.tagName = this.element.tagName;
        element = Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["wrapperInitialize"])(this.createElement, 'EJS-CHECKBOX', 'checkbox', element, WRAPPER, 'checkbox');
        this.element = element;
        if (this.element.getAttribute('type') !== 'checkbox') {
            this.element.setAttribute('type', 'checkbox');
        }
        if (!this.element.id) {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + this.getModuleName());
        }
    };
    /**
     * Initialize the control rendering.
     * @private
     */
    CheckBox.prototype.render = function () {
        this.initWrapper();
        this.initialize();
        if (!this.disabled) {
            this.wireEvents();
        }
        this.updateHtmlAttributeToWrapper();
        this.updateVueArrayModel(true);
        this.renderComplete();
        this.wrapper = this.getWrapper();
    };
    CheckBox.prototype.setDisabled = function () {
        var wrapper = this.getWrapper();
        this.element.disabled = true;
        wrapper.classList.add(DISABLED);
        wrapper.setAttribute('aria-disabled', 'true');
    };
    CheckBox.prototype.setText = function (text) {
        var wrapper = this.getWrapper();
        if (!wrapper) {
            return;
        }
        var label = wrapper.getElementsByClassName(LABEL)[0];
        if (label) {
            label.textContent = text;
        }
        else {
            text = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(text) : text;
            label = this.createElement('span', { className: LABEL, innerHTML: text });
            var labelWrap = wrapper.getElementsByTagName('label')[0];
            if (this.labelPosition === 'Before') {
                labelWrap.insertBefore(label, wrapper.getElementsByClassName(FRAME)[0]);
            }
            else {
                labelWrap.appendChild(label);
            }
        }
    };
    CheckBox.prototype.changeHandler = function (e) {
        e.stopPropagation();
    };
    CheckBox.prototype.formResetHandler = function () {
        this.checked = this.initialCheckedValue;
        this.element.checked = this.initialCheckedValue;
    };
    CheckBox.prototype.unWireEvents = function () {
        var wrapper = this.wrapper;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', this.keyUpHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.focusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focusout', this.focusOutHandler);
        var label = wrapper.getElementsByTagName('label')[0];
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(label, 'mousedown', this.labelMouseHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(label, 'mouseup', this.labelMouseHandler);
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
        if (this.tagName === 'EJS-CHECKBOX') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'change', this.changeHandler);
        }
    };
    CheckBox.prototype.wireEvents = function () {
        var wrapper = this.getWrapper();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', this.keyUpHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.focusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.focusOutHandler, this);
        var label = wrapper.getElementsByTagName('label')[0];
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(label, 'mousedown', this.labelMouseHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(label, 'mouseup', this.labelMouseHandler, this);
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
        if (this.tagName === 'EJS-CHECKBOX') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'change', this.changeHandler, this);
        }
    };
    CheckBox.prototype.updateVueArrayModel = function (init) {
        if (this.isVue && typeof this.value === 'object') {
            var value = this.element.value;
            if (value && this.value) {
                if (init) {
                    for (var i = 0; i < this.value.length; i++) {
                        if (value === this.value[i]) {
                            this.changeState('check');
                            this.setProperties({ 'checked': true }, true);
                        }
                    }
                }
                else {
                    var index = this.value.indexOf(value);
                    if (this.checked) {
                        if (index < 0) {
                            this.value.push(value);
                        }
                    }
                    else {
                        if (index > -1) {
                            this.value.splice(index, 1);
                        }
                    }
                    // tslint:disable-next-line:no-any
                    return this.value;
                }
            }
        }
        return this.element.checked;
    };
    CheckBox.prototype.updateHtmlAttributeToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (containerAttr.indexOf(key) > -1) {
                    var wrapper = this.getWrapper();
                    if (key === 'class') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.htmlAttributes[key].split(' '));
                    }
                    else if (key === 'title') {
                        wrapper.setAttribute(key, this.htmlAttributes[key]);
                    }
                    else if (key === 'style') {
                        var frameSpan = this.getWrapper().getElementsByClassName(FRAME)[0];
                        frameSpan.setAttribute(key, this.htmlAttributes[key]);
                    }
                    else {
                        this.element.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    /**
     * Click the CheckBox element
     * its native method
     * @public
     */
    CheckBox.prototype.click = function () {
        this.element.click();
    };
    /**
     * Sets the focus to CheckBox
     * its native method
     * @public
     */
    CheckBox.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CheckBox.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CheckBox.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CheckBox.prototype, "checked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], CheckBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CheckBox.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CheckBox.prototype, "indeterminate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], CheckBox.prototype, "label", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('After')
    ], CheckBox.prototype, "labelPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], CheckBox.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], CheckBox.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CheckBox.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], CheckBox.prototype, "htmlAttributes", void 0);
    CheckBox = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], CheckBox);
    return CheckBox;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/index.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/index.js ***!
  \**********************************************************************/
/*! exports provided: CheckBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _check_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./check-box */ "./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/check-box.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckBox", function() { return _check_box__WEBPACK_IMPORTED_MODULE_0__["CheckBox"]; });

/**
 * CheckBox modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip-list.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip-list.js ***!
  \**********************************************************************/
/*! exports provided: classNames, ChipList */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return classNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChipList", function() { return ChipList; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var classNames = {
    chipSet: 'e-chip-set',
    chip: 'e-chip',
    avatar: 'e-chip-avatar',
    text: 'e-chip-text',
    icon: 'e-chip-icon',
    delete: 'e-chip-delete',
    deleteIcon: 'e-dlt-btn',
    multiSelection: 'e-multi-selection',
    singleSelection: 'e-selection',
    active: 'e-active',
    chipWrapper: 'e-chip-avatar-wrap',
    iconWrapper: 'e-chip-icon-wrap',
    focused: 'e-focused',
    disabled: 'e-disabled',
    rtl: 'e-rtl',
};
/**
 * A chip component is a small block of essential information, mostly used on contacts or filter tags.
 * ```html
 * <div id="chip"></div>
 * ```
 * ```typescript
 * <script>
 * var chipObj = new ChipList();
 * chipObj.appendTo("#chip");
 * </script>
 * ```
 */
var ChipList = /** @__PURE__ @class */ (function (_super) {
    __extends(ChipList, _super);
    function ChipList(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.multiSelectedChip = [];
        return _this;
    }
    /**
     * Initialize the event handler
     * @private
     */
    ChipList.prototype.preRender = function () {
        //prerender
    };
    /**
     * To find the chips length.
     * @returns boolean
     * @private
     */
    ChipList.prototype.chipType = function () {
        return (this.chips && this.chips.length && this.chips.length > 0);
    };
    /**
     * To Initialize the control rendering.
     * @returns void
     * @private
     */
    ChipList.prototype.render = function () {
        var property;
        this.type = this.chips.length ? 'chipset' : (this.text || this.element.innerText ? 'chip' : 'chipset');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.setAttributes();
            this.createChip();
            this.setRtl();
            this.select(this.selectedChips, property);
        }
        this.wireEvent(false);
        this.rippleFunction = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, {
            selector: '.e-chip'
        });
        this.renderComplete();
    };
    ChipList.prototype.createChip = function () {
        this.innerText = this.element.innerText.trim();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var childElement = this.element.querySelectorAll('.e-chip');
            for (var i = 0; i < childElement.length; i++) {
                if (childElement[i] != null) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(childElement[i]);
                }
            }
        }
        else {
            this.element.innerHTML = '';
        }
        this.chipCreation(this.type === 'chip' ? [this.innerText ? this.innerText : this.text] : this.chips);
    };
    ChipList.prototype.setAttributes = function () {
        if (this.type === 'chip') {
            this.element.tabIndex = 0;
            this.element.setAttribute('role', 'option');
        }
        else {
            this.element.classList.add(classNames.chipSet);
            this.element.setAttribute('role', 'listbox');
            if (this.selection === 'Multiple') {
                this.element.classList.add(classNames.multiSelection);
                this.element.setAttribute('aria-multiselectable', 'true');
            }
            else if (this.selection === 'Single') {
                this.element.classList.add(classNames.singleSelection);
                this.element.setAttribute('aria-multiselectable', 'false');
            }
            else {
                this.element.setAttribute('aria-multiselectable', 'false');
            }
        }
    };
    ChipList.prototype.setRtl = function () {
        this.element.classList[this.enableRtl ? 'add' : 'remove'](classNames.rtl);
    };
    ChipList.prototype.chipCreation = function (data) {
        var chipListArray = [];
        for (var i = 0; i < data.length; i++) {
            var fieldsData = this.getFieldValues(data[i]);
            var chipArray = this.elementCreation(fieldsData);
            var className = (classNames.chip + ' ' + (fieldsData.enabled ? ' ' : classNames.disabled) + ' ' +
                (fieldsData.avatarIconCss || fieldsData.avatarText ? classNames.chipWrapper : (fieldsData.leadingIconCss ?
                    classNames.iconWrapper : ' ')) + ' ' + fieldsData.cssClass).split(' ').filter(function (css) { return css; });
            if (!this.chipType()) {
                chipListArray = chipArray;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], className);
                this.element.setAttribute('aria-label', fieldsData.text);
                if (fieldsData.value) {
                    this.element.setAttribute('data-value', fieldsData.value.toString());
                }
            }
            else {
                var wrapper = this.createElement('DIV', {
                    className: className.join(' '), attrs: {
                        tabIndex: '0', role: 'option',
                        'aria-label': fieldsData.text, 'aria-selected': 'false'
                    }
                });
                if (fieldsData.value) {
                    wrapper.setAttribute('data-value', fieldsData.value.toString());
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(chipArray, wrapper);
                chipListArray.push(wrapper);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(chipListArray, this.element);
    };
    ChipList.prototype.getFieldValues = function (data) {
        var chipEnabled = !(this.enabled.toString() === 'false');
        var fields = {
            text: typeof data === 'object' ? (data.text ? data.text.toString() : this.text.toString()) :
                (!this.chipType() ? (this.innerText ? this.innerText : this.text.toString()) : data.toString()),
            cssClass: typeof data === 'object' ? (data.cssClass ? data.cssClass.toString() : this.cssClass.toString()) :
                (this.cssClass.toString()),
            leadingIconCss: typeof data === 'object' ? (data.leadingIconCss ? data.leadingIconCss.toString() :
                this.leadingIconCss.toString()) : (this.leadingIconCss.toString()),
            avatarIconCss: typeof data === 'object' ? (data.avatarIconCss ? data.avatarIconCss.toString() :
                this.avatarIconCss.toString()) : (this.avatarIconCss.toString()),
            avatarText: typeof data === 'object' ? (data.avatarText ? data.avatarText.toString() : this.avatarText.toString()) :
                (this.avatarText.toString()),
            trailingIconCss: typeof data === 'object' ? (data.trailingIconCss ? data.trailingIconCss.toString() :
                this.trailingIconCss.toString()) : (this.trailingIconCss.toString()),
            enabled: typeof data === 'object' ? (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.enabled) ? (data.enabled.toString() === 'false' ? false : true) :
                chipEnabled) : (chipEnabled),
            value: typeof data === 'object' ? ((data.value ? data.value.toString() : null)) : null,
            leadingIconUrl: typeof data === 'object' ? (data.leadingIconUrl ? data.leadingIconUrl.toString() : this.leadingIconUrl) :
                this.leadingIconUrl,
            trailingIconUrl: typeof data === 'object' ? (data.trailingIconUrl ? data.trailingIconUrl.toString() : this.trailingIconUrl) :
                this.trailingIconUrl
        };
        return fields;
    };
    ChipList.prototype.elementCreation = function (fields) {
        var chipArray = [];
        if (fields.avatarText || fields.avatarIconCss) {
            var className = (classNames.avatar + ' ' + fields.avatarIconCss).trim();
            var chipAvatarElement = this.createElement('span', { className: className });
            chipAvatarElement.innerText = fields.avatarText;
            chipArray.push(chipAvatarElement);
        }
        else if (fields.leadingIconCss) {
            var className = (classNames.icon + ' ' + fields.leadingIconCss).trim();
            var chipIconElement = this.createElement('span', { className: className });
            chipArray.push(chipIconElement);
        }
        else if (fields.leadingIconUrl) {
            var className = (classNames.avatar + ' ' + 'image-url').trim();
            var chipIconElement = this.createElement('span', { className: className });
            chipIconElement.style.backgroundImage = 'url(' + fields.leadingIconUrl + ')';
            chipArray.push(chipIconElement);
        }
        var chipTextElement = this.createElement('span', { className: classNames.text });
        chipTextElement.innerText = fields.text;
        chipArray.push(chipTextElement);
        if (fields.trailingIconCss || (this.chipType() && this.enableDelete)) {
            var className = (classNames.delete + ' ' +
                (fields.trailingIconCss ? fields.trailingIconCss : classNames.deleteIcon)).trim();
            var chipdeleteElement = this.createElement('span', { className: className });
            chipArray.push(chipdeleteElement);
        }
        else if (fields.trailingIconUrl) {
            var className = ('trailing-icon-url').trim();
            var chipIconsElement = this.createElement('span', { className: className });
            chipIconsElement.style.backgroundImage = 'url(' + fields.trailingIconUrl + ')';
            chipArray.push(chipIconsElement);
        }
        return chipArray;
    };
    /**
     * A function that finds chip based on given input.
     * @param  {number | HTMLElement } fields - We can pass index number or element of chip.
     * {% codeBlock src='chips/find/index.md' %}{% endcodeBlock %}
     */
    ChipList.prototype.find = function (fields) {
        var chipData;
        var chipElement = fields instanceof HTMLElement ?
            fields : this.element.querySelectorAll('.' + classNames.chip)[fields];
        if (chipElement && this.chipType()) {
            chipData = { text: undefined, index: undefined, element: undefined, data: undefined };
            chipData.index = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.chip)).indexOf(chipElement);
            chipData.text = typeof this.chips[chipData.index] === 'object' ?
                (this.chips[chipData.index].text ?
                    this.chips[chipData.index].text.toString() : '') :
                this.chips[chipData.index].toString();
            chipData.data = this.chips[chipData.index];
            chipData.element = chipElement;
        }
        return chipData;
    };
    /**
     * Allows adding the chip item(s) by passing a single or array of string, number, or ChipModel values.
     * @param  {string[] | number[] | ChipModel[] | string | number | ChipModel} chipsData - We can pass array of string or
     *  array of number or array of chip model or string data or number data or chip model.
     * {% codeBlock src='chips/add/index.md' %}{% endcodeBlock %}

     */
    ChipList.prototype.add = function (chipsData) {
        var _a;
        if (this.type !== 'chip') {
            var fieldData = chipsData instanceof Array ?
                chipsData : [chipsData];
            (_a = this.chips).push.apply(_a, fieldData);
            this.chipCreation(fieldData);
        }
    };
    /**
     * Allows selecting the chip item(s) by passing a single or array of string, number, or ChipModel values.
     * @param  {number | number[] | HTMLElement | HTMLElement[]} fields - We can pass number or array of number
     *  or chip element or array of chip element.
     * {% codeBlock src='chips/select/index.md' %}{% endcodeBlock %}
     */
    ChipList.prototype.select = function (fields, selectionType) {
        this.onSelect(fields, false, selectionType);
    };
    ChipList.prototype.multiSelection = function (newProp) {
        var items = this.element.querySelectorAll('.' + 'e-chip');
        for (var j = 0; j < newProp.length; j++) {
            if (typeof newProp[j] === 'string') {
                for (var k = 0; k < items.length; k++) {
                    if (newProp[j] !== k) {
                        if (newProp[j] === items[k].attributes[5].value) {
                            this.multiSelectedChip.push(k);
                            break;
                        }
                    }
                }
            }
            else {
                this.multiSelectedChip.push(newProp[j]);
            }
        }
    };
    ChipList.prototype.onSelect = function (fields, callFromProperty, selectionType) {
        var index;
        var chipNodes;
        var chipValue;
        if (this.chipType() && this.selection !== 'None') {
            if (callFromProperty) {
                var chipElements = this.element.querySelectorAll('.' + classNames.chip);
                for (var i = 0; i < chipElements.length; i++) {
                    chipElements[i].setAttribute('aria-selected', 'false');
                    chipElements[i].classList.remove(classNames.active);
                }
            }
            var fieldData = fields instanceof Array ? fields : [fields];
            for (var i = 0; i < fieldData.length; i++) {
                var chipElement = fieldData[i] instanceof HTMLElement ? fieldData[i]
                    : this.element.querySelectorAll('.' + classNames.chip)[fieldData[i]];
                if (selectionType !== 'index') {
                    for (var j = 0; j < this.chips.length; j++) {
                        chipNodes = this.element.querySelectorAll('.' + classNames.chip)[j];
                        var fieldsData = this.getFieldValues(this.chips[j]);
                        if (selectionType === 'value') {
                            if (fieldsData.value !== null) {
                                chipValue = chipNodes.dataset.value;
                            }
                        }
                        else if (selectionType === 'text') {
                            chipValue = chipNodes.innerText;
                        }
                        if (chipValue === fieldData[i].toString()) {
                            index = j;
                            chipElement = this.element.querySelectorAll('.' + classNames.chip)[index];
                        }
                    }
                }
                if (chipElement instanceof HTMLElement) {
                    this.selectionHandler(chipElement);
                }
            }
        }
    };
    /**
     * Allows removing the chip item(s) by passing a single or array of string, number, or ChipModel values.
     * @param  {number | number[] | HTMLElement | HTMLElement[]} fields - We can pass number or array of number
     *  or chip element or array of chip element.
     * {% codeBlock src='chips/remove/index.md' %}{% endcodeBlock %}
     */
    ChipList.prototype.remove = function (fields) {
        var _this = this;
        if (this.chipType()) {
            var fieldData = fields instanceof Array ? fields : [fields];
            var chipElements_1 = [];
            var chipCollection_1 = this.element.querySelectorAll('.' + classNames.chip);
            fieldData.forEach(function (data) {
                var chipElement = data instanceof HTMLElement ? data
                    : chipCollection_1[data];
                if (chipElement instanceof HTMLElement) {
                    chipElements_1.push(chipElement);
                }
            });
            chipElements_1.forEach(function (element) {
                var chips = _this.element.querySelectorAll('.' + classNames.chip);
                var index = Array.prototype.slice.call(chips).indexOf(element);
                _this.deleteHandler(element, index);
            });
        }
    };
    /**
     * Returns the selected chip(s) data.
     * {% codeBlock src='chips/getSelectedChips/index.md' %}{% endcodeBlock %}
     */
    ChipList.prototype.getSelectedChips = function () {
        var selectedChips;
        if (this.chipType() && this.selection !== 'None') {
            var selectedItems = { texts: [], Indexes: [], data: [], elements: [] };
            var items = this.element.querySelectorAll('.' + classNames.active);
            for (var i = 0; i < items.length; i++) {
                var chip = items[i];
                selectedItems.elements.push(chip);
                var index = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.chip)).indexOf(chip);
                selectedItems.Indexes.push(index);
                selectedItems.data.push(this.chips[index]);
                var text = typeof this.chips[index] === 'object' ?
                    this.chips[index].text ? this.chips[index].text.toString()
                        : null : this.chips[index].toString();
                selectedItems.texts.push(text);
            }
            var selectedItem = {
                text: selectedItems.texts[0], index: selectedItems.Indexes[0],
                data: selectedItems.data[0], element: selectedItems.elements[0]
            };
            selectedChips = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedItem.index) ?
                (this.selection === 'Multiple' ? selectedItems : selectedItem) : undefined;
        }
        return selectedChips;
    };
    ChipList.prototype.wireEvent = function (unWireEvent) {
        if (!unWireEvent) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.focusOutHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.keyHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', this.keyHandler, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focusout', this.focusOutHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', this.keyHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', this.keyHandler);
        }
    };
    ChipList.prototype.keyHandler = function (e) {
        if (e.target.classList.contains(classNames.chip)) {
            if (e.type === 'keydown') {
                if (e.keyCode === 13) {
                    this.clickHandler(e);
                }
                else if (e.keyCode === 46 && this.enableDelete) {
                    this.clickHandler(e, true);
                }
            }
            else if (e.keyCode === 9) {
                this.focusInHandler(e.target);
            }
        }
    };
    ChipList.prototype.focusInHandler = function (chipWrapper) {
        if (!chipWrapper.classList.contains(classNames.focused)) {
            chipWrapper.classList.add(classNames.focused);
        }
    };
    ChipList.prototype.focusOutHandler = function (e) {
        var chipWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + classNames.chip);
        var focusedElement = !this.chipType() ? (this.element.classList.contains(classNames.focused) ?
            this.element : null) : this.element.querySelector('.' + classNames.focused);
        if (chipWrapper && focusedElement) {
            focusedElement.classList.remove(classNames.focused);
        }
    };
    ChipList.prototype.clickHandler = function (e, del) {
        var _this = this;
        if (del === void 0) { del = false; }
        var chipWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + classNames.chip);
        if (chipWrapper) {
            var chipDataArgs = void 0;
            if (this.chipType()) {
                chipDataArgs = this.find(chipWrapper);
            }
            else {
                var index = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.chip)).indexOf(chipWrapper);
                chipDataArgs = {
                    text: this.innerText ? this.innerText : this.text,
                    element: chipWrapper, data: this.text, index: index
                };
            }
            chipDataArgs.event = e;
            chipDataArgs.cancel = false;
            this.trigger('beforeClick', chipDataArgs, function (observedArgs) {
                if (!observedArgs.cancel) {
                    observedArgs.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(observedArgs.element) : observedArgs.element;
                    _this.clickEventHandler(observedArgs.element, e, del);
                }
            });
        }
    };
    ChipList.prototype.clickEventHandler = function (chipWrapper, e, del) {
        var _this = this;
        if (this.chipType()) {
            var chipData = this.find(chipWrapper);
            chipData.event = e;
            var deleteElement = e.target.classList.contains(classNames.deleteIcon) ?
                e.target : (del ? chipWrapper.querySelector('.' + classNames.deleteIcon) : undefined);
            if (deleteElement && this.enableDelete) {
                chipData.cancel = false;
                var deletedItemArgs = chipData;
                this.trigger('delete', deletedItemArgs, function (observedArgs) {
                    if (!observedArgs.cancel) {
                        observedArgs.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(observedArgs.element) : observedArgs.element;
                        _this.deleteHandler(observedArgs.element, observedArgs.index);
                    }
                });
            }
            else if (this.selection !== 'None') {
                this.selectionHandler(chipWrapper);
                chipData.selected = chipWrapper.classList.contains(classNames.active);
                var selectedItemArgs = chipData;
                this.trigger('click', selectedItemArgs);
            }
            else {
                this.focusInHandler(chipWrapper);
                var clickedItemArgs = chipData;
                this.trigger('click', clickedItemArgs);
            }
        }
        else {
            this.focusInHandler(chipWrapper);
            var clickedItemArgs = {
                text: this.innerText ? this.innerText : this.text,
                element: chipWrapper, data: this.text, event: e
            };
            this.trigger('click', clickedItemArgs);
        }
    };
    ChipList.prototype.selectionHandler = function (chipWrapper) {
        if (this.selection === 'Single') {
            var activeElement = this.element.querySelector('.' + classNames.active);
            if (activeElement && activeElement !== chipWrapper) {
                activeElement.classList.remove(classNames.active);
                activeElement.setAttribute('aria-selected', 'false');
            }
            this.setProperties({ selectedChips: null }, true);
        }
        else {
            this.setProperties({ selectedChips: [] }, true);
        }
        if (chipWrapper.classList.contains(classNames.active)) {
            chipWrapper.classList.remove(classNames.active);
            chipWrapper.setAttribute('aria-selected', 'false');
        }
        else {
            chipWrapper.classList.add(classNames.active);
            chipWrapper.setAttribute('aria-selected', 'true');
        }
        this.updateSelectedChips();
    };
    ChipList.prototype.updateSelectedChips = function () {
        var chipListEle = this.element.querySelectorAll('.e-chip');
        var chipCollIndex = [];
        var chipCollValue = [];
        var chip = null;
        var value;
        for (var i = 0; i < chipListEle.length; i++) {
            var selectedEle = this.element.querySelectorAll('.e-chip')[i];
            if (selectedEle.getAttribute('aria-selected') === 'true') {
                value = selectedEle.getAttribute('data-value');
                if (this.selection === 'Single' && selectedEle.classList.contains('e-active')) {
                    chip = value ? value : i;
                    break;
                }
                else {
                    value ? chipCollValue.push(value) : chipCollIndex.push(i);
                }
            }
        }
        this.setProperties({ selectedChips: this.selection === 'Single' ? chip : value ? chipCollValue : chipCollIndex }, true);
    };
    ChipList.prototype.deleteHandler = function (chipWrapper, index) {
        this.allowServerDataBinding = true;
        this.chips.splice(index, 1);
        this.setProperties({ chips: this.chips }, true);
        this.serverDataBind();
        this.allowServerDataBinding = false;
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(chipWrapper);
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. Also, it removes the attributes and classes.
     * {% codeBlock src='chips/destroy/index.md' %}{% endcodeBlock %}
     */
    ChipList.prototype.destroy = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [classNames.chipSet, classNames.chip, classNames.rtl,
            classNames.multiSelection, classNames.singleSelection, classNames.disabled, classNames.chipWrapper, classNames.iconWrapper,
            classNames.active, classNames.focused].concat(this.cssClass.toString().split(' ').filter(function (css) { return css; })));
        this.removeMultipleAttributes(['tabindex', 'role', 'aria-label', 'aria-multiselectable'], this.element);
        this.wireEvent(true);
        this.rippleFunction();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var chipChildElement = !this.chipType() ? this.element.querySelectorAll('.e-chip-text') :
                this.element.querySelectorAll('.e-chip');
            for (var i = 0; i < chipChildElement.length; i++) {
                if (chipChildElement[i] != null) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(chipChildElement[i]);
                }
            }
        }
        else {
            _super.prototype.destroy.call(this);
            this.element.innerHTML = '';
            this.element.innerText = this.innerText;
        }
    };
    ChipList.prototype.removeMultipleAttributes = function (attributes, element) {
        attributes.forEach(function (attr) {
            element.removeAttribute(attr);
        });
    };
    ChipList.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    ChipList.prototype.getModuleName = function () {
        return 'chip-list';
    };
    /**
     * Called internally if any of the property value changed.
     * @returns void
     * @private
     */
    ChipList.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'chips':
                case 'text':
                case 'avatarText':
                case 'avatarIconCss':
                case 'leadingIconCss':
                case 'trailingIconCss':
                case 'selection':
                case 'enableDelete':
                case 'enabled':
                    if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                        this.isServerRendered = false;
                        this.refresh();
                        this.isServerRendered = true;
                    }
                    break;
                case 'cssClass':
                    if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                        if (!this.chipType()) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldProp.cssClass.toString().split(' ').filter(function (css) { return css; }));
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newProp.cssClass.toString().split(' ').filter(function (css) { return css; }));
                        }
                        else {
                            this.isServerRendered = false;
                            this.refresh();
                            this.isServerRendered = true;
                        }
                    }
                    break;
                case 'selectedChips':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.element.querySelectorAll('.e-active'), 'e-active');
                    var property = void 0;
                    if (this.selection === 'Multiple') {
                        this.multiSelectedChip = [];
                        this.multiSelection(newProp.selectedChips);
                        this.onSelect(this.multiSelectedChip, true, property);
                        this.updateSelectedChips();
                    }
                    else {
                        this.onSelect(newProp.selectedChips, true, property);
                    }
                    break;
                case 'enableRtl':
                    this.setRtl();
                    break;
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], ChipList.prototype, "chips", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "avatarText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "avatarIconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "leadingIconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "trailingIconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "leadingIconUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "trailingIconUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ChipList.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ChipList.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], ChipList.prototype, "selectedChips", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], ChipList.prototype, "selection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ChipList.prototype, "enableDelete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ChipList.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ChipList.prototype, "click", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ChipList.prototype, "beforeClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ChipList.prototype, "delete", void 0);
    ChipList = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], ChipList);
    return ChipList;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip.js ***!
  \*****************************************************************/
/*! exports provided: Chip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Chip", function() { return Chip; });
/**
 * Represents ChipList `Chip` model class.
 */
var Chip = /** @__PURE__ @class */ (function () {
    function Chip() {
    }
    return Chip;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/index.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/chips/index.js ***!
  \******************************************************************/
/*! exports provided: classNames, ChipList, Chip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _chip_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chip-list */ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip-list.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return _chip_list__WEBPACK_IMPORTED_MODULE_0__["classNames"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChipList", function() { return _chip_list__WEBPACK_IMPORTED_MODULE_0__["ChipList"]; });

/* harmony import */ var _chip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chip */ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/chip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Chip", function() { return _chip__WEBPACK_IMPORTED_MODULE_1__["Chip"]; });

/**
 * Chip modules
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js ***!
  \********************************************************************/
/*! exports provided: wrapperInitialize, getTextNode, destroy, preRender, createCheckBox, rippleMouseHandler, setHiddenInput */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapperInitialize", function() { return wrapperInitialize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextNode", function() { return getTextNode; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroy", function() { return destroy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preRender", function() { return preRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCheckBox", function() { return createCheckBox; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rippleMouseHandler", function() { return rippleMouseHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHiddenInput", function() { return setHiddenInput; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");


/**
 * Initialize wrapper element for angular.
 * @private
 */
function wrapperInitialize(createElement, tag, type, element, WRAPPER, role) {
    var input = element;
    if (element.tagName === tag) {
        var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', element);
        input = createElement('input', { attrs: { 'type': type } });
        var props = ['change', 'cssClass', 'label', 'labelPosition', 'id'];
        for (var index = 0, len = element.attributes.length; index < len; index++) {
            if (props.indexOf(element.attributes[index].nodeName) === -1) {
                input.setAttribute(element.attributes[index].nodeName, element.attributes[index].nodeValue);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'class': WRAPPER, 'role': role, 'aria-checked': 'false' });
        element.appendChild(input);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, input);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["deleteObject"])(element, 'ej2_instances');
    }
    return input;
}
function getTextNode(element) {
    var node;
    var childnode = element.childNodes;
    for (var i = 0; i < childnode.length; i++) {
        node = childnode[i];
        if (node.nodeType === 3) {
            return node;
        }
    }
    return null;
}
/**
 * Destroy the button components.
 * @private
 */
function destroy(ejInst, wrapper, tagName) {
    if (tagName === 'INPUT') {
        wrapper.parentNode.insertBefore(ejInst.element, wrapper);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(wrapper);
        ejInst.element.checked = false;
        ['name', 'value', 'disabled'].forEach(function (key) {
            ejInst.element.removeAttribute(key);
        });
    }
    else {
        ['role', 'aria-checked', 'class'].forEach(function (key) {
            wrapper.removeAttribute(key);
        });
        wrapper.innerHTML = '';
    }
}
function preRender(proxy, control, wrapper, element, moduleName) {
    element = wrapperInitialize(proxy.createElement, control, 'checkbox', element, wrapper, moduleName);
    proxy.element = element;
    if (proxy.element.getAttribute('type') !== 'checkbox') {
        proxy.element.setAttribute('type', 'checkbox');
    }
    if (!proxy.element.id) {
        proxy.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + moduleName);
    }
}
/**
 * Creates CheckBox component UI with theming and ripple support.
 * @private
 */
function createCheckBox(createElement, enableRipple, options) {
    if (enableRipple === void 0) { enableRipple = false; }
    if (options === void 0) { options = {}; }
    var wrapper = createElement('div', { className: 'e-checkbox-wrapper e-css' });
    if (options.cssClass) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], options.cssClass.split(' '));
    }
    if (options.enableRtl) {
        wrapper.classList.add('e-rtl');
    }
    if (enableRipple) {
        var rippleSpan = createElement('span', { className: 'e-ripple-container' });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(rippleSpan, { isCenterRipple: true, duration: 400 });
        wrapper.appendChild(rippleSpan);
    }
    var frameSpan = createElement('span', { className: 'e-frame e-icons' });
    if (options.checked) {
        frameSpan.classList.add('e-check');
    }
    wrapper.appendChild(frameSpan);
    if (options.label) {
        var labelSpan = createElement('span', { className: 'e-label', innerHTML: options.label });
        wrapper.appendChild(labelSpan);
    }
    return wrapper;
}
function rippleMouseHandler(e, rippleSpan) {
    if (rippleSpan) {
        var event_1 = document.createEvent('MouseEvents');
        event_1.initEvent(e.type, false, true);
        rippleSpan.dispatchEvent(event_1);
    }
}
/**
 * Append hidden input to given element
 * @private
 */
function setHiddenInput(proxy, wrap) {
    if (proxy.element.getAttribute('ejs-for')) {
        wrap.appendChild(proxy.createElement('input', {
            attrs: { 'name': proxy.name || proxy.element.name, 'value': 'false', 'type': 'hidden' }
        }));
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/common/index.js ***!
  \*******************************************************************/
/*! exports provided: wrapperInitialize, getTextNode, destroy, preRender, createCheckBox, rippleMouseHandler, setHiddenInput */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperInitialize", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["wrapperInitialize"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTextNode", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["getTextNode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "destroy", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["destroy"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "preRender", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["preRender"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createCheckBox", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["createCheckBox"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rippleMouseHandler", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["rippleMouseHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHiddenInput", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["setHiddenInput"]; });

/**
 * Common modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js":
/*!************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/index.js ***!
  \************************************************************/
/*! exports provided: wrapperInitialize, getTextNode, destroy, preRender, createCheckBox, rippleMouseHandler, setHiddenInput, buttonObserver, Button, CheckBox, RadioButton, Switch, classNames, ChipList, Chip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperInitialize", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["wrapperInitialize"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTextNode", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["getTextNode"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "destroy", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["destroy"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "preRender", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["preRender"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createCheckBox", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["createCheckBox"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rippleMouseHandler", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["rippleMouseHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setHiddenInput", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["setHiddenInput"]; });

/* harmony import */ var _button_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buttonObserver", function() { return _button_index__WEBPACK_IMPORTED_MODULE_1__["buttonObserver"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return _button_index__WEBPACK_IMPORTED_MODULE_1__["Button"]; });

/* harmony import */ var _check_box_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./check-box/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/check-box/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckBox", function() { return _check_box_index__WEBPACK_IMPORTED_MODULE_2__["CheckBox"]; });

/* harmony import */ var _radio_button_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./radio-button/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return _radio_button_index__WEBPACK_IMPORTED_MODULE_3__["RadioButton"]; });

/* harmony import */ var _switch_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/switch/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch_index__WEBPACK_IMPORTED_MODULE_4__["Switch"]; });

/* harmony import */ var _chips_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chips/index */ "./ej2-resources/18.4.46/scripts/ej2-buttons/chips/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return _chips_index__WEBPACK_IMPORTED_MODULE_5__["classNames"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChipList", function() { return _chips_index__WEBPACK_IMPORTED_MODULE_5__["ChipList"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Chip", function() { return _chips_index__WEBPACK_IMPORTED_MODULE_5__["Chip"]; });

/**
 * Button all modules
 */








/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/index.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/index.js ***!
  \*************************************************************************/
/*! exports provided: RadioButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _radio_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./radio-button */ "./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/radio-button.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return _radio_button__WEBPACK_IMPORTED_MODULE_0__["RadioButton"]; });

/**
 * RadioButton modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/radio-button.js":
/*!********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/radio-button/radio-button.js ***!
  \********************************************************************************/
/*! exports provided: RadioButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return RadioButton; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../common/common */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var LABEL = 'e-label';
var RIPPLE = 'e-ripple-container';
var RTL = 'e-rtl';
var WRAPPER = 'e-radio-wrapper';
var ATTRIBUTES = ['title', 'class', 'style', 'disabled', 'readonly', 'name', 'value'];
/**
 * The RadioButton is a graphical user interface element that allows you to select one option from the choices.
 * It contains checked and unchecked states.
 * ```html
 * <input type="radio" id="radio"/>
 * <script>
 * var radioObj = new RadioButton({ label: "Default" });
 * radioObj.appendTo("#radio");
 * </script>
 * ```
 */
var RadioButton = /** @__PURE__ @class */ (function (_super) {
    __extends(RadioButton, _super);
    /**
     * Constructor for creating the widget
     * @private
     */
    function RadioButton(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isFocused = false;
        return _this;
    }
    RadioButton_1 = RadioButton;
    RadioButton.prototype.changeHandler = function (event) {
        this.checked = true;
        this.dataBind();
        var value = this.element.getAttribute('value');
        value = this.isVue && value ? this.element.value : this.value;
        this.trigger('change', { value: value, event: event });
        if (this.tagName === 'EJS-RADIOBUTTON') {
            event.stopPropagation();
        }
    };
    RadioButton.prototype.updateChange = function () {
        var input;
        var instance;
        var radioGrp = this.getRadioGroup();
        for (var i = 0; i < radioGrp.length; i++) {
            input = radioGrp[i];
            if (input !== this.element) {
                instance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(input, RadioButton_1);
                instance.checked = false;
                if (this.tagName === 'EJS-RADIOBUTTON') {
                    instance.angularValue = this.value;
                }
            }
        }
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    RadioButton.prototype.destroy = function () {
        var _this = this;
        var radioWrap = this.element.parentElement;
        _super.prototype.destroy.call(this);
        if (!this.disabled) {
            this.unWireEvents();
        }
        if (this.tagName === 'INPUT') {
            if (radioWrap.parentNode) {
                radioWrap.parentNode.insertBefore(this.element, radioWrap);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(radioWrap);
            this.element.checked = false;
            ['name', 'value', 'disabled'].forEach(function (key) {
                _this.element.removeAttribute(key);
            });
        }
        else {
            ['role', 'aria-checked', 'class'].forEach(function (key) {
                radioWrap.removeAttribute(key);
            });
            radioWrap.innerHTML = '';
        }
    };
    RadioButton.prototype.focusHandler = function () {
        this.isFocused = true;
    };
    RadioButton.prototype.focusOutHandler = function () {
        var label = this.getLabel();
        if (label) {
            label.classList.remove('e-focus');
        }
    };
    RadioButton.prototype.getModuleName = function () {
        return 'radio';
    };
    /**
     * To get the value of selected radio button in a group.
     * @method getSelectedValue
     * @return {string}
     */
    RadioButton.prototype.getSelectedValue = function () {
        var input;
        var radioGrp = this.getRadioGroup();
        for (var i = 0, len = radioGrp.length; i < len; i++) {
            input = radioGrp[i];
            if (input.checked) {
                return input.value;
            }
        }
        return '';
    };
    RadioButton.prototype.getRadioGroup = function () {
        return document.querySelectorAll('input.e-radio[name="' + this.element.getAttribute('name') + '"]');
    };
    /**
     * Gets the properties to be maintained in the persistence state.
     * @private
     */
    RadioButton.prototype.getPersistData = function () {
        return this.addOnPersist(['checked']);
    };
    RadioButton.prototype.getLabel = function () {
        if (this.element) {
            return this.element.nextElementSibling;
        }
        else {
            return null;
        }
    };
    RadioButton.prototype.initialize = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initialCheckedValue)) {
            this.initialCheckedValue = this.checked;
        }
        this.initWrapper();
        this.updateHtmlAttribute();
        if (this.name) {
            this.element.setAttribute('name', this.name);
        }
        var value = this.element.getAttribute('value');
        if (this.isVue && value && value === this.value) {
            this.checked = true;
        }
        if (this.isVue ? this.value && !value : this.value) {
            this.element.setAttribute('value', this.value);
        }
        if (this.checked) {
            this.element.checked = true;
        }
        if (this.disabled) {
            this.setDisabled();
        }
    };
    RadioButton.prototype.initWrapper = function () {
        var rippleSpan;
        var wrapper = this.element.parentElement;
        if (!wrapper.classList.contains(WRAPPER)) {
            wrapper = this.createElement('div', { className: WRAPPER });
            this.element.parentNode.insertBefore(wrapper, this.element);
        }
        var label = this.createElement('label', { attrs: { for: this.element.id } });
        wrapper.appendChild(this.element);
        wrapper.appendChild(label);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            rippleSpan = this.createElement('span', { className: (RIPPLE) });
            label.appendChild(rippleSpan);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(rippleSpan, {
                duration: 400,
                isCenterRipple: true
            });
        }
        wrapper.classList.add('e-wrapper');
        if (this.enableRtl) {
            label.classList.add(RTL);
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], this.cssClass.split(' '));
        }
        if (this.label) {
            this.setText(this.label);
        }
    };
    RadioButton.prototype.keyUpHandler = function () {
        if (this.isFocused) {
            this.getLabel().classList.add('e-focus');
        }
    };
    RadioButton.prototype.labelRippleHandler = function (e) {
        var ripple = this.getLabel().getElementsByClassName(RIPPLE)[0];
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["rippleMouseHandler"])(e, ripple);
    };
    RadioButton.prototype.formResetHandler = function () {
        this.checked = this.initialCheckedValue;
        if (this.initialCheckedValue) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'checked': 'true' });
        }
    };
    /**
     * Called internally if any of the property value changes.
     * @private
     */
    RadioButton.prototype.onPropertyChanged = function (newProp, oldProp) {
        var label = this.getLabel();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'checked':
                    if (newProp.checked) {
                        this.updateChange();
                    }
                    this.element.checked = newProp.checked;
                    break;
                case 'disabled':
                    if (newProp.disabled) {
                        this.setDisabled();
                        this.unWireEvents();
                    }
                    else {
                        this.element.disabled = false;
                        this.wireEvents();
                    }
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], newProp.cssClass.split(' '));
                    }
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        label.classList.add(RTL);
                    }
                    else {
                        label.classList.remove(RTL);
                    }
                    break;
                case 'label':
                    this.setText(newProp.label);
                    break;
                case 'labelPosition':
                    if (newProp.labelPosition === 'Before') {
                        label.classList.add('e-right');
                    }
                    else {
                        label.classList.remove('e-right');
                    }
                    break;
                case 'name':
                    this.element.setAttribute('name', newProp.name);
                    break;
                case 'value':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) && this.htmlAttributes.value) {
                        break;
                    }
                    this.element.setAttribute('value', newProp.value);
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttribute();
                    break;
            }
        }
    };
    /**
     * Initialize checked Property, Angular and React and Unique ID support.
     * @private
     */
    RadioButton.prototype.preRender = function () {
        var element = this.element;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        this.tagName = this.element.tagName;
        element = Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["wrapperInitialize"])(this.createElement, 'EJS-RADIOBUTTON', 'radio', element, WRAPPER, 'radio');
        this.element = element;
        if (this.element.getAttribute('type') !== 'radio') {
            this.element.setAttribute('type', 'radio');
        }
        if (!this.element.id) {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + this.getModuleName());
        }
        if (this.tagName === 'EJS-RADIOBUTTON') {
            var formControlName = this.element.getAttribute('formcontrolname');
            if (formControlName) {
                this.setProperties({ 'name': formControlName }, true);
                this.element.setAttribute('name', formControlName);
            }
        }
    };
    /**
     * Initialize the control rendering
     * @private
     */
    RadioButton.prototype.render = function () {
        this.initialize();
        if (!this.disabled) {
            this.wireEvents();
        }
        this.renderComplete();
    };
    RadioButton.prototype.setDisabled = function () {
        this.element.disabled = true;
    };
    RadioButton.prototype.setText = function (text) {
        var label = this.getLabel();
        if (label) {
            var textLabel = label.getElementsByClassName(LABEL)[0];
            if (textLabel) {
                textLabel.textContent = text;
            }
            else {
                text = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(text) : text;
                textLabel = this.createElement('span', { className: LABEL, innerHTML: text });
                label.appendChild(textLabel);
            }
            if (this.labelPosition === 'Before') {
                this.getLabel().classList.add('e-right');
            }
            else {
                this.getLabel().classList.remove('e-right');
            }
        }
    };
    RadioButton.prototype.updateHtmlAttribute = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (ATTRIBUTES.indexOf(key) > -1) {
                    var wrapper = this.element.parentElement;
                    if (key === 'class') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.htmlAttributes[key].split(' '));
                    }
                    else if (key === 'title' || key === 'style') {
                        wrapper.setAttribute(key, this.htmlAttributes[key]);
                    }
                    else {
                        this.element.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    RadioButton.prototype.unWireEvents = function () {
        var label = this.getLabel();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'change', this.changeHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.focusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focusout', this.focusOutHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', this.keyUpHandler);
        var rippleLabel = label.getElementsByClassName(LABEL)[0];
        if (rippleLabel) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(rippleLabel, 'mousedown', this.labelRippleHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(rippleLabel, 'mouseup', this.labelRippleHandler);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
    };
    RadioButton.prototype.wireEvents = function () {
        var label = this.getLabel();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'change', this.changeHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', this.keyUpHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.focusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.focusOutHandler, this);
        var rippleLabel = label.getElementsByClassName(LABEL)[0];
        if (rippleLabel) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(rippleLabel, 'mousedown', this.labelRippleHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(rippleLabel, 'mouseup', this.labelRippleHandler, this);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
    };
    /**
     * Click the RadioButton element
     * its native method
     * @public
     */
    RadioButton.prototype.click = function () {
        this.element.click();
    };
    /**
     * Sets the focus to RadioButton
     * its native method
     * @public
     */
    RadioButton.prototype.focusIn = function () {
        this.element.focus();
    };
    var RadioButton_1;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], RadioButton.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], RadioButton.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], RadioButton.prototype, "checked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], RadioButton.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], RadioButton.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], RadioButton.prototype, "label", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('After')
    ], RadioButton.prototype, "labelPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], RadioButton.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], RadioButton.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], RadioButton.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], RadioButton.prototype, "htmlAttributes", void 0);
    RadioButton = RadioButton_1 = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], RadioButton);
    return RadioButton;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/switch/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/switch/index.js ***!
  \*******************************************************************/
/*! exports provided: Switch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./switch */ "./ej2-resources/18.4.46/scripts/ej2-buttons/switch/switch.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_0__["Switch"]; });

/**
 * Switch modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-buttons/switch/switch.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-buttons/switch/switch.js ***!
  \********************************************************************/
/*! exports provided: Switch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../common/common */ "./ej2-resources/18.4.46/scripts/ej2-buttons/common/common.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var CHECK = 'e-check';
var DISABLED = 'e-switch-disabled';
var RIPPLE = 'e-ripple-container';
var RIPPLE_CHECK = 'e-ripple-check';
var RTL = 'e-rtl';
var WRAPPER = 'e-switch-wrapper';
var ACTIVE = 'e-switch-active';
/**
 * The Switch is a graphical user interface element that allows you to toggle between checked and unchecked states.
 * ```html
 * <input type="checkbox" id="switch"/>
 * <script>
 * var switchObj = new Switch({});
 * switchObj.appendTo("#switch");
 * </script>
 * ```
 */
var Switch = /** @__PURE__ @class */ (function (_super) {
    __extends(Switch, _super);
    /**
     * Constructor for creating the widget.
     * @private
     */
    function Switch(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isFocused = false;
        _this.isDrag = false;
        return _this;
    }
    Switch.prototype.changeState = function (state) {
        var ariaState;
        var rippleSpan;
        var wrapper = this.getWrapper();
        var bar = wrapper.querySelector('.e-switch-inner');
        var handle = wrapper.querySelector('.e-switch-handle');
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            rippleSpan = wrapper.getElementsByClassName(RIPPLE)[0];
        }
        if (state) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([bar, handle], ACTIVE);
            ariaState = 'true';
            this.element.checked = true;
            this.checked = true;
            if (rippleSpan) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([rippleSpan], [RIPPLE_CHECK]);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([bar, handle], ACTIVE);
            ariaState = 'false';
            this.element.checked = false;
            this.checked = false;
            if (rippleSpan) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([rippleSpan], [RIPPLE_CHECK]);
            }
        }
        wrapper.setAttribute('aria-checked', ariaState);
    };
    Switch.prototype.clickHandler = function (evt) {
        this.isDrag = false;
        this.focusOutHandler();
        this.changeState(!this.checked);
        this.element.focus();
        var changeEventArgs = { checked: this.element.checked, event: evt };
        this.trigger('change', changeEventArgs);
    };
    /**
     * Destroys the Switch widget.
     * @returns void
     */
    Switch.prototype.destroy = function () {
        _super.prototype.destroy.call(this);
        if (!this.disabled) {
            this.unWireEvents();
        }
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["destroy"])(this, this.getWrapper(), this.tagName);
    };
    Switch.prototype.focusHandler = function () {
        this.isFocused = true;
    };
    Switch.prototype.focusOutHandler = function () {
        this.getWrapper().classList.remove('e-focus');
    };
    /**
     * Gets the module name.
     * @private
     */
    Switch.prototype.getModuleName = function () {
        return 'switch';
    };
    /**
     * Gets the properties to be maintained in the persistence state.
     * @private
     */
    Switch.prototype.getPersistData = function () {
        return this.addOnPersist(['checked']);
    };
    Switch.prototype.getWrapper = function () {
        return this.element.parentElement;
    };
    Switch.prototype.initialize = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initialSwitchCheckedValue)) {
            this.initialSwitchCheckedValue = this.checked;
        }
        if (this.name) {
            this.element.setAttribute('name', this.name);
        }
        if (this.value) {
            this.element.setAttribute('value', this.value);
        }
        if (this.checked) {
            this.changeState(true);
        }
        if (this.disabled) {
            this.setDisabled();
        }
        if (this.onLabel || this.offLabel) {
            this.setLabel(this.onLabel, this.offLabel);
        }
    };
    Switch.prototype.initWrapper = function () {
        var wrapper = this.element.parentElement;
        if (!wrapper.classList.contains(WRAPPER)) {
            wrapper = this.createElement('div', {
                className: WRAPPER, attrs: { 'role': 'switch', 'aria-checked': 'false' }
            });
            this.element.parentNode.insertBefore(wrapper, this.element);
        }
        var switchInner = this.createElement('span', { className: 'e-switch-inner' });
        var onLabel = this.createElement('span', { className: 'e-switch-on' });
        var offLabel = this.createElement('span', { className: 'e-switch-off' });
        var handle = this.createElement('span', { className: 'e-switch-handle' });
        wrapper.appendChild(this.element);
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["setHiddenInput"])(this, wrapper);
        switchInner.appendChild(onLabel);
        switchInner.appendChild(offLabel);
        wrapper.appendChild(switchInner);
        wrapper.appendChild(handle);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            var rippleSpan = this.createElement('span', { className: RIPPLE });
            handle.appendChild(rippleSpan);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(rippleSpan, { duration: 400, isCenterRipple: true });
        }
        wrapper.classList.add('e-wrapper');
        if (this.enableRtl) {
            wrapper.classList.add(RTL);
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.cssClass.split(' '));
        }
    };
    /**
     * Called internally if any of the property value changes.
     * @private
     */
    Switch.prototype.onPropertyChanged = function (newProp, oldProp) {
        var wrapper = this.getWrapper();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'checked':
                    this.changeState(newProp.checked);
                    break;
                case 'disabled':
                    if (newProp.disabled) {
                        this.setDisabled();
                        this.unWireEvents();
                    }
                    else {
                        this.element.disabled = false;
                        wrapper.classList.remove(DISABLED);
                        wrapper.setAttribute('aria-disabled', 'false');
                        this.wireEvents();
                    }
                    break;
                case 'value':
                    this.element.setAttribute('value', newProp.value);
                    break;
                case 'name':
                    this.element.setAttribute('name', newProp.name);
                    break;
                case 'onLabel':
                case 'offLabel':
                    this.setLabel(newProp.onLabel, newProp.offLabel);
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        wrapper.classList.add(RTL);
                    }
                    else {
                        wrapper.classList.remove(RTL);
                    }
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([wrapper], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], newProp.cssClass.split(' '));
                    }
                    break;
            }
        }
    };
    /**
     * Initialize Angular, React and Unique ID support.
     * @private
     */
    Switch.prototype.preRender = function () {
        var element = this.element;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        this.tagName = this.element.tagName;
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["preRender"])(this, 'EJS-SWITCH', WRAPPER, element, this.getModuleName());
    };
    /**
     * Initialize control rendering.
     * @private
     */
    Switch.prototype.render = function () {
        this.initWrapper();
        this.initialize();
        if (!this.disabled) {
            this.wireEvents();
        }
        this.renderComplete();
    };
    Switch.prototype.rippleHandler = function (e) {
        var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];
        Object(_common_common__WEBPACK_IMPORTED_MODULE_1__["rippleMouseHandler"])(e, rippleSpan);
        if (e.type === 'mousedown' && e.currentTarget.classList.contains('e-switch-wrapper') && e.which === 1) {
            this.isDrag = true;
            this.isFocused = false;
        }
    };
    Switch.prototype.rippleTouchHandler = function (eventType) {
        var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];
        if (rippleSpan) {
            var event_1 = document.createEvent('MouseEvents');
            event_1.initEvent(eventType, false, true);
            rippleSpan.dispatchEvent(event_1);
        }
    };
    Switch.prototype.setDisabled = function () {
        var wrapper = this.getWrapper();
        this.element.disabled = true;
        wrapper.classList.add(DISABLED);
        wrapper.setAttribute('aria-disabled', 'true');
    };
    Switch.prototype.setLabel = function (onText, offText) {
        var wrapper = this.getWrapper();
        if (onText) {
            wrapper.querySelector('.e-switch-on').textContent = onText;
        }
        if (offText) {
            wrapper.querySelector('.e-switch-off').textContent = offText;
        }
    };
    Switch.prototype.switchFocusHandler = function () {
        if (this.isFocused) {
            this.getWrapper().classList.add('e-focus');
        }
    };
    Switch.prototype.switchMouseUp = function (e) {
        var target = e.target;
        var rippleSpan = this.getWrapper().getElementsByClassName(RIPPLE)[0];
        if (e.type === 'touchmove') {
            e.preventDefault();
        }
        if (e.type === 'touchstart') {
            this.isDrag = true;
            this.rippleTouchHandler('mousedown');
        }
        if (this.isDrag) {
            if ((e.type === 'mouseup' && target.className.indexOf('e-switch') < 0) || e.type === 'touchend') {
                this.clickHandler(e);
                this.rippleTouchHandler('mouseup');
                e.preventDefault();
            }
        }
    };
    Switch.prototype.formResetHandler = function () {
        this.checked = this.initialSwitchCheckedValue;
        this.element.checked = this.initialSwitchCheckedValue;
    };
    /**
     * Toggle the Switch component state into checked/unchecked.
     * @returns void
     */
    Switch.prototype.toggle = function () {
        this.clickHandler();
    };
    Switch.prototype.wireEvents = function () {
        var wrapper = this.getWrapper();
        var handle = wrapper.querySelector('.e-switch-handle');
        this.delegateMouseUpHandler = this.switchMouseUp.bind(this);
        this.delegateKeyUpHandler = this.switchFocusHandler.bind(this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrapper, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.focusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.focusOutHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseup', this.delegateMouseUpHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', this.delegateKeyUpHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrapper, 'mousedown mouseup', this.rippleHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrapper, 'touchstart touchmove touchend', this.switchMouseUp, this);
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
    };
    Switch.prototype.unWireEvents = function () {
        var wrapper = this.getWrapper();
        var handle = wrapper.querySelector('.e-switch-handle');
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(wrapper, 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.focusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focusout', this.focusOutHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseup', this.delegateMouseUpHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', this.delegateKeyUpHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(wrapper, 'mousedown mouseup', this.rippleHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(wrapper, 'touchstart touchmove touchend', this.switchMouseUp);
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
    };
    /**
     * Click the switch element
     * its native method
     * @public
     */
    Switch.prototype.click = function () {
        this.element.click();
    };
    /**
     * Sets the focus to Switch
     * its native method
     * @public
     */
    Switch.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Switch.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Switch.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Switch.prototype, "checked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Switch.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Switch.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Switch.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Switch.prototype, "onLabel", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Switch.prototype, "offLabel", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Switch.prototype, "value", void 0);
    Switch = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Switch);
    return Switch;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/calendar.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/calendar.js ***!
  \**************************************************************************/
/*! exports provided: CalendarBase, Calendar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CalendarBase", function() { return CalendarBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Calendar", function() { return Calendar; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};







//class constant defination.
var OTHERMONTH = 'e-other-month';
var OTHERDECADE = 'e-other-year';
var ROOT = 'e-calendar';
var DEVICE = 'e-device';
var HEADER = 'e-header';
var RTL = 'e-rtl';
var CONTENT = 'e-content';
var YEAR = 'e-year';
var MONTH = 'e-month';
var DECADE = 'e-decade';
var ICON = 'e-icons';
var PREVICON = 'e-prev';
var NEXTICON = 'e-next';
var PREVSPAN = 'e-date-icon-prev';
var NEXTSPAN = 'e-date-icon-next ';
var ICONCONTAINER = 'e-icon-container';
var DISABLED = 'e-disabled';
var OVERLAY = 'e-overlay';
var WEEKEND = 'e-weekend';
var WEEKNUMBER = 'e-week-number';
var SELECTED = 'e-selected';
var FOCUSEDDATE = 'e-focused-date';
var OTHERMONTHROW = 'e-month-hide';
var TODAY = 'e-today';
var TITLE = 'e-title';
var LINK = 'e-day';
var CELL = 'e-cell';
var WEEKHEADER = 'e-week-header';
var ZOOMIN = 'e-zoomin';
var FOOTER = 'e-footer-container';
var BTN = 'e-btn';
var FLAT = 'e-flat';
var CSS = 'e-css';
var PRIMARY = 'e-primary';
var DAYHEADERLONG = 'e-calendar-day-header-lg';
var dayMilliSeconds = 86400000;
var minutesMilliSeconds = 60000;
/**
 *
 * @private
 */
var CalendarBase = /** @__PURE__ @class */ (function (_super) {
    __extends(CalendarBase, _super);
    /**
     * Initialized new instance of Calendar Class.
     * Constructor for creating the widget
     * @param  {CalendarModel} options?
     * @param  {string|HTMLElement} element?
     */
    function CalendarBase(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.effect = '';
        _this.isPopupClicked = false;
        _this.isDateSelected = true;
        _this.isTodayClicked = false;
        _this.preventChange = false;
        _this.isAngular = false;
        return _this;
    }
    /**
     * To Initialize the control rendering.
     * @returns void
     * @private
     */
    CalendarBase.prototype.render = function () {
        this.rangeValidation(this.min, this.max);
        this.calendarEleCopy = this.element.cloneNode(true);
        if (this.calendarMode === 'Islamic') {
            if (+(this.min.setSeconds(0)) === +new Date(1900, 0, 1, 0, 0, 0)) {
                this.min = new Date(1944, 2, 18);
            }
            if (+this.max === +new Date(2099, 11, 31)) {
                this.max = new Date(2069, 10, 16);
            }
        }
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.firstDayOfWeek) || this.firstDayOfWeek > 6 || this.firstDayOfWeek < 0) {
            this.setProperties({ firstDayOfWeek: this.globalize.getFirstDayOfWeek() }, true);
        }
        this.todayDisabled = false;
        this.todayDate = new Date(new Date().setHours(0, 0, 0, 0));
        if (this.getModuleName() === 'calendar') {
            this.element.classList.add(ROOT);
            if (this.enableRtl) {
                this.element.classList.add(RTL);
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.element.classList.add(DEVICE);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, {
                'data-role': 'calendar'
            });
            this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
            this.element.setAttribute('tabindex', this.tabIndex);
        }
        else {
            this.calendarElement = this.createElement('div');
            this.calendarElement.classList.add(ROOT);
            if (this.enableRtl) {
                this.calendarElement.classList.add(RTL);
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.calendarElement.classList.add(DEVICE);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.calendarElement, {
                'role': 'calendar'
            });
        }
        this.createHeader();
        this.createContent();
        this.wireEvents();
    };
    CalendarBase.prototype.rangeValidation = function (min, max) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(min)) {
            this.setProperties({ min: new Date(1900, 0, 1) }, true);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(max)) {
            this.setProperties({ max: new Date(2099, 11, 31) }, true);
        }
    };
    CalendarBase.prototype.getDefaultKeyConfig = function () {
        this.defaultKeyConfigs = {
            controlUp: 'ctrl+38',
            controlDown: 'ctrl+40',
            moveDown: 'downarrow',
            moveUp: 'uparrow',
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            select: 'enter',
            home: 'home',
            end: 'end',
            pageUp: 'pageup',
            pageDown: 'pagedown',
            shiftPageUp: 'shift+pageup',
            shiftPageDown: 'shift+pagedown',
            controlHome: 'ctrl+home',
            controlEnd: 'ctrl+end',
            altUpArrow: 'alt+uparrow',
            spacebar: 'space',
            altRightArrow: 'alt+rightarrow',
            altLeftArrow: 'alt+leftarrow'
        };
        return this.defaultKeyConfigs;
    };
    CalendarBase.prototype.validateDate = function (value) {
        this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(this.min))) }, true);
        this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(this.max))) }, true);
        this.currentDate = this.currentDate ? this.currentDate : new Date(new Date().setHours(0, 0, 0, 0));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && this.min <= this.max && value >= this.min && value <= this.max) {
            this.currentDate = new Date(this.checkValue(value));
        }
    };
    CalendarBase.prototype.setOverlayIndex = function (popupWrapper, popupElement, modal, isDevice) {
        if (isDevice && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popupElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(modal) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popupWrapper)) {
            var index = parseInt(popupElement.style.zIndex, 10) ? parseInt(popupElement.style.zIndex, 10) : 1000;
            modal.style.zIndex = (index - 1).toString();
            popupWrapper.style.zIndex = index.toString();
        }
    };
    CalendarBase.prototype.minMaxUpdate = function (value) {
        if (!(+this.min <= +this.max)) {
            this.setProperties({ min: this.min }, true);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], OVERLAY);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], OVERLAY);
        }
        this.min = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.min) || !(+this.min) ? this.min = new Date(1900, 0, 1) : this.min;
        this.max = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.max) || !(+this.max) ? this.max = new Date(2099, 11, 31) : this.max;
        if (+this.min <= +this.max && value && +value <= +this.max && +value >= +this.min) {
            this.currentDate = new Date(this.checkValue(value));
        }
        else {
            if (+this.min <= +this.max && !value && +this.currentDate > +this.max) {
                this.currentDate = new Date(this.checkValue(this.max));
            }
            else {
                if (+this.currentDate < +this.min) {
                    this.currentDate = new Date(this.checkValue(this.min));
                }
            }
        }
    };
    CalendarBase.prototype.createHeader = function () {
        var ariaPrevAttrs = {
            'aria-disabled': 'false',
            'aria-label': 'previous month'
        };
        var ariaNextAttrs = {
            'aria-disabled': 'false',
            'aria-label': 'next month'
        };
        var ariaTitleAttrs = {
            'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title'
        };
        this.headerElement = this.createElement('div', { className: HEADER });
        var iconContainer = this.createElement('div', { className: ICONCONTAINER });
        this.previousIcon = this.createElement('button', { className: '' + PREVICON, attrs: { type: 'button' } });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.previousIcon, {
            duration: 400,
            selector: '.e-prev',
            isCenterRipple: true
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.previousIcon, ariaPrevAttrs);
        this.nextIcon = this.createElement('button', { className: '' + NEXTICON, attrs: { type: 'button' } });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.nextIcon, {
            selector: '.e-next',
            duration: 400,
            isCenterRipple: true
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.nextIcon, ariaNextAttrs);
        this.headerTitleElement = this.createElement('div', { className: '' + LINK + ' ' + TITLE });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.headerTitleElement, ariaTitleAttrs);
        this.headerElement.appendChild(this.headerTitleElement);
        this.previousIcon.appendChild(this.createElement('span', { className: '' + PREVSPAN + ' ' + ICON }));
        this.nextIcon.appendChild(this.createElement('span', { className: '' + NEXTSPAN + ' ' + ICON }));
        iconContainer.appendChild(this.previousIcon);
        iconContainer.appendChild(this.nextIcon);
        this.headerElement.appendChild(iconContainer);
        if (this.getModuleName() === 'calendar') {
            this.element.appendChild(this.headerElement);
        }
        else {
            this.calendarElement.appendChild(this.headerElement);
        }
        this.adjustLongHeaderSize();
    };
    CalendarBase.prototype.createContent = function () {
        this.contentElement = this.createElement('div', { className: CONTENT });
        this.table = this.createElement('table', { attrs: { tabIndex: '0', 'role': 'grid', 'aria-activedescendant': '' } });
        if (this.getModuleName() === 'calendar') {
            this.element.appendChild(this.contentElement);
        }
        else {
            this.calendarElement.appendChild(this.contentElement);
        }
        this.contentElement.appendChild(this.table);
        this.createContentHeader();
        this.createContentBody();
        if (this.showTodayButton) {
            this.createContentFooter();
        }
    };
    CalendarBase.prototype.getCultureValues = function () {
        var culShortNames = [];
        var cldrObj;
        var dayFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'days.' : 'days.stand-alone.') + this.dayHeaderFormat.toLowerCase();
        if (this.locale === 'en' || this.locale === 'en-US') {
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(dayFormat, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
        }
        else {
            cldrObj = (this.getCultureObjects(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
        }
        for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {
            var obj = _a[_i];
            culShortNames.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(obj, cldrObj));
        }
        return culShortNames;
    };
    CalendarBase.prototype.toCapitalize = function (text) {
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(text) && text.length ? text[0].toUpperCase() + text.slice(1) : text;
    };
    CalendarBase.prototype.createContentHeader = function () {
        if (this.getModuleName() === 'calendar') {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelectorAll('.e-content .e-week-header')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.querySelectorAll('.e-content .e-week-header')[0]);
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelectorAll('.e-content .e-week-header')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.calendarElement.querySelectorAll('.e-content .e-week-header')[0]);
            }
        }
        var daysCount = 6;
        var html = '';
        var shortNames;
        if (this.firstDayOfWeek > 6 || this.firstDayOfWeek < 0) {
            this.setProperties({ firstDayOfWeek: 0 }, true);
        }
        this.tableHeadElement = this.createElement('thead', { className: WEEKHEADER });
        if (this.weekNumber) {
            html += '<th class="e-week-number"></th>';
            if (this.getModuleName() === 'calendar') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], '' + WEEKNUMBER);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.calendarElement], '' + WEEKNUMBER);
            }
        }
        shortNames = this.shiftArray(((this.getCultureValues().length > 0 && this.getCultureValues())), this.firstDayOfWeek);
        for (var days = 0; days <= daysCount; days++) {
            html += '<th  class="">' + this.toCapitalize(shortNames[days]) + '</th>';
        }
        html = '<tr>' + html + '</tr>';
        this.tableHeadElement.innerHTML = html;
        this.table.appendChild(this.tableHeadElement);
    };
    CalendarBase.prototype.createContentBody = function () {
        if (this.getModuleName() === 'calendar') {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelectorAll('.e-content tbody')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.querySelectorAll('.e-content tbody')[0]);
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelectorAll('.e-content tbody')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.calendarElement.querySelectorAll('.e-content tbody')[0]);
            }
        }
        switch (this.start) {
            case 'Year':
                this.renderYears();
                break;
            case 'Decade':
                this.renderDecades();
                break;
            default:
                this.renderMonths();
        }
    };
    CalendarBase.prototype.updateFooter = function () {
        this.todayElement.textContent = this.l10.getConstant('today');
        this.todayElement.setAttribute('aria-label', this.l10.getConstant('today'));
    };
    CalendarBase.prototype.createContentFooter = function () {
        if (this.showTodayButton) {
            var minimum = new Date(+this.min);
            var maximum = new Date(+this.max);
            var l10nLocale = { today: 'Today' };
            this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            this.l10 = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getModuleName(), l10nLocale, this.locale);
            this.todayElement = this.createElement('button', { attrs: { role: 'button' } });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.todayElement);
            this.updateFooter();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.todayElement], [BTN, TODAY, FLAT, PRIMARY, CSS]);
            if ((!(+new Date(minimum.setHours(0, 0, 0, 0)) <= +this.todayDate &&
                +this.todayDate <= +new Date(maximum.setHours(0, 0, 0, 0)))) || (this.todayDisabled)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.todayElement], DISABLED);
            }
            this.footer = this.createElement('div', { className: FOOTER });
            this.footer.appendChild(this.todayElement);
            if (this.getModuleName() === 'calendar') {
                this.element.appendChild(this.footer);
            }
            if (this.getModuleName() === 'datepicker') {
                this.calendarElement.appendChild(this.footer);
            }
            if (this.getModuleName() === 'datetimepicker') {
                this.calendarElement.appendChild(this.footer);
            }
            if (!this.todayElement.classList.contains(DISABLED)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.todayElement, 'click', this.todayButtonClick, this);
            }
        }
    };
    CalendarBase.prototype.wireEvents = function (id, ref, keyConfig, moduleName) {
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && ref)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.headerTitleElement, 'click', this.navigateTitle, this);
            this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, this.keyConfigs);
        }
        else {
            this.element = document.getElementById(id);
            this.defaultKeyConfigs = this.getDefaultKeyConfig();
            this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, keyConfig);
            this.blazorRef = ref;
            this.serverModuleName = moduleName;
        }
        if (this.getModuleName() === 'calendar') {
            this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
                eventName: 'keydown',
                keyAction: this.keyActionHandle.bind(this),
                keyConfigs: this.defaultKeyConfigs
            });
        }
        else {
            this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.calendarElement, {
                eventName: 'keydown',
                keyAction: this.keyActionHandle.bind(this),
                keyConfigs: this.defaultKeyConfigs
            });
        }
    };
    CalendarBase.prototype.dateWireEvents = function (id, ref, keyConfig, moduleName) {
        this.defaultKeyConfigs = this.getDefaultKeyConfig();
        this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, keyConfig);
        this.blazorRef = ref;
        this.serverModuleName = moduleName;
    };
    CalendarBase.prototype.todayButtonClick = function (e, value, isCustomDate) {
        if (this.showTodayButton) {
            if (this.currentView() === this.depth) {
                this.effect = '';
            }
            else {
                this.effect = 'e-zoomin';
            }
            if (this.getViewNumber(this.start) >= this.getViewNumber(this.depth)) {
                this.navigateTo(this.depth, new Date(this.checkValue(value)), isCustomDate);
            }
            else {
                this.navigateTo('Month', new Date(this.checkValue(value)), isCustomDate);
            }
        }
    };
    CalendarBase.prototype.checkDeviceMode = function (ref) {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && ref) {
            // tslint:disable-next-line
            ref.invokeMethodAsync('OnDevice', true);
        }
    };
    // tslint:disable-next-line:max-func-body-length
    CalendarBase.prototype.keyActionHandle = function (e, value, multiSelection) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.blazorRef) {
            e.preventDefault();
            if (!this.tableBodyElement) {
                this.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + 'e-calendar');
                this.tableBodyElement = this.element.querySelector('tbody');
            }
            multiSelection = false;
        }
        var focusedDate = this.tableBodyElement.querySelector('tr td.e-focused-date');
        var selectedDate;
        if (multiSelection) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate) && +value === parseInt(focusedDate.getAttribute('id').split('_')[0], 10)) {
                selectedDate = focusedDate;
            }
            else {
                selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
            }
        }
        else {
            selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.blazorRef) {
            this.tableBodyElement.focus();
            var targetEle = e.target;
            var args = {
                Action: e.action, Key: e.key, Events: e,
                SelectDate: selectedDate ? selectedDate.id : null,
                FocusedDate: focusedDate ? focusedDate.id : null,
                classList: selectedDate ? selectedDate.classList.toString() : focusedDate ? focusedDate.classList.toString() : 'e-cell',
                Id: focusedDate ? focusedDate.id : selectedDate ? selectedDate.id : null,
                TargetClassList: targetEle.classList.toString()
            };
            // tslint:disable-next-line
            this.blazorRef.invokeMethodAsync('OnCalendarKeyboardEvent', args);
            if (targetEle.classList.contains('e-today')) {
                targetEle.blur();
                this.tableBodyElement.focus();
            }
            if (this.serverModuleName === 'sf.calendars.Calendar') {
                this.tableBodyElement = null;
            }
        }
        else {
            var view = this.getViewNumber(this.currentView());
            var depthValue = this.getViewNumber(this.depth);
            var levelRestrict = (view === depthValue && this.getViewNumber(this.start) >= depthValue);
            this.effect = '';
            switch (e.action) {
                case 'moveLeft':
                    this.KeyboardNavigate(-1, view, e, this.max, this.min);
                    e.preventDefault();
                    break;
                case 'moveRight':
                    this.KeyboardNavigate(1, view, e, this.max, this.min);
                    e.preventDefault();
                    break;
                case 'moveUp':
                    if (view === 0) {
                        this.KeyboardNavigate(-7, view, e, this.max, this.min); // move the current date to the previous seven days.
                    }
                    else {
                        this.KeyboardNavigate(-4, view, e, this.max, this.min); // move the current year to the previous four days.
                    }
                    e.preventDefault();
                    break;
                case 'moveDown':
                    if (view === 0) {
                        this.KeyboardNavigate(7, view, e, this.max, this.min);
                    }
                    else {
                        this.KeyboardNavigate(4, view, e, this.max, this.min);
                    }
                    e.preventDefault();
                    break;
                case 'select':
                    if (e.target === this.todayElement) {
                        this.todayButtonClick(e, value);
                    }
                    else {
                        var element = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate) ? focusedDate : selectedDate;
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element) && !element.classList.contains(DISABLED)) {
                            if (levelRestrict) {
                                var d = new Date(parseInt('' + (element).id, 0));
                                this.selectDate(e, d, (element));
                            }
                            else {
                                this.contentClick(null, --view, (element), value);
                            }
                        }
                    }
                    break;
                case 'controlUp':
                    this.title();
                    e.preventDefault();
                    break;
                case 'controlDown':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedDate) && !levelRestrict) {
                        this.contentClick(null, --view, (focusedDate || selectedDate), value);
                    }
                    e.preventDefault();
                    break;
                case 'home':
                    this.currentDate = this.firstDay(this.currentDate);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    (view === 0) ? this.renderMonths(e) : ((view === 1) ? this.renderYears(e) : this.renderDecades(e));
                    e.preventDefault();
                    break;
                case 'end':
                    this.currentDate = this.lastDay(this.currentDate, view);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    (view === 0) ? this.renderMonths(e) : ((view === 1) ? this.renderYears(e) : this.renderDecades(e));
                    e.preventDefault();
                    break;
                case 'pageUp':
                    this.addMonths(this.currentDate, -1);
                    this.navigateTo('Month', this.currentDate);
                    e.preventDefault();
                    break;
                case 'pageDown':
                    this.addMonths(this.currentDate, 1);
                    this.navigateTo('Month', this.currentDate);
                    e.preventDefault();
                    break;
                case 'shiftPageUp':
                    this.addYears(this.currentDate, -1);
                    this.navigateTo('Month', this.currentDate);
                    e.preventDefault();
                    break;
                case 'shiftPageDown':
                    this.addYears(this.currentDate, 1);
                    this.navigateTo('Month', this.currentDate);
                    e.preventDefault();
                    break;
                case 'controlHome':
                    this.navigateTo('Month', new Date(this.currentDate.getFullYear(), 0, 1));
                    e.preventDefault();
                    break;
                case 'controlEnd':
                    this.navigateTo('Month', new Date(this.currentDate.getFullYear(), 11, 31));
                    e.preventDefault();
                    break;
            }
            if (this.getModuleName() === 'calendar') {
                this.table.focus();
            }
        }
    };
    CalendarBase.prototype.KeyboardNavigate = function (number, currentView, e, max, min) {
        var date = new Date(this.checkValue(this.currentDate));
        switch (currentView) {
            case 2:
                this.addYears(this.currentDate, number);
                if (this.isMonthYearRange(this.currentDate)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.renderDecades(e);
                }
                else {
                    this.currentDate = date;
                }
                break;
            case 1:
                this.addMonths(this.currentDate, number);
                if (this.calendarMode === 'Gregorian') {
                    if (this.isMonthYearRange(this.currentDate)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                        this.renderYears(e);
                    }
                    else {
                        this.currentDate = date;
                    }
                }
                else {
                    if (this.isMonthYearRange(this.currentDate)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                        this.renderYears(e);
                    }
                    else {
                        this.currentDate = date;
                    }
                }
                break;
            case 0:
                this.addDay(this.currentDate, number, e, max, min);
                if (this.isMinMaxRange(this.currentDate)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.renderMonths(e);
                }
                else {
                    this.currentDate = date;
                }
                break;
        }
    };
    /**
     * Initialize the event handler
     * @private
     */
    CalendarBase.prototype.preRender = function (value) {
        var _this = this;
        this.navigatePreviousHandler = this.navigatePrevious.bind(this);
        this.navigateNextHandler = this.navigateNext.bind(this);
        this.defaultKeyConfigs = this.getDefaultKeyConfig();
        this.navigateHandler = function (e) {
            _this.triggerNavigate(e);
        };
    };
    ;
    CalendarBase.prototype.minMaxDate = function (localDate) {
        var currentDate = new Date(new Date(+localDate).setHours(0, 0, 0, 0));
        var minDate = new Date(new Date(+this.min).setHours(0, 0, 0, 0));
        var maxDate = new Date(new Date(+this.max).setHours(0, 0, 0, 0));
        if (+currentDate === +minDate || +currentDate === +maxDate) {
            if (+localDate < +this.min) {
                localDate = new Date(+this.min);
            }
            if (+localDate > +this.max) {
                localDate = new Date(+this.max);
            }
        }
        return localDate;
    };
    CalendarBase.prototype.renderMonths = function (e, value, isCustomDate) {
        var numCells = this.weekNumber ? 8 : 7;
        var tdEles;
        if (this.calendarMode === 'Gregorian') {
            tdEles = this.renderDays(this.currentDate, value, null, null, isCustomDate);
        }
        else {
            tdEles = this.islamicModule.islamicRenderDays(this.currentDate, value);
        }
        this.createContentHeader();
        if (this.calendarMode === 'Gregorian') {
            this.renderTemplate(tdEles, numCells, MONTH, e, value);
        }
        else {
            this.islamicModule.islamicRenderTemplate(tdEles, numCells, MONTH, e, value);
        }
    };
    // tslint:disable-next-line:max-func-body-length
    CalendarBase.prototype.renderDays = function (currentDate, value, multiSelection, values, isTodayDate) {
        var tdEles = [];
        var cellsCount = 42;
        var todayDate = isTodayDate ? new Date(+currentDate) : new Date();
        var localDate = new Date(this.checkValue(currentDate));
        var minMaxDate;
        var numCells = this.weekNumber ? 8 : 7;
        // 8 and 7 denotes the number of columns to be specified.
        var currentMonth = localDate.getMonth();
        this.titleUpdate(currentDate, 'days');
        var d = localDate;
        localDate = new Date(d.getFullYear(), d.getMonth(), 0, d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
        while (localDate.getDay() !== this.firstDayOfWeek) {
            this.setStartDate(localDate, -1 * dayMilliSeconds);
        }
        for (var day = 0; day < cellsCount; ++day) {
            var weekEle = this.createElement('td', { className: CELL });
            var weekAnchor = this.createElement('span');
            if (day % 7 === 0 && this.weekNumber) {
                var numberOfDays = void 0;
                // 6 days are added to get Last day of the week and 3 days are added to get middle day of the week.
                numberOfDays = this.weekRule === 'FirstDay' ? 6 : (this.weekRule === 'FirstFourDayWeek' ? 3 : 0);
                var finalDate = new Date(localDate.getFullYear(), localDate.getMonth(), (localDate.getDate() + numberOfDays));
                weekAnchor.textContent = '' + this.getWeek(finalDate);
                weekEle.appendChild(weekAnchor);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([weekEle], '' + WEEKNUMBER);
                tdEles.push(weekEle);
            }
            minMaxDate = new Date(+localDate);
            localDate = this.minMaxDate(localDate);
            var dateFormatOptions = { type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'D' : 'full' };
            var date = this.globalize.parseDate(this.globalize.formatDate(localDate, dateFormatOptions), dateFormatOptions);
            var tdEle = this.dayCell(localDate);
            var title = this.globalize.formatDate(localDate, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'D' : 'full' });
            var dayLink = this.createElement('span');
            dayLink.textContent = this.globalize.formatDate(localDate, { format: 'd', type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' });
            var disabled = (this.min > localDate) || (this.max < localDate);
            if (disabled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OVERLAY);
            }
            else {
                dayLink.setAttribute('title', '' + title);
            }
            if (currentMonth !== localDate.getMonth()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OTHERMONTH);
            }
            if (localDate.getDay() === 0 || localDate.getDay() === 6) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], WEEKEND);
            }
            tdEle.appendChild(dayLink);
            this.renderDayCellArgs = {
                date: localDate,
                isDisabled: false,
                element: tdEle,
                isOutOfRange: disabled
            };
            var argument = this.renderDayCellArgs;
            this.renderDayCellEvent(argument);
            if (argument.isDisabled) {
                var selectDate = new Date(this.checkValue(value));
                var argsDate = new Date(this.checkValue(argument.date));
                if (multiSelection) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values) && values.length > 0) {
                        for (var index = 0; index < values.length; index++) {
                            var localDateString = +new Date(this.globalize.formatDate(argument.date, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' }));
                            var tempDateString = +new Date(this.globalize.formatDate(values[index], { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' }));
                            if (localDateString === tempDateString) {
                                values.splice(index, 1);
                                index = -1;
                            }
                        }
                    }
                }
                else if (selectDate && +selectDate === +argsDate) {
                    this.setProperties({ value: null }, true);
                }
            }
            if (this.renderDayCellArgs.isDisabled && !tdEle.classList.contains(SELECTED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OVERLAY);
                if (+this.renderDayCellArgs.date === +this.todayDate) {
                    this.todayDisabled = true;
                }
            }
            var otherMnthBool = tdEle.classList.contains(OTHERMONTH);
            var disabledCls = tdEle.classList.contains(DISABLED);
            if (!disabledCls) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.clickHandler, this);
            }
            // to set the value as null while setting the disabled date onProperty change.
            // if (args.isDisabled && +this.value === +args.date) {
            //     this.setProperties({ value: null }, true);
            // }
            if (multiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values) && !disabledCls) {
                for (var tempValue = 0; tempValue < values.length; tempValue++) {
                    var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
                    var formatOptions = { format: this.getFromatStringValue(), type: 'date', skeleton: 'short', calendar: type };
                    var localDateString = this.globalize.formatDate(localDate, formatOptions);
                    var tempDateString = this.globalize.formatDate(values[tempValue], formatOptions);
                    if ((localDateString === tempDateString && this.getDateVal(localDate, values[tempValue]))
                        || (this.getDateVal(localDate, value))) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
                    }
                    else {
                        this.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
                    }
                }
                if (values.length <= 0) {
                    this.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
                }
            }
            else if (!disabledCls && this.getDateVal(localDate, value)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                this.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
            }
            if (date.getFullYear() === todayDate.getFullYear() && date.getMonth() === todayDate.getMonth()
                && date.getDate() === todayDate.getDate()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], TODAY);
            }
            tdEles.push(this.renderDayCellArgs.element);
            localDate = new Date(+minMaxDate);
            this.addDay(localDate, 1, null, this.max, this.min);
        }
        return tdEles;
    };
    CalendarBase.prototype.updateFocus = function (otherMonth, disabled, localDate, tableElement, currentDate) {
        if (currentDate.getDate() === localDate.getDate() && !otherMonth && !disabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tableElement], FOCUSEDDATE);
        }
        else {
            if (currentDate >= this.max && parseInt(tableElement.id, 0) === +this.max && !otherMonth && !disabled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tableElement], FOCUSEDDATE);
            }
            if (currentDate <= this.min && parseInt(tableElement.id, 0) === +this.min && !otherMonth && !disabled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tableElement], FOCUSEDDATE);
            }
        }
    };
    CalendarBase.prototype.renderYears = function (e, value) {
        this.removeTableHeadElement();
        var numCells = 4;
        var days;
        var tdEles = [];
        var valueUtil = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value);
        var curDate = new Date(this.checkValue(this.currentDate));
        var mon = curDate.getMonth();
        var yr = curDate.getFullYear();
        var localDate = curDate;
        var curYrs = localDate.getFullYear();
        var minYr = new Date(this.checkValue(this.min)).getFullYear();
        var minMonth = new Date(this.checkValue(this.min)).getMonth();
        var maxYr = new Date(this.checkValue(this.max)).getFullYear();
        var maxMonth = new Date(this.checkValue(this.max)).getMonth();
        localDate.setMonth(0);
        this.titleUpdate(this.currentDate, 'months');
        var disabled = (this.min > localDate) || (this.max < localDate);
        localDate.setDate(1);
        for (var month = 0; month < 12; ++month) {
            var tdEle = this.dayCell(localDate);
            var dayLink = this.createElement('span');
            var localMonth = (value && (value).getMonth() === localDate.getMonth());
            var select = (value && (value).getFullYear() === yr && localMonth);
            dayLink.textContent = this.toCapitalize(this.globalize.formatDate(localDate, {
                format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'MMM' : null, type: 'dateTime', skeleton: 'MMM'
            }));
            if ((this.min && (curYrs < minYr || (month < minMonth && curYrs === minYr))) || (this.max && (curYrs > maxYr || (month > maxMonth && curYrs >= maxYr)))) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
            }
            else if (!valueUtil && select) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                if (localDate.getMonth() === mon && this.currentDate.getMonth() === mon) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], FOCUSEDDATE);
                }
            }
            localDate.setDate(1);
            localDate.setMonth(localDate.getMonth() + 1);
            if (!tdEle.classList.contains(DISABLED)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.clickHandler, this);
            }
            tdEle.appendChild(dayLink);
            tdEles.push(tdEle);
        }
        this.renderTemplate(tdEles, numCells, YEAR, e, value);
    };
    CalendarBase.prototype.renderDecades = function (e, value) {
        this.removeTableHeadElement();
        var numCells = 4;
        var yearCell = 12;
        var tdEles = [];
        var localDate = new Date(this.checkValue(this.currentDate));
        localDate.setMonth(0);
        localDate.setDate(1);
        var localYr = localDate.getFullYear();
        var startYr = new Date(localDate.setFullYear((localYr - localYr % 10)));
        var endYr = new Date(localDate.setFullYear((localYr - localYr % 10 + (10 - 1))));
        var startFullYr = startYr.getFullYear();
        var endFullYr = endYr.getFullYear();
        var startHdrYr = this.globalize.formatDate(startYr, {
            format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'yyyy' : null, type: 'dateTime', skeleton: 'y'
        });
        var endHdrYr = this.globalize.formatDate(endYr, { format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'yyyy' : null, type: 'dateTime', skeleton: 'y' });
        this.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
        var start = new Date(localYr - (localYr % 10) - 1, 0, 1);
        var startYear = start.getFullYear();
        for (var rowIterator = 0; rowIterator < yearCell; ++rowIterator) {
            var year = startYear + rowIterator;
            localDate.setFullYear(year);
            var tdEle = this.dayCell(localDate);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(tdEle, { 'role': 'gridcell' });
            var dayLink = this.createElement('span');
            dayLink.textContent = this.globalize.formatDate(localDate, {
                format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'yyyy' : null, type: 'dateTime', skeleton: 'y'
            });
            if ((year < startFullYr) || (year > endFullYr)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OTHERDECADE);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && localDate.getFullYear() === (value).getFullYear()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
                }
                if (year < new Date(this.checkValue(this.min)).getFullYear() ||
                    year > new Date(this.checkValue(this.max)).getFullYear()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
                }
            }
            else if (year < new Date(this.checkValue(this.min)).getFullYear() ||
                year > new Date(this.checkValue(this.max)).getFullYear()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && localDate.getFullYear() === (value).getFullYear()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                if (localDate.getFullYear() === this.currentDate.getFullYear() && !tdEle.classList.contains(DISABLED)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], FOCUSEDDATE);
                }
            }
            if (!tdEle.classList.contains(DISABLED)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.clickHandler, this);
            }
            tdEle.appendChild(dayLink);
            tdEles.push(tdEle);
        }
        this.renderTemplate(tdEles, numCells, 'e-decade', e, value);
    };
    CalendarBase.prototype.dayCell = function (localDate) {
        var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
        var dateFormatOptions = { skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'F' : 'full', type: 'dateTime', calendar: type };
        var date = this.globalize.parseDate(this.globalize.formatDate(localDate, dateFormatOptions), dateFormatOptions);
        var value = date.valueOf();
        var attrs = {
            className: CELL, attrs: { 'id': '' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('' + value), 'aria-selected': 'false', 'role': 'gridcell' }
        };
        return this.createElement('td', attrs);
    };
    CalendarBase.prototype.firstDay = function (date) {
        var collection = this.currentView() !== 'Decade' ? this.tableBodyElement.querySelectorAll('td' + ':not(.' + OTHERMONTH + '') :
            this.tableBodyElement.querySelectorAll('td' + ':not(.' + OTHERDECADE + '');
        if (collection.length) {
            for (var i = 0; i < collection.length; i++) {
                if (!collection[i].classList.contains(DISABLED)) {
                    date = new Date(parseInt(collection[i].id, 0));
                    break;
                }
            }
        }
        return date;
    };
    CalendarBase.prototype.lastDay = function (date, view) {
        var lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
        if (view !== 2) {
            var timeOffset = Math.abs(lastDate.getTimezoneOffset() - this.firstDay(date).getTimezoneOffset());
            if (timeOffset) {
                lastDate.setHours(this.firstDay(date).getHours() + (timeOffset / 60));
            }
            return this.findLastDay(lastDate);
        }
        else {
            return this.findLastDay(this.firstDay(lastDate));
        }
    };
    ;
    CalendarBase.prototype.checkDateValue = function (value) {
        return (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && value instanceof Date && !isNaN(+value)) ? value : null;
    };
    CalendarBase.prototype.findLastDay = function (date) {
        var collection = this.currentView() === 'Decade' ? this.tableBodyElement.querySelectorAll('td' + ':not(.' + OTHERDECADE + '') :
            this.tableBodyElement.querySelectorAll('td' + ':not(.' + OTHERMONTH + '');
        if (collection.length) {
            for (var i = collection.length - 1; i >= 0; i--) {
                if (!collection[i].classList.contains(DISABLED)) {
                    date = new Date(parseInt(collection[i].id, 0));
                    break;
                }
            }
        }
        return date;
    };
    CalendarBase.prototype.removeTableHeadElement = function () {
        if (this.getModuleName() === 'calendar') {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelectorAll('.e-content table thead')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableHeadElement);
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelectorAll('.e-content table thead')[0])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableHeadElement);
            }
        }
    };
    CalendarBase.prototype.renderTemplate = function (elements, count, classNm, e, value) {
        var view = this.getViewNumber(this.currentView());
        var trEle;
        this.tableBodyElement = this.createElement('tbody');
        this.table.appendChild(this.tableBodyElement);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.contentElement, this.headerElement], [MONTH, DECADE, YEAR]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.contentElement, this.headerElement], [classNm]);
        var weekNumCell = 41;
        var numberCell = 35;
        var otherMonthCell = 6;
        var row = count;
        var rowIterator = 0;
        for (var dayCell = 0; dayCell < elements.length / count; ++dayCell) {
            trEle = this.createElement('tr', { attrs: { 'role': 'row' } });
            for (rowIterator = 0 + rowIterator; rowIterator < row; rowIterator++) {
                if (!elements[rowIterator].classList.contains('e-week-number') && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(elements[rowIterator].children[0])) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([elements[rowIterator].children[0]], [LINK]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(elements[rowIterator].children[0], {
                        duration: 600,
                        isCenterRipple: true
                    });
                }
                trEle.appendChild(elements[rowIterator]);
                if (this.weekNumber && rowIterator === otherMonthCell + 1 && elements[otherMonthCell + 1].classList.contains(OTHERMONTH)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                }
                if (!this.weekNumber && rowIterator === otherMonthCell && elements[otherMonthCell].classList.contains(OTHERMONTH)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                }
                if (this.weekNumber) {
                    if (rowIterator === weekNumCell && elements[weekNumCell].classList.contains(OTHERMONTH)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                    }
                }
                else {
                    if (rowIterator === numberCell && elements[numberCell].classList.contains(OTHERMONTH)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                    }
                }
            }
            row = row + count;
            rowIterator = rowIterator + 0;
            this.tableBodyElement.appendChild(trEle);
        }
        this.table.querySelector('tbody').className = this.effect;
        if (this.calendarMode === 'Gregorian') {
            this.iconHandler();
        }
        else {
            this.islamicModule.islamicIconHandler();
        }
        if (view !== this.getViewNumber(this.currentView()) || (view === 0 && view !== this.getViewNumber(this.currentView()))) {
            this.navigateHandler(e);
        }
        this.setAriaActiveDescendant();
    };
    CalendarBase.prototype.clickHandler = function (e, value) {
        this.clickEventEmitter(e);
        var eve = e.currentTarget;
        var view = this.getViewNumber(this.currentView());
        if (eve.classList.contains(OTHERMONTH)) {
            this.contentClick(e, 0, null, value);
        }
        else if (view === this.getViewNumber(this.depth) && this.getViewNumber(this.start) >= this.getViewNumber(this.depth)) {
            this.contentClick(e, 1, null, value);
        }
        else if (2 === view) {
            this.contentClick(e, 1, null, value);
        }
        else if (!eve.classList.contains(OTHERMONTH) && view === 0) {
            this.selectDate(e, this.getIdValue(e, null), null);
        }
        else {
            this.contentClick(e, 0, eve, value);
        }
        if (this.getModuleName() === 'calendar') {
            this.table.focus();
        }
    };
    // Content click event handler required for extended components
    CalendarBase.prototype.clickEventEmitter = function (e) {
        e.preventDefault();
    };
    CalendarBase.prototype.contentClick = function (e, view, element, value) {
        var currentView = this.getViewNumber(this.currentView());
        var d = this.getIdValue(e, element);
        switch (view) {
            case 0:
                if (currentView === this.getViewNumber(this.depth) && this.getViewNumber(this.start) >= this.getViewNumber(this.depth)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.currentDate = d;
                    this.effect = ZOOMIN;
                    this.renderMonths(e);
                }
                else {
                    if (this.calendarMode === 'Gregorian') {
                        this.currentDate.setMonth(d.getMonth());
                        if (d.getMonth() > 0 && this.currentDate.getMonth() !== d.getMonth()) {
                            this.currentDate.setDate(0);
                        }
                        this.currentDate.setFullYear(d.getFullYear());
                    }
                    else {
                        this.currentDate = d;
                    }
                    this.effect = ZOOMIN;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.renderMonths(e);
                }
                break;
            case 1:
                if (currentView === this.getViewNumber(this.depth) && this.getViewNumber(this.start) >= this.getViewNumber(this.depth)) {
                    this.selectDate(e, d, null);
                }
                else {
                    if (this.calendarMode === 'Gregorian') {
                        this.currentDate.setFullYear(d.getFullYear());
                    }
                    else {
                        var islamicDate = this.islamicModule.getIslamicDate(d);
                        this.currentDate = this.islamicModule.toGregorian(islamicDate.year, islamicDate.month, 1);
                    }
                    this.effect = ZOOMIN;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.renderYears(e);
                }
        }
    };
    CalendarBase.prototype.switchView = function (view, e, multiSelection, isCustomDate) {
        switch (view) {
            case 0:
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                this.renderMonths(e, null, isCustomDate);
                if (multiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tableBodyElement.querySelectorAll('.' + FOCUSEDDATE)[0])) {
                    this.tableBodyElement.querySelectorAll('.' + FOCUSEDDATE)[0].classList.remove(FOCUSEDDATE);
                }
                break;
            case 1:
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                this.renderYears(e);
                break;
            case 2:
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                this.renderDecades(e);
        }
    };
    /**
     * To get component name
     * @private
     */
    CalendarBase.prototype.getModuleName = function () {
        return 'calendar';
    };
    /**

     */
    CalendarBase.prototype.requiredModules = function () {
        var modules = [];
        if (this) {
            modules.push({ args: [this], member: 'islamic' });
        }
        return modules;
    };
    /**
     * Gets the properties to be maintained upon browser refresh.
     * @returns string
     */
    CalendarBase.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Called internally if any of the property value changed.
     * returns void
     * @private
     */
    CalendarBase.prototype.onPropertyChanged = function (newProp, oldProp, multiSelection, values) {
        this.effect = '';
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        if (this.getModuleName() === 'calendar') {
                            this.element.classList.add('e-rtl');
                        }
                        else {
                            this.calendarElement.classList.add('e-rtl');
                        }
                    }
                    else {
                        if (this.getModuleName() === 'calendar') {
                            this.element.classList.remove('e-rtl');
                        }
                        else {
                            this.calendarElement.classList.remove('e-rtl');
                        }
                    }
                    break;
                case 'dayHeaderFormat':
                    this.getCultureValues();
                    this.createContentHeader();
                    this.adjustLongHeaderSize();
                    break;
                case 'min':
                case 'max':
                    this.rangeValidation(this.min, this.max);
                    prop === 'min' ? this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(newProp.min))) }, true) :
                        this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(newProp.max))) }, true);
                    this.setProperties({ start: this.currentView() }, true);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
                    this.minMaxUpdate();
                    if (multiSelection) {
                        this.validateValues(multiSelection, values);
                    }
                    this.createContentBody();
                    if ((this.todayDate < this.min || this.max < this.todayDate) && (this.footer) && (this.todayElement)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.todayElement);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.footer);
                        this.todayElement = this.footer = null;
                        this.createContentFooter();
                    }
                    else {
                        if ((this.footer) && (this.todayElement) && this.todayElement.classList.contains('e-disabled')) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.todayElement], DISABLED);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.todayElement);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.footer);
                            this.todayElement = this.footer = null;
                            this.createContentFooter();
                        }
                    }
                    break;
                case 'start':
                case 'depth':
                case 'weekNumber':
                case 'firstDayOfWeek':
                case 'weekRule':
                    this.checkView();
                    this.createContentHeader();
                    this.createContentBody();
                    break;
                case 'locale':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.createContentHeader();
                    this.createContentBody();
                    this.l10.setLocale(this.locale);
                    this.updateFooter();
                    break;
                case 'showTodayButton':
                    if (newProp.showTodayButton) {
                        this.createContentFooter();
                    }
                    else {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.todayElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.footer)) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.todayElement);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.footer);
                            this.todayElement = this.footer = undefined;
                        }
                    }
                    this.setProperties({ showTodayButton: newProp.showTodayButton }, true);
                    break;
            }
        }
    };
    /**
     * values property updated with considered disabled dates of the calendar.
     */
    CalendarBase.prototype.validateValues = function (multiSelection, values) {
        if (multiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values) && values.length > 0) {
            var copyValues = this.copyValues(values);
            for (var skipIndex = 0; skipIndex < copyValues.length; skipIndex++) {
                var tempValue = copyValues[skipIndex];
                var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
                var tempValueString = void 0;
                if (this.calendarMode === 'Gregorian') {
                    /* tslint:disable-next-line:max-line-length */
                    tempValueString = this.globalize.formatDate(tempValue, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' });
                }
                else {
                    /* tslint:disable-next-line:max-line-length */
                    tempValueString = this.globalize.formatDate(tempValue, { type: 'dateTime', skeleton: 'full', calendar: 'islamic' });
                }
                var minFormatOption = { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd', calendar: type };
                var minStringValue = this.globalize.formatDate(this.min, minFormatOption);
                var minString = minStringValue;
                var maxFormatOption = { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd', calendar: type };
                var maxStringValue = this.globalize.formatDate(this.max, maxFormatOption);
                var maxString = maxStringValue;
                if (+new Date(tempValueString) < +new Date(minString) ||
                    +new Date(tempValueString) > +new Date(maxString)) {
                    copyValues.splice(skipIndex, 1);
                    skipIndex = -1;
                }
            }
            this.setProperties({ values: copyValues }, true);
        }
    };
    CalendarBase.prototype.setValueUpdate = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tableBodyElement)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.tableBodyElement);
            this.setProperties({ start: this.currentView() }, true);
            this.createContentBody();
        }
    };
    CalendarBase.prototype.copyValues = function (values) {
        var copyValues = [];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values) && values.length > 0) {
            for (var index = 0; index < values.length; index++) {
                copyValues.push(new Date(+values[index]));
            }
        }
        return copyValues;
    };
    CalendarBase.prototype.titleUpdate = function (date, view) {
        var globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        var dayFormatOptions;
        var monthFormatOptions;
        var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
        if (this.calendarMode === 'Gregorian') {
            dayFormatOptions = globalize.formatDate(date, { type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'y' : 'yMMMM', calendar: type });
            monthFormatOptions = globalize.formatDate(date, {
                format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'yyyy' : null, type: 'dateTime', skeleton: 'y', calendar: type
            });
        }
        else {
            dayFormatOptions = globalize.formatDate(date, { type: 'dateTime', format: 'MMMM y', calendar: type });
            monthFormatOptions = globalize.formatDate(date, { type: 'dateTime', format: 'y', calendar: type });
        }
        switch (view) {
            case 'days':
                this.headerTitleElement.textContent = this.toCapitalize(dayFormatOptions);
                break;
            case 'months':
                this.headerTitleElement.textContent = monthFormatOptions;
        }
    };
    CalendarBase.prototype.setActiveDescendant = function () {
        var id;
        var focusedEle = this.tableBodyElement.querySelector('tr td.e-focused-date');
        var selectedEle = this.tableBodyElement.querySelector('tr td.e-selected');
        var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
        var title;
        var view = this.currentView();
        if (view === 'Month') {
            title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'D' : 'full', calendar: type });
        }
        else if (view === 'Year') {
            if (type !== 'islamic') {
                title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'y' : 'yMMMM', calendar: type });
            }
            else {
                title = this.globalize.formatDate(this.currentDate, { type: 'date', skeleton: 'GyMMM', calendar: type });
            }
        }
        else {
            title = this.globalize.formatDate(this.currentDate, {
                format: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'yyyy' : null, type: 'date', skeleton: 'y', calendar: type
            });
        }
        if (selectedEle || focusedEle) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedEle)) {
                selectedEle.setAttribute('aria-selected', 'true');
            }
            (focusedEle || selectedEle).setAttribute('aria-label', title);
            id = (focusedEle || selectedEle).getAttribute('id');
        }
        return id;
    };
    CalendarBase.prototype.iconHandler = function () {
        new Date(this.checkValue(this.currentDate)).setDate(1);
        switch (this.currentView()) {
            case 'Month':
                this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)), this.min) < 1);
                this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)), this.max) > -1);
                break;
            case 'Year':
                this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)), this.min) < 1);
                this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)), this.max) > -1);
                break;
            case 'Decade':
                this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)), this.min) < 1);
                this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)), this.max) > -1);
        }
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    CalendarBase.prototype.destroy = function () {
        if (this.getModuleName() === 'calendar' && this.element) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [ROOT]);
        }
        else {
            if (this.calendarElement && this.element) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [ROOT]);
            }
        }
        if (this.getModuleName() === 'calendar' && this.element) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.headerTitleElement, 'click', this.navigateTitle);
            if (this.todayElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.todayElement, 'click', this.todayButtonClick);
            }
            this.previousIconHandler(true);
            this.nextIconHandler(true);
            this.keyboardModule.destroy();
            this.element.removeAttribute('data-role');
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarEleCopy.getAttribute('tabindex'))) ?
                this.element.setAttribute('tabindex', this.tabIndex) : this.element.removeAttribute('tabindex');
        }
        if (this.element) {
            this.element.innerHTML = '';
        }
        _super.prototype.destroy.call(this);
    };
    CalendarBase.prototype.title = function (e) {
        var currentView = this.getViewNumber(this.currentView());
        this.effect = ZOOMIN;
        this.switchView(++currentView, e);
    };
    CalendarBase.prototype.getViewNumber = function (stringVal) {
        if (stringVal === 'Month') {
            return 0;
        }
        else if (stringVal === 'Year') {
            return 1;
        }
        else {
            return 2;
        }
    };
    CalendarBase.prototype.navigateTitle = function (e) {
        e.preventDefault();
        this.title(e);
        if (this.getModuleName() === 'calendar') {
            this.table.focus();
        }
    };
    CalendarBase.prototype.previous = function () {
        this.effect = '';
        var currentView = this.getViewNumber(this.currentView());
        switch (this.currentView()) {
            case 'Month':
                this.addMonths(this.currentDate, -1);
                this.switchView(currentView);
                break;
            case 'Year':
                this.addYears(this.currentDate, -1);
                this.switchView(currentView);
                break;
            case 'Decade':
                this.addYears(this.currentDate, -10);
                this.switchView(currentView);
                break;
        }
    };
    CalendarBase.prototype.navigatePrevious = function (e) {
        e.preventDefault();
        if (this.calendarMode === 'Gregorian') {
            this.previous();
        }
        else {
            this.islamicModule.islamicPrevious();
        }
        this.triggerNavigate(e);
        if (this.getModuleName() === 'calendar') {
            this.table.focus();
        }
    };
    CalendarBase.prototype.next = function () {
        this.effect = '';
        var currentView = this.getViewNumber(this.currentView());
        switch (this.currentView()) {
            case 'Month':
                this.addMonths(this.currentDate, 1);
                this.switchView(currentView);
                break;
            case 'Year':
                this.addYears(this.currentDate, 1);
                this.switchView(currentView);
                break;
            case 'Decade':
                this.addYears(this.currentDate, 10);
                this.switchView(currentView);
                break;
        }
    };
    CalendarBase.prototype.navigateNext = function (eve) {
        eve.preventDefault();
        if (this.calendarMode === 'Gregorian') {
            this.next();
        }
        else {
            this.islamicModule.islamicNext();
        }
        this.triggerNavigate(eve);
        if (this.getModuleName() === 'calendar') {
            this.table.focus();
        }
    };
    /**
     * This method is used to navigate to the month/year/decade view of the Calendar.
     * @param  {string} view - Specifies the view of the Calendar.
     * @param  {Date} date - Specifies the focused date in a view.
     * @returns void
     */
    CalendarBase.prototype.navigateTo = function (view, date, isCustomDate) {
        if (+date >= +this.min && +date <= +this.max) {
            this.currentDate = date;
        }
        if (+date <= +this.min) {
            this.currentDate = new Date(this.checkValue(this.min));
        }
        if (+date >= +this.max) {
            this.currentDate = new Date(this.checkValue(this.max));
        }
        if ((this.getViewNumber(this.depth) >= this.getViewNumber(view))) {
            if ((this.getViewNumber(this.depth) <= this.getViewNumber(this.start))
                || this.getViewNumber(this.depth) === this.getViewNumber(view)) {
                view = this.depth;
            }
        }
        this.switchView(this.getViewNumber(view), null, null, isCustomDate);
    };
    /**
     * Gets the current view of the Calendar.
     * @returns string
     */
    CalendarBase.prototype.currentView = function () {
        if (this.contentElement.classList.contains(YEAR)) {
            return 'Year';
        }
        else if (this.contentElement.classList.contains(DECADE)) {
            return 'Decade';
        }
        else {
            return 'Month';
        }
    };
    CalendarBase.prototype.getDateVal = function (date, value) {
        return (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && date.getDate() === (value).getDate()
            && date.getMonth() === (value).getMonth() && date.getFullYear() === (value).getFullYear());
    };
    CalendarBase.prototype.getCultureObjects = function (ld, c) {
        var gregorianFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? '.dates.days.' :
            '.dates.calendars.gregorian.days.format.') + this.dayHeaderFormat.toLowerCase();
        var islamicFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? '.dates.days.' :
            '.dates.calendars.islamic.days.format.') + this.dayHeaderFormat.toLowerCase();
        var mainVal = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? '' : 'main.';
        if (this.calendarMode === 'Gregorian') {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mainVal + '' + this.locale + gregorianFormat, ld);
        }
        else {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.locale + islamicFormat, ld);
        }
    };
    ;
    CalendarBase.prototype.getWeek = function (d) {
        var currentDate = new Date(this.checkValue(d)).valueOf();
        var date = new Date(d.getFullYear(), 0, 1).valueOf();
        return Math.ceil((((currentDate - date) + dayMilliSeconds) / dayMilliSeconds) / 7);
    };
    CalendarBase.prototype.setStartDate = function (date, time) {
        var tzOffset = date.getTimezoneOffset();
        var d = new Date(date.getTime() + time);
        var tzOffsetDiff = d.getTimezoneOffset() - tzOffset;
        date.setTime(d.getTime() + tzOffsetDiff * minutesMilliSeconds);
    };
    CalendarBase.prototype.addMonths = function (date, i) {
        if (this.calendarMode === 'Gregorian') {
            var day = date.getDate();
            date.setDate(1);
            date.setMonth(date.getMonth() + i);
            date.setDate(Math.min(day, this.getMaxDays(date)));
        }
        else {
            var islamicDate = this.islamicModule.getIslamicDate(date);
            this.currentDate = this.islamicModule.toGregorian(islamicDate.year, (islamicDate.month) + i, 1);
        }
    };
    CalendarBase.prototype.addYears = function (date, i) {
        if (this.calendarMode === 'Gregorian') {
            var day = date.getDate();
            date.setDate(1);
            date.setFullYear(date.getFullYear() + i);
            date.setDate(Math.min(day, this.getMaxDays(date)));
        }
        else {
            var islamicDate = this.islamicModule.getIslamicDate(date);
            this.currentDate = this.islamicModule.toGregorian(islamicDate.year + i, (islamicDate.month), 1);
        }
    };
    CalendarBase.prototype.getIdValue = function (e, element) {
        var eve;
        if (e) {
            eve = e.currentTarget;
        }
        else {
            eve = element;
        }
        var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
        var dateFormatOptions = { type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'F' : 'full', calendar: type };
        var dateString = this.globalize.formatDate(new Date(parseInt('' + eve.getAttribute('id'), 0)), dateFormatOptions);
        var date = this.globalize.parseDate(dateString, dateFormatOptions);
        var value = date.valueOf() - date.valueOf() % 1000;
        return new Date(value);
        //return this.globalize.parseDate(dateString, dateFormatOptions);
    };
    CalendarBase.prototype.adjustLongHeaderSize = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], DAYHEADERLONG);
        if (this.dayHeaderFormat === 'Wide') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.getModuleName() === 'calendar' ? this.element : this.calendarElement], DAYHEADERLONG);
        }
    };
    CalendarBase.prototype.selectDate = function (e, date, node, multiSelection, values) {
        var element = node || e.currentTarget;
        this.isDateSelected = false;
        if (this.currentView() === 'Decade') {
            this.setDateDecade(this.currentDate, date.getFullYear());
        }
        else if (this.currentView() === 'Year') {
            this.setDateYear(this.currentDate, date);
        }
        else {
            if (multiSelection && !this.checkPresentDate(date, values)) {
                var copyValues = this.copyValues(values);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values) && copyValues.length > 0) {
                    copyValues.push(new Date(this.checkValue(date)));
                    this.setProperties({ values: copyValues }, true);
                    this.setProperties({ value: values[values.length - 1] }, true);
                }
                else {
                    this.setProperties({ values: [new Date(this.checkValue(date))] }, true);
                }
            }
            else {
                this.setProperties({ value: new Date(this.checkValue(date)) }, true);
            }
            this.currentDate = new Date(this.checkValue(date));
        }
        var tableBodyElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, '.' + ROOT);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tableBodyElement)) {
            tableBodyElement = this.tableBodyElement;
        }
        if (!multiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tableBodyElement.querySelector('.' + SELECTED))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([tableBodyElement.querySelector('.' + SELECTED)], SELECTED);
        }
        if (!multiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tableBodyElement.querySelector('.' + FOCUSEDDATE))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([tableBodyElement.querySelector('.' + FOCUSEDDATE)], FOCUSEDDATE);
        }
        if (multiSelection) {
            var copyValues = this.copyValues(values);
            var collection = Array.prototype.slice.call(this.tableBodyElement.querySelectorAll('td'));
            for (var index = 0; index < collection.length; index++) {
                var tempElement = tableBodyElement.querySelectorAll('td' + '.' + FOCUSEDDATE)[0];
                var selectedElement = tableBodyElement.querySelectorAll('td' + '.' + SELECTED)[0];
                if (collection[index] === tempElement) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([collection[index]], FOCUSEDDATE);
                }
                if (collection[index] === selectedElement &&
                    !this.checkPresentDate(new Date(parseInt(selectedElement.getAttribute('id').split('_')[0], 10)), values)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([collection[index]], SELECTED);
                }
            }
            if (element.classList.contains(SELECTED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], SELECTED);
                for (var i = 0; i < copyValues.length; i++) {
                    var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
                    var formatOptions = { format: this.getFromatStringValue(), type: 'date', skeleton: 'short', calendar: type };
                    var localDateString = this.globalize.formatDate(date, formatOptions);
                    var tempDateString = this.globalize.formatDate(copyValues[i], formatOptions);
                    if (localDateString === tempDateString) {
                        var index = copyValues.indexOf(copyValues[i]);
                        copyValues.splice(index, 1);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], FOCUSEDDATE);
                    }
                }
                this.setProperties({ values: copyValues }, true);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], SELECTED);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], SELECTED);
        }
        this.isDateSelected = true;
    };
    CalendarBase.prototype.getFromatStringValue = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ?
            // tslint:disable-next-line
            'M' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])().dateSeperator + 'd' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])().dateSeperator + 'yy'
            : null;
    };
    CalendarBase.prototype.checkPresentDate = function (dates, values) {
        var previousValue = false;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(values)) {
            for (var checkPrevious = 0; checkPrevious < values.length; checkPrevious++) {
                var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
                /* tslint:disable-next-line:max-line-length */
                var localDateString = this.globalize.formatDate(dates, {
                    format: this.getFromatStringValue(), type: 'date', skeleton: 'short', calendar: type
                });
                /* tslint:disable-next-line:max-line-length */
                var tempDateString = this.globalize.formatDate(values[checkPrevious], {
                    format: this.getFromatStringValue(), type: 'date', skeleton: 'short', calendar: type
                });
                if (localDateString === tempDateString) {
                    previousValue = true;
                }
            }
        }
        return previousValue;
    };
    CalendarBase.prototype.setAriaActiveDescendant = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.table, {
            'aria-activedescendant': '' + this.setActiveDescendant()
        });
    };
    CalendarBase.prototype.previousIconHandler = function (disabled) {
        if (disabled) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.previousIcon, 'click', this.navigatePreviousHandler);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.previousIcon], '' + DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.previousIcon], '' + OVERLAY);
            this.previousIcon.setAttribute('aria-disabled', 'true');
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.previousIcon, 'click', this.navigatePreviousHandler);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.previousIcon], '' + DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.previousIcon], '' + OVERLAY);
            this.previousIcon.setAttribute('aria-disabled', 'false');
        }
    };
    CalendarBase.prototype.renderDayCellEvent = function (args) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.renderDayCellArgs, { name: 'renderDayCell' });
        this.trigger('renderDayCell', args);
    };
    CalendarBase.prototype.navigatedEvent = function (eve) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.navigatedArgs, { name: 'navigated', event: eve });
        this.trigger('navigated', this.navigatedArgs);
    };
    CalendarBase.prototype.triggerNavigate = function (event) {
        this.navigatedArgs = { view: this.currentView(), date: this.currentDate };
        this.navigatedEvent(event);
    };
    CalendarBase.prototype.nextIconHandler = function (disabled) {
        if (disabled) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.nextIcon, 'click', this.navigateNextHandler);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.nextIcon], DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.nextIcon], OVERLAY);
            this.nextIcon.setAttribute('aria-disabled', 'true');
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.nextIcon, 'click', this.navigateNextHandler);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.nextIcon], DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.nextIcon], OVERLAY);
            this.nextIcon.setAttribute('aria-disabled', 'false');
        }
    };
    CalendarBase.prototype.compare = function (startDate, endDate, modifier) {
        var start = endDate.getFullYear();
        var end;
        var result;
        end = start;
        result = 0;
        if (modifier) {
            start = start - start % modifier;
            end = start - start % modifier + modifier - 1;
        }
        if (startDate.getFullYear() > end) {
            result = 1;
        }
        else if (startDate.getFullYear() < start) {
            result = -1;
        }
        return result;
    };
    CalendarBase.prototype.isMinMaxRange = function (date) {
        return +date >= +this.min && +date <= +this.max;
    };
    CalendarBase.prototype.isMonthYearRange = function (date) {
        if (this.calendarMode === 'Gregorian') {
            return date.getMonth() >= this.min.getMonth()
                && date.getFullYear() >= this.min.getFullYear()
                && date.getMonth() <= this.max.getMonth()
                && date.getFullYear() <= this.max.getFullYear();
        }
        else {
            var islamicDate = this.islamicModule.getIslamicDate(date);
            return islamicDate.month >= (this.islamicModule.getIslamicDate(new Date(1944, 1, 18))).month
                && islamicDate.year >= (this.islamicModule.getIslamicDate(new Date(1944, 1, 18))).year
                && islamicDate.month <= (this.islamicModule.getIslamicDate(new Date(2069, 1, 16))).month
                && islamicDate.year <= (this.islamicModule.getIslamicDate(new Date(2069, 1, 16))).year;
        }
    };
    CalendarBase.prototype.compareYear = function (start, end) {
        return this.compare(start, end, 0);
    };
    CalendarBase.prototype.compareDecade = function (start, end) {
        return this.compare(start, end, 10);
    };
    CalendarBase.prototype.shiftArray = function (array, i) {
        return array.slice(i).concat(array.slice(0, i));
    };
    CalendarBase.prototype.addDay = function (date, i, e, max, min) {
        var column = i;
        var value = new Date(+date);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tableBodyElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)) {
            while (this.findNextTD(new Date(+date), column, max, min)) {
                column += i;
            }
            var rangeValue = new Date(value.setDate(value.getDate() + column));
            column = (+rangeValue > +max || +rangeValue < +min) ? column === i ? i - i : i : column;
        }
        date.setDate(date.getDate() + column);
    };
    CalendarBase.prototype.findNextTD = function (date, column, max, min) {
        var value = new Date(date.setDate(date.getDate() + column));
        var collection = [];
        var isDisabled = false;
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && value.getMonth()) === (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.currentDate) && this.currentDate.getMonth())) {
            var tdEles = void 0;
            if (this.calendarMode === 'Gregorian') {
                tdEles = this.renderDays(value);
            }
            else {
                tdEles = this.islamicModule.islamicRenderDays(this.currentDate, value);
            }
            collection = tdEles.filter(function (element) {
                return element.classList.contains(DISABLED);
            });
        }
        else {
            collection = this.tableBodyElement.querySelectorAll('td.' + DISABLED);
        }
        if (+value <= (+(max)) && +value >= (+(min))) {
            if (collection.length) {
                for (var i = 0; i < collection.length; i++) {
                    isDisabled = (+value === +new Date(parseInt(collection[i].id, 0))) ? true : false;
                    if (isDisabled) {
                        break;
                    }
                }
            }
        }
        return isDisabled;
    };
    CalendarBase.prototype.getMaxDays = function (d) {
        var date;
        var month;
        var tmpDate = new Date(this.checkValue(d));
        date = 28;
        month = tmpDate.getMonth();
        while (tmpDate.getMonth() === month) {
            ++date;
            tmpDate.setDate(date);
        }
        return date - 1;
    };
    CalendarBase.prototype.setDateDecade = function (date, year) {
        date.setFullYear(year);
        this.setProperties({ value: new Date(this.checkValue(date)) }, true);
    };
    ;
    CalendarBase.prototype.setDateYear = function (date, value) {
        date.setFullYear(value.getFullYear(), value.getMonth(), date.getDate());
        if (value.getMonth() !== date.getMonth()) {
            date.setDate(0);
            this.currentDate = new Date(this.checkValue(value));
        }
        this.setProperties({ value: new Date(this.checkValue(date)) }, true);
    };
    CalendarBase.prototype.compareMonth = function (start, end) {
        var result;
        if (start.getFullYear() > end.getFullYear()) {
            result = 1;
        }
        else if (start.getFullYear() < end.getFullYear()) {
            result = -1;
        }
        else {
            result = start.getMonth() === end.getMonth() ? 0 : start.getMonth() > end.getMonth() ? 1 : -1;
        }
        return result;
    };
    CalendarBase.prototype.checkValue = function (inValue) {
        if (inValue instanceof Date) {
            return (inValue.toUTCString());
        }
        else {
            return ('' + inValue);
        }
    };
    CalendarBase.prototype.checkView = function () {
        if (this.start !== 'Decade' && this.start !== 'Year') {
            this.setProperties({ start: 'Month' }, true);
        }
        if (this.depth !== 'Decade' && this.depth !== 'Year') {
            this.setProperties({ depth: 'Month' }, true);
        }
        if (this.getViewNumber(this.depth) > this.getViewNumber(this.start)) {
            this.setProperties({ depth: 'Month' }, true);
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(1900, 0, 1))
    ], CalendarBase.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], CalendarBase.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], CalendarBase.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(2099, 11, 31))
    ], CalendarBase.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], CalendarBase.prototype, "firstDayOfWeek", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Gregorian')
    ], CalendarBase.prototype, "calendarMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], CalendarBase.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], CalendarBase.prototype, "depth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CalendarBase.prototype, "weekNumber", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('FirstDay')
    ], CalendarBase.prototype, "weekRule", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], CalendarBase.prototype, "showTodayButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Short')
    ], CalendarBase.prototype, "dayHeaderFormat", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], CalendarBase.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], CalendarBase.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], CalendarBase.prototype, "serverTimezoneOffset", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CalendarBase.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CalendarBase.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CalendarBase.prototype, "navigated", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], CalendarBase.prototype, "renderDayCell", void 0);
    CalendarBase = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], CalendarBase);
    return CalendarBase;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));

/**
 * Represents the Calendar component that allows the user to select a date.
 * ```html
 * <div id="calendar"/>
 * ```
 * ```typescript
 * <script>
 *   var calendarObj = new Calendar({ value: new Date() });
 *   calendarObj.appendTo("#calendar");
 * </script>
 * ```
 */
var Calendar = /** @__PURE__ @class */ (function (_super) {
    __extends(Calendar, _super);
    /**
     * Initialized new instance of Calendar Class.
     * Constructor for creating the widget
     * @param  {CalendarModel} options?
     * @param  {string|HTMLElement} element?
     */
    function Calendar(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * To Initialize the control rendering.
     * @returns void
     * @private
     */
    Calendar.prototype.render = function () {
        if (this.calendarMode === 'Islamic' && this.islamicModule === undefined) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["throwError"])('Requires the injectable Islamic modules to render Calendar in Islamic mode');
        }
        if (this.isMultiSelection && typeof this.values === 'object' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.values) && this.values.length > 0) {
            var tempValues = [];
            var copyValues = [];
            for (var limit = 0; limit < this.values.length; limit++) {
                if (tempValues.indexOf(+this.values[limit]) === -1) {
                    tempValues.push(+this.values[limit]);
                    copyValues.push(this.values[limit]);
                }
            }
            this.setProperties({ values: copyValues }, true);
            for (var index = 0; index < this.values.length; index++) {
                if (!this.checkDateValue(this.values[index])) {
                    if (typeof (this.values[index]) === 'string' && this.checkDateValue(new Date(this.checkValue(this.values[index])))) {
                        var copyDate = new Date(this.checkValue(this.values[index]));
                        this.values.splice(index, 1);
                        this.values.splice(index, 0, copyDate);
                    }
                    else {
                        this.values.splice(index, 1);
                    }
                }
            }
            this.setProperties({ value: this.values[this.values.length - 1] }, true);
            this.previousValues = this.values.length;
        }
        this.validateDate();
        this.minMaxUpdate();
        this.setEnable(this.enabled);
        if (this.getModuleName() === 'calendar') {
            this.setClass(this.cssClass);
        }
        _super.prototype.render.call(this);
        if (this.getModuleName() === 'calendar') {
            var form = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
            if (form) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(form, 'reset', this.formResetHandler.bind(this));
            }
            this.setTimeZone(this.serverTimezoneOffset);
        }
        this.renderComplete();
    };
    Calendar.prototype.setEnable = function (enable) {
        if (!enable) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], DISABLED);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], DISABLED);
        }
    };
    Calendar.prototype.setClass = function (newCssClass, oldCssClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCssClass)) {
            oldCssClass = (oldCssClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newCssClass)) {
            newCssClass = (newCssClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCssClass) && oldCssClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldCssClass.split(' '));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newCssClass)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newCssClass.split(' '));
        }
    };
    Calendar.prototype.isDayLightSaving = function () {
        var secondOffset = new Date(this.value.getFullYear(), 6, 1).getTimezoneOffset();
        var firstOffset = new Date(this.value.getFullYear(), 0, 1).getTimezoneOffset();
        return (this.value.getTimezoneOffset() < Math.max(firstOffset, secondOffset));
    };
    Calendar.prototype.setTimeZone = function (offsetValue) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.serverTimezoneOffset) && this.value) {
            var serverTimezoneDiff = offsetValue;
            var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
            var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
            timeZoneDiff = this.isDayLightSaving() ? timeZoneDiff-- : timeZoneDiff;
            this.value = new Date(this.value.getTime() + (timeZoneDiff * 60 * 60 * 1000));
        }
    };
    Calendar.prototype.formResetHandler = function () {
        this.setProperties({ value: null }, true);
    };
    Calendar.prototype.validateDate = function () {
        if (typeof this.value === 'string') {
            this.setProperties({ value: this.checkDateValue(new Date(this.checkValue(this.value))) }, true); // persist the value property.
        }
        _super.prototype.validateDate.call(this, this.value);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.min <= this.max && this.value >= this.min && this.value <= this.max) {
            this.currentDate = new Date(this.checkValue(this.value));
        }
        if (isNaN(+this.value)) {
            this.setProperties({ value: null }, true);
        }
    };
    Calendar.prototype.minMaxUpdate = function () {
        if (this.getModuleName() === 'calendar') {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value <= this.min && this.min <= this.max) {
                this.setProperties({ value: this.min }, true);
                this.changedArgs = { value: this.value };
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value >= this.max && this.min <= this.max) {
                    this.setProperties({ value: this.max }, true);
                    this.changedArgs = { value: this.value };
                }
            }
        }
        if (this.getModuleName() !== 'calendar' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value < this.min && this.min <= this.max) {
                _super.prototype.minMaxUpdate.call(this, this.min);
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value > this.max && this.min <= this.max) {
                    _super.prototype.minMaxUpdate.call(this, this.max);
                }
            }
        }
        else {
            _super.prototype.minMaxUpdate.call(this, this.value);
        }
    };
    Calendar.prototype.generateTodayVal = function (value) {
        var tempValue = new Date();
        if (value) {
            tempValue.setHours(value.getHours());
            tempValue.setMinutes(value.getMinutes());
            tempValue.setSeconds(value.getSeconds());
            tempValue.setMilliseconds(value.getMilliseconds());
        }
        else {
            tempValue = new Date(tempValue.getFullYear(), tempValue.getMonth(), tempValue.getDate(), 0, 0, 0, 0);
        }
        return tempValue;
    };
    Calendar.prototype.todayButtonClick = function (e) {
        if (this.showTodayButton) {
            var tempValue = this.generateTodayVal(this.value);
            this.setProperties({ value: tempValue }, true);
            this.isTodayClicked = true;
            this.todayButtonEvent = e;
            if (this.isMultiSelection) {
                var copyValues = this.copyValues(this.values);
                if (!_super.prototype.checkPresentDate.call(this, tempValue, this.values)) {
                    copyValues.push(tempValue);
                    this.setProperties({ values: copyValues });
                }
            }
            _super.prototype.todayButtonClick.call(this, e, new Date(+this.value));
        }
    };
    Calendar.prototype.keyActionHandle = function (e) {
        _super.prototype.keyActionHandle.call(this, e, this.value, this.isMultiSelection);
    };
    /**
     * Initialize the event handler
     * @private
     */
    Calendar.prototype.preRender = function () {
        var _this = this;
        this.changeHandler = function (e) {
            _this.triggerChange(e);
        };
        this.checkView();
        _super.prototype.preRender.call(this, this.value);
    };
    ;
    /**

     */
    Calendar.prototype.createContent = function () {
        this.previousDate = this.value;
        this.previousDateTime = this.value;
        _super.prototype.createContent.call(this);
    };
    Calendar.prototype.minMaxDate = function (localDate) {
        return _super.prototype.minMaxDate.call(this, localDate);
    };
    Calendar.prototype.renderMonths = function (e, value, isCustomDate) {
        _super.prototype.renderMonths.call(this, e, this.value, isCustomDate);
    };
    Calendar.prototype.renderDays = function (currentDate, value, isMultiSelect, values, isCustomDate) {
        var tempDays = _super.prototype.renderDays.call(this, currentDate, this.value, this.isMultiSelection, this.values, isCustomDate);
        if (this.isMultiSelection) {
            _super.prototype.validateValues.call(this, this.isMultiSelection, this.values);
        }
        return tempDays;
    };
    Calendar.prototype.renderYears = function (e) {
        if (this.calendarMode === 'Gregorian') {
            _super.prototype.renderYears.call(this, e, this.value);
        }
        else {
            this.islamicModule.islamicRenderYears(e, this.value);
        }
    };
    Calendar.prototype.renderDecades = function (e) {
        if (this.calendarMode === 'Gregorian') {
            _super.prototype.renderDecades.call(this, e, this.value);
        }
        else {
            this.islamicModule.islamicRenderDecade(e, this.value);
        }
    };
    Calendar.prototype.renderTemplate = function (elements, count, classNm, e) {
        if (this.calendarMode === 'Gregorian') {
            _super.prototype.renderTemplate.call(this, elements, count, classNm, e, this.value);
        }
        else {
            this.islamicModule.islamicRenderTemplate(elements, count, classNm, e, this.value);
        }
        this.changedArgs = { value: this.value, values: this.values };
        this.changeHandler();
    };
    Calendar.prototype.clickHandler = function (e) {
        var eve = e.currentTarget;
        this.isPopupClicked = true;
        if (eve.classList.contains(OTHERMONTH)) {
            if (this.isMultiSelection) {
                var copyValues = this.copyValues(this.values);
                copyValues.push(this.getIdValue(e, null));
                this.setProperties({ values: copyValues }, true);
                this.setProperties({ value: this.values[this.values.length - 1] }, true);
            }
            else {
                this.setProperties({ value: this.getIdValue(e, null) }, true);
            }
        }
        var storeView = this.currentView();
        _super.prototype.clickHandler.call(this, e, this.value);
        if (this.isMultiSelection && this.currentDate !== this.value &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tableBodyElement.querySelectorAll('.' + FOCUSEDDATE)[0]) && storeView === 'Year') {
            this.tableBodyElement.querySelectorAll('.' + FOCUSEDDATE)[0].classList.remove(FOCUSEDDATE);
        }
    };
    Calendar.prototype.switchView = function (view, e, isMultiSelection, isCustomDate) {
        _super.prototype.switchView.call(this, view, e, this.isMultiSelection, isCustomDate);
    };
    /**
     * To get component name
     * @private
     */
    Calendar.prototype.getModuleName = function () {
        _super.prototype.getModuleName.call(this);
        return 'calendar';
    };
    /**
     * Gets the properties to be maintained upon browser refresh.
     * @returns string
     */
    Calendar.prototype.getPersistData = function () {
        _super.prototype.getPersistData.call(this);
        var keyEntity = ['value', 'values'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Called internally if any of the property value changed.
     * returns void
     * @private
     */
    Calendar.prototype.onPropertyChanged = function (newProp, oldProp) {
        this.effect = '';
        this.rangeValidation(this.min, this.max);
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'value':
                    if (this.isDateSelected) {
                        if (typeof newProp.value === 'string') {
                            this.setProperties({ value: new Date(this.checkValue(newProp.value)) }, true);
                        }
                        else {
                            newProp.value = new Date(this.checkValue(newProp.value));
                        }
                        if (isNaN(+this.value)) {
                            this.setProperties({ value: oldProp.value }, true);
                        }
                        this.update();
                    }
                    break;
                case 'values':
                    if (this.isDateSelected) {
                        if (typeof newProp.values === 'string' || typeof newProp.values === 'number') {
                            this.setProperties({ values: null }, true);
                        }
                        else {
                            var copyValues = this.copyValues(this.values);
                            for (var index = 0; index < copyValues.length; index++) {
                                var tempDate = copyValues[index];
                                if (this.checkDateValue(tempDate) && !_super.prototype.checkPresentDate.call(this, tempDate, copyValues)) {
                                    copyValues.push(tempDate);
                                }
                            }
                            this.setProperties({ values: copyValues }, true);
                            if (this.values.length > 0) {
                                this.setProperties({ value: newProp.values[newProp.values.length - 1] }, true);
                            }
                        }
                        this.validateValues(this.isMultiSelection, this.values);
                        this.update();
                    }
                    break;
                case 'isMultiSelection':
                    if (this.isDateSelected) {
                        this.setProperties({ isMultiSelection: newProp.isMultiSelection }, true);
                        this.update();
                    }
                    break;
                case 'enabled':
                    this.setEnable(this.enabled);
                    break;
                case 'cssClass':
                    if (this.getModuleName() === 'calendar') {
                        this.setClass(newProp.cssClass, oldProp.cssClass);
                    }
                    break;
                default:
                    _super.prototype.onPropertyChanged.call(this, newProp, oldProp, this.isMultiSelection, this.values);
            }
        }
        this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    Calendar.prototype.destroy = function () {
        _super.prototype.destroy.call(this);
        if (this.getModuleName() === 'calendar') {
            var form = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
            if (form) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(form, 'reset', this.formResetHandler.bind(this));
            }
        }
    };
    /**
     * This method is used to navigate to the month/year/decade view of the Calendar.
     * @param  {string} view - Specifies the view of the Calendar.
     * @param  {Date} date - Specifies the focused date in a view.
     * @returns void

     */
    Calendar.prototype.navigateTo = function (view, date, isCustomDate) {
        this.minMaxUpdate();
        _super.prototype.navigateTo.call(this, view, date, isCustomDate);
    };
    /**
     * Gets the current view of the Calendar.
     * @returns string

     */
    Calendar.prototype.currentView = function () {
        return _super.prototype.currentView.call(this);
    };
    /**
     * This method is used to add the single or multiple dates to the values property of the Calendar.
     * @param  {Date || Date[]} dates - Specifies the date or dates to be added to the values property of the Calendar.
     * @returns void

     */
    Calendar.prototype.addDate = function (dates) {
        if (typeof dates !== 'string' && typeof dates !== 'number') {
            var copyValues = this.copyValues(this.values);
            if (typeof dates === 'object' && (dates).length > 0) {
                var tempDates = dates;
                for (var i = 0; i < tempDates.length; i++) {
                    if (this.checkDateValue(tempDates[i]) && !_super.prototype.checkPresentDate.call(this, tempDates[i], copyValues)) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(copyValues) && copyValues.length > 0) {
                            copyValues.push(tempDates[i]);
                        }
                        else {
                            copyValues = [new Date(+tempDates[i])];
                        }
                    }
                }
            }
            else {
                if (this.checkDateValue(dates) && !_super.prototype.checkPresentDate.call(this, dates, copyValues)) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(copyValues) && copyValues.length > 0) {
                        copyValues.push((dates));
                    }
                    else {
                        copyValues = [new Date(+dates)];
                    }
                }
            }
            this.setProperties({ values: copyValues }, true);
            if (this.isMultiSelection) {
                this.setProperties({ value: this.values[this.values.length - 1] }, true);
            }
            this.validateValues(this.isMultiSelection, copyValues);
            this.update();
            this.changedArgs = { value: this.value, values: this.values };
            this.changeHandler();
        }
    };
    /**
     * This method is used to remove the single or multiple dates from the values property of the Calendar.
     * @param  {Date || Date[]} dates - Specifies the date or dates which need to be removed from the values property of the Calendar.
     * @returns void

     */
    Calendar.prototype.removeDate = function (dates) {
        if (typeof dates !== 'string' && typeof dates !== 'number' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.values) && this.values.length > 0) {
            var copyValues = this.copyValues(this.values);
            if (typeof dates === 'object' && ((dates).length > 0)) {
                var tempDates = dates;
                for (var index = 0; index < tempDates.length; index++) {
                    for (var i = 0; i < copyValues.length; i++) {
                        if (+copyValues[i] === +tempDates[index]) {
                            copyValues.splice(i, 1);
                        }
                    }
                }
            }
            else {
                for (var i = 0; i < copyValues.length; i++) {
                    if (+copyValues[i] === +dates) {
                        copyValues.splice(i, 1);
                    }
                }
            }
            this.setProperties({ values: copyValues }, false);
            this.update();
            if (this.isMultiSelection) {
                this.setProperties({ value: this.values[this.values.length - 1] }, true);
            }
            this.changedArgs = { value: this.value, values: this.values };
            this.changeHandler();
        }
    };
    /**
     * To set custom today date in calendar
     * @private
     */
    Calendar.prototype.setTodayDate = function (date) {
        var todayDate = new Date(+date);
        this.setProperties({ value: todayDate }, true);
        _super.prototype.todayButtonClick.call(this, null, todayDate, true);
    };
    Calendar.prototype.update = function () {
        this.validateDate();
        this.minMaxUpdate();
        _super.prototype.setValueUpdate.call(this);
    };
    Calendar.prototype.selectDate = function (e, date, element) {
        _super.prototype.selectDate.call(this, e, date, element, this.isMultiSelection, this.values);
        if (this.isMultiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.values) && this.values.length > 0) {
            this.setProperties({ value: this.values[this.values.length - 1] }, true);
        }
        this.changedArgs = { value: this.value, values: this.values };
        this.changeHandler(e);
    };
    Calendar.prototype.changeEvent = function (e) {
        if ((this.value && this.value.valueOf()) !== (this.previousDate && +this.previousDate.valueOf())
            || this.isMultiSelection) {
            if (this.isAngular && this.preventChange) {
                this.preventChange = false;
            }
            else {
                this.trigger('change', this.changedArgs);
            }
            this.previousDate = new Date(+this.value);
        }
    };
    Calendar.prototype.triggerChange = function (e) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.todayButtonEvent) && this.isTodayClicked) {
            e = this.todayButtonEvent;
            this.isTodayClicked = false;
        }
        this.changedArgs.event = e || null;
        this.changedArgs.isInteracted = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.setProperties({ value: this.value }, true);
        }
        if (!this.isMultiSelection && +this.value !== Number.NaN && (+this.value !== +this.previousDate || this.previousDate == null
            && !isNaN(+this.value))) {
            this.changeEvent(e);
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.values) && this.previousValues !== this.values.length) {
            this.changeEvent(e);
            this.previousValues = this.values.length;
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Calendar.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Calendar.prototype, "values", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Calendar.prototype, "isMultiSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Calendar.prototype, "change", void 0);
    Calendar = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Calendar);
    return Calendar;
}(CalendarBase));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/index.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/index.js ***!
  \***********************************************************************/
/*! exports provided: CalendarBase, Calendar, Islamic */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _calendar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/calendar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CalendarBase", function() { return _calendar__WEBPACK_IMPORTED_MODULE_0__["CalendarBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Calendar", function() { return _calendar__WEBPACK_IMPORTED_MODULE_0__["Calendar"]; });

/* harmony import */ var _islamic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./islamic */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/islamic.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return _islamic__WEBPACK_IMPORTED_MODULE_1__["Islamic"]; });

/**
 * Calendar modules
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/islamic.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/islamic.js ***!
  \*************************************************************************/
/*! exports provided: Islamic */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return Islamic; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/**
 *
 */





//class constant defination.
var OTHERMONTH = 'e-other-month';
var YEAR = 'e-year';
var MONTH = 'e-month';
var DECADE = 'e-decade';
var DISABLED = 'e-disabled';
var OVERLAY = 'e-overlay';
var WEEKEND = 'e-weekend';
var WEEKNUMBER = 'e-week-number';
var SELECTED = 'e-selected';
var FOCUSEDDATE = 'e-focused-date';
var OTHERMONTHROW = 'e-month-hide';
var TODAY = 'e-today';
var LINK = 'e-day';
var CELL = 'e-cell';
var dayMilliSeconds = 86400000;
var minDecade = 2060;
var maxDecade = 2069;
var Islamic = /** @__PURE__ @class */ (function () {
    function Islamic(instance) {
        this.calendarInstance = instance;
    }
    Islamic.prototype.getModuleName = function () {
        return 'islamic';
    };
    Islamic.prototype.islamicTitleUpdate = function (date, view) {
        var globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.calendarInstance.locale);
        switch (view) {
            case 'days':
                /* tslint:disable-next-line:max-line-length */
                this.calendarInstance.headerTitleElement.textContent = globalize.formatDate(date, { type: 'dateTime', format: 'MMMMyyyy', calendar: 'islamic' });
                break;
            case 'months':
                /* tslint:disable-next-line:max-line-length */
                this.calendarInstance.headerTitleElement.textContent = globalize.formatDate(date, { type: 'dateTime', format: 'yyyy', calendar: 'islamic' });
        }
    };
    /* tslint:disable-next-line:max-line-length */
    // tslint:disable-next-line:max-func-body-length
    Islamic.prototype.islamicRenderDays = function (currentDate, value, multiSelection, values) {
        var tdEles = [];
        var cellsCount = 42;
        var localDate = new Date(this.islamicInValue(currentDate));
        var minMaxDate;
        var numCells = this.calendarInstance.weekNumber ? 8 : 7;
        // 8 and 7 denotes the number of columns to be specified.
        this.islamicTitleUpdate(currentDate, 'days');
        /* tslint:disable-next-line:no-any */
        var islamicDate = this.getIslamicDate(localDate);
        var gregorianObject = this.toGregorian(islamicDate.year, islamicDate.month, 1);
        var currentMonth = islamicDate.month;
        localDate = gregorianObject;
        while (localDate.getDay() !== this.calendarInstance.firstDayOfWeek) {
            this.calendarInstance.setStartDate(localDate, -1 * dayMilliSeconds);
        }
        for (var day = 0; day < cellsCount; ++day) {
            var weekEle = this.calendarInstance.createElement('td', { className: CELL });
            var weekAnchor = this.calendarInstance.createElement('span');
            if (day % 7 === 0 && this.calendarInstance.weekNumber) {
                weekAnchor.textContent = '' + this.calendarInstance.getWeek(localDate);
                weekEle.appendChild(weekAnchor);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([weekEle], '' + WEEKNUMBER);
                tdEles.push(weekEle);
            }
            minMaxDate = new Date(+localDate);
            localDate = this.calendarInstance.minMaxDate(localDate);
            /* tslint:disable-next-line:max-line-length */
            var dateFormatOptions = { type: 'dateTime', skeleton: 'full', calendar: 'islamic' };
            var date = this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(localDate, dateFormatOptions), dateFormatOptions);
            var tdEle = this.islamicDayCell(localDate);
            /* tslint:disable-next-line:max-line-length */
            var title = this.calendarInstance.globalize.formatDate(localDate, { type: 'date', skeleton: 'full', calendar: 'islamic' });
            var dayLink = this.calendarInstance.createElement('span');
            /* tslint:disable-next-line:max-line-length */
            dayLink.textContent = this.calendarInstance.globalize.formatDate(localDate, { type: 'date', skeleton: 'd', calendar: 'islamic' });
            var disabled = (this.calendarInstance.min > localDate) || (this.calendarInstance.max < localDate);
            if (disabled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OVERLAY);
            }
            else {
                dayLink.setAttribute('title', '' + title);
            }
            /* tslint:disable-next-line:no-any */
            var hijriMonthObject = this.getIslamicDate(localDate);
            if (currentMonth !== hijriMonthObject.month) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OTHERMONTH);
            }
            if (localDate.getDay() === 0 || localDate.getDay() === 6) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], WEEKEND);
            }
            tdEle.appendChild(dayLink);
            this.calendarInstance.renderDayCellArgs = {
                date: localDate,
                isDisabled: false,
                element: tdEle,
                isOutOfRange: disabled
            };
            var argument = this.calendarInstance.renderDayCellArgs;
            this.calendarInstance.renderDayCellEvent(argument);
            if (argument.isDisabled) {
                if (this.calendarInstance.isMultiSelection) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarInstance.values) && this.calendarInstance.values.length > 0) {
                        for (var index = 0; index < values.length; index++) {
                            /* tslint:disable-next-line:max-line-length */
                            var localDateString = +new Date(this.calendarInstance.globalize.formatDate(argument.date, { type: 'date', skeleton: 'yMd', calendar: 'islamic' }));
                            /* tslint:disable-next-line:max-line-length */
                            var tempDateString = +new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[index], { type: 'date', skeleton: 'yMd', calendar: 'islamic' }));
                            if (localDateString === tempDateString) {
                                this.calendarInstance.values.splice(index, 1);
                                index = -1;
                            }
                        }
                    }
                }
                else if (value && +value === +argument.date) {
                    this.calendarInstance.setProperties({ value: null }, true);
                }
            }
            if (this.calendarInstance.renderDayCellArgs.isDisabled && !tdEle.classList.contains(SELECTED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OVERLAY);
                if (+this.calendarInstance.renderDayCellArgs.date === +this.calendarInstance.todayDate) {
                    this.calendarInstance.todayDisabled = true;
                }
            }
            var otherMnthBool = tdEle.classList.contains(OTHERMONTH);
            var disabledCls = tdEle.classList.contains(DISABLED);
            if (!disabledCls) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.calendarInstance.clickHandler, this.calendarInstance);
            }
            if (this.calendarInstance.isMultiSelection && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarInstance.values) &&
                !otherMnthBool && !disabledCls) {
                for (var tempValue = 0; tempValue < this.calendarInstance.values.length; tempValue++) {
                    /* tslint:disable-next-line:max-line-length */
                    var localDateString = this.calendarInstance.globalize.formatDate(localDate, { type: 'date', skeleton: 'short', calendar: 'islamic' });
                    var tempDateString = this.calendarInstance.globalize.formatDate(this.calendarInstance.values[tempValue], { type: 'date', skeleton: 'short', calendar: 'islamic' });
                    if (localDateString === tempDateString &&
                        this.calendarInstance.getDateVal(localDate, this.calendarInstance.values[tempValue])) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
                    }
                    else {
                        this.calendarInstance.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
                    }
                }
                if (this.calendarInstance.values.length <= 0) {
                    this.calendarInstance.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
                }
            }
            else if (!otherMnthBool && !disabledCls && this.calendarInstance.getDateVal(localDate, value)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                this.calendarInstance.updateFocus(otherMnthBool, disabledCls, localDate, tdEle, currentDate);
            }
            if (date.getDate() === new Date().getDate() && date.getMonth() === new Date().getMonth()) {
                if (date.getFullYear() === new Date().getFullYear()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], TODAY);
                }
            }
            localDate = new Date(+minMaxDate);
            tdEles.push(this.calendarInstance.renderDayCellArgs.element);
            this.calendarInstance.addDay(localDate, 1, null, this.calendarInstance.max, this.calendarInstance.min);
        }
        return tdEles;
    };
    Islamic.prototype.islamicIconHandler = function () {
        new Date(this.islamicInValue(this.calendarInstance.currentDate)).setDate(1);
        var date = new Date(this.islamicInValue(this.calendarInstance.currentDate));
        switch (this.calendarInstance.currentView()) {
            case 'Month':
                var prevMonthCompare = this.islamicCompareMonth(date, this.calendarInstance.min) < 1;
                var nextMonthCompare = this.islamicCompareMonth(date, this.calendarInstance.max) > -1;
                this.calendarInstance.previousIconHandler(prevMonthCompare);
                this.calendarInstance.nextIconHandler(nextMonthCompare);
                break;
            case 'Year':
                var prevYearCompare = this.hijriCompareYear(date, this.calendarInstance.min) < 1;
                var nextYearCompare = this.hijriCompareYear(date, this.calendarInstance.max) > -1;
                this.calendarInstance.previousIconHandler(prevYearCompare);
                this.calendarInstance.nextIconHandler(nextYearCompare);
                break;
            case 'Decade':
                var prevDecadeCompare = this.hijriCompareDecade(date, this.calendarInstance.min) < 1;
                var nextDecadeCompare = this.hijriCompareDecade(date, this.calendarInstance.max) > -1;
                this.calendarInstance.previousIconHandler(prevDecadeCompare);
                this.calendarInstance.nextIconHandler(nextDecadeCompare);
        }
    };
    Islamic.prototype.islamicNext = function () {
        this.calendarInstance.effect = '';
        var view = this.calendarInstance.getViewNumber(this.calendarInstance.currentView());
        /* tslint:disable-next-line:no-any */
        var islamicDate = this.getIslamicDate(this.calendarInstance.currentDate);
        switch (this.calendarInstance.currentView()) {
            case 'Year':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year + 1, islamicDate.month, 1);
                this.calendarInstance.switchView(view);
                break;
            case 'Month':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year, islamicDate.month + 1, 1);
                this.calendarInstance.switchView(view);
                break;
            case 'Decade':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year + 10, islamicDate.month, 1);
                this.calendarInstance.switchView(view);
                break;
        }
    };
    Islamic.prototype.islamicPrevious = function () {
        var currentView = this.calendarInstance.getViewNumber(this.calendarInstance.currentView());
        this.calendarInstance.effect = '';
        /* tslint:disable-next-line:no-any */
        var islamicDate = this.getIslamicDate(this.calendarInstance.currentDate);
        switch (this.calendarInstance.currentView()) {
            case 'Month':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year, islamicDate.month - 1, 1);
                this.calendarInstance.switchView(currentView);
                break;
            case 'Year':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year - 1, islamicDate.month, 1);
                this.calendarInstance.switchView(currentView);
                break;
            case 'Decade':
                this.calendarInstance.currentDate = this.toGregorian(islamicDate.year - 10, islamicDate.month - 1, 1);
                this.calendarInstance.switchView(currentView);
                break;
        }
    };
    Islamic.prototype.islamicRenderYears = function (e, value) {
        this.calendarInstance.removeTableHeadElement();
        var numCells = 4;
        var days;
        var tdEles = [];
        var valueUtil = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value);
        var curDate = new Date(this.islamicInValue(this.calendarInstance.currentDate));
        var localDate = curDate;
        /* tslint:disable-next-line:no-any */
        var islamicDate = this.getIslamicDate(localDate);
        var gregorianObject = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(islamicDate.year, 1, 1);
        localDate = gregorianObject;
        var mon = islamicDate.month;
        var yr = islamicDate.year;
        var curYrs = islamicDate.year;
        /* tslint:disable-next-line:no-any */
        var minYr = (this.getIslamicDate(this.calendarInstance.min)).year;
        /* tslint:disable-next-line:no-any */
        var minMonth = (this.getIslamicDate(this.calendarInstance.min)).month;
        /* tslint:disable-next-line:no-any */
        var maxYr = (this.getIslamicDate(this.calendarInstance.max)).year;
        /* tslint:disable-next-line:no-any */
        var maxMonth = (this.getIslamicDate(this.calendarInstance.max)).month;
        this.islamicTitleUpdate(this.calendarInstance.currentDate, 'months');
        var disabled = (this.calendarInstance.min > localDate) || (this.calendarInstance.max < localDate);
        for (var month = 1; month <= 12; ++month) {
            /* tslint:disable-next-line:no-any */
            var islamicDate_1 = this.getIslamicDate(localDate);
            var gregorianObject_1 = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(islamicDate_1.year, month, 1);
            localDate = gregorianObject_1;
            var tdEle = this.islamicDayCell(localDate);
            var dayLink = this.calendarInstance.createElement('span');
            /* tslint:disable-next-line:max-line-length */
            /* tslint:disable-next-line:no-any */
            var localMonth = (value && (this.getIslamicDate(value)).month === (this.getIslamicDate(localDate)).month);
            /* tslint:disable-next-line:no-any  tslint:disable-next-line:max-line-length */
            var select = (value && (this.getIslamicDate(value)).year === yr && localMonth);
            /* tslint:disable-next-line:max-line-length */
            dayLink.textContent = this.calendarInstance.globalize.formatDate(localDate, { type: 'dateTime', format: 'MMM', calendar: 'islamic' });
            if ((this.calendarInstance.min && (curYrs < minYr || (month < minMonth && curYrs === minYr))) || (this.calendarInstance.max && (curYrs > maxYr || (month > maxMonth && curYrs >= maxYr)))) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
            }
            else if (!valueUtil && select) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                /* tslint:disable-next-line:no-any */
                if ((this.getIslamicDate(localDate)).month === mon &&
                    /* tslint:disable-next-line:no-any */
                    (this.getIslamicDate(this.calendarInstance.currentDate)).month === mon) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], FOCUSEDDATE);
                }
            }
            if (!tdEle.classList.contains(DISABLED)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.calendarInstance.clickHandler, this.calendarInstance);
            }
            tdEle.appendChild(dayLink);
            tdEles.push(tdEle);
        }
        this.islamicRenderTemplate(tdEles, numCells, YEAR, e, value);
    };
    Islamic.prototype.islamicRenderDecade = function (e, value) {
        this.calendarInstance.removeTableHeadElement();
        var numCells = 4;
        var yearCell = 12;
        var tdEles = [];
        var localDate = new Date(this.islamicInValue(this.calendarInstance.currentDate));
        /* tslint:disable-next-line:no-any */
        var islamicDate = this.getIslamicDate(localDate);
        var gregorianObject = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(islamicDate.year, 1, 1);
        localDate = gregorianObject;
        var localYr = localDate.getFullYear();
        var startYr = new Date(this.islamicInValue((localYr - localYr % 10)));
        var endYr = new Date(this.islamicInValue((localYr - localYr % 10 + (10 - 1))));
        var startFullYr = startYr.getFullYear();
        var endFullYr = endYr.getFullYear();
        /* tslint:disable-next-line:max-line-length */
        var startHdrYr = this.calendarInstance.globalize.formatDate(startYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
        var endHdrYr = this.calendarInstance.globalize.formatDate(endYr, { type: 'dateTime', format: 'y', calendar: 'islamic' });
        this.calendarInstance.headerTitleElement.textContent = startHdrYr + ' - ' + (endHdrYr);
        var start = new Date(localYr - (localYr % 10) - 2, 0, 1);
        var startYear = start.getFullYear();
        for (var rowCount = 1; rowCount <= yearCell; ++rowCount) {
            var year = startYear + rowCount;
            localDate.setFullYear(year);
            localDate.setDate(1);
            localDate.setMonth(0);
            /* tslint:disable-next-line:no-any */
            var islamicDate_2 = this.getIslamicDate(localDate);
            var gregorianObject_2 = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(islamicDate_2.year, 1, 1);
            localDate = gregorianObject_2;
            var tdEle = this.islamicDayCell(localDate);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(tdEle, { 'role': 'gridcell' });
            var dayLink = this.calendarInstance.createElement('span');
            /* tslint:disable-next-line:max-line-length */
            dayLink.textContent = this.calendarInstance.globalize.formatDate(localDate, { type: 'dateTime', format: 'y', calendar: 'islamic' });
            /* tslint:disable-next-line:no-any */
            if ((year < startFullYr) || (year > endFullYr)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], OTHERMONTH);
            }
            else if (year < new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()
                || year > new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], DISABLED);
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) &&
                /* tslint:disable-next-line:no-any */
                (this.getIslamicDate(localDate)).year ===
                    /* tslint:disable-next-line:no-any */
                    (this.getIslamicDate(value)).year) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], SELECTED);
            }
            else {
                if (localDate.getFullYear() === this.calendarInstance.currentDate.getFullYear() && !tdEle.classList.contains(DISABLED)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], FOCUSEDDATE);
                }
            }
            if (!tdEle.classList.contains(DISABLED)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tdEle, 'click', this.calendarInstance.clickHandler, this.calendarInstance);
            }
            tdEle.appendChild(dayLink);
            tdEles.push(tdEle);
        }
        this.islamicRenderTemplate(tdEles, numCells, 'e-decade', e, value);
    };
    Islamic.prototype.islamicDayCell = function (localDate) {
        var dateFormatOptions = { skeleton: 'full', type: 'dateTime', calendar: 'islamic' };
        var formatDate = this.calendarInstance.globalize.formatDate(localDate, dateFormatOptions);
        var date = this.calendarInstance.globalize.parseDate(formatDate, dateFormatOptions);
        var value = date.valueOf();
        var attrs = {
            className: CELL, attrs: { 'id': '' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('' + value), 'aria-selected': 'false', 'role': 'gridcell' }
        };
        return this.calendarInstance.createElement('td', attrs);
    };
    Islamic.prototype.islamicRenderTemplate = function (elements, count, classNm, e, value) {
        var view = this.calendarInstance.getViewNumber(this.calendarInstance.currentView());
        var trEle;
        this.calendarInstance.tableBodyElement = this.calendarInstance.createElement('tbody');
        this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.calendarInstance.contentElement, this.calendarInstance.headerElement], [MONTH, DECADE, YEAR]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.calendarInstance.contentElement, this.calendarInstance.headerElement], [classNm]);
        var weekNumCell = 41;
        var numberCell = 35;
        var otherMonthCell = 6;
        var row = count;
        var rowCount = 0;
        for (var dayCell = 0; dayCell < elements.length / count; ++dayCell) {
            trEle = this.calendarInstance.createElement('tr', { attrs: { 'role': 'row' } });
            for (rowCount = 0 + rowCount; rowCount < row; rowCount++) {
                if (!elements[rowCount].classList.contains('e-week-number') && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(elements[rowCount].children[0])) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([elements[rowCount].children[0]], [LINK]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(elements[rowCount].children[0], {
                        duration: 600,
                        isCenterRipple: true
                    });
                }
                trEle.appendChild(elements[rowCount]);
                if (this.calendarInstance.weekNumber &&
                    rowCount === otherMonthCell + 1 && elements[otherMonthCell + 1].classList.contains(OTHERMONTH)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                }
                if (!this.calendarInstance.weekNumber
                    && rowCount === otherMonthCell && elements[otherMonthCell].classList.contains(OTHERMONTH)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                }
                if (this.calendarInstance.weekNumber) {
                    if (rowCount === weekNumCell && elements[weekNumCell].classList.contains(OTHERMONTH)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                    }
                }
                else {
                    if (rowCount === numberCell && elements[numberCell].classList.contains(OTHERMONTH)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([trEle], OTHERMONTHROW);
                    }
                }
            }
            row = row + count;
            rowCount = rowCount + 0;
            this.calendarInstance.tableBodyElement.appendChild(trEle);
        }
        this.calendarInstance.table.querySelector('tbody').className = this.calendarInstance.effect;
        this.islamicIconHandler();
        if (view !== this.calendarInstance.getViewNumber(this.calendarInstance.currentView())
            || (view === 0 && view !== this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))) {
            this.calendarInstance.navigateHandler(e);
        }
        this.calendarInstance.setAriaActiveDescendant();
        this.calendarInstance.changedArgs = { value: this.calendarInstance.value, values: this.calendarInstance.values };
        this.calendarInstance.changeHandler();
    };
    Islamic.prototype.islamicCompareMonth = function (start, end) {
        /* tslint:disable-next-line:no-any */
        var hijriStart = (this.getIslamicDate(start));
        /* tslint:disable-next-line:no-any */
        var hijriEnd = (this.getIslamicDate(end));
        var result;
        if (hijriStart.year > hijriEnd.year) {
            result = 1;
        }
        else if (hijriStart.year < hijriEnd.year) {
            result = -1;
        }
        else {
            result = hijriStart.month === hijriEnd.month ? 0 : hijriStart.month > hijriEnd.month ? 1 : -1;
        }
        return result;
    };
    ;
    Islamic.prototype.islamicCompare = function (startDate, endDate, modifier) {
        /* tslint:disable-next-line:no-any */
        var hijriStart = this.getIslamicDate(startDate);
        /* tslint:disable-next-line:no-any */
        var hijriEnd = this.getIslamicDate(endDate);
        var start = hijriEnd.year;
        var end;
        var result;
        end = start;
        result = 0;
        if (modifier) {
            start = start - start % modifier;
            end = start - start % modifier + modifier - 1;
        }
        if (hijriStart.year > end) {
            result = 1;
        }
        else if ((this.calendarInstance.currentView() === 'Decade') && hijriStart.year < start &&
            !((startDate.getFullYear() >= minDecade && startDate.getFullYear() <= maxDecade))) {
            result = -1;
        }
        else if (hijriStart.year < start && (this.calendarInstance.currentView() === 'Year')) {
            result = -1;
        }
        return result;
    };
    ;
    /* tslint:disable-next-line:no-any */
    Islamic.prototype.getIslamicDate = function (date) {
        /* tslint:disable-next-line:no-any */
        return (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date));
    };
    Islamic.prototype.toGregorian = function (year, month, date) {
        return _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(year, month, date);
    };
    Islamic.prototype.hijriCompareYear = function (start, end) {
        return this.islamicCompare(start, end, 0);
    };
    Islamic.prototype.hijriCompareDecade = function (start, end) {
        return this.islamicCompare(start, end, 10);
    };
    ;
    Islamic.prototype.destroy = function () {
        this.calendarInstance = null;
    };
    Islamic.prototype.islamicInValue = function (inValue) {
        if (inValue instanceof Date) {
            return (inValue.toUTCString());
        }
        else {
            return ('' + inValue);
        }
    };
    return Islamic;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/datepicker.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/datepicker.js ***!
  \******************************************************************************/
/*! exports provided: DatePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return DatePicker; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _calendar_calendar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../calendar/calendar */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/calendar.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../calendar/calendar-model.d.ts'/>






// tslint:disable-next-line

//class constant defination
var DATEWRAPPER = 'e-date-wrapper';
var ROOT = 'e-datepicker';
var LIBRARY = 'e-lib';
var CONTROL = 'e-control';
var POPUPWRAPPER = 'e-popup-wrapper';
var INPUTWRAPPER = 'e-input-group-icon';
var POPUP = 'e-popup';
var INPUTCONTAINER = 'e-input-group';
var INPUTFOCUS = 'e-input-focus';
var INPUTROOT = 'e-input';
var ERROR = 'e-error';
var RTL = 'e-rtl';
var LINK = 'e-day';
var ACTIVE = 'e-active';
var OVERFLOW = 'e-date-overflow';
var DATEICON = 'e-date-icon';
var CLEARICON = 'e-clear-icon';
var ICONS = 'e-icons';
var OPENDURATION = 300;
var CLOSEDURATION = 200;
var OFFSETVALUE = 4;
var SELECTED = 'e-selected';
var FOCUSEDDATE = 'e-focused-date';
var NONEDIT = 'e-non-edit';
var containerAttr = ['title', 'class', 'style'];
/**
 * Represents the DatePicker component that allows user to select
 * or enter a date value.
 * ```html
 * <input id='datepicker'/>
 * ```
 * ```typescript
 * <script>
 *   let datePickerObject:DatePicker = new DatePicker({ value: new Date() });
 *   datePickerObject.appendTo('#datepicker');
 * </script>
 * ```
 */
var DatePicker = /** @__PURE__ @class */ (function (_super) {
    __extends(DatePicker, _super);
    /**
     * Constructor for creating the widget.
     */
    function DatePicker(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.previousElementValue = '';
        _this.isDateIconClicked = false;
        _this.isAltKeyPressed = false;
        _this.isInteracted = true;
        _this.isBlazorServer = false;
        _this.invalidValueString = null;
        _this.checkPreviousValue = null;
        _this.isAngular = false;
        _this.preventChange = false;
        _this.isIconClicked = false;
        _this.isDynamicValueChanged = false;
        _this.datepickerOptions = options;
        return _this;
    }
    /**
     * To Initialize the control rendering.
     * @return void
     * @private
     */
    DatePicker.prototype.render = function () {
        this.initialize();
        this.bindEvents();
        this.renderComplete();
        if (!this.isBlazorServer) {
            this.setTimeZone(this.serverTimezoneOffset);
        }
    };
    DatePicker.prototype.setTimeZone = function (offsetValue) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.serverTimezoneOffset) && this.value) {
            var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
            var serverTimezoneDiff = offsetValue;
            var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
            timeZoneDiff = this.isDayLightSaving() ? timeZoneDiff-- : timeZoneDiff;
            this.value = new Date((this.value).getTime() + (timeZoneDiff * 60 * 60 * 1000));
            this.updateInput();
        }
    };
    DatePicker.prototype.isDayLightSaving = function () {
        var firstOffset = new Date(this.value.getFullYear(), 0, 1).getTimezoneOffset();
        var secondOffset = new Date(this.value.getFullYear(), 6, 1).getTimezoneOffset();
        return (this.value.getTimezoneOffset() < Math.max(firstOffset, secondOffset));
    };
    DatePicker.prototype.setAllowEdit = function () {
        if (this.allowEdit) {
            if (!this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'readonly': '' });
        }
        this.updateIconState();
    };
    DatePicker.prototype.updateIconState = function () {
        if (!this.allowEdit && this.inputWrapper && !this.readonly) {
            if (this.inputElement.value === '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [NONEDIT]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [NONEDIT]);
            }
        }
        else if (this.inputWrapper) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [NONEDIT]);
        }
    };
    DatePicker.prototype.initialize = function () {
        if (!this.isBlazorServer) {
            this.checkInvalidValue(this.value);
            this.createInput();
            this.updateHtmlAttributeToWrapper();
            this.setAllowEdit();
            this.updateInput();
        }
        else {
            var parentElement = this.element.parentElement;
            this.inputWrapper = {
                container: parentElement,
                clearButton: parentElement.querySelector('.' + CLEARICON),
                buttons: [parentElement.querySelector('.' + DATEICON)]
            };
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].bindInitialEvent({
                element: this.inputElement,
                floatLabelType: this.floatLabelType
            });
            if (this.showClearButton && this.inputWrapper.clearButton) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].wireClearBtnEvents(this.inputElement, this.inputWrapper.clearButton, this.inputWrapper.container);
            }
            this.setAllowEdit();
        }
        this.previousElementValue = this.inputElement.value;
        this.previousDate = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? new Date(+this.value) : null;
        this.inputElement.setAttribute('value', this.inputElement.value);
        this.inputValueCopy = this.value;
    };
    DatePicker.prototype.createInput = function () {
        var ariaAttrs = {
            'aria-live': 'assertive', 'aria-atomic': 'true',
            'aria-haspopup': 'true', 'aria-activedescendant': 'null',
            'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',
            'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-invalid': 'false'
        };
        if (this.getModuleName() === 'datepicker') {
            var l10nLocale = { placeholder: this.placeholder };
            this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('datepicker', l10nLocale, this.locale);
            this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
        }
        var updatedCssClassValues = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
        }
        this.inputWrapper = _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].createInput({
            element: this.inputElement,
            floatLabelType: this.floatLabelType,
            properties: {
                readonly: this.readonly,
                placeholder: this.placeholder,
                cssClass: updatedCssClassValues,
                enabled: this.enabled,
                enableRtl: this.enableRtl,
                showClearButton: this.showClearButton,
            },
            buttons: [INPUTWRAPPER + ' ' + DATEICON + ' ' + ICONS]
        }, this.createElement);
        this.setWidth(this.width);
        if (this.inputElement.name !== '') {
            this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute('name'));
        }
        else {
            this.inputElement.setAttribute('name', '' + this.element.id);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, ariaAttrs);
        if (!this.enabled) {
            this.inputElement.setAttribute('aria-disabled', 'true');
            this.inputElement.tabIndex = -1;
        }
        else {
            this.inputElement.setAttribute('aria-disabled', 'false');
            this.inputElement.setAttribute('tabindex', this.tabIndex);
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addAttributes({ 'aria-label': 'select' }, this.inputWrapper.buttons[0]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], DATEWRAPPER);
    };
    DatePicker.prototype.updateInput = function () {
        var formatOptions;
        if (this.value && !this.isCalendar()) {
            if (!this.isBlazorServer) {
                this.disabledDates();
            }
        }
        if (isNaN(+new Date(this.checkValue(this.value)))) {
            this.setProperties({ value: null }, true);
        }
        if (this.strictMode) {
            //calls the Calendar processDate protected method to update the date value according to the strictMode true behaviour.
            _super.prototype.validateDate.call(this);
            this.minMaxUpdates();
            _super.prototype.minMaxUpdate.call(this);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            var dateValue = this.value;
            var dateString = void 0;
            var tempFormat = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat;
            if (this.getModuleName() === 'datetimepicker') {
                if (this.calendarMode === 'Gregorian') {
                    dateString = this.globalize.formatDate(this.value, {
                        format: tempFormat, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
                    });
                }
                else {
                    dateString = this.globalize.formatDate(this.value, {
                        format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'
                    });
                }
            }
            else {
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                }
                else {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                }
                dateString = this.globalize.formatDate(this.value, formatOptions);
            }
            if ((+dateValue <= +this.max) && (+dateValue >= +this.min)) {
                this.updateInputValue(dateString);
            }
            else {
                var value = (+dateValue >= +this.max || !+this.value) || (!+this.value || +dateValue <= +this.min);
                if (!this.strictMode && value) {
                    this.updateInputValue(dateString);
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.strictMode) {
            this.updateInputValue('');
        }
        if (!this.strictMode && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.invalidValueString) {
            this.updateInputValue(this.invalidValueString);
        }
        this.changedArgs = { value: this.value };
        this.errorClass();
        this.updateIconState();
    };
    ;
    DatePicker.prototype.minMaxUpdates = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value < this.min && this.min <= this.max && this.strictMode) {
            this.setProperties({ value: this.min }, true);
            this.changedArgs = { value: this.value };
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value > this.max && this.min <= this.max && this.strictMode) {
                this.setProperties({ value: this.max }, true);
                this.changedArgs = { value: this.value };
            }
        }
    };
    DatePicker.prototype.checkStringValue = function (val) {
        var returnDate = null;
        var formatOptions = null;
        var formatDateTime = null;
        if (this.getModuleName() === 'datetimepicker') {
            var culture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            if (this.calendarMode === 'Gregorian') {
                formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                formatDateTime = { format: culture.getDatePattern({ skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' }), type: 'dateTime' };
            }
            else {
                formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime', calendar: 'islamic' };
            }
        }
        else {
            if (this.calendarMode === 'Gregorian') {
                formatOptions = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            }
            else {
                formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
            }
        }
        returnDate = this.checkDateValue(this.globalize.parseDate(val, formatOptions));
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(returnDate) && (this.getModuleName() === 'datetimepicker')) {
            returnDate = this.checkDateValue(this.globalize.parseDate(val, formatDateTime));
        }
        return returnDate;
    };
    DatePicker.prototype.checkInvalidValue = function (value) {
        if (!(value instanceof Date) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            var valueDate = null;
            var valueString = value;
            if (typeof value === 'number') {
                valueString = value.toString();
            }
            var formatOptions = null;
            var formatDateTime = null;
            if (this.getModuleName() === 'datetimepicker') {
                var culture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                    formatDateTime = { format: culture.getDatePattern({ skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' }), type: 'dateTime' };
                }
                else {
                    formatOptions = { format: this.dateTimeFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                    formatDateTime = { format: culture.getDatePattern({ skeleton: 'yMd' }), type: 'dateTime', calendar: 'islamic' };
                }
            }
            else {
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                }
                else {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                }
            }
            var invalid = false;
            if (typeof valueString !== 'string') {
                valueString = null;
                invalid = true;
            }
            else {
                if (typeof valueString === 'string') {
                    valueString = valueString.trim();
                }
                valueDate = this.checkStringValue(valueString);
                if (!valueDate) {
                    var extISOString = null;
                    var basicISOString = null;
                    // tslint:disable-next-line
                    extISOString = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                    // tslint:disable-next-line
                    basicISOString = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                    if ((!extISOString.test(valueString) && !basicISOString.test(valueString))
                        || (/^[a-zA-Z0-9- ]*$/).test(valueString) || isNaN(+new Date(this.checkValue(valueString)))) {
                        invalid = true;
                    }
                    else {
                        valueDate = new Date(valueString);
                    }
                }
            }
            if (invalid) {
                if (!this.strictMode) {
                    this.invalidValueString = valueString;
                }
                this.setProperties({ value: null }, true);
            }
            else {
                this.setProperties({ value: valueDate }, true);
            }
        }
    };
    ;
    DatePicker.prototype.bindInputEvent = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString)) {
            if (this.formatString.indexOf('y') === -1) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'input', this.inputHandler, this);
            }
            else {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'input', this.inputHandler);
            }
        }
    };
    DatePicker.prototype.bindEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown touchstart', (this.isBlazorServer ? this.preventEventBubbling : this.dateIconHandler), this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'focus', this.inputFocusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'blur', this.inputBlurHandler, this);
        this.bindInputEvent();
        // To prevent the twice triggering.
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'change', this.inputChangeHandler, this);
        if (this.showClearButton && (this.inputWrapper.clearButton || (this.isBlazorServer))) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.resetFormHandler, this);
        }
        this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, this.keyConfigs);
        this.keyboardModules = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputElement, {
            eventName: 'keydown',
            keyAction: this.inputKeyActionHandle.bind(this),
            keyConfigs: this.defaultKeyConfigs
        });
    };
    DatePicker.prototype.unBindEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown touchstart', (this.isBlazorServer ? this.preventEventBubbling : this.dateIconHandler));
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.inputFocusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.inputBlurHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'change', this.inputChangeHandler);
        if (this.showClearButton && (this.inputWrapper.clearButton || (this.isBlazorServer))) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.resetFormHandler);
        }
    };
    DatePicker.prototype.resetFormHandler = function () {
        if (!this.enabled) {
            return;
        }
        if (!this.inputElement.disabled) {
            var value = this.inputElement.getAttribute('value');
            if (this.element.tagName === 'EJS-DATEPICKER' || this.element.tagName === 'EJS-DATETIMEPICKER') {
                value = '';
                this.inputValueCopy = null;
                this.inputElement.setAttribute('value', '');
            }
            if (!this.isBlazorServer) {
                this.setProperties({ value: this.inputValueCopy }, true);
                this.restoreValue();
                if (this.inputElement) {
                    this.updateInputValue(value);
                    this.errorClass();
                }
            }
        }
    };
    DatePicker.prototype.restoreValue = function () {
        this.currentDate = this.value ? this.value : new Date();
        this.previousDate = this.value;
        this.previousElementValue = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputValueCopy)) ? '' :
            this.globalize.formatDate(this.inputValueCopy, {
                format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
            });
    };
    DatePicker.prototype.inputChangeHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        e.stopPropagation();
    };
    DatePicker.prototype.bindClearEvent = function () {
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);
        }
    };
    DatePicker.prototype.resetHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        e.preventDefault();
        this.clear(e);
    };
    DatePicker.prototype.clear = function (event) {
        if (!this.isBlazorServer) {
            this.setProperties({ value: null }, true);
        }
        this.updateInputValue('');
        var clearedArgs = {
            event: event
        };
        this.trigger('cleared', clearedArgs);
        this.invalidValueString = '';
        if (!this.isBlazorServer) {
            this.updateInput();
            this.popupUpdate();
            this.changeEvent(event);
        }
        if (this.isBlazorServer) {
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('OnValueCleared');
            // tslint:enable
        }
    };
    DatePicker.prototype.preventEventBubbling = function (e) {
        e.preventDefault();
        // tslint:disable
        this.interopAdaptor.invokeMethodAsync('OnDateIconClick');
        // tslint:enable
    };
    DatePicker.prototype.updateInputValue = function (value) {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(value, this.inputElement, this.floatLabelType, this.showClearButton);
    };
    DatePicker.prototype.dateIconHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        this.isIconClicked = true;
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.inputElement.setAttribute('readonly', '');
            this.inputElement.blur();
        }
        if (!this.isBlazorServer) {
            e.preventDefault();
        }
        if (!this.readonly) {
            if (this.isCalendar() && !this.isBlazorServer) {
                this.hide(e);
            }
            else {
                if (!this.isBlazorServer || (this.isBlazorServer && this.inputWrapper.container.nextElementSibling)) {
                    this.isDateIconClicked = true;
                    this.show(null, e);
                    if (this.getModuleName() === 'datetimepicker') {
                        this.inputElement.focus();
                    }
                    this.inputElement.focus();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(this.inputWrapper.buttons, ACTIVE);
                }
            }
        }
        this.isIconClicked = false;
    };
    DatePicker.prototype.updateHtmlAttributeToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes[key])) {
                    if (containerAttr.indexOf(key) > -1) {
                        if (key === 'class') {
                            var updatedClassValues = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
                            if (updatedClassValues !== '') {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], updatedClassValues.split(' '));
                            }
                        }
                        else if (key === 'style') {
                            var setStyle = this.inputWrapper.container.getAttribute(key);
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(setStyle)) {
                                if (setStyle.charAt(setStyle.length - 1) === ';') {
                                    setStyle = setStyle + this.htmlAttributes[key];
                                }
                                else {
                                    setStyle = setStyle + ';' + this.htmlAttributes[key];
                                }
                            }
                            else {
                                setStyle = this.htmlAttributes[key];
                            }
                            this.inputWrapper.container.setAttribute(key, setStyle);
                        }
                        else {
                            this.inputWrapper.container.setAttribute(key, this.htmlAttributes[key]);
                        }
                    }
                }
            }
        }
    };
    DatePicker.prototype.updateHtmlAttributeToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (containerAttr.indexOf(key) < 0) {
                    this.inputElement.setAttribute(key, this.htmlAttributes[key]);
                }
            }
        }
    };
    DatePicker.prototype.updateCssClass = function (newCssClass, oldCssClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCssClass)) {
            oldCssClass = (oldCssClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newCssClass)) {
            newCssClass = (newCssClass.replace(/\s+/g, ' ')).trim();
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newCssClass, [this.inputWrapper.container], oldCssClass);
        if (this.popupWrapper) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newCssClass, [this.popupWrapper], oldCssClass);
        }
    };
    DatePicker.prototype.CalendarKeyActionHandle = function (e) {
        switch (e.action) {
            case 'escape':
                if (this.isCalendar()) {
                    this.hide(e);
                }
                else {
                    this.inputWrapper.container.children[this.index].blur();
                }
                break;
            case 'enter':
                if (!this.isCalendar()) {
                    this.show(null, e);
                }
                else {
                    if (+this.value !== +this.currentDate && !this.isCalendar()) {
                        this.inputWrapper.container.children[this.index].focus();
                    }
                }
                if (this.getModuleName() === 'datetimepicker') {
                    this.inputElement.focus();
                }
                break;
            case 'tab':
                this.hide(e);
        }
    };
    DatePicker.prototype.inputFocusHandler = function () {
        if (!this.enabled) {
            return;
        }
        var focusArguments = {
            model: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered ? null : this
        };
        this.isDateIconClicked = false;
        this.trigger('focus', focusArguments);
        this.updateIconState();
        if (this.openOnFocus && !this.isIconClicked) {
            this.show();
        }
    };
    DatePicker.prototype.inputHandler = function (e) {
        this.isPopupClicked = false;
    };
    DatePicker.prototype.inputBlurHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (!this.isBlazorServer) {
            this.strictModeUpdate();
            if (this.inputElement.value === '' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                this.invalidValueString = null;
                this.updateInputValue('');
            }
            this.updateInput();
            this.popupUpdate();
            this.changeTrigger(e);
            this.errorClass();
        }
        else {
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
            // tslint:enable
        }
        if (this.isCalendar() && document.activeElement === this.inputElement) {
            this.hide(e);
        }
        if (this.getModuleName() === 'datepicker') {
            var blurArguments = {
                model: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered ? null : this
            };
            this.trigger('blur', blurArguments);
        }
        if (this.isCalendar()) {
            this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, this.keyConfigs);
            this.calendarKeyboardModules = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.calendarElement.children[1].firstElementChild, {
                eventName: 'keydown',
                keyAction: this.CalendarKeyActionHandle.bind(this),
                keyConfigs: this.defaultKeyConfigs
            });
        }
        this.isPopupClicked = false;
    };
    DatePicker.prototype.documentHandler = function (e) {
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && (this.inputWrapper.container.contains(e.target) ||
            (this.popupObj.element && this.popupObj.element.contains(e.target)))) && e.type !== 'touchstart') {
            e.preventDefault();
        }
        var target = e.target;
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-datepicker.e-popup-wrapper'))
            && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + INPUTCONTAINER) === this.inputWrapper.container)
            && (!target.classList.contains('e-day'))) {
            this.hide(e);
            this.focusOut();
        }
        else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-datepicker.e-popup-wrapper')) {
            // Fix for close the popup when select the previously selected value.
            if (target.classList.contains('e-day')
                && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.target.parentElement)
                && e.target.parentElement.classList.contains('e-selected')
                && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-content')
                && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-content').classList.contains('e-' + this.depth.toLowerCase())) {
                this.hide(e);
            }
            else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-footer-container')
                && target.classList.contains('e-today')
                && target.classList.contains('e-btn')
                && (+new Date(+this.value) === +_super.prototype.generateTodayVal.call(this, this.value) && !this.isBlazorServer)) {
                this.hide(e);
            }
        }
    };
    DatePicker.prototype.inputKeyActionHandle = function (e) {
        var clickedView = this.currentView();
        switch (e.action) {
            case 'altUpArrow':
                this.isAltKeyPressed = false;
                this.hide(e);
                this.inputElement.focus();
                break;
            case 'altDownArrow':
                this.isAltKeyPressed = true;
                if (!this.isBlazorServer) {
                    this.strictModeUpdate();
                    this.updateInput();
                    this.changeTrigger(e);
                }
                else {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
                    // tslint:enable
                }
                if (this.getModuleName() === 'datepicker') {
                    if (!this.isBlazorServer) {
                        this.show(null, e);
                    }
                    else {
                        // tslint:disable
                        this.interopAdaptor.invokeMethodAsync('OnPopupHide', true);
                        // tslint:enable
                    }
                }
                break;
            case 'escape':
                this.hide(e);
                break;
            case 'enter':
                if (!this.isBlazorServer) {
                    this.strictModeUpdate();
                    this.updateInput();
                    this.popupUpdate();
                    this.changeTrigger(e);
                    this.errorClass();
                }
                else {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
                    // tslint:enable
                }
                if (!this.isCalendar() && document.activeElement === this.inputElement) {
                    this.hide(e);
                }
                if (this.isCalendar()) {
                    e.preventDefault();
                    e.stopPropagation();
                }
                break;
            case 'tab':
            case 'shiftTab':
                if (!this.isBlazorServer) {
                    this.strictModeUpdate();
                    this.updateInput();
                    this.popupUpdate();
                    this.changeTrigger(e);
                    this.errorClass();
                }
                else {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('OnStrictModeUpdate', this.inputElement.value);
                    // tslint:enable
                }
                this.hide(e);
                break;
            default:
                this.defaultAction(e);
                // Fix for close the popup when select the previously selected value.
                if (e.action === 'select' && clickedView === this.depth) {
                    this.hide(e);
                }
        }
    };
    DatePicker.prototype.defaultAction = function (e) {
        this.previousDate = ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && new Date(+this.value)) || null);
        if (this.isCalendar()) {
            _super.prototype.keyActionHandle.call(this, e);
            if (!this.isBlazorServer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, {
                    'aria-activedescendant': '' + this.setActiveDescendant()
                });
            }
        }
    };
    DatePicker.prototype.popupUpdate = function () {
        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousDate)) ||
            (+this.value !== +this.previousDate)) {
            if (this.popupObj) {
                if (this.popupObj.element.querySelectorAll('.' + SELECTED).length > 0) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.popupObj.element.querySelectorAll('.' + SELECTED), [SELECTED]);
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && !this.isBlazorServer) {
                if ((+this.value >= +this.min) && (+this.value <= +this.max)) {
                    var targetdate = new Date(this.checkValue(this.value));
                    _super.prototype.navigateTo.call(this, 'Month', targetdate);
                }
            }
        }
    };
    DatePicker.prototype.strictModeUpdate = function () {
        var format;
        var formatOptions;
        if (this.getModuleName() === 'datetimepicker') {
            format = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat;
        }
        else {
            format = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.formatString.replace('dd', 'd');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(format)) {
            var len = format.split('M').length - 1;
            if (len < 3) {
                format = format.replace('MM', 'M');
            }
        }
        var dateOptions;
        if (this.getModuleName() === 'datetimepicker') {
            if (this.calendarMode === 'Gregorian') {
                dateOptions = {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
                };
            }
            else {
                dateOptions = {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'
                };
            }
        }
        else {
            if (this.calendarMode === 'Gregorian') {
                formatOptions = { format: format, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            }
            else {
                formatOptions = { format: format, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
            }
            dateOptions = formatOptions;
        }
        var date;
        if (typeof this.inputElement.value === 'string') {
            this.inputElement.value = this.inputElement.value.trim();
        }
        if ((this.getModuleName() === 'datetimepicker')) {
            if (this.checkDateValue(this.globalize.parseDate(this.inputElement.value, dateOptions))) {
                date = this.globalize.parseDate(this.inputElement.value, dateOptions);
            }
            else {
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                }
                else {
                    formatOptions = { type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                }
                date = this.globalize.parseDate(this.inputElement.value, formatOptions);
            }
        }
        else {
            date = this.globalize.parseDate(this.inputElement.value, dateOptions);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) && this.inputElement.value !== '' && this.strictMode) {
                if ((this.isPopupClicked || (!this.isPopupClicked && this.inputElement.value === this.previousElementValue))
                    && this.formatString.indexOf('y') === -1) {
                    date.setFullYear(this.value.getFullYear());
                }
            }
        }
        // EJ2-35061 - To prevent change event from triggering twice when using strictmode and format property
        if ((this.getModuleName() === 'datepicker') && (this.value && !isNaN(+this.value)) && date) {
            date.setHours(this.value.getHours(), this.value.getMinutes(), this.value.getSeconds(), this.value.getMilliseconds());
        }
        if (this.strictMode && date) {
            this.updateInputValue(this.globalize.formatDate(date, dateOptions));
            if (this.inputElement.value !== this.previousElementValue) {
                this.setProperties({ value: date }, true);
            }
        }
        else if (!this.strictMode) {
            if (this.inputElement.value !== this.previousElementValue) {
                this.setProperties({ value: date }, true);
            }
        }
        if (this.strictMode && !date && this.inputElement.value === '') {
            this.setProperties({ value: null }, true);
        }
        if (isNaN(+this.value)) {
            this.setProperties({ value: null }, true);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
        }
    };
    DatePicker.prototype.createCalendar = function () {
        var _this = this;
        if (!this.isBlazorServer) {
            this.popupWrapper = this.createElement('div', { className: '' + ROOT + ' ' + POPUPWRAPPER });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
                this.popupWrapper.className += ' ' + this.cssClass;
            }
        }
        else {
            this.popupWrapper = this.inputWrapper.container.nextElementSibling;
            this.calendarElement = this.popupWrapper.firstElementChild;
            this.tableBodyElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('tbody', this.calendarElement);
            this.contentElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-content', this.calendarElement);
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.modelHeader();
            this.modal = this.createElement('div');
            this.modal.className = '' + ROOT + ' e-date-modal';
            document.body.className += ' ' + OVERFLOW;
            this.modal.style.display = 'block';
            document.body.appendChild(this.modal);
        }
        //this.calendarElement represent the Calendar object from the Calendar class.
        this.calendarElement.querySelector('table tbody').className = '';
        this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](this.popupWrapper, {
            content: this.isBlazorServer ? null : this.calendarElement,
            relateTo: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? document.body : this.inputWrapper.container,
            position: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },
            offsetY: OFFSETVALUE,
            targetType: 'container',
            enableRtl: this.enableRtl,
            zIndex: this.zIndex,
            collision: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'fit', Y: 'fit' } : { X: 'flip', Y: 'flip' },
            open: function () {
                if (_this.getModuleName() !== 'datetimepicker') {
                    if (document.activeElement !== _this.inputElement) {
                        _this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.defaultKeyConfigs, _this.keyConfigs);
                        _this.calendarElement.children[1].firstElementChild.focus();
                        _this.calendarKeyboardModules = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.calendarElement.children[1].firstElementChild, {
                            eventName: 'keydown',
                            keyAction: _this.CalendarKeyActionHandle.bind(_this),
                            keyConfigs: _this.defaultKeyConfigs
                        });
                        _this.calendarKeyboardModules = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.inputWrapper.container.children[_this.index], {
                            eventName: 'keydown',
                            keyAction: _this.CalendarKeyActionHandle.bind(_this),
                            keyConfigs: _this.defaultKeyConfigs
                        });
                    }
                }
            }, close: function () {
                if (_this.isDateIconClicked) {
                    _this.inputWrapper.container.children[_this.index].focus();
                }
                if (_this.value && !_this.isBlazorServer) {
                    _this.disabledDates();
                }
                if (_this.popupObj) {
                    _this.popupObj.destroy();
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(_this.popupWrapper);
                _this.popupObj = _this.popupWrapper = null;
                _this.setAriaAttributes();
            }, targetExitViewport: function () {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.hide();
                }
            }
        });
        if (!this.isBlazorServer) {
            this.popupObj.element.className += ' ' + this.cssClass;
        }
        this.setAriaAttributes();
    };
    DatePicker.prototype.setAriaDisabled = function () {
        if (!this.enabled) {
            this.inputElement.setAttribute('aria-disabled', 'true');
            this.inputElement.tabIndex = -1;
        }
        else {
            this.inputElement.setAttribute('aria-disabled', 'false');
            this.inputElement.setAttribute('tabindex', this.tabIndex);
        }
    };
    DatePicker.prototype.modelHeader = function () {
        var dateOptions;
        var modelHeader = this.createElement('div', { className: 'e-model-header' });
        var yearHeading = this.createElement('h1', { className: 'e-model-year' });
        var h2 = this.createElement('div');
        var daySpan = this.createElement('span', { className: 'e-model-day' });
        var monthSpan = this.createElement('span', { className: 'e-model-month' });
        if (this.calendarMode === 'Gregorian') {
            dateOptions = { format: 'y', skeleton: 'dateTime' };
        }
        else {
            dateOptions = { format: 'y', skeleton: 'dateTime', calendar: 'islamic' };
        }
        yearHeading.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions);
        if (this.calendarMode === 'Gregorian') {
            dateOptions = { format: 'E', skeleton: 'dateTime' };
        }
        else {
            dateOptions = { format: 'E', skeleton: 'dateTime', calendar: 'islamic' };
        }
        daySpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions) + ', ';
        if (this.calendarMode === 'Gregorian') {
            dateOptions = { format: 'MMM d', skeleton: 'dateTime' };
        }
        else {
            dateOptions = { format: 'MMM d', skeleton: 'dateTime', calendar: 'islamic' };
        }
        monthSpan.textContent = '' + this.globalize.formatDate(this.value || new Date(), dateOptions);
        modelHeader.appendChild(yearHeading);
        h2.appendChild(daySpan);
        h2.appendChild(monthSpan);
        modelHeader.appendChild(h2);
        this.calendarElement.insertBefore(modelHeader, this.calendarElement.firstElementChild);
    };
    DatePicker.prototype.changeTrigger = function (event) {
        if (this.inputElement.value !== this.previousElementValue) {
            if (((this.previousDate && this.previousDate.valueOf()) !== (this.value && this.value.valueOf()))) {
                if (this.isDynamicValueChanged) {
                    this.popupUpdate();
                }
                this.changedArgs.value = this.value;
                this.changedArgs.event = event || null;
                this.changedArgs.element = this.element;
                this.changedArgs.isInteracted = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event);
                if (this.isAngular && this.preventChange) {
                    this.preventChange = false;
                }
                else {
                    this.trigger('change', this.changedArgs);
                }
                this.previousElementValue = this.inputElement.value;
                this.previousDate = !isNaN(+new Date(this.checkValue(this.value))) ? new Date(this.checkValue(this.value)) : null;
                this.isInteracted = true;
            }
        }
    };
    DatePicker.prototype.navigatedEvent = function () {
        this.trigger('navigated', this.navigatedArgs);
    };
    DatePicker.prototype.changeEvent = function (event) {
        if (((this.previousDate && this.previousDate.valueOf()) !== (this.value && this.value.valueOf()))) {
            this.selectCalendar(event);
            this.changedArgs.event = event ? event : null;
            this.changedArgs.element = this.element;
            this.changedArgs.isInteracted = this.isInteracted;
            if (!this.isDynamicValueChanged) {
                this.trigger('change', this.changedArgs);
            }
            this.previousDate = this.value && new Date(+this.value);
            if (!this.isDynamicValueChanged) {
                this.hide(event);
            }
            this.previousElementValue = this.inputElement.value;
            this.errorClass();
        }
    };
    DatePicker.prototype.requiredModules = function () {
        var modules = [];
        if (this) {
            modules.push({ args: [this], member: 'islamic' });
        }
        return modules;
    };
    DatePicker.prototype.selectCalendar = function (e) {
        var date;
        var tempFormat;
        var formatOptions;
        if (this.getModuleName() === 'datetimepicker') {
            tempFormat = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat;
        }
        else {
            tempFormat = this.formatString;
        }
        if (this.value) {
            if (this.getModuleName() === 'datetimepicker') {
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { format: tempFormat, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                }
                else {
                    formatOptions = { format: tempFormat, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                }
                date = this.globalize.formatDate(this.changedArgs.value, formatOptions);
            }
            else {
                if (this.calendarMode === 'Gregorian') {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                }
                else {
                    formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
                }
                date = this.globalize.formatDate(this.changedArgs.value, formatOptions);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date)) {
            this.updateInputValue(date);
        }
    };
    DatePicker.prototype.isCalendar = function () {
        if (this.popupWrapper && this.popupWrapper.classList.contains('' + POPUPWRAPPER)) {
            return true;
        }
        return false;
    };
    DatePicker.prototype.setWidth = function (width) {
        if (typeof width === 'number') {
            this.inputWrapper.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        }
        else if (typeof width === 'string') {
            this.inputWrapper.container.style.width = (width.match(/px|%|em/)) ? (this.width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width));
        }
        else {
            this.inputWrapper.container.style.width = '100%';
        }
    };
    /**
     * Shows the Calendar.
     * @returns void

     */
    DatePicker.prototype.show = function (type, e) {
        var _this = this;
        if ((this.enabled && this.readonly) || !this.enabled || this.popupObj) {
            return;
        }
        else {
            var prevent_1 = true;
            var outOfRange = void 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && !(+this.value >= +this.min && +this.value <= +this.max)) {
                outOfRange = new Date(this.checkValue(this.value));
                if (!this.isBlazorServer) {
                    this.setProperties({ 'value': null }, true);
                }
            }
            else {
                outOfRange = this.value || null;
            }
            if (!this.isCalendar()) {
                if (!this.isBlazorServer) {
                    _super.prototype.render.call(this);
                    this.setProperties({ 'value': outOfRange || null }, true);
                }
                this.previousDate = outOfRange;
                this.createCalendar();
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.mobilePopupWrapper = this.createElement('div', { className: 'e-datepick-mob-popup-wrap' });
                document.body.appendChild(this.mobilePopupWrapper);
            }
            this.preventArgs = {
                preventDefault: function () {
                    prevent_1 = false;
                },
                popup: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered ? null : this.popupObj,
                event: e || null,
                cancel: false,
                appendTo: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? this.mobilePopupWrapper : document.body
            };
            var eventArgs = this.preventArgs;
            this.trigger('open', eventArgs, function (eventArgs) {
                _this.preventArgs = eventArgs;
                if (prevent_1 && !_this.preventArgs.cancel) {
                    if (_this.isBlazorServer) {
                        _this.popupWrapper.style.visibility = '';
                        _this.popupWrapper.style.width = 'auto';
                        _this.popupWrapper.style.height = 'auto';
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(_this.inputWrapper.buttons, ACTIVE);
                    _this.preventArgs.appendTo.appendChild(_this.popupWrapper);
                    _this.popupObj.refreshPosition(_this.inputElement);
                    var openAnimation = {
                        name: 'FadeIn',
                        duration: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? 0 : OPENDURATION,
                    };
                    if (_this.zIndex === 1000) {
                        _this.popupObj.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), _this.element);
                    }
                    else {
                        _this.popupObj.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), null);
                    }
                    if (!_this.isBlazorServer) {
                        _super.prototype.setOverlayIndex.call(_this, _this.mobilePopupWrapper, _this.popupObj.element, _this.modal, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice);
                    }
                    _this.setAriaAttributes();
                }
                else {
                    _this.popupObj.destroy();
                    if (_this.isBlazorServer) {
                        // tslint:disable
                        _this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
                        // tslint:enable
                    }
                    _this.popupWrapper = _this.popupObj = null;
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.inputElement) && _this.inputElement.value === '') {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.tableBodyElement) && _this.tableBodyElement.querySelectorAll('td.e-selected').length > 0) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.tableBodyElement.querySelector('td.e-selected')], FOCUSEDDATE);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(_this.tableBodyElement.querySelectorAll('td.e-selected'), SELECTED);
                    }
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', _this.documentHandler, _this);
            });
        }
    };
    /**
     * Hide the Calendar.
     * @returns void

     */
    DatePicker.prototype.hide = function (event) {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            var prevent_2 = true;
            this.preventArgs = {
                preventDefault: function () {
                    prevent_2 = false;
                },
                popup: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered ? null : this.popupObj,
                event: event || null,
                cancel: false
            };
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.inputWrapper.buttons, ACTIVE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], OVERFLOW);
            var eventArgs = this.preventArgs;
            if (this.isCalendar()) {
                this.trigger('close', eventArgs, function (eventArgs) {
                    _this.closeEventCallback(prevent_2, eventArgs);
                });
            }
            else {
                this.closeEventCallback(prevent_2, eventArgs);
            }
        }
        else {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.allowEdit && !this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
            this.setAllowEdit();
        }
    };
    DatePicker.prototype.closeEventCallback = function (prevent, eventArgs) {
        this.preventArgs = eventArgs;
        if (this.isCalendar() && (prevent && !this.preventArgs.cancel)) {
            var closeAnimation = {
                name: 'FadeOut',
                duration: CLOSEDURATION,
            };
            if (!this.isBlazorServer) {
                this.popupObj.hide();
                this.isAltKeyPressed = false;
                this.keyboardModule.destroy();
            }
            else {
                // tslint:disable
                this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
                // tslint:enable
                this.isAltKeyPressed = false;
                this.popupWrapper = this.popupObj = null;
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.inputWrapper.buttons, ACTIVE);
        }
        this.setAriaAttributes();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.modal) {
            this.modal.style.display = 'none';
            this.modal.outerHTML = '';
            this.modal = null;
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.mobilePopupWrapper)) {
                this.mobilePopupWrapper.remove();
                this.mobilePopupWrapper = null;
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.documentHandler);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.allowEdit && !this.readonly) {
            this.inputElement.removeAttribute('readonly');
        }
        this.setAllowEdit();
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    DatePicker.prototype.focusIn = function (triggerEvent) {
        if (document.activeElement !== this.inputElement && this.enabled) {
            this.inputElement.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
            var focusArguments = {
                model: this
            };
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    DatePicker.prototype.focusOut = function () {
        if (document.activeElement === this.inputElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [INPUTFOCUS]);
            this.inputElement.blur();
        }
    };
    /**
     * Gets the current view of the DatePicker.
     * @returns string

     */
    DatePicker.prototype.currentView = function () {
        var currentView;
        if (this.calendarElement) {
            // calls the Calendar currentView public method
            currentView = _super.prototype.currentView.call(this);
        }
        return currentView;
    };
    /**
     * Navigates to specified month or year or decade view of the DatePicker.
     * @param  {string} view - Specifies the view of the calendar.
     * @param  {Date} date - Specifies the focused date in a view.
     * @returns void

     */
    DatePicker.prototype.navigateTo = function (view, date) {
        if (this.calendarElement) {
            // calls the Calendar navigateTo public method
            _super.prototype.navigateTo.call(this, view, date);
        }
    };
    /**
     * To destroy the widget.
     * @returns void
     */
    DatePicker.prototype.destroy = function () {
        this.unBindEvents();
        if (!this.isBlazorServer) {
            _super.prototype.destroy.call(this);
            this.keyboardModules.destroy();
            if (this.popupObj && this.popupObj.element.classList.contains(POPUP)) {
                _super.prototype.destroy.call(this);
            }
        }
        var ariaAttrs = {
            'aria-live': 'assertive', 'aria-atomic': 'true', 'aria-disabled': 'true',
            'aria-haspopup': 'true', 'aria-activedescendant': 'null',
            'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',
            'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false'
        };
        if (this.inputElement) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeAttributes(ariaAttrs, this.inputElement);
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElementCopy.getAttribute('tabindex'))) ?
                this.inputElement.setAttribute('tabindex', this.tabIndex) : this.inputElement.removeAttribute('tabindex');
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.inputBlurHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.inputFocusHandler);
            this.ensureInputAttribute();
        }
        if (this.isCalendar()) {
            if (this.popupWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.popupWrapper);
            }
            this.popupObj = this.popupWrapper = null;
            if (!this.isBlazorServer) {
                this.keyboardModule.destroy();
            }
        }
        if (this.ngTag === null) {
            if (this.inputElement) {
                this.inputWrapper.container.insertAdjacentElement('afterend', this.inputElement);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputElement], [INPUTROOT]);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [ROOT]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.container);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.resetFormHandler);
        }
    };
    DatePicker.prototype.ensureInputAttribute = function () {
        var prop = [];
        for (var i = 0; i < this.inputElement.attributes.length; i++) {
            prop[i] = this.inputElement.attributes[i].name;
        }
        for (var i = 0; i < prop.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElementCopy.getAttribute(prop[i]))) {
                if (prop[i].toLowerCase() === 'value') {
                    this.inputElement.value = '';
                }
                this.inputElement.removeAttribute(prop[i]);
            }
            else {
                if (prop[i].toLowerCase() === 'value') {
                    this.inputElement.value = this.inputElementCopy.getAttribute(prop[i]);
                }
                this.inputElement.setAttribute(prop[i], this.inputElementCopy.getAttribute(prop[i]));
            }
        }
    };
    /**
     * Initialize the event handler
     * @private
     */
    DatePicker.prototype.preRender = function () {
        this.inputElementCopy = this.element.cloneNode(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputElementCopy], [ROOT, CONTROL, LIBRARY]);
        this.inputElement = this.element;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.inputElement, 'form');
        this.index = this.showClearButton ? 2 : 1;
        this.isBlazorServer = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.getModuleName() === 'datepicker') ? true : false;
        if (!this.isBlazorServer) {
            this.ngTag = null;
            if (this.element.tagName === 'EJS-DATEPICKER' || this.element.tagName === 'EJS-DATETIMEPICKER') {
                this.ngTag = this.element.tagName;
                this.inputElement = this.createElement('input');
                this.element.appendChild(this.inputElement);
            }
            if (this.element.getAttribute('id')) {
                if (this.ngTag !== null) {
                    this.inputElement.id = this.element.getAttribute('id') + '_input';
                }
            }
            else {
                if (this.getModuleName() === 'datetimepicker') {
                    this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2-datetimepicker');
                    if (this.ngTag !== null) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'id': this.element.id + '_input' });
                    }
                }
                else {
                    this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2-datepicker');
                    if (this.ngTag !== null) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'id': this.element.id + '_input' });
                    }
                }
            }
            if (this.ngTag !== null) {
                this.validationAttribute(this.element, this.inputElement);
            }
            this.updateHtmlAttributeToElement();
        }
        this.defaultKeyConfigs = this.getDefaultKeyConfig();
        this.checkHtmlAttributes(false);
        this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
        if (!this.isBlazorServer) {
            this.element.removeAttribute('tabindex');
            _super.prototype.preRender.call(this);
        }
    };
    ;
    DatePicker.prototype.getDefaultKeyConfig = function () {
        this.defaultKeyConfigs = {
            altUpArrow: 'alt+uparrow',
            altDownArrow: 'alt+downarrow',
            escape: 'escape',
            enter: 'enter',
            controlUp: 'ctrl+38',
            controlDown: 'ctrl+40',
            moveDown: 'downarrow',
            moveUp: 'uparrow',
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            select: 'enter',
            home: 'home',
            end: 'end',
            pageUp: 'pageup',
            pageDown: 'pagedown',
            shiftPageUp: 'shift+pageup',
            shiftPageDown: 'shift+pagedown',
            controlHome: 'ctrl+home',
            controlEnd: 'ctrl+end',
            shiftTab: 'shift+tab',
            tab: 'tab'
        };
        return this.defaultKeyConfigs;
    };
    DatePicker.prototype.validationAttribute = function (target, inputElement) {
        var nameAttribute = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
        inputElement.setAttribute('name', nameAttribute);
        target.removeAttribute('name');
        var attribute = ['required', 'aria-required', 'form'];
        for (var i = 0; i < attribute.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target.getAttribute(attribute[i]))) {
                continue;
            }
            var attr = target.getAttribute(attribute[i]);
            inputElement.setAttribute(attribute[i], attr);
            target.removeAttribute(attribute[i]);
        }
    };
    DatePicker.prototype.checkFormat = function () {
        var culture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        if (this.format) {
            if (typeof this.format === 'string') {
                this.formatString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.format.replace(/tt/, 'a') : this.format;
            }
            else if (this.format.skeleton !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.format.skeleton)) {
                var skeletonString = this.format.skeleton;
                if (this.getModuleName() === 'datetimepicker') {
                    this.formatString = culture.getDatePattern({ skeleton: skeletonString, type: 'dateTime' });
                }
                else {
                    this.formatString = culture.getDatePattern({ skeleton: skeletonString, type: 'date' });
                }
            }
            else {
                if (this.getModuleName() === 'datetimepicker') {
                    this.formatString = this.dateTimeFormat;
                }
                else {
                    this.formatString = null;
                }
            }
        }
        else {
            this.formatString = null;
        }
    };
    DatePicker.prototype.checkHtmlAttributes = function (dynamic) {
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        this.checkFormat();
        this.checkView();
        var attributes = dynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['value', 'min', 'max', 'disabled', 'readonly', 'style', 'name', 'placeholder', 'type'];
        var options;
        if (this.getModuleName() === 'datetimepicker') {
            if (this.calendarMode === 'Gregorian') {
                options = {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
                };
            }
            else {
                options = {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'
                };
            }
        }
        else {
            if (this.calendarMode === 'Gregorian') {
                options = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            }
            else {
                options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
            }
        }
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute(prop))) {
                switch (prop) {
                    case 'disabled':
                        // tslint:disable-next-line
                        if (((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.datepickerOptions) || (this.datepickerOptions['enabled'] === undefined)) || dynamic) && !this.isBlazorServer) {
                            var enabled = this.inputElement.getAttribute(prop) === 'disabled' || this.inputElement.getAttribute(prop) === '' ||
                                this.inputElement.getAttribute(prop) === 'true' ? false : true;
                            this.setProperties({ enabled: enabled }, !dynamic);
                        }
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if (((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.datepickerOptions) || (this.datepickerOptions['readonly'] === undefined)) || dynamic) && !this.isBlazorServer) {
                            var readonly = this.inputElement.getAttribute(prop) === 'readonly' || this.inputElement.getAttribute(prop) === '' ||
                                this.inputElement.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !dynamic);
                        }
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if (((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.datepickerOptions) || (this.datepickerOptions['placeholder'] === undefined)) || dynamic) && !this.isBlazorServer) {
                            var placeholder = this.inputElement.getAttribute(prop);
                            this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !dynamic);
                        }
                        break;
                    case 'style':
                        if (!this.isBlazorServer) {
                            this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
                        }
                        break;
                    case 'name':
                        if (!this.isBlazorServer) {
                            this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if (((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.datepickerOptions) || (this.datepickerOptions['value'] === undefined)) || dynamic) && !this.isBlazorServer) {
                            var value = this.inputElement.getAttribute(prop);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, this.globalize.parseDate(value, options), {}), !dynamic);
                        }
                        break;
                    case 'min':
                        if ((+this.min === +new Date(1900, 0, 1)) || dynamic) {
                            var min = this.inputElement.getAttribute(prop);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, this.globalize.parseDate(min), {}), !dynamic);
                        }
                        break;
                    case 'max':
                        if ((+this.max === +new Date(2099, 11, 31)) || dynamic) {
                            var max = this.inputElement.getAttribute(prop);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, this.globalize.parseDate(max), {}), !dynamic);
                        }
                        break;
                    case 'type':
                        if (this.inputElement.getAttribute(prop) !== 'text' && !this.isBlazorServer) {
                            this.inputElement.setAttribute('type', 'text');
                        }
                        break;
                }
            }
        }
    };
    /**
     * To get component name.
     * @private
     */
    DatePicker.prototype.getModuleName = function () {
        return 'datepicker';
    };
    DatePicker.prototype.disabledDates = function () {
        var valueCopy;
        var formatOptions;
        var globalize;
        valueCopy = this.checkDateValue(this.value) ? new Date(+this.value) : new Date(this.checkValue(this.value));
        var previousValCopy = this.previousDate;
        //calls the Calendar render method to check the disabled dates through renderDayCell event and update the input value accordingly.
        this.minMaxUpdates();
        if (!this.isBlazorServer) {
            _super.prototype.render.call(this);
        }
        this.previousDate = previousValCopy;
        var date = valueCopy && +(valueCopy);
        var dateIdString = '*[id^="/id"]'.replace('/id', '' + date);
        if (!this.strictMode) {
            if (typeof this.value === 'string' || ((typeof this.value === 'object') && (+this.value) !== (+valueCopy))) {
                this.setProperties({ value: valueCopy }, true);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelectorAll(dateIdString)[0])) {
            if (this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled')) {
                if (!this.strictMode) {
                    this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
                }
            }
        }
        var inputVal;
        if (this.getModuleName() === 'datetimepicker') {
            if (this.calendarMode === 'Gregorian') {
                globalize = this.globalize.formatDate(valueCopy, {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
                });
            }
            else {
                globalize = this.globalize.formatDate(valueCopy, {
                    format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.dateTimeFormat,
                    type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'
                });
            }
            inputVal = globalize;
        }
        else {
            if (this.calendarMode === 'Gregorian') {
                formatOptions = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            }
            else {
                formatOptions = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
            }
            inputVal = this.globalize.formatDate(valueCopy, formatOptions);
        }
        if (!this.popupObj) {
            this.updateInputValue(inputVal);
        }
    };
    DatePicker.prototype.setAriaAttributes = function () {
        if (this.isBlazorServer) {
            if (this.isCalendar()) {
                var focusedEle = this.tableBodyElement.querySelector('tr td.e-focused-date');
                var selectedEle = this.tableBodyElement.querySelector('tr td.e-selected');
                var id = (focusedEle || selectedEle) ? (focusedEle || selectedEle).getAttribute('id') : 'null';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': '' + id });
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': 'null' });
            }
        }
        else {
            if (this.isCalendar()) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addAttributes({ 'aria-expanded': 'true' }, this.inputElement);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': '' + this.setActiveDescendant() });
            }
            else {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addAttributes({ 'aria-expanded': 'false' }, this.inputElement);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': 'null' });
            }
        }
    };
    DatePicker.prototype.errorClass = function () {
        var dateIdString = '*[id^="/id"]'.replace('/id', '' + (+this.value));
        var isDisabledDate = this.calendarElement &&
            this.calendarElement.querySelectorAll(dateIdString)[0] &&
            this.calendarElement.querySelectorAll(dateIdString)[0].classList.contains('e-disabled');
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && !(+new Date(+this.value).setMilliseconds(0) >= +this.min
            && +new Date(+this.value).setMilliseconds(0) <= +this.max))
            || (!this.strictMode && this.inputElement.value !== '' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) || isDisabledDate)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], ERROR);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'true' });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], ERROR);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'false' });
        }
    };
    /**
     * Called internally if any of the property value changed.
     * returns void
     * @private
     */
    DatePicker.prototype.onPropertyChanged = function (newProp, oldProp) {
        var options;
        if (this.calendarMode === 'Gregorian') {
            options = { format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        }
        else {
            options = { format: this.formatString, type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'value':
                    this.isDynamicValueChanged = true;
                    this.isInteracted = false;
                    this.invalidValueString = null;
                    if (!this.isBlazorServer) {
                        this.checkInvalidValue(newProp.value);
                    }
                    newProp.value = this.value;
                    this.previousElementValue = this.inputElement.value;
                    if (!this.isBlazorServer) {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                            this.updateInputValue('');
                            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
                        }
                        this.updateInput();
                        if (+this.previousDate !== +this.value) {
                            this.changeTrigger(null);
                        }
                    }
                    this.isInteracted = true;
                    break;
                case 'format':
                    this.checkFormat();
                    this.bindInputEvent();
                    if (!this.isBlazorServer) {
                        this.updateInput();
                    }
                    break;
                case 'allowEdit':
                    this.setAllowEdit();
                    break;
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(this.placeholder, this.inputElement);
                    break;
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setReadonly(this.readonly, this.inputElement);
                    break;
                case 'enabled':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnabled(this.enabled, this.inputElement);
                    this.setAriaDisabled();
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttributeToElement();
                    this.updateHtmlAttributeToWrapper();
                    this.checkHtmlAttributes(true);
                    break;
                case 'locale':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.l10n.setLocale(this.locale);
                    this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(this.placeholder, this.inputElement);
                    if (!this.isBlazorServer) {
                        this.updateInput();
                    }
                    break;
                case 'enableRtl':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnableRtl(this.enableRtl, [this.inputWrapper.container]);
                    break;
                case 'start':
                case 'depth':
                    this.checkView();
                    if (this.calendarElement && !this.isBlazorServer) {
                        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
                    }
                    break;
                case 'zIndex':
                    this.setProperties({ zIndex: newProp.zIndex }, true);
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'showClearButton':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setClearButton(this.showClearButton, this.inputElement, this.inputWrapper);
                    this.bindClearEvent();
                    this.index = this.showClearButton ? 2 : 1;
                    break;
                case 'strictMode':
                    this.invalidValueString = null;
                    if (!this.isBlazorServer) {
                        this.updateInput();
                    }
                    break;
                case 'width':
                    this.setWidth(newProp.width);
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeFloating(this.inputWrapper);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addFloating(this.inputElement, this.floatLabelType, this.placeholder);
                    break;
                default:
                    if (this.calendarElement && !this.isBlazorServer) {
                        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
                    }
                    break;
            }
            if (!this.isDynamicValueChanged) {
                this.hide(null);
            }
            this.isDynamicValueChanged = false;
            this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DatePicker.prototype, "strictMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "format", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DatePicker.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], DatePicker.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "values", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DatePicker.prototype, "isMultiSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DatePicker.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DatePicker.prototype, "allowEdit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DatePicker.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], DatePicker.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DatePicker.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], DatePicker.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DatePicker.prototype, "serverTimezoneOffset", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DatePicker.prototype, "openOnFocus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "cleared", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DatePicker.prototype, "destroyed", void 0);
    DatePicker = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DatePicker);
    return DatePicker;
}(_calendar_calendar__WEBPACK_IMPORTED_MODULE_3__["Calendar"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/index.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/index.js ***!
  \*************************************************************************/
/*! exports provided: DatePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _datepicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./datepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/datepicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return _datepicker__WEBPACK_IMPORTED_MODULE_0__["DatePicker"]; });

/**
 * Datepicker modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/daterangepicker.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/daterangepicker.js ***!
  \****************************************************************************************/
/*! exports provided: Presets, DateRangePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Presets", function() { return Presets; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateRangePicker", function() { return DateRangePicker; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _calendar_calendar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../calendar/calendar */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/calendar.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../calendar/calendar-model.d.ts'/>









var DATERANGEWRAPPER = 'e-date-range-wrapper';
var INPUTCONTAINER = 'e-input-group';
var DATERANGEICON = 'e-input-group-icon e-range-icon e-icons';
var POPUP = 'e-popup';
var LEFTCALENDER = 'e-left-calendar';
var RIGHTCALENDER = 'e-right-calendar';
var LEFTCONTAINER = 'e-left-container';
var RIGHTCONTAINER = 'e-right-container';
var ROOT = 'e-daterangepicker';
var LIBRARY = 'e-lib';
var CONTROL = 'e-control';
var ERROR = 'e-error';
var ACTIVE = 'e-active';
var STARTENDCONTAINER = 'e-start-end';
var STARTDATE = 'e-start-date';
var ENDDATE = 'e-end-date';
var STARTBUTTON = 'e-start-btn';
var INPUTFOCUS = 'e-input-focus';
var ENDBUTTON = 'e-end-btn';
var RANGEHOVER = 'e-range-hover';
var OTHERMONTH = 'e-other-month';
var STARTLABEL = 'e-start-label';
var ENDLABEL = 'e-end-label';
var DISABLED = 'e-disabled';
var SELECTED = 'e-selected';
var CALENDAR = 'e-calendar';
var NEXTICON = 'e-next';
var PREVICON = 'e-prev';
var HEADER = 'e-header';
var TITLE = 'e-title';
var ICONCONTAINER = 'e-icon-container';
var RANGECONTAINER = 'e-date-range-container';
var RANGEHEADER = 'e-range-header';
var PRESETS = 'e-presets';
var FOOTER = 'e-footer';
var RANGEBORDER = 'e-range-border';
var TODAY = 'e-today';
var FOCUSDATE = 'e-focused-date';
var CONTENT = 'e-content';
var DAYSPAN = 'e-day-span';
var WEEKNUMBER = 'e-week-number';
var DATEDISABLED = 'e-date-disabled';
var ICONDISABLED = 'e-icon-disabled';
var CALENDARCONTAINER = 'e-calendar-container';
var SEPARATOR = 'e-separator';
var APPLY = 'e-apply';
var CANCEL = 'e-cancel';
var DEVICE = 'e-device';
var OVERLAY = 'e-overlay';
var CHANGEICON = 'e-change-icon e-icons';
var LISTCLASS = 'e-list-item';
var RTL = 'e-rtl';
var HOVER = 'e-hover';
var OVERFLOW = 'e-range-overflow';
var OFFSETVALUE = 4;
var PRIMARY = 'e-primary';
var FLAT = 'e-flat';
var CSS = 'e-css';
var ZOOMIN = 'e-zoomin';
var NONEDITABLE = 'e-non-edit';
var DAYHEADERLONG = 'e-daterange-day-header-lg';
var HIDDENELEMENT = 'e-daterange-hidden';
var wrapperAttr = ['title', 'class', 'style'];
var Presets = /** @__PURE__ @class */ (function (_super) {
    __extends(Presets, _super);
    function Presets() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Presets.prototype, "label", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Presets.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Presets.prototype, "end", void 0);
    return Presets;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Represents the DateRangePicker component that allows user to select the date range from the calendar
 * or entering the range through the input element.
 * ```html
 * <input id="daterangepicker"/>
 * ```
 * ```typescript
 * <script>
 *   var dateRangePickerObj = new DateRangePicker({ startDate: new Date("05/07/2017"), endDate: new Date("10/07/2017") });
 *   dateRangePickerObj.appendTo("#daterangepicker");
 * </script>
 * ```
 */
var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
    __extends(DateRangePicker, _super);
    /**
     * Constructor for creating the widget
     */
    function DateRangePicker(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isCustomRange = false;
        _this.isCustomWindow = false;
        _this.presetsItem = [];
        _this.liCollections = [];
        _this.previousEleValue = '';
        _this.isKeyPopup = false;
        _this.dateDisabled = false;
        _this.isRangeIconClicked = false;
        _this.isMaxDaysClicked = false;
        _this.disabledDays = [];
        _this.preventBlur = false;
        _this.preventFocus = false;
        _this.invalidValueString = null;
        _this.isAngular = false;
        _this.preventChange = false;
        _this.dateRangeOptions = options;
        return _this;
    }
    /**
     * To Initialize the control rendering.
     * @return void
     * @private
     */
    DateRangePicker.prototype.render = function () {
        this.initialize();
        this.setProperties({ startDate: this.startValue }, true);
        this.setProperties({ endDate: this.endValue }, true);
        this.setModelValue();
        this.setDataAttribute(false);
        if (this.element.hasAttribute('data-val')) {
            this.element.setAttribute('data-val', 'false');
        }
        this.renderComplete();
    };
    /**
     * Initialize the event handler
     * @returns void
     * @private
     */
    DateRangePicker.prototype.preRender = function () {
        this.keyInputConfigs = {
            altDownArrow: 'alt+downarrow',
            escape: 'escape',
            enter: 'enter',
            tab: 'tab',
            altRightArrow: 'alt+rightarrow',
            altLeftArrow: 'alt+leftarrow',
            moveUp: 'uparrow',
            moveDown: 'downarrow',
            spacebar: 'space'
        };
        this.defaultConstant = {
            placeholder: this.placeholder,
            startLabel: 'Start Date',
            endLabel: 'End Date',
            customRange: 'Custom Range',
            applyText: 'Apply',
            cancelText: 'Cancel',
            selectedDays: 'Selected Days',
            days: 'days'
        };
        /**
         * Mobile View
         */
        this.isMobile = window.matchMedia('(max-width:550px)').matches;
        this.inputElement = this.element;
        this.angularTag = null;
        if (this.element.tagName === 'EJS-DATERANGEPICKER') {
            this.angularTag = this.element.tagName;
            this.inputElement = this.createElement('input');
            this.element.appendChild(this.inputElement);
        }
        this.cloneElement = this.element.cloneNode(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.cloneElement], [ROOT, CONTROL, LIBRARY]);
        this.updateHtmlAttributeToElement();
        if (this.element.getAttribute('id')) {
            if (this.angularTag !== null) {
                this.inputElement.id = this.element.getAttribute('id') + '_input';
            }
        }
        else {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2-datetimepicker');
            if (this.angularTag !== null) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'id': this.element.id + '_input' });
            }
        }
        this.checkInvalidRange(this.value);
        if (!this.invalidValueString && (typeof (this.value) === 'string')) {
            var rangeArray = this.value.split(' ' + this.separator + ' ');
            this.value = [new Date(rangeArray[0]), new Date(rangeArray[1])];
        }
        this.initProperty();
        this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
        this.element.removeAttribute('tabindex');
        _super.prototype.preRender.call(this);
        this.navNextFunction = this.navNextMonth.bind(this);
        this.navPrevFunction = this.navPrevMonth.bind(this);
        this.deviceNavNextFunction = this.deviceNavNext.bind(this);
        this.deviceNavPrevFunction = this.deviceNavPrevious.bind(this);
        this.initStartDate = this.checkDateValue(this.startValue);
        this.initEndDate = this.checkDateValue(this.endValue);
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
    };
    ;
    DateRangePicker.prototype.updateValue = function () {
        var dateOptions = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        if (this.value && this.value.length > 0) {
            if (this.value[0] instanceof Date && !isNaN(+this.value[0])) {
                this.setProperties({ startDate: this.value[0] }, true);
                this.startValue = this.value[0];
            }
            else if (typeof this.value[0] === 'string') {
                if (+this.value[0] === 0 || isNaN(+(new Date(this.checkValue(this.value[0]))))) {
                    this.startValue = null;
                    this.setValue();
                }
                else {
                    this.setProperties({ startDate: new Date(this.checkValue(this.value[0])) }, true);
                    this.startValue = new Date(this.checkValue(this.value[0]));
                }
            }
            else {
                this.startValue = null;
                this.setValue();
            }
            if (this.value[1] instanceof Date && !isNaN(+this.value[1])) {
                this.setProperties({ endDate: this.value[1] }, true);
                this.endValue = this.value[1];
            }
            else if (typeof this.value[1] === 'string') {
                if (+this.value[0] === 0 || isNaN(+(new Date(this.checkValue(this.value[0]))))) {
                    this.setProperties({ endDate: null }, true);
                    this.endValue = null;
                    this.setValue();
                }
                else {
                    this.setProperties({ endDate: new Date(this.checkValue(this.value[1])) }, true);
                    this.endValue = new Date(this.checkValue(this.value[1]));
                    this.setValue();
                }
            }
            else {
                this.setProperties({ endDate: null }, true);
                this.endValue = null;
                this.setValue();
            }
        }
        else if (this.value && this.value.start) {
            if (this.value.start instanceof Date && !isNaN(+this.value.start)) {
                this.setProperties({ startDate: this.value.start }, true);
                this.startValue = this.value.start;
            }
            else if (typeof this.value.start === 'string') {
                this.setProperties({ startDate: new Date(this.checkValue(this.value.start)) }, true);
                this.startValue = new Date(this.checkValue(this.value.start));
            }
            else {
                this.startValue = null;
                this.setValue();
            }
            if (this.value.end instanceof Date && !isNaN(+this.value.end)) {
                this.setProperties({ endDate: this.value.end }, true);
                this.endValue = this.value.end;
            }
            else if (typeof this.value.end === 'string') {
                this.setProperties({ endDate: new Date(this.checkValue(this.value.end)) }, true);
                this.endValue = new Date(this.checkValue(this.value.end));
                this.setValue();
            }
            else {
                this.setProperties({ endDate: null }, true);
                this.endValue = null;
                this.setValue();
            }
        }
        else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.endValue = this.checkDateValue(new Date(this.checkValue(this.endDate)));
            this.startValue = this.checkDateValue(new Date(this.checkValue(this.startDate)));
            this.setValue();
        }
    };
    DateRangePicker.prototype.initProperty = function () {
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        this.checkFormat();
        this.checkView();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.firstDayOfWeek) || this.firstDayOfWeek > 6 || this.firstDayOfWeek < 0) {
            this.setProperties({ firstDayOfWeek: this.globalize.getFirstDayOfWeek() }, true);
        }
        this.updateValue();
    };
    DateRangePicker.prototype.checkFormat = function () {
        if (this.format) {
            if (typeof this.format === 'string') {
                this.formatString = this.format;
            }
            else if (this.format.skeleton !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.format.skeleton)) {
                var skeletonString = this.format.skeleton;
                this.formatString = this.globalize.getDatePattern({ skeleton: skeletonString, type: 'date' });
            }
            else {
                this.formatString = null;
            }
        }
        else {
            this.formatString = null;
        }
    };
    DateRangePicker.prototype.initialize = function () {
        if (this.angularTag !== null) {
            this.validationAttribute(this.element, this.inputElement);
        }
        this.checkHtmlAttributes(false);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(this.defaultKeyConfigs, { shiftTab: 'shift+tab' });
        var start = this.checkDateValue(new Date(this.checkValue(this.startValue)));
        this.setProperties({ startDate: start }, true); // persist the value propeerty.
        this.setProperties({ endValue: this.checkDateValue(new Date(this.checkValue(this.endValue))) }, true);
        this.setValue();
        this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(this.min))) }, true);
        this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(this.max))) }, true);
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('daterangepicker', this.defaultConstant, this.locale);
        this.l10n.setLocale(this.locale);
        this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
        this.processPresets();
        this.createInput();
        this.updateHtmlAttributeToWrapper();
        this.setRangeAllowEdit();
        this.bindEvents();
    };
    DateRangePicker.prototype.setDataAttribute = function (isDynamic) {
        var attributes = {};
        if (!isDynamic) {
            for (var i = 0; i < this.element.attributes.length; i++) {
                attributes[this.element.attributes[i].name] = this.element.getAttribute(this.element.attributes[i].name);
            }
        }
        else {
            attributes = this.htmlAttributes;
        }
        for (var _i = 0, _a = Object.keys(attributes); _i < _a.length; _i++) {
            var pro = _a[_i];
            if (pro.indexOf('data') === 0) {
                this.firstHiddenChild.setAttribute(pro, attributes[pro]);
                this.secondHiddenChild.setAttribute(pro, attributes[pro]);
            }
        }
    };
    DateRangePicker.prototype.setRangeAllowEdit = function () {
        if (this.allowEdit) {
            if (!this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'readonly': '' });
        }
        this.updateClearIconState();
    };
    DateRangePicker.prototype.updateClearIconState = function () {
        if (!this.allowEdit && this.inputWrapper && !this.readonly) {
            if (this.inputElement.value === '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [NONEDITABLE]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [NONEDITABLE]);
            }
        }
        else if (this.inputWrapper) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [NONEDITABLE]);
        }
    };
    DateRangePicker.prototype.validationAttribute = function (element, input) {
        var name = element.getAttribute('name') ? element.getAttribute('name') : element.getAttribute('id');
        input.setAttribute('name', name);
        element.removeAttribute('name');
        var attributes = ['required', 'aria-required', 'form'];
        for (var i = 0; i < attributes.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.getAttribute(attributes[i]))) {
                continue;
            }
            var attr = element.getAttribute(attributes[i]);
            input.setAttribute(attributes[i], attr);
            element.removeAttribute(attributes[i]);
        }
    };
    DateRangePicker.prototype.updateHtmlAttributeToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttr.indexOf(key) > -1) {
                    if (key === 'class') {
                        var updatedClassValue = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
                        if (updatedClassValue !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], updatedClassValue.split(' '));
                        }
                    }
                    else if (key === 'style') {
                        var dateRangeStyle = this.inputWrapper.container.getAttribute(key);
                        dateRangeStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dateRangeStyle) ? (dateRangeStyle + this.htmlAttributes[key]) :
                            this.htmlAttributes[key];
                        this.inputWrapper.container.setAttribute(key, dateRangeStyle);
                    }
                    else {
                        this.inputWrapper.container.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    DateRangePicker.prototype.updateHtmlAttributeToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttr.indexOf(key) < 0) {
                    this.inputElement.setAttribute(key, this.htmlAttributes[key]);
                }
            }
        }
    };
    DateRangePicker.prototype.updateCssClass = function (cssNewClass, cssOldClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssOldClass)) {
            cssOldClass = (cssOldClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssNewClass)) {
            cssNewClass = (cssNewClass.replace(/\s+/g, ' ')).trim();
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setCssClass(cssNewClass, [this.inputWrapper.container], cssOldClass);
        if (this.popupWrapper) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setCssClass(cssNewClass, [this.popupWrapper], cssOldClass);
        }
    };
    DateRangePicker.prototype.processPresets = function () {
        this.presetsItem = [];
        var i = 0;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
            for (var _i = 0, _a = this.presets; _i < _a.length; _i++) {
                var range = _a[_i];
                var id = range.label.replace(/\s+/g, '') + '_' + (++i);
                if (typeof range.end === 'string') {
                    this.presetsItem.push({
                        id: id, text: range.label, end: new Date(this.checkValue(range.end)), start: new Date(this.checkValue(range.start))
                    });
                }
                else {
                    this.presetsItem.push({ id: id, text: range.label, start: range.start, end: range.end });
                }
            }
            var startDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) ? null : new Date(+this.startValue);
            var endDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) ? null : new Date(+this.endValue);
            this.presetsItem.push({ id: 'custom_range', text: this.l10n.getConstant('customRange'), start: startDate, end: endDate });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
                this.isCustomRange = true;
                this.activeIndex = this.presetsItem.length - 1;
            }
        }
    };
    DateRangePicker.prototype.bindEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown', this.rangeIconHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'focus', this.inputFocusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'blur', this.inputBlurHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'change', this.inputChangeHandler, this);
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);
        }
        if (!this.isMobile) {
            this.keyInputConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.keyInputConfigs, this.keyConfigs);
            this.inputKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputElement, {
                eventName: 'keydown',
                keyAction: this.inputHandler.bind(this),
                keyConfigs: this.keyInputConfigs
            });
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
        if (this.enabled) {
            this.inputElement.setAttribute('tabindex', this.tabIndex);
        }
        else {
            this.inputElement.tabIndex = -1;
        }
    };
    DateRangePicker.prototype.unBindEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown', this.rangeIconHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.inputBlurHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.inputFocusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'change', this.inputChangeHandler);
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler);
        }
        if (!this.isMobile) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputKeyboardModule)) {
                this.inputKeyboardModule.destroy();
            }
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
        this.inputElement.tabIndex = -1;
    };
    DateRangePicker.prototype.updateHiddenInput = function () {
        if (this.firstHiddenChild && this.secondHiddenChild) {
            var format = { type: 'datetime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            if (typeof this.startDate === 'string') {
                this.startDate = this.globalize.parseDate(this.startDate, format);
            }
            if (typeof this.endDate === 'string') {
                this.endDate = this.globalize.parseDate(this.endDate, format);
            }
            this.firstHiddenChild.value = (this.startDate && this.globalize.formatDate(this.startDate, format))
                || (this.inputElement.value);
            this.secondHiddenChild.value = (this.endDate && this.globalize.formatDate(this.endDate, format)) ||
                (this.inputElement.value);
            this.dispatchEvent(this.firstHiddenChild, 'focusout');
            this.dispatchEvent(this.firstHiddenChild, 'change');
        }
    };
    DateRangePicker.prototype.inputChangeHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        e.stopPropagation();
        this.updateHiddenInput();
    };
    DateRangePicker.prototype.bindClearEvent = function () {
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);
        }
    };
    DateRangePicker.prototype.resetHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        this.valueType = this.value;
        e.preventDefault();
        this.clear();
        var clearedArgs = {
            event: e
        };
        this.setProperties({ endDate: this.checkDateValue(this.endValue) }, true);
        this.setProperties({ startDate: this.checkDateValue(this.startValue) }, true);
        this.trigger('cleared', clearedArgs);
        this.changeTrigger(e);
        this.clearRange();
        this.hide(e);
    };
    DateRangePicker.prototype.restoreValue = function () {
        this.previousEleValue = this.inputElement.value;
        this.previousStartValue = this.startValue;
        this.previousEndValue = this.endValue;
        this.valueType = null;
        this.initStartDate = this.checkDateValue(this.startValue);
        this.initEndDate = this.checkDateValue(this.endValue);
        this.setValue();
        this.setModelValue();
    };
    DateRangePicker.prototype.formResetHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (this.formElement && (e.target === this.formElement) && !this.inputElement.disabled) {
            var val = this.inputElement.getAttribute('value');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startCopy)) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value.start)) {
                    this.setProperties({ value: { start: this.startCopy, end: this.endCopy } }, true);
                    this.startValue = this.value.start;
                    this.endValue = this.value.end;
                }
                else {
                    this.setProperties({ value: [this.startCopy, this.endCopy] }, true);
                    this.startValue = this.value[0];
                    this.endValue = this.value[1];
                }
                this.setProperties({ startDate: this.startValue, endDate: this.endValue }, true);
            }
            else {
                this.setProperties({ value: null, startDate: null, endDate: null }, true);
                this.startValue = this.endValue = null;
            }
            if (this.element.tagName === 'EJS-DATERANGEPICKER') {
                this.setProperties({ value: null, startDate: null, endDate: null }, true);
                val = '';
                this.startValue = this.endValue = null;
                this.inputElement.setAttribute('value', '');
            }
            this.restoreValue();
            if (this.inputElement) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(val, this.inputElement, this.floatLabelType, this.showClearButton);
                this.errorClass();
            }
        }
    };
    DateRangePicker.prototype.clear = function () {
        if (this.startValue !== null) {
            this.startValue = null;
        }
        if (this.endValue !== null) {
            this.endValue = null;
        }
        if (this.value && this.value.start) {
            this.setProperties({ value: { start: null, end: null } }, true);
        }
        if (this.value !== null && this.value.length > 0) {
            this.setProperties({ value: null }, true);
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.applyButton))) {
            this.applyButton.disabled = this.applyButton.element.disabled = true;
        }
        this.removeSelection();
    };
    DateRangePicker.prototype.rangeIconHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (this.isMobile) {
            this.inputElement.setAttribute('readonly', '');
        }
        e.preventDefault();
        this.targetElement = null;
        if (this.isPopupOpen() && document.body.contains(this.popupObj.element)) {
            this.applyFunction(e);
        }
        else {
            this.isRangeIconClicked = true;
            this.inputWrapper.container.children[0].focus();
            this.show(null, e);
            if (!this.isMobile) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.leftCalendar)) {
                    this.isRangeIconClicked = false;
                    this.calendarFocus();
                    this.isRangeIconClicked = true;
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
        }
    };
    DateRangePicker.prototype.checkHtmlAttributes = function (isDynamic) {
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['startDate', 'endDate', 'minDays', 'maxDays', 'min', 'max', 'disabled', 'readonly', 'style', 'name', 'placeholder',
                'type', 'value'];
        var format = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute(prop))) {
                switch (prop) {
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateRangeOptions) || (this.dateRangeOptions['enabled'] === undefined)) || isDynamic) {
                            var disabled = this.inputElement.getAttribute(prop) === 'disabled' ||
                                this.inputElement.getAttribute(prop) === '' || this.inputElement.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ enabled: !disabled }, !isDynamic);
                        }
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateRangeOptions) || (this.dateRangeOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.inputElement.getAttribute(prop) === 'readonly' ||
                                this.inputElement.getAttribute(prop) === 'true' || this.inputElement.getAttribute(prop) === '' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateRangeOptions) || (this.dateRangeOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !isDynamic);
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateRangeOptions) || (this.dateRangeOptions['value'] === undefined)) || isDynamic) {
                            var value = this.inputElement.getAttribute(prop);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, value, {}), !isDynamic);
                        }
                        break;
                    case 'style':
                        this.inputElement.setAttribute('style', '' + this.inputElement.getAttribute(prop));
                        break;
                    case 'min':
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.min) || +this.min === +new Date(1900, 0, 1)) || isDynamic) {
                            var dateValue = this.globalize.parseDate(this.inputElement.getAttribute(prop), format);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, dateValue, {}), !isDynamic);
                        }
                        break;
                    case 'name':
                        this.inputElement.setAttribute('name', '' + this.inputElement.getAttribute(prop));
                        break;
                    case 'max':
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.max) || +this.max === +new Date(2099, 11, 31)) || isDynamic) {
                            var dateValue = this.globalize.parseDate(this.inputElement.getAttribute(prop), format);
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, dateValue, {}), !isDynamic);
                        }
                        break;
                    case 'startDate':
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startDate)) {
                            var dateValue = this.globalize.parseDate(this.inputElement.getAttribute(prop), format);
                            this.startValue = dateValue;
                            this.setValue();
                        }
                        break;
                    case 'endDate':
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endDate)) {
                            var dateValue = this.globalize.parseDate(this.inputElement.getAttribute(prop), format);
                            this.endValue = dateValue;
                            this.setValue();
                        }
                        break;
                    case 'minDays':
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays)) {
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, parseInt(this.inputElement.getAttribute(prop), 10), {}), true);
                        }
                        break;
                    case 'maxDays':
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays)) {
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, parseInt(this.inputElement.getAttribute(prop), 10), {}), true);
                        }
                        break;
                    case 'type':
                        if (this.inputElement.getAttribute(prop) !== 'text') {
                            this.inputElement.setAttribute('type', 'text');
                        }
                        break;
                }
            }
        }
    };
    DateRangePicker.prototype.createPopup = function () {
        for (var i = 0; i < this.presetsItem.length; i++) {
            if ((i !== (this.presetsItem.length - 1)) && this.presetsItem[i].id === 'custom_range') {
                this.presetsItem.splice(i, 1);
            }
        }
        this.activeIndex = this.presetsItem.length - 1;
        this.isCustomRange = true;
        for (var i = 0; i <= this.presetsItem.length - 2; i++) {
            var startDate = this.presetsItem[i].start;
            var endDate = this.presetsItem[i].end;
            if (this.startValue && this.endValue) {
                if ((+startDate.setMilliseconds(0) === +this.startValue.setMilliseconds(0)) &&
                    (+endDate.setMilliseconds(0) === +this.endValue.setMilliseconds(0))) {
                    this.activeIndex = i;
                    this.isCustomRange = false;
                }
            }
        }
        this.popupWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: this.element.id + '_popup', className: ROOT + ' ' + POPUP });
        this.adjustLongHeaderWidth();
        var isPreset = (!this.isCustomRange || this.isMobile);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label) && isPreset) {
            this.isCustomWindow = false;
            this.createPresets();
            this.listRippleEffect();
            this.renderPopup();
        }
        else {
            this.isCustomWindow = true;
            this.renderControl();
        }
    };
    DateRangePicker.prototype.renderControl = function () {
        this.createControl();
        this.bindCalendarEvents();
        this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            this.disabledDateRender();
        }
        this.updateHeader();
    };
    DateRangePicker.prototype.clearCalendarEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.leftCalPrevIcon);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.leftCalNextIcon);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.rightCalPrevIcon);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.rightCalNextIcon);
    };
    DateRangePicker.prototype.updateNavIcons = function () {
        _super.prototype.iconHandler.call(this);
    };
    DateRangePicker.prototype.calendarIconEvent = function () {
        this.clearCalendarEvents();
        if (this.leftCalPrevIcon && !this.leftCalPrevIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.leftCalPrevIcon, 'mousedown', this.navPrevFunction);
        }
        if (this.leftCalNextIcon && !this.leftCalNextIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.leftCalNextIcon, 'mousedown', this.navNextFunction);
        }
        if (this.rightCalPrevIcon && !this.rightCalPrevIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.rightCalPrevIcon, 'mousedown', this.navPrevFunction);
        }
        if (this.rightCalNextIcon && !this.rightCalNextIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.rightCalNextIcon, 'mousedown', this.navNextFunction);
        }
    };
    DateRangePicker.prototype.bindCalendarEvents = function () {
        if (!this.isMobile) {
            this.updateNavIcons();
            this.calendarIconEvent();
            this.calendarIconRipple();
            this.headerTitleElement = this.popupObj.element.querySelector('.' + RIGHTCALENDER + ' .' + HEADER + ' .' + TITLE);
            this.headerTitleElement = this.popupObj.element.querySelector('.' + LEFTCALENDER + ' .' + HEADER + ' .' + TITLE);
            this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, this.keyConfigs);
            this.leftKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.leftCalendar, {
                eventName: 'keydown',
                keyAction: this.keyInputHandler.bind(this),
                keyConfigs: this.defaultKeyConfigs
            });
            this.rightKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.rightCalendar, {
                eventName: 'keydown',
                keyAction: this.keyInputHandler.bind(this),
                keyConfigs: this.defaultKeyConfigs
            });
        }
        else {
            this.deviceCalendarEvent();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.startButton.element, 'click', this.deviceHeaderClick, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.endButton.element, 'click', this.deviceHeaderClick, this);
        }
        if (this.start === this.depth) {
            this.bindCalendarCellEvents();
        }
        this.removeFocusedDate();
    };
    DateRangePicker.prototype.calendarIconRipple = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.leftCalPrevIcon, { selector: '.e-prev', duration: 400, isCenterRipple: true });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.leftCalNextIcon, { selector: '.e-next', duration: 400, isCenterRipple: true });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.rightCalPrevIcon, { selector: '.e-prev', duration: 400, isCenterRipple: true });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.rightCalNextIcon, { selector: '.e-next', duration: 400, isCenterRipple: true });
    };
    DateRangePicker.prototype.deviceCalendarEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.nextIcon);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(this.previousIcon);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.nextIcon, { selector: '.e-prev', duration: 400, isCenterRipple: true });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.previousIcon, { selector: '.e-next', duration: 400, isCenterRipple: true });
        if (this.nextIcon && !this.nextIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.nextIcon, 'mousedown', this.deviceNavNextFunction);
        }
        if (this.previousIcon && !this.previousIcon.classList.contains(DISABLED)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.previousIcon, 'mousedown', this.deviceNavPrevFunction);
        }
    };
    DateRangePicker.prototype.deviceNavNext = function (e) {
        var calendar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CALENDAR);
        this.updateDeviceCalendar(calendar);
        this.navigateNext(e);
        this.deviceNavigation();
    };
    DateRangePicker.prototype.deviceNavPrevious = function (e) {
        var calendar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CALENDAR);
        this.updateDeviceCalendar(calendar);
        this.navigatePrevious(e);
        this.deviceNavigation();
    };
    DateRangePicker.prototype.updateDeviceCalendar = function (calendar) {
        if (calendar) {
            this.previousIcon = calendar.querySelector('.' + PREVICON);
            this.nextIcon = calendar.querySelector('.' + NEXTICON);
            this.calendarElement = calendar;
            this.deviceCalendar = calendar;
            this.contentElement = calendar.querySelector('.' + CONTENT);
            this.tableBodyElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CONTENT + ' tbody', calendar);
            this.table = calendar.querySelector('.' + CONTENT).getElementsByTagName('table')[0];
            this.headerTitleElement = calendar.querySelector('.' + HEADER + ' .' + TITLE);
            this.headerElement = calendar.querySelector('.' + HEADER);
        }
    };
    DateRangePicker.prototype.deviceHeaderClick = function (event) {
        var element = event.currentTarget;
        if (element.classList.contains(STARTBUTTON) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            this.endButton.element.classList.remove(ACTIVE);
            this.startButton.element.classList.add(ACTIVE);
            var calendar = this.popupObj.element.querySelector('.' + CALENDAR);
            this.updateDeviceCalendar(calendar);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelector('.' + STARTDATE + ':not(.e-other-month)'))) {
                this.currentDate = new Date(+this.startValue);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tableBodyElement);
                this.createContentBody();
                this.deviceNavigation();
            }
            this.removeClassDisabled();
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            this.startButton.element.classList.remove(ACTIVE);
            this.endButton.element.classList.add(ACTIVE);
            var calendar = this.popupObj.element.querySelector('.' + CALENDAR);
            this.updateDeviceCalendar(calendar);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.calendarElement.querySelector('.' + ENDDATE + ':not(.e-other-month)'))) {
                this.currentDate = new Date(+this.endValue);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tableBodyElement);
                this.createContentBody();
                this.deviceNavigation();
            }
            this.updateMinMaxDays(this.popupObj.element.querySelector('.' + CALENDAR));
            this.selectableDates();
        }
    };
    DateRangePicker.prototype.inputFocusHandler = function () {
        if (!this.enabled) {
            return;
        }
        this.preventBlur = false;
        var focusArguments = {
            model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this
        };
        if (!this.preventFocus) {
            this.preventFocus = true;
            this.trigger('focus', focusArguments);
        }
        this.updateClearIconState();
        this.updateHiddenInput();
        if (this.openOnFocus) {
            this.show();
        }
    };
    DateRangePicker.prototype.inputBlurHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (!this.preventBlur) {
            var value = this.inputElement.value;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.presetsItem)) {
                if (this.presetsItem.length > 0 && this.previousEleValue !== this.inputElement.value) {
                    this.activeIndex = this.presetsItem.length - 1;
                    this.isCustomRange = true;
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && value.trim() !== '') {
                var range = value.split(' ' + this.separator + ' ');
                if (range.length > 1) {
                    this.invalidValueString = null;
                    var dateOptions = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                    var startDate = this.globalize.parseDate(range[0].trim(), dateOptions);
                    var endDate = this.globalize.parseDate(range[1].trim(), dateOptions);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startDate) && !isNaN(+startDate) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endDate) && !isNaN(+endDate)) {
                        var prevStartVal = this.startValue;
                        this.startValue = startDate;
                        var prevEndVal = this.endValue;
                        this.endValue = endDate;
                        this.setValue();
                        this.refreshControl();
                        if (value !== this.previousEleValue) {
                            this.changeTrigger(e);
                        }
                        if (!this.preventBlur && document.activeElement !== this.inputElement) {
                            this.preventFocus = false;
                            var blurArguments = {
                                model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this
                            };
                            this.trigger('blur', blurArguments);
                        }
                        this.updateHiddenInput();
                        // For Mobile mode, when a value is present and choose another range and click on console
                        // when popup is open, two startvalues and end values are updated in the popup.
                        if (this.isMobile && this.isPopupOpen()) {
                            this.startValue = prevStartVal;
                            this.endValue = prevEndVal;
                        }
                        return;
                    }
                    else {
                        if (!this.strictMode) {
                            this.startValue = null;
                            this.endValue = null;
                            this.setValue();
                        }
                    }
                }
                else {
                    if (!this.strictMode) {
                        this.startValue = null;
                        this.endValue = null;
                        this.setValue();
                    }
                }
            }
            if (!this.strictMode) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj)) {
                    this.currentDate = null;
                }
                this.previousStartValue = this.previousEndValue = null;
                this.startValue = null;
                this.endValue = null;
                this.setValue();
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && value.trim() === '') {
                    this.startValue = null;
                    this.endValue = null;
                }
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
                this.updateInput();
            }
            this.errorClass();
            this.changeTrigger(e);
            if (!this.preventBlur && document.activeElement !== this.inputElement) {
                this.preventFocus = false;
                var blurArguments = {
                    model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this
                };
                this.trigger('blur', blurArguments);
            }
        }
        this.updateHiddenInput();
    };
    DateRangePicker.prototype.clearRange = function () {
        this.previousStartValue = this.previousEndValue = null;
        this.currentDate = null;
    };
    DateRangePicker.prototype.errorClass = function () {
        var inputStr = this.inputElement.value.trim();
        if (((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && inputStr !== '') ||
            ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)
                || ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) && +this.startValue > +this.endValue)
                || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max))
            || ((this.startValue && this.isDateDisabled(this.startValue))
                || (this.endValue && this.isDateDisabled(this.endValue)))) && inputStr !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], ERROR);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'true' });
        }
        else {
            if (this.inputWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], ERROR);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'false' });
            }
        }
    };
    DateRangePicker.prototype.keyCalendarUpdate = function (isLeftCalendar, ele) {
        this.removeFocusedDate();
        if (isLeftCalendar) {
            this.leftCalCurrentDate = new Date(+this.currentDate);
            ele = this.leftCalendar;
        }
        else {
            this.rightCalCurrentDate = new Date(+this.currentDate);
            ele = this.rightCalendar;
        }
        this.updateCalendarElement(ele);
        this.table.focus();
        return ele;
    };
    DateRangePicker.prototype.navInCalendar = function (e, isLeftCalendar, leftLimit, rightLimit, ele) {
        var view = this.getViewNumber(this.currentView());
        var date;
        var min = this.min;
        var max;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.isMaxDaysClicked && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            max = new Date(new Date(+this.startValue).setDate(this.startValue.getDate() + (this.maxDays - 1)));
        }
        else {
            max = this.max;
        }
        switch (e.action) {
            case 'moveRight':
                date = new Date(+this.currentDate);
                this.addDay(date, 1, e, max, min);
                if (isLeftCalendar && +date === +rightLimit) {
                    ele = this.keyCalendarUpdate(false, ele);
                }
                this.KeyboardNavigate(1, view, e, max, min);
                this.keyNavigation(ele, e);
                break;
            case 'moveLeft':
                date = new Date(+this.currentDate);
                this.addDay(date, -1, e, max, min);
                if (!isLeftCalendar) {
                    if (+date === +leftLimit) {
                        ele = this.keyCalendarUpdate(true, ele);
                    }
                }
                this.KeyboardNavigate(-1, view, e, max, min);
                this.keyNavigation(ele, e);
                break;
            case 'moveUp':
                if (view === 0) {
                    date = new Date(+this.currentDate);
                    this.addDay(date, -7, e, max, min);
                    if (+date <= +leftLimit && !isLeftCalendar) {
                        ele = this.keyCalendarUpdate(true, ele);
                    }
                    this.KeyboardNavigate(-7, view, e, max, min);
                }
                else {
                    this.KeyboardNavigate(-4, view, e, this.max, this.min); // move the current year to the previous four days.
                }
                this.keyNavigation(ele, e);
                break;
            case 'moveDown':
                if (view === 0) {
                    date = new Date(+this.currentDate);
                    this.addDay(date, 7, e, max, min);
                    if (isLeftCalendar && +date >= +rightLimit) {
                        ele = this.keyCalendarUpdate(false, ele);
                    }
                    this.KeyboardNavigate(7, view, e, max, min);
                }
                else {
                    this.KeyboardNavigate(4, view, e, this.max, this.min);
                }
                this.keyNavigation(ele, e);
                break;
            case 'home':
                this.currentDate = this.firstDay(this.currentDate);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tableBodyElement);
                (view === 0) ? this.renderMonths(e) : ((view === 1) ? this.renderYears(e) : this.renderDecades(e));
                this.keyNavigation(ele, e);
                break;
            case 'end':
                this.currentDate = this.lastDay(this.currentDate, view);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tableBodyElement);
                (view === 0) ? this.renderMonths(e) : ((view === 1) ? this.renderYears(e) : this.renderDecades(e));
                this.keyNavigation(ele, e);
                break;
        }
    };
    // tslint:disable-next-line:max-func-body-length
    DateRangePicker.prototype.keyInputHandler = function (e, value) {
        var date;
        var view = this.getViewNumber(this.currentView());
        var rightDateLimit = new Date(this.rightCalCurrentDate.getFullYear(), this.rightCalCurrentDate.getMonth(), 1);
        var leftDateLimit = new Date(this.leftCalCurrentDate.getFullYear(), this.leftCalCurrentDate.getMonth() + 1, 0);
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + RIGHTCALENDER);
        ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) ? this.leftCalendar : ele;
        var isLeftCalendar = ele.classList.contains(LEFTCALENDER);
        this.updateCalendarElement(ele);
        var selectedDate = this.tableBodyElement.querySelector('tr td.e-selected');
        var focusedDate = ele.querySelector('tr td.' + FOCUSDATE);
        var startDate = ele.querySelector('tr td.' + STARTDATE);
        var endDate = ele.querySelector('tr td.' + ENDDATE);
        var depthValue = this.getViewNumber(this.depth);
        var levelRestrict = (view === depthValue && this.getViewNumber(this.start) >= depthValue);
        var leftCalendar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + LEFTCALENDER);
        var rightCalendar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + RIGHTCALENDER);
        var presetElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + PRESETS);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate)) {
            this.currentDate = this.currentDate;
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endDate) && !this.dateDisabled) {
            this.currentDate = new Date(+this.endValue);
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startDate) && !this.dateDisabled) {
            this.currentDate = new Date(+this.startValue);
        }
        else if (!this.dateDisabled) {
            this.currentDate.setDate(1);
        }
        this.effect = '';
        switch (e.action) {
            case 'altUpArrow':
                if (this.isPopupOpen()) {
                    this.hide(e);
                    this.preventFocus = true;
                    this.inputElement.focus();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
                }
                break;
            case 'select':
                if (levelRestrict) {
                    var element = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate) ? focusedDate : startDate;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element) && !element.classList.contains(DISABLED)) {
                        this.selectRange(null, (element));
                    }
                }
                else {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedDate) && !levelRestrict || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate)) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                            if (this.calendarElement.classList.contains(LEFTCALENDER)) {
                                value = this.startDate;
                            }
                            else {
                                value = this.endDate;
                            }
                        }
                        this.controlDown = e;
                        this.contentClick(null, --view, (focusedDate || selectedDate), value);
                    }
                }
                e.preventDefault();
                break;
            case 'controlHome':
                var yearDate = new Date(this.currentDate.getFullYear(), 0, 1);
                if (!isLeftCalendar && +yearDate < +leftDateLimit) {
                    ele = this.keyCalendarUpdate(true, ele);
                }
                _super.prototype.navigateTo.call(this, 'Month', new Date(this.currentDate.getFullYear(), 0, 1));
                this.keyNavigation(ele, e);
                break;
            case 'altRightArrow':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(leftCalendar)) {
                    this.rightCalendar.children[1].firstElementChild.focus();
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rightCalendar)) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.presetElement)) {
                        this.presetElement.focus();
                        this.removeFocusedDate();
                    }
                    else {
                        this.cancelButton.element.focus();
                    }
                }
                else {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(presetElement)) {
                        this.cancelButton.element.focus();
                    }
                }
                e.preventDefault();
                break;
            case 'altLeftArrow':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(leftCalendar)) {
                    if (this.applyButton.element.disabled !== true) {
                        this.applyButton.element.focus();
                    }
                    else {
                        this.cancelButton.element.focus();
                    }
                }
                else {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rightCalendar)) {
                        this.leftCalendar.children[1].firstElementChild.focus();
                    }
                }
                e.preventDefault();
                break;
            case 'controlUp':
                if (this.calendarElement.classList.contains(LEFTCALENDER)) {
                    this.calendarNavigation(e, this.calendarElement);
                }
                else {
                    this.calendarNavigation(e, this.calendarElement);
                }
                e.preventDefault();
                break;
            case 'controlDown':
                if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedDate) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(focusedDate)) && !levelRestrict) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                        if (this.calendarElement.classList.contains(LEFTCALENDER)) {
                            value = this.startDate;
                        }
                        else {
                            value = this.endDate;
                        }
                    }
                    this.controlDown = e;
                    this.contentClick(null, --view, (selectedDate || focusedDate), value);
                }
                e.preventDefault();
                break;
            case 'controlEnd':
                yearDate = new Date(this.currentDate.getFullYear(), 11, 31);
                if (isLeftCalendar && +yearDate > +rightDateLimit) {
                    ele = this.keyCalendarUpdate(false, ele);
                }
                _super.prototype.navigateTo.call(this, 'Month', new Date(this.currentDate.getFullYear(), 11, 31));
                this.keyNavigation(ele, e);
                break;
            case 'pageUp':
                date = new Date(+this.currentDate);
                this.addMonths(date, -1);
                if (!isLeftCalendar && +date <= +leftDateLimit) {
                    ele = this.keyCalendarUpdate(true, ele);
                }
                this.addMonths(this.currentDate, -1);
                _super.prototype.navigateTo.call(this, 'Month', this.currentDate);
                this.keyNavigation(ele, e);
                break;
            case 'pageDown':
                date = new Date(+this.currentDate);
                this.addMonths(date, 1);
                if (isLeftCalendar && +date >= +rightDateLimit) {
                    ele = this.keyCalendarUpdate(false, ele);
                }
                this.addMonths(this.currentDate, 1);
                _super.prototype.navigateTo.call(this, 'Month', this.currentDate);
                this.keyNavigation(ele, e);
                break;
            case 'shiftPageUp':
                date = new Date(+this.currentDate);
                this.addYears(date, -1);
                if (!isLeftCalendar && +date <= +leftDateLimit) {
                    ele = this.keyCalendarUpdate(true, ele);
                }
                this.addYears(this.currentDate, -1);
                _super.prototype.navigateTo.call(this, 'Month', this.currentDate);
                this.keyNavigation(ele, e);
                break;
            case 'shiftPageDown':
                date = new Date(+this.currentDate);
                this.addYears(date, 1);
                if (isLeftCalendar && +date >= +rightDateLimit) {
                    ele = this.keyCalendarUpdate(false, ele);
                }
                this.addYears(this.currentDate, 1);
                _super.prototype.navigateTo.call(this, 'Month', this.currentDate);
                this.keyNavigation(ele, e);
                break;
            case 'shiftTab':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.presetElement)) {
                    this.presetElement.setAttribute('tabindex', '0');
                    this.presetElement.focus();
                    this.removeFocusedDate();
                }
                e.preventDefault();
                break;
            case 'spacebar':
                if (this.applyButton && !this.applyButton.disabled) {
                    this.applyFunction(e);
                }
                break;
            default:
                this.navInCalendar(e, isLeftCalendar, leftDateLimit, rightDateLimit, ele);
                this.checkMinMaxDays();
        }
        this.presetHeight();
    };
    DateRangePicker.prototype.keyNavigation = function (calendar, e) {
        this.bindCalendarCellEvents(calendar);
        if (calendar.classList.contains(LEFTCALENDER)) {
            this.leftCalCurrentDate = new Date(+this.currentDate);
        }
        else {
            this.rightCalCurrentDate = new Date(+this.currentDate);
        }
        this.updateNavIcons();
        this.calendarIconEvent();
        this.updateRange([calendar]);
        this.dateDisabled = this.isDateDisabled(this.currentDate);
        e.preventDefault();
    };
    DateRangePicker.prototype.inputHandler = function (e) {
        switch (e.action) {
            case 'altDownArrow':
                if (!this.isPopupOpen()) {
                    if (this.inputElement.value === '') {
                        this.clear();
                        this.changeTrigger(e);
                        this.clearRange();
                    }
                    this.show(null, e);
                    this.isRangeIconClicked = false;
                    if (!this.isMobile) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.leftCalendar)) {
                            this.calendarFocus();
                        }
                    }
                    this.isKeyPopup = true;
                }
                break;
            case 'escape':
                if (this.isPopupOpen()) {
                    this.hide(e);
                }
                break;
            case 'enter':
                if (document.activeElement === this.inputElement) {
                    this.inputBlurHandler(e);
                    this.hide(e);
                }
                break;
            case 'tab':
                if (document.activeElement === this.inputElement && this.isPopupOpen()) {
                    this.hide(e);
                    e.preventDefault();
                }
                break;
        }
    };
    DateRangePicker.prototype.bindCalendarCellEvents = function (calendar) {
        var tdCells;
        if (calendar) {
            tdCells = calendar.querySelectorAll('.' + CALENDAR + ' td');
        }
        else {
            tdCells = this.popupObj.element.querySelectorAll('.' + CALENDAR + ' td');
        }
        for (var _i = 0, tdCells_1 = tdCells; _i < tdCells_1.length; _i++) {
            var cell = tdCells_1[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(cell);
            var disabledCell = void 0;
            disabledCell = cell.classList.contains(DISABLED) || cell.classList.contains(DATEDISABLED);
            if (!disabledCell && !cell.classList.contains(WEEKNUMBER)) {
                if (!this.isMobile) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(cell, 'mouseover', this.hoverSelection, this);
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(cell, 'mousedown', this.selectRange, this);
            }
        }
    };
    DateRangePicker.prototype.removeFocusedDate = function () {
        var isDate = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue);
        var focusedDate;
        focusedDate = this.popupObj.element.querySelectorAll('.' + CALENDAR + ' .' + FOCUSDATE);
        for (var _i = 0, focusedDate_1 = focusedDate; _i < focusedDate_1.length; _i++) {
            var ele = focusedDate_1[_i];
            var today = new Date();
            var eleDate = this.getIdValue(null, ele);
            if ((this.depth === 'Month' && this.currentView() === 'Month' &&
                (!ele.classList.contains(TODAY) || (ele.classList.contains(TODAY) && isDate)))
                || (this.depth === 'Year' && this.currentView() === 'Year' &&
                    ((!this.isSameMonth(today, eleDate) && !this.isSameYear(today, eleDate)) || isDate))
                || (this.depth === 'Decade' && this.currentView() === 'Decade' &&
                    (!this.isSameYear(today, eleDate) || isDate))) {
                ele.classList.remove(FOCUSDATE);
                if (!ele.classList.contains(STARTDATE) && !ele.classList.contains(ENDDATE)) {
                    ele.removeAttribute('aria-label');
                }
            }
        }
    };
    DateRangePicker.prototype.hoverSelection = function (event, element) {
        var currentElement = element || event.currentTarget;
        var currentDate = this.getIdValue(null, currentElement);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue >= +this.min && +this.startValue <= +this.max) {
            if ((!this.isDateDisabled(this.endValue) && !this.isDateDisabled(this.startValue)
                && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue))
                || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue))) {
                var tdCells = void 0;
                tdCells = this.popupObj.element.querySelectorAll('.' + CALENDAR + ' td');
                for (var _i = 0, tdCells_2 = tdCells; _i < tdCells_2.length; _i++) {
                    var ele = tdCells_2[_i];
                    var isDisabledCell = (!ele.classList.contains(DISABLED) || ele.classList.contains(DATEDISABLED));
                    if (!ele.classList.contains(WEEKNUMBER) && isDisabledCell) {
                        var eleDate = this.getIdValue(null, ele);
                        var startDateValue = new Date(+this.startValue);
                        var eleDateValue = new Date(+eleDate);
                        if (eleDateValue.setHours(0, 0, 0, 0) >= startDateValue.setHours(0, 0, 0, 0) && +eleDate <= +currentDate) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], RANGEHOVER);
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [RANGEHOVER]);
                        }
                    }
                }
            }
        }
    };
    DateRangePicker.prototype.isSameStartEnd = function (startVal, endVal) {
        var isSame = false;
        if (this.depth === 'Month') {
            if ((startVal).setHours(0, 0, 0, 0) === (endVal).setHours(0, 0, 0, 0)) {
                isSame = true;
            }
        }
        else if (this.depth === 'Year') {
            if ((startVal.getFullYear() === endVal.getFullYear()) &&
                (startVal.getMonth() === endVal.getMonth())) {
                isSame = true;
            }
        }
        else if (this.depth === 'Decade') {
            if (startVal.getFullYear() === endVal.getFullYear()) {
                isSame = true;
            }
        }
        return isSame;
    };
    DateRangePicker.prototype.updateRange = function (elementCollection) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            for (var _i = 0, elementCollection_1 = elementCollection; _i < elementCollection_1.length; _i++) {
                var calendar = elementCollection_1[_i];
                var tdCells = calendar.querySelectorAll('.' + CALENDAR + ' td');
                for (var _a = 0, tdCells_3 = tdCells; _a < tdCells_3.length; _a++) {
                    var ele = tdCells_3[_a];
                    if (!ele.classList.contains(WEEKNUMBER) && !ele.classList.contains(DISABLED)) {
                        var eleDate = this.getIdValue(null, ele);
                        var eleDateValue = this.getIdValue(null, ele);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
                            if (this.currentView() === this.depth &&
                                +eleDateValue.setHours(0, 0, 0, 0) >= +new Date(+this.startValue).setHours(0, 0, 0, 0)
                                && +eleDateValue.setHours(0, 0, 0, 0) <= +new Date(+this.endValue).setHours(0, 0, 0, 0) &&
                                !this.isSameStartEnd(new Date(+this.startValue), new Date(+this.endValue)) &&
                                +new Date(+this.startValue).setHours(0, 0, 0, 0) >= +this.min
                                && +new Date(+this.endValue).setHours(0, 0, 0, 0) <= +this.max
                                && !(this.isDateDisabled(this.startValue) || this.isDateDisabled(this.endValue))) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], RANGEHOVER);
                            }
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [RANGEHOVER]);
                        }
                        if (ele.classList.contains(SELECTED) && ele.classList.contains(ENDDATE) &&
                            (+eleDateValue !== +this.endValue)) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [SELECTED]);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [ENDDATE]);
                        }
                        if (ele.classList.contains(RANGEHOVER) && (+eleDateValue > +this.endValue)) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [RANGEHOVER]);
                        }
                        if (!ele.classList.contains(OTHERMONTH)) {
                            var startDateValue = new Date(+this.startValue);
                            var eleDateValue_1 = new Date(+eleDate);
                            if (this.currentView() === this.depth &&
                                +eleDateValue_1.setHours(0, 0, 0, 0) === +startDateValue.setHours(0, 0, 0, 0)
                                && +eleDateValue_1.setHours(0, 0, 0, 0) >= +startDateValue.setHours(0, 0, 0, 0) &&
                                +this.startValue >= +this.min
                                && !this.inputWrapper.container.classList.contains('e-error')
                                && !(this.isDateDisabled(this.startValue) || this.isDateDisabled(this.endValue))) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [STARTDATE, SELECTED]);
                                this.addSelectedAttributes(ele, this.startValue, true);
                            }
                            var endDateValue = new Date(+this.endValue);
                            if (this.currentView() === 'Year') {
                                eleDateValue_1 = new Date(eleDateValue_1.getFullYear(), eleDateValue_1.getMonth() + 1, 0);
                            }
                            else if (this.currentView() === 'Decade') {
                                eleDateValue_1 = new Date(eleDateValue_1.getFullYear(), 11, 31);
                            }
                            if (this.currentView() === this.depth &&
                                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) &&
                                +eleDateValue_1.setHours(0, 0, 0, 0) === +endDateValue.setHours(0, 0, 0, 0)
                                && +eleDateValue_1.setHours(0, 0, 0, 0) <= +endDateValue.setHours(0, 0, 0, 0) &&
                                +this.startValue >= +this.min
                                && !this.inputWrapper.container.classList.contains('e-error')
                                && !(this.isDateDisabled(this.startValue) || this.isDateDisabled(this.endValue))) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [ENDDATE, SELECTED]);
                                this.addSelectedAttributes(ele, this.startValue, false);
                            }
                            if (+eleDate === +this.startValue && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +eleDate === +this.endValue) {
                                this.addSelectedAttributes(ele, this.endValue, false, true);
                            }
                        }
                    }
                }
            }
        }
    };
    DateRangePicker.prototype.checkMinMaxDays = function () {
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays > 0) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.maxDays > 0)) {
            if (!this.isMobile) {
                this.updateMinMaxDays(this.popupObj.element.querySelector('.' + LEFTCALENDER));
                this.updateMinMaxDays(this.popupObj.element.querySelector('.' + RIGHTCALENDER));
            }
            else {
                this.updateMinMaxDays(this.popupObj.element.querySelector('.' + CALENDAR));
            }
        }
    };
    DateRangePicker.prototype.rangeArgs = function (e) {
        var inputValue;
        var range;
        var startDate = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) ?
            this.globalize.formatDate(this.startValue, {
                format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
            }) : null;
        var endDate = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) ?
            this.globalize.formatDate(this.endValue, {
                format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
            }) : null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            inputValue = startDate + ' ' + this.separator + ' ' + endDate;
            range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
                this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
        }
        else {
            inputValue = '';
            range = 0;
        }
        var args = {
            value: this.value,
            startDate: this.startValue,
            endDate: this.endValue,
            daySpan: range,
            event: e || null,
            element: this.element,
            isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e),
            text: inputValue
        };
        return args;
    };
    DateRangePicker.prototype.otherMonthSelect = function (ele, isStartDate, sameDate) {
        var value = +this.getIdValue(null, ele);
        var dateIdString = '*[id^="/id"]:not(.e-other-month)'.replace('/id', '' + value);
        var tdCell = this.popupObj && this.popupObj.element.querySelector(dateIdString);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tdCell)) {
            if (isStartDate) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdCell], [STARTDATE, SELECTED]);
                this.addSelectedAttributes(tdCell, this.startValue, true);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdCell], [ENDDATE, SELECTED]);
                this.addSelectedAttributes(tdCell, this.endValue, true);
            }
            if (sameDate) {
                this.addSelectedAttributes(ele, this.endValue, false, true);
            }
        }
    };
    // tslint:disable-next-line:max-func-body-length
    DateRangePicker.prototype.selectRange = function (event, element) {
        var leftCalendar;
        var rightCalendar;
        if (event) {
            event.preventDefault();
        }
        var date;
        date = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event) ? this.getIdValue(null, element)
            : this.getIdValue(event, null);
        var y = date.getFullYear();
        var m = date.getMonth();
        var firstDay = new Date(y, m, 1);
        var lastDay = new Date(y, m + 1, 0);
        var firstMonth = new Date(y, 0, 1);
        var lastMonth = new Date(y, 11, 31);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            if (!this.isMobile || this.isMobile && !this.endButton.element.classList.contains(ACTIVE)) {
                this.removeSelection();
            }
        }
        else if (this.isMobile && this.startButton.element.classList.contains(ACTIVE)) {
            this.removeSelection();
        }
        var ele = element || event.currentTarget;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousStartValue)) {
                date.setHours(this.previousStartValue.getHours());
                date.setMinutes(this.previousStartValue.getMinutes());
                date.setSeconds(this.previousStartValue.getSeconds());
            }
            this.startValue = (this.depth === 'Month') ? new Date(this.checkValue(date)) :
                (this.depth === 'Year') ? firstDay : firstMonth;
            this.endValue = null;
            this.setValue();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], STARTDATE);
            this.addSelectedAttributes(ele, this.startValue, true);
            if (ele.classList.contains(OTHERMONTH)) {
                this.otherMonthSelect(ele, true);
            }
            this.checkMinMaxDays();
            this.applyButton.disabled = true;
            this.applyButton.element.disabled = true;
            if (this.isMobile) {
                this.endButton.element.classList.add(ACTIVE);
                this.startButton.element.classList.remove(ACTIVE);
                this.endButton.element.removeAttribute('disabled');
                this.selectableDates();
            }
            this.trigger('select', this.rangeArgs(event));
        }
        else {
            if (+date === +this.startValue || +date > +this.startValue) {
                if (+date === +this.startValue && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays > 1) {
                    return;
                }
                this.endValue = null;
                this.setValue();
                if (this.isMobile || element) {
                    this.hoverSelection(event, element);
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousEndValue)) {
                    date.setHours(this.previousEndValue.getHours());
                    date.setMinutes(this.previousEndValue.getMinutes());
                    date.setSeconds(this.previousEndValue.getSeconds());
                }
                this.endValue = (this.depth === 'Month') ? new Date(this.checkValue(date)) :
                    (this.depth === 'Year') ? lastDay : lastMonth;
                this.setValue();
                var endEle = this.popupObj.element.querySelectorAll('.' + ENDDATE);
                if (this.isMobile) {
                    this.startButton.element.classList.remove(ACTIVE);
                    this.endButton.element.classList.add(ACTIVE);
                    for (var _i = 0, endEle_1 = endEle; _i < endEle_1.length; _i++) {
                        var ele_1 = endEle_1[_i];
                        ele_1.removeAttribute('aria-label');
                        if (!ele_1.classList.contains(STARTDATE)) {
                            ele_1.setAttribute('aria-selected', 'false');
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele_1], [ENDDATE, SELECTED]);
                        }
                        else {
                            this.addSelectedAttributes(ele_1, this.startValue, true);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele_1], [ENDDATE]);
                        }
                    }
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], ENDDATE);
                if (+this.endValue === +this.startValue) {
                    this.addSelectedAttributes(ele, this.endValue, false, true);
                }
                else {
                    this.addSelectedAttributes(ele, this.endValue, false);
                }
                if (ele.classList.contains(OTHERMONTH)) {
                    if (+this.endValue === +this.startValue) {
                        this.otherMonthSelect(ele, false, true);
                    }
                    else {
                        this.otherMonthSelect(ele, false);
                    }
                }
                endEle = this.popupObj.element.querySelectorAll('.' + ENDDATE);
                for (var _a = 0, endEle_2 = endEle; _a < endEle_2.length; _a++) {
                    var ele_2 = endEle_2[_a];
                    if (ele_2.classList.contains(STARTDATE)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele_2], [RANGEHOVER]);
                    }
                }
                this.applyButton.disabled = false;
                this.applyButton.element.disabled = false;
                if (!this.isMobile) {
                    this.removeClassDisabled();
                }
                this.disabledDateRender();
                this.trigger('select', this.rangeArgs(event));
            }
            else if (+date < +this.startValue) {
                this.removeClassDisabled();
                this.startValue = (this.depth === 'Month') ? new Date(this.checkValue(date)) :
                    (this.depth === 'Year') ? firstDay : firstMonth;
                this.setValue();
                this.removeSelectedAttributes();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.popupObj.element.querySelectorAll('.' + STARTDATE), [STARTDATE, SELECTED]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], STARTDATE);
                this.addSelectedAttributes(ele, this.startValue, true);
                if (ele.classList.contains(OTHERMONTH)) {
                    this.otherMonthSelect(ele, true);
                }
                this.checkMinMaxDays();
            }
        }
        if (event) {
            leftCalendar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + LEFTCALENDER);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(leftCalendar)) {
            this.leftCalendar.children[1].firstElementChild.focus();
        }
        else {
            if (event) {
                rightCalendar = event && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + RIGHTCALENDER);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rightCalendar)) {
                this.rightCalendar.children[1].firstElementChild.focus();
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], SELECTED);
        this.updateHeader();
        this.removeFocusedDate();
    };
    DateRangePicker.prototype.selectableDates = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            var tdCells = this.calendarElement.querySelectorAll('.' + CALENDAR + ' td');
            var isStartDate = false;
            if (this.currentView() === this.depth) {
                for (var _i = 0, tdCells_4 = tdCells; _i < tdCells_4.length; _i++) {
                    var ele = tdCells_4[_i];
                    if (!ele.classList.contains(STARTDATE) && !ele.classList.contains(WEEKNUMBER)) {
                        if (!ele.classList.contains(DISABLED)) {
                            var eleDate = this.getIdValue(null, ele);
                            if (+eleDate < +this.startValue) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [DATEDISABLED, DISABLED, OVERLAY]);
                                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(ele);
                                continue;
                            }
                            else {
                                break;
                            }
                        }
                    }
                    if (ele.classList.contains(STARTDATE) && !ele.classList.contains(OTHERMONTH)) {
                        isStartDate = true;
                        break;
                    }
                }
                if (isStartDate) {
                    if (!this.previousIcon.classList.contains(DISABLED)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.previousIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                    }
                }
            }
            else {
                for (var _a = 0, tdCells_5 = tdCells; _a < tdCells_5.length; _a++) {
                    var ele = tdCells_5[_a];
                    var startMonth = this.startValue.getMonth();
                    var startYear = this.startValue.getFullYear();
                    var element = this.getIdValue(null, ele);
                    if (!this.startButton.element.classList.contains(ACTIVE) && ((this.currentView() === 'Year' &&
                        (element.getMonth() < startMonth) && (element.getFullYear() <= startYear))
                        || (this.currentView() === 'Decade' && (element.getMonth() <= startMonth) &&
                            (element.getFullYear() < startYear)))) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [DISABLED]);
                    }
                    else {
                        break;
                    }
                }
                if (tdCells[0].classList.contains(DISABLED)) {
                    this.previousIconHandler(true);
                }
                else if (tdCells[tdCells.length - 1].classList.contains(DISABLED)) {
                    this.nextIconHandler(true);
                }
            }
        }
    };
    DateRangePicker.prototype.updateMinMaxDays = function (calendar) {
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) ||
            (this.isMobile && this.endButton.element.classList.contains(ACTIVE))) {
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays > 0) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.maxDays > 0)) {
                var startValueSelected = this.removeTimeValueFromDate(this.startValue);
                var minDate = new Date(new Date(+startValueSelected).setDate(startValueSelected.getDate() + (this.minDays - 1)));
                var maxDate = new Date(new Date(+startValueSelected).setDate(startValueSelected.getDate() + (this.maxDays - 1)));
                minDate = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays > 0) ? minDate : null;
                maxDate = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.maxDays > 0) ? maxDate : null;
                if (this.currentView() === 'Year') {
                    minDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(minDate) ? null : new Date(minDate.getFullYear(), minDate.getMonth(), 0);
                    maxDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxDate) ? null : new Date(maxDate.getFullYear(), maxDate.getMonth(), 1);
                }
                else if (this.currentView() === 'Decade') {
                    minDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(minDate) ? null : new Date(minDate.getFullYear() - 1, 11, 1);
                    maxDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxDate) ? null : new Date(maxDate.getFullYear(), 0, 1);
                }
                var tdCells = calendar.querySelectorAll('.' + CALENDAR + ' td');
                var maxEle = void 0;
                for (var _i = 0, tdCells_6 = tdCells; _i < tdCells_6.length; _i++) {
                    var ele = tdCells_6[_i];
                    if (!ele.classList.contains(STARTDATE) && !ele.classList.contains(WEEKNUMBER)) {
                        var eleDate = this.getIdValue(null, ele);
                        eleDate = this.removeTimeValueFromDate(eleDate);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(minDate) && +eleDate === +minDate && ele.classList.contains(DISABLED)) {
                            minDate.setDate(minDate.getDate() + 1);
                        }
                        if (!ele.classList.contains(DISABLED)) {
                            if (+eleDate <= +startValueSelected) {
                                continue;
                            }
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(minDate) && +eleDate < +minDate) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [DATEDISABLED, DISABLED, OVERLAY]);
                                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(ele);
                            }
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxDate) && +eleDate > +maxDate) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], [DATEDISABLED, DISABLED, OVERLAY]);
                                this.isMaxDaysClicked = true;
                                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(ele);
                                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxEle) && !ele.classList.contains(OTHERMONTH)) {
                                    maxEle = ele;
                                }
                            }
                        }
                    }
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxEle)) {
                    if (this.isMobile) {
                        if (!this.nextIcon.classList.contains(DISABLED)) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.nextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                        }
                    }
                    else {
                        var calendar_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(maxEle, '.' + RIGHTCALENDER);
                        calendar_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(calendar_1) ? this.leftCalendar : calendar_1;
                        var isLeftCalendar = calendar_1.classList.contains(LEFTCALENDER);
                        if (!isLeftCalendar) {
                            if (!this.rightCalNextIcon.classList.contains(DISABLED)) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.rightCalNextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                            }
                        }
                        else {
                            if (!this.rightCalNextIcon.classList.contains(DISABLED)) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.rightCalNextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                            }
                            if (!this.leftCalNextIcon.classList.contains(DISABLED)) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.leftCalNextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                            }
                            if (!this.rightCalPrevIcon.classList.contains(DISABLED)) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.rightCalPrevIcon], [ICONDISABLED, DISABLED, OVERLAY]);
                            }
                        }
                    }
                }
            }
        }
        else {
            this.isMaxDaysClicked = false;
        }
    };
    DateRangePicker.prototype.removeTimeValueFromDate = function (value) {
        var dateValue = new Date(value.getFullYear(), value.getMonth(), value.getDate());
        return dateValue;
    };
    DateRangePicker.prototype.removeClassDisabled = function () {
        var tdCells;
        tdCells = this.popupObj.element.querySelectorAll('.' + CALENDAR + ' td' + '.' + DATEDISABLED);
        for (var _i = 0, tdCells_7 = tdCells; _i < tdCells_7.length; _i++) {
            var ele = tdCells_7[_i];
            if (ele.classList.contains(DATEDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [DATEDISABLED, DISABLED, OVERLAY]);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(ele, 'click', this.selectRange, this);
                if (!this.isMobile) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(ele, 'mouseover', this.hoverSelection, this);
                }
            }
        }
        if (this.isMobile) {
            if (this.nextIcon.classList.contains(ICONDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.nextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
            }
            if (this.previousIcon.classList.contains(ICONDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.previousIcon], [ICONDISABLED, DISABLED, OVERLAY]);
            }
        }
        else {
            if (this.rightCalNextIcon.classList.contains(ICONDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.rightCalNextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
            }
            if (this.rightCalPrevIcon.classList.contains(ICONDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.rightCalPrevIcon], [ICONDISABLED, DISABLED, OVERLAY]);
            }
            if (this.leftCalNextIcon.classList.contains(ICONDISABLED)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.leftCalNextIcon], [ICONDISABLED, DISABLED, OVERLAY]);
            }
        }
    };
    DateRangePicker.prototype.updateHeader = function () {
        var format = { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'D' : 'yMMMd' };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            var range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
                this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.disabledDayCnt)) {
                range = range - this.disabledDayCnt;
                this.disabledDayCnt = null;
            }
            this.popupObj.element.querySelector('.' + DAYSPAN).textContent = range.toString() + ' ' + this.l10n.getConstant('days');
        }
        else {
            this.popupObj.element.querySelector('.' + DAYSPAN).textContent = this.l10n.getConstant('selectedDays');
        }
        if (!this.isMobile) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
                this.popupObj.element.querySelector('.' + ENDLABEL).textContent = this.globalize.formatDate(this.endValue, format);
            }
            else {
                this.popupObj.element.querySelector('.' + ENDLABEL).textContent = this.l10n.getConstant('endLabel');
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
                this.popupObj.element.querySelector('.' + STARTLABEL).textContent = this.globalize.formatDate(this.startValue, format);
            }
            else {
                this.popupObj.element.querySelector('.' + STARTLABEL).textContent = this.l10n.getConstant('startLabel');
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
                this.startButton.element.textContent = this.globalize.formatDate(this.startValue, format);
            }
            else {
                this.startButton.element.textContent = this.l10n.getConstant('startLabel');
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
                this.endButton.element.textContent = this.globalize.formatDate(this.endValue, format);
            }
            else {
                this.endButton.element.textContent = this.l10n.getConstant('endLabel');
            }
        }
        if ((this.isDateDisabled(this.startValue) || this.isDateDisabled(this.endValue)) ||
            ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)
                || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max)
                || ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue))
                    && +this.startValue > +this.endValue))) {
            if (!this.isMobile) {
                this.popupObj.element.querySelector('.' + DAYSPAN).textContent = this.l10n.getConstant('selectedDays');
                this.popupObj.element.querySelector('.' + STARTLABEL).textContent = this.l10n.getConstant('startLabel');
                this.popupObj.element.querySelector('.' + ENDLABEL).textContent = this.l10n.getConstant('endLabel');
            }
            else {
                this.startButton.element.textContent = this.l10n.getConstant('startLabel');
                this.endButton.element.textContent = this.l10n.getConstant('endLabel');
                this.popupObj.element.querySelector('.' + DAYSPAN).textContent = this.l10n.getConstant('selectedDays');
            }
        }
        if (this.popupObj.element.querySelector('#custom_range')) {
            this.popupObj.element.querySelector('#custom_range').textContent =
                this.l10n.getConstant('customRange') !== '' ? this.l10n.getConstant('customRange') : 'Custom Range';
        }
    };
    DateRangePicker.prototype.removeSelection = function () {
        this.startValue = null;
        this.endValue = null;
        this.setValue();
        this.removeSelectedAttributes();
        if (this.popupObj) {
            if (this.popupObj.element.querySelectorAll('.' + SELECTED).length > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.popupObj.element.querySelectorAll('.' + SELECTED), [STARTDATE, ENDDATE, SELECTED]);
            }
            if (this.popupObj.element.querySelectorAll('.' + FOCUSDATE).length > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.popupObj.element.querySelectorAll('.' + FOCUSDATE), FOCUSDATE);
            }
            if (this.popupObj.element.querySelectorAll('.' + RANGEHOVER).length > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.popupObj.element.querySelectorAll('.' + RANGEHOVER), [RANGEHOVER]);
            }
        }
    };
    DateRangePicker.prototype.addSelectedAttributes = function (ele, date, isStartDate, sameDate) {
        if (ele) {
            var title = this.globalize.formatDate(date, { type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'D' : 'full' });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(sameDate) && sameDate) {
                ele.setAttribute('aria-label', 'The current start and end date is ' + '' + title);
            }
            else {
                ele.setAttribute('aria-label', 'The current ' + (isStartDate ? 'start' : 'end') + ' date is ' + '' + title);
            }
            ele.setAttribute('aria-selected', 'true');
        }
    };
    DateRangePicker.prototype.removeSelectedAttributes = function () {
        if (this.popupObj) {
            var start = this.popupObj.element.querySelectorAll('.' + STARTDATE);
            for (var _i = 0, start_1 = start; _i < start_1.length; _i++) {
                var ele = start_1[_i];
                ele.setAttribute('aria-selected', 'false');
                ele.removeAttribute('aria-label');
            }
            var end = this.popupObj.element.querySelectorAll('.' + ENDDATE);
            for (var _a = 0, end_1 = end; _a < end_1.length; _a++) {
                var ele = end_1[_a];
                ele.setAttribute('aria-selected', 'false');
                ele.removeAttribute('aria-label');
            }
        }
    };
    DateRangePicker.prototype.updateCalendarElement = function (calendar) {
        if (calendar.classList.contains(LEFTCALENDER)) {
            this.calendarElement = this.leftCalendar;
            this.currentDate = this.leftCalCurrentDate;
            this.previousIcon = this.leftCalPrevIcon;
            this.nextIcon = this.leftCalNextIcon;
        }
        else {
            this.calendarElement = this.rightCalendar;
            this.currentDate = this.rightCalCurrentDate;
            this.previousIcon = this.rightCalPrevIcon;
            this.nextIcon = this.rightCalNextIcon;
        }
        this.contentElement = calendar.querySelector('.' + CONTENT);
        this.tableBodyElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CONTENT + ' tbody', calendar);
        this.table = calendar.querySelector('.' + CONTENT).getElementsByTagName('table')[0];
        this.headerTitleElement = calendar.querySelector('.' + HEADER + ' .' + TITLE);
        this.headerElement = calendar.querySelector('.' + HEADER);
    };
    DateRangePicker.prototype.navPrevMonth = function (e) {
        e.preventDefault();
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + LEFTCALENDER);
        ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + RIGHTCALENDER) : ele;
        this.updateCalendarElement(ele);
        this.navigatePrevious(e);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            this.updateMinMaxDays(ele);
        }
        this.updateControl(ele);
    };
    DateRangePicker.prototype.deviceNavigation = function (ele) {
        this.deviceCalendarEvent();
        this.updateRange([this.popupObj.element.querySelector('.' + CALENDAR)]);
        if (this.endButton.element.classList.contains(ACTIVE)) {
            this.updateMinMaxDays(this.popupObj.element.querySelector('.' + CALENDAR));
        }
        if (this.endButton.element.classList.contains(ACTIVE)) {
            this.selectableDates();
        }
        if (this.currentView() === this.depth) {
            this.bindCalendarCellEvents();
        }
        this.removeFocusedDate();
    };
    DateRangePicker.prototype.updateControl = function (calendar) {
        if (calendar.classList.contains(RIGHTCALENDER)) {
            this.rightCalCurrentDate = new Date(+this.currentDate);
        }
        else {
            this.leftCalCurrentDate = new Date(+this.currentDate);
        }
        this.calendarIconEvent();
        if ((((this.depth === 'Month')
            && this.leftCalendar.querySelector('.e-content').classList.contains('e-month')
            && this.rightCalendar.querySelector('.e-content').classList.contains('e-month'))
            || ((this.depth === 'Year')
                && this.leftCalendar.querySelector('.e-content').classList.contains('e-year')
                && this.rightCalendar.querySelector('.e-content').classList.contains('e-year'))
            || ((this.depth === 'Decade')
                && this.leftCalendar.querySelector('.e-content').classList.contains('e-decade')
                && this.rightCalendar.querySelector('.e-content').classList.contains('e-decade')))
            || this.isMobile) {
            this.bindCalendarCellEvents();
        }
        this.removeFocusedDate();
        this.updateRange([calendar]);
    };
    DateRangePicker.prototype.navNextMonth = function (event) {
        event.preventDefault();
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + LEFTCALENDER);
        ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + RIGHTCALENDER) : ele;
        this.updateCalendarElement(ele);
        this.navigateNext(event);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            this.updateMinMaxDays(ele);
        }
        this.updateControl(ele);
    };
    DateRangePicker.prototype.isPopupOpen = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && this.popupObj.element.classList.contains(POPUP)) {
            return true;
        }
        return false;
    };
    DateRangePicker.prototype.createRangeHeader = function () {
        var labelContainer = this.createElement('div', { className: STARTENDCONTAINER });
        if (!this.isMobile) {
            var startLabel = this.createElement('a', { className: STARTLABEL });
            var endLabel = this.createElement('a', { className: ENDLABEL });
            var changeIcon = this.createElement('span', { className: CHANGEICON });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(startLabel, { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'Start Date', 'role': 'button' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(endLabel, { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'End Date', 'role': 'button' });
            labelContainer.appendChild(startLabel);
            labelContainer.appendChild(changeIcon);
            labelContainer.appendChild(endLabel);
            startLabel.textContent = this.l10n.getConstant('startLabel');
            endLabel.textContent = this.l10n.getConstant('endLabel');
        }
        else {
            var endBtn = this.createElement('button', { className: ENDBUTTON });
            var startBtn = this.createElement('button', { className: STARTBUTTON });
            this.startButton = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["Button"]({ content: this.l10n.getConstant('startLabel') }, startBtn);
            this.endButton = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["Button"]({ content: this.l10n.getConstant('endLabel') }, endBtn);
            labelContainer.appendChild(startBtn);
            labelContainer.appendChild(endBtn);
        }
        return labelContainer;
    };
    DateRangePicker.prototype.disableInput = function () {
        if (this.strictMode) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousStartValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousEndValue)) {
                this.startValue = this.previousStartValue;
                this.endValue = this.previousEndValue;
                this.setValue();
                this.updateInput();
            }
        }
        else {
            this.updateInput();
            this.clearRange();
            this.setProperties({ startDate: null }, true);
            this.setProperties({ endDate: null }, true);
            this.startValue = null;
            this.endValue = null;
            this.setValue();
            this.errorClass();
        }
        this.setProperties({ enabled: false }, true);
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setEnabled(this.enabled, this.inputElement);
        this.bindEvents();
    };
    DateRangePicker.prototype.validateMinMax = function () {
        this.min = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.min) || !(+this.min) ? this.min = new Date(1900, 0, 1) : this.min;
        this.max = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.max) || !(+this.max) ? this.max = new Date(2099, 11, 31) : this.max;
        if (!(this.min <= this.max)) {
            this.disableInput();
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays)) {
            if (this.maxDays > 0 && this.minDays > 0 && (this.minDays > this.maxDays)) {
                this.maxDays = null;
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays < 0) {
            this.minDays = null;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.maxDays < 0) {
            this.maxDays = null;
        }
    };
    DateRangePicker.prototype.validateRangeStrict = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            if (+this.startValue <= +this.min) {
                this.startValue = this.min;
                this.setValue();
            }
            else if (+this.startValue >= +this.min && +this.startValue >= +this.max) {
                this.startValue = this.max;
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            if (+this.endValue > +this.max) {
                this.endValue = this.max;
                this.setValue();
            }
            else if (+this.endValue < +this.min) {
                this.endValue = this.min;
                this.setValue();
            }
        }
        this.validateMinMaxDays();
    };
    DateRangePicker.prototype.validateRange = function () {
        this.validateMinMaxDays();
    };
    DateRangePicker.prototype.validateMinMaxDays = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            var range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
                this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.minDays) && this.minDays > 0) && !(range >= this.minDays)) {
                if (this.strictMode) {
                    var date = new Date(+this.startValue);
                    date.setDate(date.getDate() + (this.minDays - 1));
                    if (+date > +this.max) {
                        this.endValue = this.max;
                        this.setValue();
                    }
                    else {
                        this.endValue = date;
                        this.setValue();
                    }
                }
                else {
                    this.startValue = null;
                    this.endValue = null;
                    this.setValue();
                }
            }
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maxDays) && this.maxDays > 0) && !(range <= this.maxDays)) {
                if (this.strictMode) {
                    this.endValue = new Date(+this.startValue);
                    this.endValue.setDate(this.endValue.getDate() + (this.maxDays - 1));
                    this.setValue();
                }
                else {
                    this.startValue = null;
                    this.endValue = null;
                    this.setValue();
                }
            }
        }
    };
    DateRangePicker.prototype.renderCalendar = function () {
        this.calendarElement = this.createElement('div');
        this.calendarElement.classList.add(CALENDAR);
        if (this.enableRtl) {
            this.calendarElement.classList.add(RTL);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.calendarElement, { 'role': 'calendar' });
        _super.prototype.createHeader.call(this);
        _super.prototype.createContent.call(this);
    };
    DateRangePicker.prototype.isSameMonth = function (start, end) {
        if (start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear()) {
            return true;
        }
        return false;
    };
    DateRangePicker.prototype.isSameYear = function (start, end) {
        if (start.getFullYear() === end.getFullYear()) {
            return true;
        }
        return false;
    };
    DateRangePicker.prototype.isSameDecade = function (start, end) {
        var startYear = start.getFullYear();
        var endYear = end.getFullYear();
        if ((startYear - (startYear % 10)) === (endYear - (endYear % 10))) {
            return true;
        }
        return false;
    };
    DateRangePicker.prototype.startMonthCurrentDate = function () {
        if (this.isSameMonth(this.min, this.max) || +this.currentDate > +this.max || this.isSameMonth(this.currentDate, this.max)) {
            this.currentDate = new Date(+this.max);
            this.currentDate.setDate(1);
            this.currentDate.setMonth(this.currentDate.getMonth() - 1);
        }
        else if (this.currentDate < this.min) {
            this.currentDate = new Date(this.checkValue(this.min));
        }
    };
    DateRangePicker.prototype.selectNextMonth = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !this.isSameMonth(this.endValue, this.currentDate)
            && !this.isDateDisabled(this.endValue) && !this.isDateDisabled(this.startValue)) {
            this.currentDate = new Date(+this.endValue);
        }
        else {
            this.currentDate.setDate(1);
            this.currentDate.setMonth(this.currentDate.getMonth() + 1);
            return;
        }
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max)
            || ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) && +this.startValue > +this.endValue)) {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
            this.currentDate.setDate(1);
            var month = this.currentDate.getMonth() + 1;
            this.currentDate.setMonth(month);
        }
    };
    DateRangePicker.prototype.selectNextYear = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !this.isSameYear(this.endValue, this.currentDate)
            && !this.isDateDisabled(this.endValue) && !this.isDateDisabled(this.startValue)) {
            this.currentDate = new Date(+this.endValue);
        }
        else {
            this.currentDate.setMonth(0);
            var yr = this.currentDate.getFullYear() + 1;
            this.currentDate.setFullYear(yr);
            return;
        }
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max)
            || ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) && +this.startValue > +this.endValue)
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)) {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
            this.currentDate.setMonth(0);
            this.currentDate.setFullYear(this.currentDate.getFullYear() + 1);
        }
    };
    DateRangePicker.prototype.selectNextDecade = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !this.isSameDecade(this.endValue, this.currentDate)
            && !this.isDateDisabled(this.endValue) && !this.isDateDisabled(this.startValue)) {
            this.currentDate = new Date(+this.endValue);
        }
        else {
            var decyr = this.currentDate.getFullYear() + 10;
            this.currentDate.setFullYear(decyr);
            return;
        }
        if (((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) && +this.startValue > +this.endValue)
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max)
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)) {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
            this.currentDate.setFullYear(this.currentDate.getFullYear() + 10);
        }
    };
    DateRangePicker.prototype.selectStartMonth = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.max) && this.isSameMonth(this.startValue, this.max)) {
                this.currentDate = new Date(+this.max);
                this.currentDate.setDate(1);
                this.currentDate.setMonth(this.currentDate.getMonth() - 1);
            }
            else if (!(this.startValue >= this.min && this.startValue <= this.max)
                || this.isDateDisabled(this.startValue)) {
                this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
            }
            else {
                this.currentDate = new Date(+this.startValue);
            }
        }
        else {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
            this.startMonthCurrentDate();
        }
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && +this.endValue > +this.max)
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && +this.startValue < +this.min)
            || ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) && +this.startValue > +this.endValue)) {
            this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
        }
        this.startMonthCurrentDate();
    };
    DateRangePicker.prototype.createCalendar = function () {
        var calendarContainer = this.createElement('div', { className: CALENDARCONTAINER });
        if (!this.isMobile) {
            this.selectStartMonth();
            this.renderCalendar();
            this.leftCalCurrentDate = new Date(+this.currentDate);
            this.calendarElement.classList.add(LEFTCALENDER);
            this.leftCalPrevIcon = this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + PREVICON);
            this.leftCalNextIcon = this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + NEXTICON);
            this.leftTitle = this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + TITLE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + ICONCONTAINER));
            this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + HEADER).appendChild(this.leftCalNextIcon);
            this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + HEADER).appendChild(this.leftCalPrevIcon);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.leftCalPrevIcon], this.calendarElement.querySelector('.' + LEFTCALENDER + ' .' + HEADER));
            this.leftCalendar = this.calendarElement;
            var leftContainer = this.createElement('div', { className: LEFTCONTAINER });
            var rightContainer = this.createElement('div', { className: RIGHTCONTAINER });
            leftContainer.appendChild(this.leftCalendar);
            calendarContainer.appendChild(leftContainer);
            if (!this.isMobile) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.leftTitle, 'click', this.leftNavTitle, this);
            }
            if (this.start === 'Month') {
                this.selectNextMonth();
            }
            if (this.start === 'Year') {
                this.selectNextYear();
            }
            if (this.start === 'Decade') {
                this.selectNextDecade();
            }
            this.renderCalendar();
            this.rightCalCurrentDate = new Date(+this.currentDate);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.calendarElement], RIGHTCALENDER);
            this.rightCalendar = this.calendarElement;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.leftCalendar && this.leftCalendar.querySelector('.e-content tbody')], 'e-zoomin');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.rightCalendar && this.rightCalendar.querySelector('.e-content tbody')], 'e-zoomin');
            this.rightCalPrevIcon = this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + PREVICON);
            this.rightCalNextIcon = this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + NEXTICON);
            this.rightTitle = this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + TITLE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + ICONCONTAINER));
            this.calendarElement.querySelector('table').setAttribute('tabindex', '-1');
            this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + HEADER).appendChild(this.rightCalNextIcon);
            this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + HEADER).appendChild(this.rightCalPrevIcon);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.rightCalPrevIcon], this.calendarElement.querySelector('.' + RIGHTCALENDER + ' .' + HEADER));
            rightContainer.appendChild(this.rightCalendar);
            calendarContainer.appendChild(rightContainer);
            if (!this.isMobile) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.rightTitle, 'click', this.rightNavTitle, this);
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
                this.currentDate = new Date(+this.startValue);
            }
            _super.prototype.validateDate.call(this);
            _super.prototype.minMaxUpdate.call(this);
            _super.prototype.render.call(this);
            var prevIcon = this.calendarElement.querySelector('.' + CALENDAR + ' .' + PREVICON);
            var nextIcon = this.calendarElement.querySelector('.' + CALENDAR + ' .' + NEXTICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.calendarElement.querySelector('.' + CALENDAR + ' .' + ICONCONTAINER));
            this.calendarElement.querySelector('.' + CALENDAR + ' .' + HEADER).appendChild(nextIcon);
            this.calendarElement.querySelector('.' + CALENDAR + ' .' + HEADER).appendChild(prevIcon);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([prevIcon], this.calendarElement.querySelector('.' + CALENDAR + ' .' + HEADER));
            this.deviceCalendar = this.calendarElement;
            calendarContainer.appendChild(this.calendarElement);
            this.headerTitleElement = this.calendarElement.querySelector('.' + CALENDAR + ' .' + HEADER + ' .' + TITLE);
        }
        return calendarContainer;
    };
    DateRangePicker.prototype.leftNavTitle = function (e) {
        if (this.isPopupOpen()) {
            this.calendarElement = this.leftCalendar;
            this.calendarNavigation(e, this.calendarElement);
        }
    };
    DateRangePicker.prototype.calendarNavigation = function (e, element) {
        this.table = element.querySelector('table');
        this.headerTitleElement = element.querySelector('.e-title');
        this.tableBodyElement = element.querySelector('tbody');
        this.tableHeadElement = element.querySelector('thead');
        this.contentElement = element.querySelector('.e-content');
        this.updateCalendarElement(element);
        _super.prototype.navigateTitle.call(this, e);
        this.updateNavIcons();
    };
    DateRangePicker.prototype.rightNavTitle = function (e) {
        if (this.isPopupOpen()) {
            this.calendarElement = this.rightCalendar;
            this.calendarNavigation(e, this.calendarElement);
        }
    };
    DateRangePicker.prototype.clickEventEmitter = function (e) {
        if (!this.isMobile) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-calendar.e-left-calendar')) {
                this.calendarElement = this.leftCalendar;
                this.updateCalendarElement(this.leftCalendar);
            }
            else {
                this.calendarElement = this.rightCalendar;
                this.updateCalendarElement(this.rightCalendar);
            }
        }
    };
    /**
     * Gets the current view of the Calendar.
     * @returns string
     * @private
     * @hidden
     */
    DateRangePicker.prototype.currentView = function () {
        return _super.prototype.currentView.call(this);
    };
    DateRangePicker.prototype.getCalendarView = function (view) {
        if (view === 'Year') {
            return 'Year';
        }
        else if (view === 'Decade') {
            return 'Decade';
        }
        else {
            return 'Month';
        }
    };
    DateRangePicker.prototype.navigatedEvent = function (e) {
        this.trigger('navigated', this.navigatedArgs);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj)) {
            var element = void 0;
            var view = this.getCalendarView(this.currentView());
            if (this.isMobile) {
                if (view === this.depth) {
                    this.bindCalendarCellEvents();
                    this.deviceNavigation();
                    this.removeFocusedDate();
                    this.checkMinMaxDays();
                }
                else {
                    this.selectableDates();
                }
            }
            else {
                if (!this.isMobile && view === this.depth) {
                    element = this.calendarElement.classList.contains('e-left-calendar') ? this.leftCalendar : this.rightCalendar;
                    if (element === this.leftCalendar && ((e && !e.currentTarget.children[0].classList.contains('e-icons'))
                        || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.controlDown)))) {
                        this.leftCalCurrentDate = new Date(+this.currentDate);
                        this.effect = '';
                        this.currentDate = this.leftCalCurrentDate;
                        this.updateCalendarElement(this.leftCalendar);
                        this.updateControl(this.leftCalendar);
                        this.updateCalendarElement(this.rightCalendar);
                        _super.prototype.navigateTo.call(this, view, this.rightCalCurrentDate);
                        this.updateControl(this.rightCalendar);
                        this.updateNavIcons();
                        this.calendarIconEvent();
                        this.calendarIconRipple();
                        this.controlDown = null;
                    }
                    else if (e && !e.currentTarget.children[0].classList.contains('e-icons')
                        || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.controlDown))) {
                        this.rightCalCurrentDate = new Date(+this.currentDate);
                        this.effect = '';
                        this.currentDate = this.rightCalCurrentDate;
                        this.updateCalendarElement(this.rightCalendar);
                        this.updateControl(this.rightCalendar);
                        this.updateCalendarElement(this.leftCalendar);
                        if (this.startValue && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
                            if (view === 'Month' && this.startValue.getMonth() < this.rightCalCurrentDate.getMonth() &&
                                this.startValue.getFullYear() <= this.rightCalCurrentDate.getFullYear()) {
                                _super.prototype.navigateTo.call(this, view, new Date(+this.startValue));
                            }
                            else if (view === 'Year' && this.startValue.getFullYear() < this.rightCalCurrentDate.getFullYear()) {
                                _super.prototype.navigateTo.call(this, view, new Date(+this.startValue));
                            }
                            else {
                                _super.prototype.navigateTo.call(this, view, this.leftCalCurrentDate);
                            }
                        }
                        else {
                            _super.prototype.navigateTo.call(this, view, this.leftCalCurrentDate);
                        }
                        this.updateControl(this.leftCalendar);
                        this.updateNavIcons();
                        this.calendarIconEvent();
                        this.calendarIconRipple();
                        this.controlDown = null;
                    }
                    this.checkMinMaxDays();
                }
                else {
                    this.updateNavIcons();
                    this.calendarIconEvent();
                }
            }
        }
    };
    DateRangePicker.prototype.createControl = function () {
        var controlContainer = this.createElement('div', { className: RANGECONTAINER });
        var headerContainer = this.createElement('div', { className: RANGEHEADER });
        var labelContainer = this.createRangeHeader();
        headerContainer.appendChild(labelContainer);
        var daySpan = this.createElement('div', { className: DAYSPAN });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(daySpan, { 'aria-label': 'Selected Days' });
        daySpan.textContent = this.l10n.getConstant('selectedDays');
        headerContainer.appendChild(daySpan);
        var separator = this.createElement('div', { className: SEPARATOR });
        var calendarContainer = this.createCalendar();
        controlContainer.appendChild(headerContainer);
        controlContainer.appendChild(separator);
        controlContainer.appendChild(calendarContainer);
        var footerSection = this.createElement('div', { className: FOOTER });
        var cancelBtn = this.createElement('button', { className: CANCEL + ' ' + FLAT + ' ' + CSS });
        var applyBtn = this.createElement('button');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([applyBtn], [APPLY, FLAT, PRIMARY, CSS]);
        footerSection.appendChild(applyBtn);
        footerSection.appendChild(cancelBtn);
        var enable = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue);
        this.cancelButton = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["Button"]({ content: this.l10n.getConstant('cancelText') }, cancelBtn);
        this.applyButton = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["Button"]({ content: this.l10n.getConstant('applyText'), disabled: !enable }, applyBtn);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(applyBtn, 'click', this.applyFunction, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(cancelBtn, 'click', this.cancelFunction, this);
        this.popupWrapper.appendChild(controlContainer);
        if (!this.isMobile) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
                this.createPresets();
                this.listRippleEffect();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([controlContainer], RANGEBORDER);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.popupWrapper], 'e-preset-wrapper');
                var presets = this.popupWrapper.querySelector('.' + PRESETS);
                presets.style.height = this.popupWrapper.querySelector('.' + RANGECONTAINER).getBoundingClientRect().height + 'px';
            }
        }
        this.popupWrapper.appendChild(footerSection);
        if (this.isMobile) {
            this.deviceHeaderUpdate();
        }
        this.renderPopup();
    };
    DateRangePicker.prototype.cancelFunction = function (eve) {
        if (document.activeElement !== this.inputElement) {
            this.preventFocus = true;
            this.inputElement.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
        }
        eve.preventDefault();
        if (this.isKeyPopup) {
            this.inputElement.focus();
            this.isKeyPopup = false;
        }
        this.startValue = null;
        this.endValue = null;
        this.removeSelection();
        this.hide(eve);
    };
    DateRangePicker.prototype.deviceHeaderUpdate = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            this.endButton.element.setAttribute('disabled', '');
            this.startButton.element.classList.add(ACTIVE);
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            this.startButton.element.classList.add(ACTIVE);
        }
    };
    DateRangePicker.prototype.applyFunction = function (eve) {
        var isValueChanged = false;
        if (eve.type !== 'touchstart') {
            eve.preventDefault();
        }
        if (this.closeEventArgs && this.closeEventArgs.cancel) {
            this.startValue = this.popupWrapper.querySelector('.e-start-date') &&
                this.getIdValue(null, this.popupWrapper.querySelector('.e-start-date'));
            this.endValue = this.popupWrapper.querySelector('.e-end-date') &&
                this.getIdValue(null, this.popupWrapper.querySelector('.e-end-date'));
            this.setValue();
        }
        if (document.activeElement !== this.inputElement) {
            this.preventFocus = true;
            this.inputElement.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
        }
        if (eve.type !== 'touchstart' &&
            this.closeEventArgs && !this.closeEventArgs.cancel) {
            eve.preventDefault();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            this.previousStartValue = new Date(+this.startValue);
            this.previousEndValue = new Date(+this.endValue);
            this.previousEleValue = this.inputElement.value;
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.rangeArgs(eve).text, this.inputElement, this.floatLabelType, this.showClearButton);
            if (+this.initStartDate !== +this.startValue || +this.initEndDate !== +this.endValue) {
                isValueChanged = true;
            }
            this.changeTrigger(eve);
            this.hide(eve ? eve : null);
            this.errorClass();
            isValueChanged = true;
        }
        else {
            this.hide(eve ? eve : null);
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(eve.target, '.' + INPUTCONTAINER))
            && (!isValueChanged)) {
            this.focusOut();
        }
        if (!this.isMobile) {
            this.isKeyPopup = false;
            if (this.isRangeIconClicked) {
                this.inputWrapper.container.children[1].focus();
                this.keyInputConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.keyInputConfigs, this.keyConfigs);
                this.popupKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputWrapper.container.children[1], {
                    eventName: 'keydown',
                    keyConfigs: this.keyInputConfigs,
                    keyAction: this.popupKeyActionHandle.bind(this)
                });
            }
        }
    };
    DateRangePicker.prototype.onMouseClick = function (event, item) {
        if (event.type === 'touchstart') {
            return;
        }
        var target = item || event.target;
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTCLASS);
        var isClick = li && li.classList.contains(ACTIVE);
        if (li && li.classList.contains(LISTCLASS)) {
            this.setListSelection(li, event);
        }
        this.inputElement.focus();
        if (!this.isMobile) {
            this.preventFocus = true;
            if (li && li.classList.contains(LISTCLASS) && li.getAttribute('id') === 'custom_range') {
                this.leftCalendar.children[1].firstElementChild.focus();
            }
            else {
                if (!isClick && event.type === 'keydown') {
                    this.inputElement.focus();
                }
            }
        }
    };
    DateRangePicker.prototype.onMouseOver = function (event) {
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + LISTCLASS);
        if (li && li.classList.contains(LISTCLASS) && !li.classList.contains(HOVER)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
        }
    };
    DateRangePicker.prototype.onMouseLeave = function (event) {
        var item = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + HOVER);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([item], HOVER);
        }
    };
    DateRangePicker.prototype.setListSelection = function (li, event) {
        if (li && (!li.classList.contains(ACTIVE) || (this.isMobile && li.classList.contains(ACTIVE)))) {
            if (this.isMobile && li.classList.contains(ACTIVE)) {
                this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
                var values_1 = this.presetsItem[this.activeIndex];
                if (values_1.id === 'custom_range') {
                    this.renderCustomPopup();
                    return;
                }
                return;
            }
            this.removeListSelection();
            this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], ACTIVE);
            li.setAttribute('aria-selected', 'true');
            var values = this.presetsItem[this.activeIndex];
            if (values.id === 'custom_range') {
                this.renderCustomPopup();
            }
            else {
                this.applyPresetRange(values, event);
            }
        }
    };
    DateRangePicker.prototype.removeListSelection = function () {
        var item = this.presetElement.querySelector('.' + ACTIVE);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([item], ACTIVE);
            item.removeAttribute('aria-selected');
        }
    };
    DateRangePicker.prototype.setValue = function () {
        this.modelValue = [this.startValue, this.endValue];
    };
    DateRangePicker.prototype.applyPresetRange = function (values, e) {
        this.hide(null);
        this.presetsItem[this.presetsItem.length - 1].start = null;
        this.presetsItem[this.presetsItem.length - 1].end = null;
        this.startValue = values.start;
        this.endValue = values.end;
        this.setValue();
        this.refreshControl();
        this.trigger('select', this.rangeArgs(e));
        this.changeTrigger(e);
        this.previousEleValue = this.inputElement.value;
        this.isCustomRange = false;
        this.leftCalendar = this.rightCalendar = null;
        if (this.isKeyPopup) {
            this.isRangeIconClicked = false;
            this.inputElement.focus();
        }
    };
    DateRangePicker.prototype.showPopup = function (element, event) {
        this.presetHeight();
        if (this.zIndex === 1000) {
            this.popupObj.show(null, this.element);
        }
        else {
            this.popupObj.show(null, null);
        }
        if (this.isMobile) {
            this.popupObj.refreshPosition();
        }
    };
    DateRangePicker.prototype.renderCustomPopup = function () {
        this.isCustomWindow = true;
        this.popupObj.hide();
        this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: ROOT + ' ' + POPUP });
        this.renderControl();
        this.openEventArgs.appendTo.appendChild(this.popupWrapper);
        this.showPopup();
        this.isCustomRange = true;
        if (!this.isMobile) {
            this.calendarFocus();
        }
    };
    DateRangePicker.prototype.listRippleEffect = function () {
        for (var _i = 0, _a = this.liCollections; _i < _a.length; _i++) {
            var li = _a[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(li);
        }
    };
    DateRangePicker.prototype.createPresets = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label)) {
            this.presetElement = this.createElement('div', { className: PRESETS, attrs: { 'tabindex': '0' } });
            var listTag = _ej2_lists__WEBPACK_IMPORTED_MODULE_5__["ListBase"].createList(this.createElement, this.presetsItem, null, true);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options' });
            this.presetElement.appendChild(listTag);
            this.popupWrapper.appendChild(this.presetElement);
            var customElement = this.presetElement.querySelector('#custom_range');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(customElement)) {
                customElement.textContent = this.l10n.getConstant('customRange') !== '' ? this.l10n.getConstant('customRange')
                    : 'Custom Range';
            }
            this.liCollections = this.presetElement.querySelectorAll('.' + LISTCLASS);
            this.wireListEvents();
            if (this.isMobile) {
                this.presetElement.style.width = this.inputWrapper.container.getBoundingClientRect().width + 'px';
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex) && this.activeIndex > -1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.liCollections[this.activeIndex]], ACTIVE);
            }
        }
    };
    DateRangePicker.prototype.wireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.presetElement, 'click', this.onMouseClick, this);
        if (!this.isMobile) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.presetElement, 'mouseover', this.onMouseOver, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.presetElement, 'mouseout', this.onMouseLeave, this);
        }
    };
    DateRangePicker.prototype.unWireListEvents = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.presetElement)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.presetElement, 'click touchstart', this.onMouseClick);
            if (!this.isMobile) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.presetElement, 'mouseover', this.onMouseOver);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.presetElement, 'mouseout', this.onMouseLeave);
            }
        }
    };
    // tslint:disable-next-line:max-func-body-length
    DateRangePicker.prototype.renderPopup = function () {
        var _this = this;
        this.popupWrapper.classList.add('e-control');
        var popupWidth = this.popupWrapper.getBoundingClientRect().width;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass.trim() !== '') {
            this.popupWrapper.className += ' ' + this.cssClass;
        }
        if (this.isMobile && this.isCustomWindow) {
            this.modal = this.createElement('div');
            document.body.appendChild(this.modal);
        }
        this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Popup"](this.popupWrapper, {
            relateTo: this.isMobile && this.isCustomWindow ? document.body :
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetElement) ? this.targetElement : this.inputWrapper.container),
            position: (this.isMobile ?
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label) && !this.isCustomWindow ?
                    { X: 'left', Y: 'bottom' } : { X: 'center', Y: 'center' }) :
                this.enableRtl ? { X: 'left', Y: 'bottom' } : { X: 'right', Y: 'bottom' }),
            offsetX: this.isMobile || this.enableRtl ? 0 : -popupWidth,
            offsetY: OFFSETVALUE,
            collision: this.isMobile ?
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.presets[0].start && this.presets[0].end && this.presets[0].label) && !this.isCustomWindow ?
                    { X: 'fit' } : { X: 'fit', Y: 'fit' }) : { X: 'fit', Y: 'flip' },
            targetType: this.isMobile && this.isCustomWindow ? 'container' : 'relative',
            enableRtl: this.enableRtl,
            zIndex: this.zIndex,
            open: function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.inputElement, { 'aria-expanded': 'true' });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.buttons[0]], ACTIVE);
                if (!_this.isMobile) {
                    if (_this.cancelButton) {
                        _this.btnKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.cancelButton.element, {
                            eventName: 'keydown',
                            keyAction: _this.popupKeyActionHandle.bind(_this),
                            keyConfigs: { tab: 'tab', altRightArrow: 'alt+rightarrow', altLeftArrow: 'alt+leftarrow' }
                        });
                        _this.btnKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.applyButton.element, {
                            eventName: 'keydown',
                            keyAction: _this.popupKeyActionHandle.bind(_this),
                            keyConfigs: { altRightArrow: 'alt+rightarrow', altLeftArrow: 'alt+leftarrow' }
                        });
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.leftCalendar)) {
                        if (!_this.isRangeIconClicked) {
                            _this.calendarFocus();
                        }
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.presetElement)) {
                        _this.keyInputConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.keyInputConfigs, _this.keyConfigs);
                        _this.presetKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.presetElement, {
                            eventName: 'keydown',
                            keyAction: _this.presetKeyActionHandler.bind(_this),
                            keyConfigs: _this.keyInputConfigs
                        });
                        _this.presetKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.presetElement, {
                            eventName: 'keydown',
                            keyAction: _this.popupKeyActionHandle.bind(_this),
                            keyConfigs: { altRightArrow: 'alt+rightarrow', altLeftArrow: 'alt+leftarrow' }
                        });
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.leftCalendar)) {
                            _this.preventBlur = true;
                            _this.presetElement.focus();
                        }
                        else {
                            _this.presetElement.setAttribute('tabindex', '-1');
                        }
                    }
                    _this.popupKeyBoardHandler();
                }
                if (_this.isMobile && !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'keydown', _this.popupCloseHandler, _this);
                }
            },
            close: function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.inputElement, { 'aria-expanded': 'false' });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.inputWrapper.buttons[0]], ACTIVE);
                if (_this.isRangeIconClicked) {
                    _this.inputWrapper.container.children[1].focus();
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(_this.presets[0].start && _this.presets[0].end && _this.presets[0].label)) {
                    _this.unWireListEvents();
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.popupObj)) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.popupObj.element.parentElement)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(_this.popupObj.element);
                    }
                    _this.popupObj.destroy();
                    _this.popupObj = null;
                }
                if (_this.isMobile && !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'keydown', _this.popupCloseHandler);
                }
            }, targetExitViewport: function () {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.hide();
                }
            }
        });
        if (this.isMobile) {
            this.popupObj.element.classList.add(DEVICE);
            if (!this.isMobile) {
                this.popupObj.element.classList.add('e-bigger');
            }
        }
        if (this.isMobile && this.isCustomWindow) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.modal], [DEVICE, ROOT, 'e-range-modal']);
            document.body.className += ' ' + OVERFLOW;
            this.modal.style.display = 'block';
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', this.documentHandler, this);
    };
    DateRangePicker.prototype.popupCloseHandler = function (e) {
        switch (e.keyCode) {
            case 27:
                this.hide(e);
                break;
        }
    };
    DateRangePicker.prototype.calendarFocus = function () {
        var startDate = this.popupObj && this.popupObj.element.querySelector('.' + STARTDATE);
        if (startDate) {
            var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(startDate, '.' + RIGHTCALENDER);
            ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) ? this.leftCalendar : ele;
            if (this.isRangeIconClicked) {
                this.inputWrapper.container.focus();
            }
            else {
                this.preventBlur = true;
                ele.children[1].firstElementChild.focus();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([startDate], FOCUSDATE);
        }
        else {
            if (this.isRangeIconClicked) {
                this.inputWrapper.container.focus();
            }
            else {
                this.preventBlur = true;
                this.leftCalendar.children[1].firstElementChild.focus();
            }
        }
    };
    DateRangePicker.prototype.presetHeight = function () {
        var presets = this.popupObj && this.popupObj.element.querySelector('.' + PRESETS);
        var rangeContainer = this.popupObj && this.popupObj.element.querySelector('.' + RANGECONTAINER);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(presets) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rangeContainer)) {
            presets.style.height = rangeContainer.getBoundingClientRect().height + 'px';
        }
    };
    DateRangePicker.prototype.presetKeyActionHandler = function (e) {
        switch (e.action) {
            case 'moveDown':
                this.listMoveDown(e);
                this.setScrollPosition();
                e.preventDefault();
                break;
            case 'moveUp':
                this.listMoveUp(e);
                this.setScrollPosition();
                e.preventDefault();
                break;
            case 'enter':
                var hvrItem = this.getHoverLI();
                var actItem = this.getActiveLI();
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.leftCalendar) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actItem)) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hvrItem) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actItem) && actItem === hvrItem)) {
                        this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(actItem);
                        var values = this.presetsItem[this.activeIndex];
                        if (values.id === 'custom_range') {
                            this.calendarFocus();
                            actItem.classList.remove(HOVER);
                            e.preventDefault();
                            return;
                        }
                    }
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hvrItem) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actItem)) {
                    this.onMouseClick(e, hvrItem || actItem);
                }
                e.preventDefault();
                break;
            case 'tab':
                if (this.leftCalendar) {
                    var item = this.getHoverLI();
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                        item.classList.remove(HOVER);
                    }
                }
                else {
                    this.hide(e);
                    e.preventDefault();
                }
                break;
        }
    };
    DateRangePicker.prototype.listMoveDown = function (e) {
        var hvrItem = this.getHoverLI();
        var actItem = this.getActiveLI();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hvrItem)) {
            var li = hvrItem.nextElementSibling;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && li.classList.contains(LISTCLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([hvrItem], HOVER);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actItem)) {
            var li = actItem.nextElementSibling;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && li.classList.contains(LISTCLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.liCollections[0]], HOVER);
        }
    };
    DateRangePicker.prototype.listMoveUp = function (e) {
        var hvrItem = this.getHoverLI();
        var actItem = this.getActiveLI();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hvrItem)) {
            var li = hvrItem.previousElementSibling;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && li.classList.contains(LISTCLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([hvrItem], HOVER);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actItem)) {
            var li = actItem.previousElementSibling;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && li.classList.contains(LISTCLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
            }
        }
    };
    DateRangePicker.prototype.getHoverLI = function () {
        var item = this.presetElement.querySelector('.' + HOVER);
        return item;
    };
    DateRangePicker.prototype.getActiveLI = function () {
        var item = this.presetElement.querySelector('.' + ACTIVE);
        return item;
    };
    DateRangePicker.prototype.popupKeyBoardHandler = function () {
        this.popupKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.popupWrapper, {
            eventName: 'keydown',
            keyAction: this.popupKeyActionHandle.bind(this),
            keyConfigs: { escape: 'escape' }
        });
        this.keyInputConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.keyInputConfigs, this.keyConfigs);
        this.popupKeyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputWrapper.container.children[1], {
            eventName: 'keydown',
            keyAction: this.popupKeyActionHandle.bind(this),
            keyConfigs: this.keyInputConfigs
        });
    };
    DateRangePicker.prototype.setScrollPosition = function () {
        var listHeight = this.presetElement.getBoundingClientRect().height;
        var hover = this.presetElement.querySelector('.' + HOVER);
        var active = this.presetElement.querySelector('.' + ACTIVE);
        var element = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hover) ? hover : active;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            var nextEle = element.nextElementSibling;
            var height = nextEle ? nextEle.offsetTop : element.offsetTop;
            var liHeight = element.getBoundingClientRect().height;
            if ((height + element.offsetTop) > listHeight) {
                this.presetElement.scrollTop = nextEle ? (height - (listHeight / 2 + liHeight / 2)) : height;
            }
            else {
                this.presetElement.scrollTop = 0;
            }
        }
    };
    DateRangePicker.prototype.popupKeyActionHandle = function (e) {
        var presetElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + PRESETS);
        switch (e.action) {
            case 'escape':
                if (this.isPopupOpen()) {
                    if (this.isKeyPopup) {
                        this.inputElement.focus();
                        this.isKeyPopup = false;
                    }
                    this.hide(e);
                }
                else {
                    this.inputWrapper.container.children[1].blur();
                }
                break;
            case 'enter':
                if (!this.isPopupOpen()) {
                    this.show(null, e);
                }
                else {
                    this.inputWrapper.container.children[1].focus();
                }
                break;
            case 'tab':
                this.hide(e);
                break;
            case 'altRightArrow':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(presetElement)) {
                    this.cancelButton.element.focus();
                }
                else {
                    if (document.activeElement === this.cancelButton.element && this.applyButton.element.disabled !== true) {
                        this.applyButton.element.focus();
                    }
                    else {
                        this.leftCalendar.children[1].firstElementChild.focus();
                    }
                }
                e.preventDefault();
                break;
            case 'altLeftArrow':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(presetElement)) {
                    this.rightCalendar.children[1].firstElementChild.focus();
                }
                else {
                    if (document.activeElement === this.applyButton.element && this.applyButton.element.disabled !== true) {
                        this.cancelButton.element.focus();
                    }
                    else {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.presetElement) && (document.activeElement === this.cancelButton.element)) {
                            this.presetElement.focus();
                        }
                        else {
                            this.rightCalendar.children[1].firstElementChild.focus();
                        }
                    }
                }
                e.preventDefault();
                break;
        }
    };
    DateRangePicker.prototype.documentHandler = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj)) {
            return;
        }
        var target = e.target;
        if (!this.inputWrapper.container.contains(target) ||
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '[id="' + this.popupWrapper.id + '"]'))) {
            if (e.type !== 'touchstart' && ((e.type === 'mousedown') ||
                this.closeEventArgs && !this.closeEventArgs.cancel)) {
                e.preventDefault();
            }
        }
        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetElement) ||
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetElement) && !(target === this.targetElement))) &&
            !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '[id="' + this.popupWrapper.id + '"]'))
            && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + INPUTCONTAINER) === this.inputWrapper.container)
            && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.e-daterangepicker.e-popup') && (!target.classList.contains('e-day')))) {
            this.preventBlur = false;
            if (this.isPopupOpen() && document.body.contains(this.popupObj.element)) {
                this.applyFunction(e);
                if (!this.isMobile) {
                    this.isRangeIconClicked = false;
                }
            }
        }
    };
    DateRangePicker.prototype.createInput = function () {
        var updatedCssClassValue = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValue = (this.cssClass.replace(/\s+/g, ' ')).trim();
        }
        this.inputWrapper = _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].createInput({
            floatLabelType: this.floatLabelType,
            element: this.inputElement,
            properties: {
                readonly: this.readonly,
                placeholder: this.placeholder,
                cssClass: updatedCssClassValue,
                enabled: this.enabled,
                enableRtl: this.enableRtl,
                showClearButton: this.showClearButton,
            },
            buttons: [DATERANGEICON]
        }, this.createElement);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, {
            'aria-readonly': this.readonly ? 'true' : 'false', 'tabindex': '0', 'aria-haspopup': 'true',
            'aria-activedescendant': 'null', 'aria-owns': this.element.id + '_popup', 'aria-expanded': 'false',
            'role': 'combobox', 'autocomplete': 'off', 'aria-disabled': !this.enabled ? 'true' : 'false',
            'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false'
        });
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].addAttributes({ 'aria-label': 'select' }, this.inputWrapper.buttons[0]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.placeholder) && this.placeholder.trim() !== '') {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].addAttributes({ 'aria-placeholder': this.placeholder }, this.inputElement);
        }
        this.setEleWidth(this.width);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], DATERANGEWRAPPER);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute('name'))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'name': this.element.id });
        }
        if (this.inputElement.type === 'hidden') {
            this.inputWrapper.container.style.display = 'none';
        }
        this.refreshControl();
        this.previousEleValue = this.inputElement.value;
        this.inputElement.setAttribute('value', this.inputElement.value);
        this.startCopy = this.startDate;
        this.endCopy = this.endDate;
    };
    DateRangePicker.prototype.setEleWidth = function (width) {
        if (typeof width === 'string') {
            this.inputWrapper.container.style.width = (this.width);
        }
        else if (typeof width === 'number') {
            this.inputWrapper.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        }
        else {
            this.inputWrapper.container.style.width = '100%';
        }
    };
    DateRangePicker.prototype.adjustLongHeaderWidth = function () {
        if (this.dayHeaderFormat === 'Wide') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.popupWrapper], DAYHEADERLONG);
        }
    };
    DateRangePicker.prototype.refreshControl = function () {
        this.validateMinMax();
        if (this.strictMode) {
            this.validateRangeStrict();
        }
        var isDisabled = this.disabledDates();
        if (this.strictMode && (isDisabled)) {
            this.startValue = this.previousStartValue;
            this.setProperties({ startDate: this.startValue }, true);
            this.endValue = this.previousEndValue;
            this.setProperties({ endDate: this.endValue }, true);
            this.setValue();
        }
        this.updateInput();
        if (!this.strictMode) {
            this.validateRange();
        }
        if (!this.strictMode && (isDisabled)) {
            this.clearRange();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !isDisabled) {
            this.disabledDateRender();
        }
        this.errorClass();
        this.previousStartValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) || isNaN(+this.startValue) ? null : new Date(+this.startValue);
        this.previousEndValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) || isNaN(+this.endValue) ? null : new Date(+this.endValue);
    };
    DateRangePicker.prototype.updateInput = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            var formatOption = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            var startDate = this.globalize.formatDate(this.startValue, formatOption);
            var endDate = this.globalize.formatDate(this.endValue, formatOption);
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(startDate + ' ' + this.separator + ' ' + endDate, this.inputElement, this.floatLabelType, this.showClearButton);
            this.previousStartValue = new Date(+this.startValue);
            this.previousEndValue = new Date(+this.endValue);
        }
        if (!this.strictMode && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.invalidValueString) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.invalidValueString, this.inputElement, this.floatLabelType, this.showClearButton);
        }
    };
    DateRangePicker.prototype.checkInvalidRange = function (value) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            var invalid = false;
            var startinvalue = void 0;
            var endinvalue = void 0;
            var startString = null;
            var endString = null;
            var valueString = null;
            var startObject = false;
            var endObject = false;
            var invalidobject = false;
            if (typeof (value) === 'string') {
                var range = value.split(' ' + this.separator + ' ');
                if (range.length === 2) {
                    startString = range[0];
                    endString = range[1];
                }
                else {
                    invalid = true;
                    valueString = value;
                }
            }
            else {
                if (value.length > 0) {
                    startinvalue = value[0];
                    endinvalue = value[1];
                }
                else {
                    startinvalue = value.start;
                    endinvalue = value.end;
                }
                if (!(startinvalue instanceof Date) && typeof (startinvalue) !== 'object') {
                    startString = this.getstringvalue(startinvalue);
                }
                else if (startinvalue instanceof Date) {
                    startObject = true;
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startinvalue)) {
                    invalidobject = true;
                }
                if (!(endinvalue instanceof Date) && typeof (endinvalue) !== 'object') {
                    endString = this.getstringvalue(endinvalue);
                }
                else if (endinvalue instanceof Date) {
                    endObject = true;
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endinvalue)) {
                    invalidobject = true;
                }
            }
            if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startString) && !startObject && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endString)) ||
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startString) && !endObject && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endString))) {
                invalid = true;
            }
            if (invalidobject) {
                startString = endString = valueString = null;
                invalid = true;
            }
            if (startString) {
                invalid = invalid || this.checkInvalidValue(startString);
            }
            if (endString) {
                invalid = invalid || this.checkInvalidValue(endString);
            }
            if (invalid) {
                if (startObject && !invalidobject) {
                    startString = startinvalue.toLocaleDateString();
                }
                if (endObject && !invalidobject) {
                    endString = endinvalue.toLocaleDateString();
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startString) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endString)) {
                    valueString = startString + ' ' + this.separator + ' ' + endString;
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startString)) {
                    valueString = startString;
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endString)) {
                    valueString = endString;
                }
                this.invalidValueString = valueString;
                this.setProperties({ value: null }, true);
                this.setProperties({ startValue: null }, true);
                this.setProperties({ endValue: null }, true);
                this.startDate = null;
                this.endDate = null;
            }
        }
    };
    DateRangePicker.prototype.getstringvalue = function (value) {
        var stringValue = null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && (typeof value === 'number')) {
            stringValue = (value).toString();
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && (typeof value === 'string')) {
            stringValue = '' + value;
        }
        return stringValue;
    };
    DateRangePicker.prototype.checkInvalidValue = function (value) {
        var valueString = value;
        var invalid = false;
        var formatOpt = null;
        formatOpt = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        if (typeof valueString !== 'string') {
            invalid = true;
        }
        else {
            var globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            if (!this.checkDateValue(globalize.parseDate(valueString, formatOpt))) {
                var extISOStr = null;
                var basISOString = null;
                // tslint:disable-next-line
                extISOStr = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                // tslint:disable-next-line
                basISOString = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                if ((!extISOStr.test(valueString) && !basISOString.test(valueString))
                    || (/^[a-zA-Z0-9- ]*$/).test(valueString) || isNaN(+new Date(this.checkValue(valueString)))) {
                    invalid = true;
                }
            }
        }
        return invalid;
    };
    DateRangePicker.prototype.isDateDisabled = function (date) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date)) {
            return false;
        }
        var value = new Date(+date);
        if (+value < +this.min || +value > +this.max) {
            return true;
        }
        this.virtualRenderCellArgs = {
            date: value,
            isDisabled: false,
        };
        var args = this.virtualRenderCellArgs;
        this.virtualRenderCellEvent(args);
        if (args.isDisabled) {
            return true;
        }
        return false;
    };
    DateRangePicker.prototype.disabledDateRender = function () {
        this.disabledDays = [];
        this.disabledDayCnt = null;
        var localDate = new Date(+this.startValue);
        var count = 0;
        while (+localDate <= +this.endValue) {
            this.virtualRenderCellArgs = {
                date: localDate,
                isDisabled: false,
            };
            var args = this.virtualRenderCellArgs;
            this.virtualRenderCellEvent(args);
            if (args.isDisabled) {
                this.disabledDays.push(new Date(+args.date));
                if (+localDate > +this.startValue && +localDate < +this.endValue) {
                    count++;
                }
            }
            this.addDay(localDate, 1, null, this.max, this.min);
        }
        this.disabledDayCnt = count;
    };
    DateRangePicker.prototype.virtualRenderCellEvent = function (args) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.virtualRenderCellArgs, { name: 'renderDayCell' });
        this.trigger('renderDayCell', args);
    };
    DateRangePicker.prototype.disabledDates = function () {
        var isStartDisabled = false;
        var isEndDisabled = false;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue)) {
            isStartDisabled = this.isDateDisabled(this.startValue);
            isEndDisabled = this.isDateDisabled(this.endValue);
            if (!this.isPopupOpen()) {
                this.currentDate = null;
            }
            this.setValue();
        }
        return (isStartDisabled || isEndDisabled);
    };
    DateRangePicker.prototype.setModelValue = function () {
        if (!this.value && this.startDate === null && this.endDate === null) {
            this.setProperties({ value: null }, true);
        }
        else if (this.value === null || this.value.start === null) {
            if (this.value === null) {
                this.setProperties({ value: [this.startDate, this.endDate] }, true);
            }
            else if (this.value.start === null) {
                this.setProperties({ value: { start: this.startDate, end: this.endDate } }, true);
            }
        }
        else {
            if ((this.value && this.value.length > 0) ||
                this.valueType && this.valueType.length > 0) {
                if (+this.startDate !== +this.value[0] || +this.endDate !== +this.value[1]) {
                    this.setProperties({ value: [this.startDate, this.endDate] }, true);
                }
                if (this.value && this.value[0] == null && this.value[1] == null) {
                    this.setProperties({ value: null }, true);
                }
            }
            else {
                if ((this.value && this.value.start)) {
                    this.setProperties({ value: { start: this.startDate, end: this.endDate } }, true);
                }
            }
        }
        this.createHiddenInput();
    };
    /**
     * To dispatch the event manually
     */
    DateRangePicker.prototype.dispatchEvent = function (element, type) {
        var evt = document.createEvent('HTMLEvents');
        evt.initEvent(type, false, true);
        element.dispatchEvent(evt);
        this.firstHiddenChild.dispatchEvent(evt);
    };
    DateRangePicker.prototype.changeTrigger = function (e) {
        if (+this.initStartDate !== +this.startValue || +this.initEndDate !== +this.endValue) {
            this.setProperties({ endDate: this.checkDateValue(this.endValue) }, true);
            this.setProperties({ startDate: this.checkDateValue(this.startValue) }, true);
            this.setModelValue();
            if (this.isAngular && this.preventChange) {
                this.preventChange = false;
            }
            else {
                this.trigger('change', this.rangeArgs(e));
            }
        }
        this.previousEleValue = this.inputElement.value;
        this.initStartDate = this.checkDateValue(this.startValue);
        this.initEndDate = this.checkDateValue(this.endValue);
    };
    /**
     * This method is used to navigate to the month/year/decade view of the Calendar.
     * @param  {string} view - Specifies the view of the Calendar.
     * @param  {Date} date - Specifies the focused date in a view.
     * @returns void
     * @hidden
     */
    DateRangePicker.prototype.navigateTo = function (view, date) {
        if (this.isPopupOpen()) {
            if (view.toLowerCase() === 'month') {
                view = 'Month';
            }
            else if (view.toLowerCase() === 'year') {
                view = 'Year';
            }
            else if (view.toLowerCase() === 'decade') {
                view = 'Decade';
            }
            else {
                return;
            }
            if (this.getViewNumber(view) < this.getViewNumber(this.depth)) {
                view = this.depth;
            }
            if (this.isMobile) {
                _super.prototype.navigateTo.call(this, view, date);
            }
            else {
                if (date < this.min) {
                    date = new Date(+this.min);
                }
                else if (date >= this.max) {
                    date = new Date(+this.max);
                }
                if (view === 'Month' && this.isSameMonth(date, this.max)) {
                    date = new Date(this.max.getFullYear(), this.max.getMonth() - 1, this.min.getDate());
                }
                else if (view === 'Year' && this.isSameYear(date, this.max)) {
                    date = new Date((this.max.getFullYear() - 1), this.max.getMonth(), this.max.getDate());
                }
                else if (view === 'Decade' && this.isSameDecade(date, this.max)) {
                    date = new Date((this.max.getFullYear() - 10), this.max.getMonth(), this.max.getDate());
                }
                this.leftCalCurrentDate = date;
                this.navigate(this.leftCalendar, this.leftCalCurrentDate, view);
                if (view === 'Month') {
                    date = new Date(this.currentDate.setMonth(this.currentDate.getMonth() + 1));
                }
                else if (view === 'Year') {
                    date = new Date(this.currentDate.setFullYear(this.currentDate.getFullYear() + 1));
                }
                else {
                    date = new Date(this.currentDate.setFullYear(this.currentDate.getFullYear() + 10));
                }
                this.rightCalCurrentDate = date;
                this.navigate(this.rightCalendar, this.rightCalCurrentDate, view);
                this.leftKeyboardModule = this.rightKeyboardModule = null;
                this.updateNavIcons();
            }
            if (this.currentView() === this.depth) {
                this.bindCalendarCellEvents();
            }
            this.removeFocusedDate();
            this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
        }
    };
    DateRangePicker.prototype.navigate = function (calendar, date, view) {
        this.calendarElement = calendar;
        this.table = calendar.querySelector('table');
        this.tableBodyElement = calendar.querySelector('tbody');
        this.headerTitleElement = calendar.querySelector('.e-title');
        this.tableHeadElement = calendar.querySelector('thead');
        this.contentElement = calendar.querySelector('.e-content');
        this.previousIcon = calendar.querySelector('.e-prev');
        this.nextIcon = calendar.querySelector('.e-next');
        this.effect = ZOOMIN;
        _super.prototype.navigateTo.call(this, view, date);
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    DateRangePicker.prototype.focusIn = function () {
        if (document.activeElement !== this.inputElement && this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
            this.inputElement.focus();
            var focusArguments = {
                model: this
            };
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    DateRangePicker.prototype.focusOut = function () {
        var isBlur = this.preventBlur;
        if (document.activeElement === this.inputElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [INPUTFOCUS]);
            this.preventBlur = false;
            this.inputElement.blur();
            this.preventBlur = isBlur;
        }
    };
    /**
     * To destroy the widget.
     * @returns void
     */
    DateRangePicker.prototype.destroy = function () {
        this.unBindEvents();
        this.hide(null);
        var ariaAttrs = {
            'aria-readonly': this.readonly ? 'true' : 'false', 'tabindex': '0', 'aria-haspopup': 'true',
            'aria-activedescendant': 'null', 'aria-owns': this.element.id + '_popup', 'aria-expanded': 'false',
            'role': 'combobox', 'autocomplete': 'off', 'aria-disabled': !this.enabled ? 'true' : 'false',
            'autocorrect': 'off', 'autocapitalize': 'off', 'aria-invalid': 'false', 'spellcheck': 'false'
        };
        if (this.inputElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputElement], [ROOT]);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.inputBlurHandler);
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].removeAttributes(ariaAttrs, this.inputElement);
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cloneElement.getAttribute('tabindex'))) ?
                this.inputElement.setAttribute('tabindex', this.tabIndex) : this.inputElement.removeAttribute('tabindex');
            this.ensureInputAttribute();
            this.inputElement.classList.remove('e-input');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputWrapper)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown', this.rangeIconHandler);
                if (this.angularTag === null) {
                    this.inputWrapper.container.parentElement.appendChild(this.inputElement);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.container);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputKeyboardModule) && !this.isMobile) {
            this.inputKeyboardModule.destroy();
        }
        if (this.popupObj) {
            if (!this.isMobile) {
                this.clearCalendarEvents();
            }
        }
        _super.prototype.destroy.call(this);
        this.inputWrapper = this.popupWrapper = this.popupObj = this.cloneElement = this.presetElement = null;
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.firstHiddenChild))
            && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.secondHiddenChild))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.firstHiddenChild);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.secondHiddenChild);
            this.firstHiddenChild = this.secondHiddenChild = null;
            this.inputElement.setAttribute('name', this.element.getAttribute('data-name'));
            this.inputElement.removeAttribute('data-name');
        }
    };
    DateRangePicker.prototype.ensureInputAttribute = function () {
        var attr = [];
        for (var i = 0; i < this.inputElement.attributes.length; i++) {
            attr[i] = this.inputElement.attributes[i].name;
        }
        for (var i = 0; i < attr.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cloneElement.getAttribute(attr[i]))) {
                if (attr[i].toLowerCase() === 'value') {
                    this.inputElement.value = '';
                }
                this.inputElement.removeAttribute(attr[i]);
            }
            else {
                if (attr[i].toLowerCase() === 'value') {
                    this.inputElement.value = this.cloneElement.getAttribute(attr[i]);
                }
                this.inputElement.setAttribute(attr[i], this.cloneElement.getAttribute(attr[i]));
            }
        }
    };
    /**
     * To get component name
     * @returns string
     * @private
     */
    DateRangePicker.prototype.getModuleName = function () {
        return 'daterangepicker';
    };
    /**
     * Return the properties that are maintained upon browser refresh.
     * @returns string
     */
    DateRangePicker.prototype.getPersistData = function () {
        var keyEntity = ['startDate', 'endDate', 'value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Return the selected range and day span in the DateRangePicker.
     * @returns Object
     */
    DateRangePicker.prototype.getSelectedRange = function () {
        var range;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
            range = (Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime() -
                this.removeTimeValueFromDate(this.endValue).getTime()) / (1000 * 60 * 60 * 24))) + 1);
            this.disabledDateRender();
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.disabledDayCnt)) {
                range = range - this.disabledDayCnt;
                this.disabledDayCnt = null;
            }
        }
        else {
            range = 0;
        }
        return { startDate: this.startValue, endDate: this.endValue, daySpan: range };
    };
    /**
     * To open the Popup container in the DateRangePicker component.
     * @returns void
     */
    DateRangePicker.prototype.show = function (element, event) {
        var _this = this;
        if (this.isMobile && this.popupObj) {
            this.popupObj.refreshPosition();
        }
        if ((this.enabled && this.readonly) || !this.enabled || this.popupObj) {
            return;
        }
        else {
            if (!this.isPopupOpen()) {
                if (element) {
                    this.targetElement = element;
                }
                this.createPopup();
                if (this.isMobile || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    this.mobileRangePopupWrap = this.createElement('div', { className: 'e-daterangepick-mob-popup-wrap' });
                    document.body.appendChild(this.mobileRangePopupWrap);
                }
                this.openEventArgs = {
                    popup: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this.popupObj || null,
                    cancel: false,
                    date: this.inputElement.value,
                    model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this,
                    event: event ? event : null,
                    appendTo: this.isMobile || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? this.mobileRangePopupWrap : document.body
                };
                var eventArgs = this.openEventArgs;
                this.trigger('open', eventArgs, function (eventArgs) {
                    _this.openEventArgs = eventArgs;
                    if (!_this.openEventArgs.cancel) {
                        _this.openEventArgs.appendTo.appendChild(_this.popupWrapper);
                        _this.showPopup(element, event);
                        var isPreset = (!_this.isCustomRange || (_this.isMobile && _this.isCustomRange));
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(_this.presets[0].start && _this.presets[0].end && _this.presets[0].label) && isPreset) {
                            _this.setScrollPosition();
                        }
                        _this.checkMinMaxDays();
                        if ((_this.isMobile) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.startDate)) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.endDate))) {
                            _this.endButton.element.classList.add(ACTIVE);
                            _this.startButton.element.classList.remove(ACTIVE);
                            _this.endButton.element.removeAttribute('disabled');
                            _this.selectableDates();
                        }
                        _super.prototype.setOverlayIndex.call(_this, _this.mobileRangePopupWrap, _this.popupObj.element, _this.modal, _this.isMobile || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice);
                    }
                });
            }
        }
    };
    /**
     * To close the Popup container in the DateRangePicker component.
     * @returns void
     */
    DateRangePicker.prototype.hide = function (event) {
        var _this = this;
        if (this.popupObj) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousEndValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousStartValue)) {
                this.clearRange();
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousStartValue)) {
                    this.startValue = new Date(this.checkValue(this.previousStartValue));
                    this.setValue();
                    this.currentDate = new Date(this.checkValue(this.startValue));
                }
                else {
                    this.startValue = null;
                    this.setValue();
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.previousEndValue)) {
                    this.endValue = new Date(this.checkValue(this.previousEndValue));
                    this.setValue();
                }
                else {
                    this.endValue = null;
                    this.setValue();
                }
            }
            if (this.isPopupOpen()) {
                this.closeEventArgs = {
                    cancel: false,
                    popup: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this.popupObj,
                    date: this.inputElement.value,
                    model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this,
                    event: event ? event : null
                };
                var eventArgs = this.closeEventArgs;
                this.trigger('close', eventArgs, function (eventArgs) {
                    _this.closeEventArgs = eventArgs;
                    if (!_this.closeEventArgs.cancel) {
                        if (_this.isMobile) {
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.startButton) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.endButton)) {
                                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(_this.startButton.element, 'click touchstart', _this.deviceHeaderClick);
                                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(_this.endButton.element, 'click touchstart', _this.deviceHeaderClick);
                            }
                        }
                        if (_this.popupObj) {
                            _this.popupObj.hide();
                            if (_this.preventBlur) {
                                _this.inputElement.focus();
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.container], [INPUTFOCUS]);
                            }
                        }
                        if (!_this.isMobile) {
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.leftKeyboardModule) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.rightKeyboardModule)) {
                                _this.leftKeyboardModule.destroy();
                                _this.rightKeyboardModule.destroy();
                            }
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.presetElement)) {
                                _this.presetKeyboardModule.destroy();
                            }
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.cancelButton)) {
                                _this.btnKeyboardModule.destroy();
                            }
                        }
                        _this.targetElement = null;
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], OVERFLOW);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', _this.documentHandler);
                        if (_this.isMobile && _this.modal) {
                            _this.modal.style.display = 'none';
                            _this.modal.outerHTML = '';
                            _this.modal = null;
                        }
                        if (_this.isMobile || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.mobileRangePopupWrap)) {
                                _this.mobileRangePopupWrap.remove();
                                _this.mobileRangePopupWrap = null;
                            }
                        }
                        _this.isKeyPopup = _this.dateDisabled = false;
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.inputWrapper.buttons[0]], ACTIVE);
                    }
                    _this.updateClearIconState();
                    _this.updateHiddenInput();
                    if (_this.isMobile && _this.allowEdit && !_this.readonly) {
                        _this.inputElement.removeAttribute('readonly');
                    }
                });
            }
        }
        else {
            this.updateClearIconState();
            this.updateHiddenInput();
            if (this.isMobile && this.allowEdit && !this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
        }
    };
    DateRangePicker.prototype.setLocale = function () {
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        this.l10n.setLocale(this.locale);
        this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setPlaceholder(this.placeholder, this.inputElement);
        this.updateInput();
        this.updateHiddenInput();
        this.changeTrigger();
    };
    DateRangePicker.prototype.refreshChange = function () {
        this.checkView();
        this.refreshControl();
        this.changeTrigger();
    };
    DateRangePicker.prototype.setDate = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
        this.refreshChange();
    };
    DateRangePicker.prototype.enableInput = function () {
        if (+this.min <= +this.max) {
            this.setProperties({ enabled: true }, true);
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setEnabled(this.enabled, this.inputElement);
            if (this.element.hasAttribute('disabled')) {
                this.bindEvents();
            }
        }
    };
    DateRangePicker.prototype.clearModelvalue = function (newProp, oldProp) {
        this.setProperties({ startDate: null }, true);
        this.setProperties({ endDate: null }, true);
        if (oldProp.value && oldProp.value.length > 0) {
            this.setProperties({ value: null }, true);
        }
        else if (oldProp.value && oldProp.value.start) {
            this.setProperties({ value: { start: null, end: null } }, true);
        }
        else if (oldProp.value && !oldProp.value.start) {
            this.setProperties({ value: { start: null, end: null } }, true);
        }
        this.updateValue();
        this.setDate();
    };
    DateRangePicker.prototype.createHiddenInput = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.firstHiddenChild) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.secondHiddenChild)) {
            this.firstHiddenChild = this.createElement('input');
            this.secondHiddenChild = this.createElement('input');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute('name'))) {
            this.inputElement.setAttribute('data-name', this.inputElement.getAttribute('name'));
            this.inputElement.removeAttribute('name');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.firstHiddenChild, {
            'type': 'text', 'name': this.inputElement.getAttribute('data-name'), 'class': HIDDENELEMENT
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.secondHiddenChild, {
            'type': 'text', 'name': this.inputElement.getAttribute('data-name'), 'class': HIDDENELEMENT
        });
        var format = { type: 'datetime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        this.firstHiddenChild.value = this.startDate && this.globalize.formatDate(this.startDate, format);
        this.secondHiddenChild.value = this.endDate && this.globalize.formatDate(this.endDate, format);
        this.inputElement.parentElement.appendChild(this.firstHiddenChild);
        this.inputElement.parentElement.appendChild(this.secondHiddenChild);
    };
    DateRangePicker.prototype.setMinMaxDays = function () {
        if (this.isPopupOpen()) {
            this.removeClassDisabled();
            this.checkMinMaxDays();
            if (this.isMobile) {
                this.selectableDates();
            }
            if (!this.strictMode && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue))) {
                this.removeSelection();
            }
            else {
                this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
            }
            this.updateHeader();
        }
    };
    /**
     * Called internally if any of the property value changed.
     * returns void
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    DateRangePicker.prototype.onPropertyChanged = function (newProp, oldProp) {
        var format = { format: this.formatString, type: 'date', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            var openPopup = ['maxDays', 'minDays', 'value'];
            if (openPopup.indexOf(prop) < 0) {
                this.hide(null);
            }
            switch (prop) {
                case 'width':
                    this.setEleWidth(this.width);
                    break;
                case 'separator':
                    this.previousEleValue = this.inputElement.value;
                    this.setProperties({ separator: newProp.separator }, true);
                    this.updateInput();
                    this.changeTrigger();
                    break;
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setPlaceholder(newProp.placeholder, this.inputElement);
                    this.setProperties({ placeholder: newProp.placeholder }, true);
                    break;
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setReadonly(this.readonly, this.inputElement);
                    this.inputElement.setAttribute('aria-readonly', '' + this.readonly);
                    this.setRangeAllowEdit();
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'enabled':
                    this.setProperties({ enabled: newProp.enabled }, true);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setEnabled(this.enabled, this.inputElement);
                    if (this.enabled) {
                        this.inputElement.setAttribute('tabindex', this.tabIndex);
                    }
                    else {
                        this.inputElement.tabIndex = -1;
                    }
                    break;
                case 'allowEdit':
                    this.setRangeAllowEdit();
                    break;
                case 'enableRtl':
                    this.setProperties({ enableRtl: newProp.enableRtl }, true);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setEnableRtl(this.enableRtl, [this.inputWrapper.container]);
                    break;
                case 'zIndex':
                    this.setProperties({ zIndex: newProp.zIndex }, true);
                    break;
                case 'format':
                    this.setProperties({ format: newProp.format }, true);
                    this.checkFormat();
                    this.updateInput();
                    this.changeTrigger();
                    break;
                case 'locale':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.l10n.setLocale(this.locale);
                    this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setPlaceholder(this.placeholder, this.inputElement);
                    this.setLocale();
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttributeToElement();
                    this.updateHtmlAttributeToWrapper();
                    this.setDataAttribute(true);
                    this.checkHtmlAttributes(true);
                    break;
                case 'showClearButton':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setClearButton(this.showClearButton, this.inputElement, this.inputWrapper);
                    this.bindClearEvent();
                    break;
                case 'startDate':
                    if (typeof newProp.startDate === 'string') {
                        newProp.startDate = this.globalize.parseDate(newProp.startDate, format);
                    }
                    if (+this.initStartDate !== +newProp.startDate) {
                        this.startValue = this.checkDateValue(new Date(this.checkValue(newProp.startDate)));
                        this.setDate();
                        this.setValue();
                    }
                    break;
                case 'endDate':
                    if (typeof newProp.endDate === 'string') {
                        newProp.endDate = this.globalize.parseDate(newProp.endDate, format);
                    }
                    if (+this.initEndDate !== +newProp.endDate) {
                        this.endValue = this.checkDateValue(new Date(this.checkValue(newProp.endDate)));
                        this.setDate();
                        this.setValue();
                    }
                    break;
                case 'value':
                    this.invalidValueString = null;
                    this.checkInvalidRange(newProp.value);
                    if (typeof (newProp.value) === 'string') {
                        if (!this.invalidValueString) {
                            var rangeArray = newProp.value.split(' ' + this.separator + ' ');
                            this.value = [new Date(rangeArray[0]), new Date(rangeArray[1])];
                            this.updateValue();
                            this.setDate();
                        }
                        else {
                            this.clearModelvalue(newProp, oldProp);
                        }
                    }
                    else {
                        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value) && newProp.value.length > 0)
                            || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value) && newProp.value.start) {
                            this.valueType = newProp.value;
                            if (newProp.value[0] === null || (newProp.value.start === null)) {
                                if (newProp.value.length === 1 || (newProp.value.start)) {
                                    this.clearModelvalue(newProp, oldProp);
                                }
                                else if (newProp.value[1] === null ||
                                    (newProp.value.start === null)) {
                                    this.clearModelvalue(newProp, oldProp);
                                }
                            }
                            else if ((+this.initStartDate !== +newProp.value[0]
                                || +this.initEndDate !== +newProp.value[1]) ||
                                (+this.initStartDate !== +(newProp.value.start
                                    || +this.initEndDate !== +newProp.value.start))) {
                                if (newProp.value.length === 1) {
                                    this.modelValue = newProp.value;
                                }
                                else if (newProp.value.start) {
                                    this.modelValue = newProp.value;
                                }
                                this.updateValue();
                                this.setDate();
                            }
                        }
                        else {
                            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)
                                || newProp.value.start == null) {
                                this.valueType = newProp.value;
                                this.startValue = null;
                                this.endValue = null;
                                this.clearModelvalue(newProp, oldProp);
                            }
                        }
                    }
                    if (this.isPopupOpen()) {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.startValue) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.endValue)) {
                            this.removeSelection();
                            if (this.isMobile) {
                                this.deviceHeaderUpdate();
                            }
                            return;
                        }
                        if (this.isMobile) {
                            this.navigate(this.deviceCalendar, this.startValue, this.currentView());
                            this.deviceHeaderUpdate();
                        }
                        else {
                            this.navigate(this.leftCalendar, this.startValue, this.currentView());
                            this.updateControl(this.leftCalendar);
                            this.navigate(this.rightCalendar, this.endValue, this.currentView());
                            this.updateControl(this.rightCalendar);
                        }
                        this.updateRange((this.isMobile ? [this.calendarElement] : [this.leftCalendar, this.rightCalendar]));
                        this.updateHeader();
                        this.applyButton.disabled = this.applyButton.element.disabled = false;
                    }
                    break;
                case 'minDays':
                    this.setProperties({ minDays: newProp.minDays }, true);
                    this.refreshChange();
                    this.setMinMaxDays();
                    break;
                case 'maxDays':
                    this.setProperties({ maxDays: newProp.maxDays }, true);
                    this.refreshChange();
                    this.setMinMaxDays();
                    break;
                case 'min':
                    this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(newProp.min))) }, true);
                    this.previousEleValue = this.inputElement.value;
                    this.enableInput();
                    this.refreshChange();
                    break;
                case 'max':
                    this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(newProp.max))) }, true);
                    this.enableInput();
                    this.refreshChange();
                    break;
                case 'strictMode':
                    this.invalidValueString = null;
                    this.setProperties({ strictMode: newProp.strictMode }, true);
                    this.refreshChange();
                    break;
                case 'presets':
                    this.setProperties({ presets: newProp.presets }, true);
                    this.processPresets();
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].removeFloating(this.inputWrapper);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].addFloating(this.inputElement, this.floatLabelType, this.placeholder);
                    break;
                case 'start':
                    this.setProperties({ start: newProp.start }, true);
                    this.refreshChange();
                    break;
                case 'depth':
                    this.setProperties({ depth: newProp.depth }, true);
                    this.refreshChange();
                    break;
            }
            this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateRangePicker.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(1900, 0, 1))
    ], DateRangePicker.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(2099, 11, 31))
    ], DateRangePicker.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "firstDayOfWeek", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateRangePicker.prototype, "weekNumber", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Gregorian')
    ], DateRangePicker.prototype, "calendarMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateRangePicker.prototype, "openOnFocus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "cleared", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "navigated", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "renderDayCell", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "startDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "endDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([{}], Presets)
    ], DateRangePicker.prototype, "presets", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DateRangePicker.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], DateRangePicker.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateRangePicker.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateRangePicker.prototype, "showTodayButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], DateRangePicker.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], DateRangePicker.prototype, "depth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DateRangePicker.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('-')
    ], DateRangePicker.prototype, "separator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "minDays", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "maxDays", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateRangePicker.prototype, "strictMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "format", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateRangePicker.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateRangePicker.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateRangePicker.prototype, "allowEdit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], DateRangePicker.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateRangePicker.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], DateRangePicker.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateRangePicker.prototype, "blur", void 0);
    DateRangePicker = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DateRangePicker);
    return DateRangePicker;
}(_calendar_calendar__WEBPACK_IMPORTED_MODULE_1__["CalendarBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/index.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/index.js ***!
  \******************************************************************************/
/*! exports provided: Presets, DateRangePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _daterangepicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./daterangepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/daterangepicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Presets", function() { return _daterangepicker__WEBPACK_IMPORTED_MODULE_0__["Presets"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateRangePicker", function() { return _daterangepicker__WEBPACK_IMPORTED_MODULE_0__["DateRangePicker"]; });

/**
 * DateRangePicker modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/datetimepicker.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/datetimepicker.js ***!
  \**************************************************************************************/
/*! exports provided: DateTimePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return DateTimePicker; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _datepicker_datepicker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../datepicker/datepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/datepicker.js");
/* harmony import */ var _timepicker_timepicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../timepicker/timepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/timepicker.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
///<reference path='../datepicker/datepicker-model.d.ts'/>









//class constant defination
var DATEWRAPPER = 'e-date-wrapper';
var DATEPICKERROOT = 'e-datepicker';
var DATETIMEWRAPPER = 'e-datetime-wrapper';
var DAY = new Date().getDate();
var MONTH = new Date().getMonth();
var YEAR = new Date().getFullYear();
var HOUR = new Date().getHours();
var MINUTE = new Date().getMinutes();
var SECOND = new Date().getSeconds();
var MILLISECOND = new Date().getMilliseconds();
var ROOT = 'e-datetimepicker';
var DATETIMEPOPUPWRAPPER = 'e-datetimepopup-wrapper';
var INPUTWRAPPER = 'e-input-group-icon';
var POPUP = 'e-popup';
var TIMEICON = 'e-time-icon';
var INPUTFOCUS = 'e-input-focus';
var POPUPDIMENSION = '250px';
var ICONANIMATION = 'e-icon-anim';
var DISABLED = 'e-disabled';
var ERROR = 'e-error';
var CONTENT = 'e-content';
var RTL = 'e-rtl';
var NAVIGATION = 'e-navigation';
var ACTIVE = 'e-active';
var HOVER = 'e-hover';
var ICONS = 'e-icons';
var HALFPOSITION = 2;
var LISTCLASS = 'e-list-item';
var ANIMATIONDURATION = 100;
var OVERFLOW = 'e-time-overflow';
/**
 * Represents the DateTimePicker component that allows user to select
 * or enter a date time value.
 * ```html
 * <input id="dateTimePicker"/>
 * ```
 * ```typescript
 * <script>
 *   let dateTimePickerObject:DateTimePicker = new DateTimePicker({ value: new Date() });
 *   dateTimePickerObject.appendTo("#dateTimePicker");
 * </script>
 * ```
 */
var DateTimePicker = /** @__PURE__ @class */ (function (_super) {
    __extends(DateTimePicker, _super);
    /**
     * Constructor for creating the widget
     */
    function DateTimePicker(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.valueWithMinutes = null;
        _this.scrollInvoked = false;
        _this.dateTimeOptions = options;
        return _this;
    }
    DateTimePicker.prototype.focusHandler = function () {
        if (!this.enabled) {
            return;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], INPUTFOCUS);
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    DateTimePicker.prototype.focusIn = function () {
        _super.prototype.focusIn.call(this);
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    DateTimePicker.prototype.focusOut = function () {
        if (document.activeElement === this.inputElement) {
            this.inputElement.blur();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [INPUTFOCUS]);
        }
    };
    DateTimePicker.prototype.blurHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        // IE popup closing issue when click over the scrollbar
        if (this.isTimePopupOpen() && this.isPreventBlur) {
            this.inputElement.focus();
            return;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], INPUTFOCUS);
        var blurArguments = {
            model: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this
        };
        if (this.isTimePopupOpen()) {
            this.hide(e);
        }
        this.trigger('blur', blurArguments);
    };
    /**
     * To destroy the widget.
     * @returns void
     */
    DateTimePicker.prototype.destroy = function () {
        if (this.popupObject && this.popupObject.element.classList.contains(POPUP)) {
            this.popupObject.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.dateTimeWrapper);
            this.dateTimeWrapper = undefined;
            this.liCollections = this.timeCollections = [];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.rippleFn)) {
                this.rippleFn();
            }
        }
        var ariaAttribute = {
            'aria-live': 'assertive', 'aria-atomic': 'true', 'aria-invalid': 'false',
            'aria-haspopup': 'true', 'aria-activedescendant': 'null',
            'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false',
            'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off'
        };
        if (this.inputElement) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeAttributes(ariaAttribute, this.inputElement);
            this.inputElement.removeAttribute('aria-placeholder');
        }
        if (this.isCalendar()) {
            if (this.popupWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.popupWrapper);
            }
            this.popupObject = this.popupWrapper = null;
            this.keyboardHandler.destroy();
        }
        this.unBindInputEvents();
        _super.prototype.destroy.call(this);
    };
    /**
     * To Initialize the control rendering.
     * @return void
     * @private
     */
    DateTimePicker.prototype.render = function () {
        this.timekeyConfigure = {
            enter: 'enter',
            escape: 'escape',
            end: 'end',
            tab: 'tab',
            home: 'home',
            down: 'downarrow',
            up: 'uparrow',
            left: 'leftarrow',
            right: 'rightarrow',
            open: 'alt+downarrow',
            close: 'alt+uparrow'
        };
        this.valueWithMinutes = null;
        this.previousDateTime = null;
        this.isPreventBlur = false;
        this.cloneElement = this.element.cloneNode(true);
        this.dateTimeFormat = this.cldrDateTimeFormat();
        this.initValue = this.value;
        _super.prototype.updateHtmlAttributeToElement.call(this);
        this.checkAttributes(false);
        var localeText = { placeholder: this.placeholder };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('datetimepicker', localeText, this.locale);
        this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
        _super.prototype.render.call(this);
        this.createInputElement();
        _super.prototype.updateHtmlAttributeToWrapper.call(this);
        this.bindInputEvents();
        this.setValue();
        this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(this.scrollTo))) }, true);
        this.previousDateTime = this.value && new Date(+this.value);
        if (this.element.tagName === 'EJS-DATETIMEPICKER') {
            this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
            this.element.removeAttribute('tabindex');
            if (!this.enabled) {
                this.inputElement.tabIndex = -1;
            }
        }
        this.renderComplete();
    };
    DateTimePicker.prototype.setValue = function () {
        this.initValue = this.validateMinMaxRange(this.value);
        if (!this.strictMode && this.isDateObject(this.initValue)) {
            var value = this.validateMinMaxRange(this.initValue);
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(this.getFormattedValue(value), this.inputElement, this.floatLabelType, this.showClearButton);
            this.setProperties({ value: value }, true);
        }
        else {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                this.initValue = null;
                this.setProperties({ value: null }, true);
            }
        }
        this.valueWithMinutes = this.value;
        _super.prototype.updateInput.call(this);
    };
    DateTimePicker.prototype.validateMinMaxRange = function (value) {
        var result = value;
        if (this.isDateObject(value)) {
            result = this.validateValue(value);
        }
        else {
            if (+this.min > +this.max) {
                this.disablePopupButton(true);
            }
        }
        this.checkValidState(result);
        return result;
    };
    DateTimePicker.prototype.checkValidState = function (value) {
        this.isValidState = true;
        if (!this.strictMode) {
            if ((+(value) > +(this.max)) || (+(value) < +(this.min))) {
                this.isValidState = false;
            }
        }
        this.checkErrorState();
    };
    DateTimePicker.prototype.checkErrorState = function () {
        if (this.isValidState) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], ERROR);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], ERROR);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': this.isValidState ? 'false' : 'true' });
    };
    DateTimePicker.prototype.validateValue = function (value) {
        var dateVal = value;
        if (this.strictMode) {
            if (+this.min > +this.max) {
                this.disablePopupButton(true);
                dateVal = this.max;
            }
            else if (+value < +this.min) {
                dateVal = this.min;
            }
            else if (+value > +this.max) {
                dateVal = this.max;
            }
        }
        else {
            if (+this.min > +this.max) {
                this.disablePopupButton(true);
                dateVal = value;
            }
        }
        return dateVal;
    };
    DateTimePicker.prototype.disablePopupButton = function (isDisable) {
        if (isDisable) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.buttons[0], this.timeIcon], DISABLED);
            this.hide();
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.buttons[0], this.timeIcon], DISABLED);
        }
    };
    DateTimePicker.prototype.getFormattedValue = function (value) {
        var dateOptions;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            if (this.calendarMode === 'Gregorian') {
                dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
            }
            else {
                dateOptions = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: 'yMd', calendar: 'islamic' };
            }
            return this.globalize.formatDate(value, dateOptions);
        }
        else {
            return null;
        }
    };
    DateTimePicker.prototype.isDateObject = function (value) {
        return (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && !isNaN(+value)) ? true : false;
    };
    DateTimePicker.prototype.createInputElement = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputElement], DATEPICKERROOT);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], DATEWRAPPER);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], DATETIMEWRAPPER);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputElement], ROOT);
        this.renderTimeIcon();
    };
    DateTimePicker.prototype.renderTimeIcon = function () {
        this.timeIcon = _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].appendSpan(INPUTWRAPPER + ' ' + TIMEICON + ' ' + ICONS, this.inputWrapper.container);
    };
    DateTimePicker.prototype.bindInputEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.timeIcon, 'mousedown', this.timeHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown', this.dateHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'blur', this.blurHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'focus', this.focusHandler, this);
        this.defaultKeyConfigs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.defaultKeyConfigs, this.keyConfigs);
        this.keyboardHandler = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputElement, {
            eventName: 'keydown',
            keyAction: this.inputKeyAction.bind(this),
            keyConfigs: this.defaultKeyConfigs
        });
    };
    DateTimePicker.prototype.unBindInputEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.timeIcon, 'mousedown touchstart', this.timeHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown touchstart', this.dateHandler);
        if (this.inputElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.blurHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.focusHandler);
        }
        if (this.keyboardHandler) {
            this.keyboardHandler.destroy();
        }
    };
    DateTimePicker.prototype.cldrTimeFormat = function () {
        var cldrTime;
        if (this.isNullOrEmpty(this.timeFormat)) {
            if (this.locale === 'en' || this.locale === 'en-US') {
                cldrTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('t', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.locale, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))).replace(/tt/, 'a') :
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
            }
            else {
                cldrTime = (this.getCultureTimeObject(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
            }
        }
        else {
            cldrTime = this.timeFormat;
        }
        return cldrTime;
    };
    DateTimePicker.prototype.cldrDateTimeFormat = function () {
        var cldrTime;
        var culture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        var dateFormat = culture.getDatePattern({ skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' });
        if (this.isNullOrEmpty(this.formatString)) {
            cldrTime = dateFormat + ' ' + this.getCldrFormat('time');
        }
        else {
            cldrTime = this.formatString;
        }
        return cldrTime;
    };
    DateTimePicker.prototype.getCldrFormat = function (type) {
        var cldrDateTime;
        if (this.locale === 'en' || this.locale === 'en-US') {
            cldrDateTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('t', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.locale, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))).replace(/tt/, 'a') :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
        }
        else {
            cldrDateTime = (this.getCultureTimeObject(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
        }
        return cldrDateTime;
    };
    DateTimePicker.prototype.isNullOrEmpty = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) || (typeof value === 'string' && value.trim() === '')) {
            return true;
        }
        else {
            return false;
        }
    };
    DateTimePicker.prototype.getCultureTimeObject = function (ld, c) {
        if (this.calendarMode === 'Gregorian') {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('t', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.locale, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))).replace(/tt/, 'a') :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.short', ld));
        }
        else {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.locale + '.dates.calendars.islamic.timeFormats.short', ld);
        }
    };
    DateTimePicker.prototype.timeHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        this.isIconClicked = true;
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.inputElement.setAttribute('readonly', '');
        }
        if (e.currentTarget === this.timeIcon) {
            e.preventDefault();
        }
        if (this.enabled && !this.readonly) {
            if (this.isDatePopupOpen()) {
                _super.prototype.hide.call(this, e);
            }
            if (this.isTimePopupOpen()) {
                this.closePopup(e);
            }
            else {
                this.inputElement.focus();
                this.popupCreation('time', e);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [INPUTFOCUS]);
            }
        }
        this.isIconClicked = false;
    };
    DateTimePicker.prototype.dateHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (e.currentTarget === this.inputWrapper.buttons[0]) {
            e.preventDefault();
        }
        if (this.enabled && !this.readonly) {
            if (this.isTimePopupOpen()) {
                this.closePopup(e);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
                this.popupCreation('date', e);
            }
        }
    };
    DateTimePicker.prototype.show = function (type, e) {
        if ((this.enabled && this.readonly) || !this.enabled) {
            return;
        }
        else {
            if (type === 'time' && !this.dateTimeWrapper) {
                if (this.isDatePopupOpen()) {
                    this.hide(e);
                }
                this.popupCreation('time', e);
            }
            else if (!this.popupObj) {
                if (this.isTimePopupOpen()) {
                    this.hide(e);
                }
                _super.prototype.show.call(this);
                this.popupCreation('date', e);
            }
        }
    };
    DateTimePicker.prototype.toggle = function (e) {
        if (this.isDatePopupOpen()) {
            _super.prototype.hide.call(this, e);
            this.show('time', null);
        }
        else if (this.isTimePopupOpen()) {
            this.hide(e);
            _super.prototype.show.call(this, null, e);
            this.popupCreation('date', null);
        }
        else {
            this.show(null, e);
        }
    };
    DateTimePicker.prototype.listCreation = function () {
        var dateObject;
        if (this.calendarMode === 'Gregorian') {
            dateObject = this.globalize.parseDate(this.inputElement.value, {
                format: this.cldrDateTimeFormat(), type: 'datetime'
            });
        }
        else {
            dateObject = this.globalize.parseDate(this.inputElement.value, {
                format: this.cldrDateTimeFormat(), type: 'datetime', calendar: 'islamic'
            });
        }
        var value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? this.inputElement.value !== '' ?
            dateObject :
            new Date() : this.value;
        this.valueWithMinutes = value;
        this.listWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
        var min = this.startTime(value);
        var max = this.endTime(value);
        var listDetails = _timepicker_timepicker__WEBPACK_IMPORTED_MODULE_4__["TimePickerBase"].createListItems(this.createElement, min, max, this.globalize, this.cldrTimeFormat(), this.step);
        this.timeCollections = listDetails.collection;
        this.listTag = listDetails.list;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options' });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([listDetails.list], this.listWrapper);
        this.wireTimeListEvents();
        var rippleModel = { duration: 300, selector: '.' + LISTCLASS };
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.listWrapper, rippleModel);
        this.liCollections = this.listWrapper.querySelectorAll('.' + LISTCLASS);
    };
    DateTimePicker.prototype.popupCreation = function (type, e) {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.element.setAttribute('readonly', 'readonly');
        }
        if (type === 'date') {
            if (!this.readonly && this.popupWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.popupWrapper], DATETIMEPOPUPWRAPPER);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.popupWrapper, { 'id': this.element.id + '_datepopup' });
            }
        }
        else {
            if (!this.readonly) {
                this.dateTimeWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: ROOT + ' ' + POPUP,
                    attrs: { 'id': this.element.id + '_timepopup', 'style': 'visibility:hidden ; display:block' }
                });
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
                    this.dateTimeWrapper.className += ' ' + this.cssClass;
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.step) && this.step > 0) {
                    this.listCreation();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([this.listWrapper], this.dateTimeWrapper);
                }
                document.body.appendChild(this.dateTimeWrapper);
                this.addTimeSelection();
                this.renderPopup();
                this.setTimeScrollPosition();
                this.openPopup(e);
                this.popupObject.refreshPosition(this.inputElement);
            }
        }
    };
    DateTimePicker.prototype.openPopup = function (e) {
        var _this = this;
        this.preventArgs = {
            cancel: false,
            popup: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this.popupObject,
            event: e || null
        };
        var eventArgs = this.preventArgs;
        this.trigger('open', eventArgs, function (eventArgs) {
            _this.preventArgs = eventArgs;
            if (!_this.preventArgs.cancel && !_this.readonly) {
                var openAnimation = {
                    name: 'FadeIn',
                    duration: ANIMATIONDURATION,
                };
                if (_this.zIndex === 1000) {
                    _this.popupObject.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), _this.element);
                }
                else {
                    _this.popupObject.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), null);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.container], [ICONANIMATION]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.inputElement, { 'aria-expanded': 'true' });
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', _this.documentClickHandler, _this);
            }
        });
    };
    DateTimePicker.prototype.documentClickHandler = function (event) {
        var target = event.target;
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObject) && (this.inputWrapper.container.contains(target) ||
            (this.popupObject.element && this.popupObject.element.contains(target)))) && event.type !== 'touchstart') {
            event.preventDefault();
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '[id="' + (this.popupObject && this.popupObject.element.id + '"]'))) && target !== this.inputElement
            && target !== this.timeIcon && target !== this.inputWrapper.container) {
            if (this.isTimePopupOpen()) {
                this.hide(event);
                this.focusOut();
            }
        }
        else if (target !== this.inputElement) {
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.isPreventBlur = ((document.activeElement === this.inputElement) && (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'edge')
                    && target === this.popupObject.element);
            }
        }
    };
    DateTimePicker.prototype.isTimePopupOpen = function () {
        return (this.dateTimeWrapper && this.dateTimeWrapper.classList.contains('' + ROOT)) ? true : false;
    };
    DateTimePicker.prototype.isDatePopupOpen = function () {
        return (this.popupWrapper && this.popupWrapper.classList.contains('' + DATETIMEPOPUPWRAPPER)) ? true : false;
    };
    DateTimePicker.prototype.renderPopup = function () {
        var _this = this;
        this.containerStyle = this.inputWrapper.container.getBoundingClientRect();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.timeModal = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
            this.timeModal.className = '' + ROOT + ' e-time-modal';
            document.body.className += ' ' + OVERFLOW;
            this.timeModal.style.display = 'block';
            document.body.appendChild(this.timeModal);
        }
        var offset = 4;
        this.popupObject = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](this.dateTimeWrapper, {
            width: this.setPopupWidth(),
            zIndex: this.zIndex,
            targetType: 'container',
            collision: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'fit', Y: 'fit' } : { X: 'flip', Y: 'flip' },
            relateTo: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? document.body : this.inputWrapper.container,
            position: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },
            enableRtl: this.enableRtl,
            offsetY: offset,
            open: function () {
                _this.dateTimeWrapper.style.visibility = 'visible';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.timeIcon], ACTIVE);
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.timekeyConfigure = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.timekeyConfigure, _this.keyConfigs);
                    _this.inputEvent = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](_this.inputWrapper.container, {
                        keyAction: _this.TimeKeyActionHandle.bind(_this),
                        keyConfigs: _this.timekeyConfigure,
                        eventName: 'keydown'
                    });
                }
            }, close: function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.timeIcon], ACTIVE);
                _this.unWireTimeListEvents();
                _this.inputElement.setAttribute('aria-activedescendant', 'null');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(_this.popupObject.element);
                _this.popupObject.destroy();
                _this.dateTimeWrapper.innerHTML = '';
                _this.listWrapper = _this.dateTimeWrapper = undefined;
                if (_this.inputEvent) {
                    _this.inputEvent.destroy();
                }
            }, targetExitViewport: function () {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.hide();
                }
            }
        });
        this.popupObject.element.style.maxHeight = POPUPDIMENSION;
    };
    DateTimePicker.prototype.setDimension = function (width) {
        if (typeof width === 'number') {
            width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else if (typeof width === 'string') {
            width = width;
        }
        else {
            width = '100%';
        }
        return width;
    };
    DateTimePicker.prototype.setPopupWidth = function () {
        var width = this.setDimension(this.width);
        if (width.indexOf('%') > -1) {
            var inputWidth = this.containerStyle.width * parseFloat(width) / 100;
            width = inputWidth.toString() + 'px';
        }
        return width;
    };
    DateTimePicker.prototype.wireTimeListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'click', this.onMouseClick, this);
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseover', this.onMouseOver, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseout', this.onMouseLeave, this);
        }
    };
    DateTimePicker.prototype.unWireTimeListEvents = function () {
        if (this.listWrapper) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.listWrapper, 'click', this.onMouseClick);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.documentClickHandler);
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseover', this.onMouseOver, this);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseout', this.onMouseLeave, this);
            }
        }
    };
    DateTimePicker.prototype.onMouseOver = function (event) {
        var currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + LISTCLASS);
        this.setTimeHover(currentLi, HOVER);
    };
    DateTimePicker.prototype.onMouseLeave = function () {
        this.removeTimeHover(HOVER);
    };
    DateTimePicker.prototype.setTimeHover = function (li, className) {
        if (this.enabled && this.isValidLI(li) && !li.classList.contains(className)) {
            this.removeTimeHover(className);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], className);
        }
    };
    DateTimePicker.prototype.getPopupHeight = function () {
        var height = parseInt(POPUPDIMENSION, 10);
        var popupHeight = this.dateTimeWrapper.getBoundingClientRect().height;
        return popupHeight > height ? height : popupHeight;
    };
    DateTimePicker.prototype.changeEvent = function (e) {
        if ((this.value && this.value.valueOf()) !== (this.previousDateTime && +this.previousDateTime.valueOf())) {
            _super.prototype.changeEvent.call(this, e);
            this.valueWithMinutes = this.value;
            this.setInputValue('date');
            this.previousDateTime = this.value && new Date(+this.value);
        }
    };
    DateTimePicker.prototype.updateValue = function (e) {
        this.setInputValue('time');
        if (+this.previousDateTime !== +this.value) {
            this.changedArgs = {
                value: this.value, event: e || null,
                isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e),
                element: this.element
            };
            this.addTimeSelection();
            this.trigger('change', this.changedArgs);
            this.previousDateTime = this.value;
        }
    };
    DateTimePicker.prototype.setTimeScrollPosition = function () {
        var popupElement;
        popupElement = this.selectedElement;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popupElement)) {
            this.findScrollTop(popupElement);
        }
        else if (this.dateTimeWrapper && this.checkDateValue(this.scrollTo)) {
            this.setScrollTo();
        }
    };
    DateTimePicker.prototype.findScrollTop = function (element) {
        var listHeight = this.getPopupHeight();
        var nextElement = element.nextElementSibling;
        var height = nextElement ? nextElement.offsetTop : element.offsetTop;
        var lineHeight = element.getBoundingClientRect().height;
        if ((height + element.offsetTop) > listHeight) {
            this.dateTimeWrapper.scrollTop = nextElement ? (height - (listHeight / HALFPOSITION + lineHeight / HALFPOSITION)) : height;
        }
        else {
            this.dateTimeWrapper.scrollTop = 0;
        }
    };
    DateTimePicker.prototype.setScrollTo = function () {
        var element;
        var items = this.dateTimeWrapper.querySelectorAll('.' + LISTCLASS);
        if (items.length >= 0) {
            this.scrollInvoked = true;
            var initialTime = this.timeCollections[0];
            var scrollTime = this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();
            element = items[Math.round((scrollTime - initialTime) / (this.step * 60000))];
        }
        else {
            this.dateTimeWrapper.scrollTop = 0;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            this.findScrollTop(element);
        }
        else {
            this.dateTimeWrapper.scrollTop = 0;
        }
    };
    DateTimePicker.prototype.setInputValue = function (type) {
        if (type === 'date') {
            this.inputElement.value = this.previousElementValue = this.getFormattedValue(this.getFullDateTime());
            this.setProperties({ value: this.getFullDateTime() }, true);
        }
        else {
            var tempVal = this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(tempVal, this.inputElement, this.floatLabelType, this.showClearButton);
            this.previousElementValue = this.inputElement.value;
            this.setProperties({ value: new Date(this.timeCollections[this.activeIndex]) }, true);
        }
        this.updateIconState();
    };
    DateTimePicker.prototype.getFullDateTime = function () {
        var value = null;
        if (this.isDateObject(this.valueWithMinutes)) {
            value = this.combineDateTime(this.valueWithMinutes);
        }
        else {
            value = this.previousDate;
        }
        return this.validateMinMaxRange(value);
    };
    DateTimePicker.prototype.combineDateTime = function (value) {
        if (this.isDateObject(value)) {
            var day = this.previousDate.getDate();
            var month = this.previousDate.getMonth();
            var year = this.previousDate.getFullYear();
            var hour = value.getHours();
            var minutes = value.getMinutes();
            var seconds = value.getSeconds();
            return new Date(year, month, day, hour, minutes, seconds);
        }
        else {
            return this.previousDate;
        }
    };
    DateTimePicker.prototype.onMouseClick = function (event) {
        var target = event.target;
        var li = this.selectedElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTCLASS);
        if (li && li.classList.contains(LISTCLASS)) {
            this.timeValue = li.getAttribute('data-value');
            this.hide(event);
        }
        this.setSelection(li, event);
    };
    DateTimePicker.prototype.setSelection = function (li, event) {
        if (this.isValidLI(li) && !li.classList.contains(ACTIVE)) {
            var value = li.getAttribute('data-value');
            this.selectedElement = li;
            var index = Array.prototype.slice.call(this.liCollections).indexOf(li);
            this.activeIndex = index;
            this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.selectedElement], ACTIVE);
            this.selectedElement.setAttribute('aria-selected', 'true');
            this.updateValue(event);
        }
    };
    DateTimePicker.prototype.setTimeActiveClass = function () {
        var collections = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeWrapper) ? this.listWrapper : this.dateTimeWrapper;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(collections)) {
            var items = collections.querySelectorAll('.' + LISTCLASS);
            if (items.length) {
                for (var i = 0; i < items.length; i++) {
                    if (this.timeCollections[i] === +(this.valueWithMinutes)) {
                        items[i].setAttribute('aria-selected', 'true');
                        this.selectedElement = items[i];
                        this.activeIndex = i;
                        this.setTimeActiveDescendant();
                        break;
                    }
                }
            }
        }
    };
    DateTimePicker.prototype.setTimeActiveDescendant = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedElement)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': this.selectedElement.getAttribute('id') });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': 'null' });
        }
    };
    DateTimePicker.prototype.addTimeSelection = function () {
        this.selectedElement = null;
        this.removeTimeSelection();
        this.setTimeActiveClass();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedElement)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.selectedElement], ACTIVE);
            this.selectedElement.setAttribute('aria-selected', 'true');
        }
    };
    DateTimePicker.prototype.removeTimeSelection = function () {
        this.removeTimeHover(HOVER);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeWrapper)) {
            var items = this.dateTimeWrapper.querySelectorAll('.' + ACTIVE);
            if (items.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(items, ACTIVE);
                items[0].removeAttribute('aria-selected');
            }
        }
    };
    DateTimePicker.prototype.removeTimeHover = function (className) {
        var hoveredItem = this.getTimeHoverItem(className);
        if (hoveredItem && hoveredItem.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(hoveredItem, className);
        }
    };
    DateTimePicker.prototype.getTimeHoverItem = function (className) {
        var collections = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeWrapper) ? this.listWrapper : this.dateTimeWrapper;
        var hoveredItem;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(collections)) {
            hoveredItem = collections.querySelectorAll('.' + className);
        }
        return hoveredItem;
    };
    DateTimePicker.prototype.isValidLI = function (li) {
        return (li && li.classList.contains(LISTCLASS) && !li.classList.contains(DISABLED));
    };
    DateTimePicker.prototype.calculateStartEnd = function (value, range, method) {
        var day = value.getDate();
        var month = value.getMonth();
        var year = value.getFullYear();
        var hours = value.getHours();
        var minutes = value.getMinutes();
        var seconds = value.getSeconds();
        var milliseconds = value.getMilliseconds();
        if (range) {
            if (method === 'starttime') {
                return new Date(year, month, day, 0, 0, 0);
            }
            else {
                return new Date(year, month, day, 23, 59, 59);
            }
        }
        else {
            return new Date(year, month, day, hours, minutes, seconds, milliseconds);
        }
    };
    DateTimePicker.prototype.startTime = function (date) {
        var tempStartValue;
        var start;
        var tempMin = this.min;
        var value;
        value = date === null ? new Date() : date;
        if ((+value.getDate() === +tempMin.getDate() && +value.getMonth() === +tempMin.getMonth() &&
            +value.getFullYear() === +tempMin.getFullYear()) || ((+new Date(value.getFullYear(), value.getMonth(), value.getDate())) <=
            +new Date(tempMin.getFullYear(), tempMin.getMonth(), tempMin.getDate()))) {
            start = false;
            tempStartValue = this.min;
        }
        else if (+value < +this.max && +value > +this.min) {
            start = true;
            tempStartValue = value;
        }
        else if (+value >= +this.max) {
            start = true;
            tempStartValue = this.max;
        }
        return this.calculateStartEnd(tempStartValue, start, 'starttime');
    };
    DateTimePicker.prototype.endTime = function (date) {
        var tempEndValue;
        var end;
        var tempMax = this.max;
        var value;
        value = date === null ? new Date() : date;
        if ((+value.getDate() === +tempMax.getDate() && +value.getMonth() === +tempMax.getMonth() &&
            +value.getFullYear() === +tempMax.getFullYear()) || (+new Date(value.getUTCFullYear(), value.getMonth(), value.getDate()) >=
            +new Date(tempMax.getFullYear(), tempMax.getMonth(), tempMax.getDate()))) {
            end = false;
            tempEndValue = this.max;
        }
        else if (+value < +this.max && +value > +this.min) {
            end = true;
            tempEndValue = value;
        }
        else if (+value <= +this.min) {
            end = true;
            tempEndValue = this.min;
        }
        return this.calculateStartEnd(tempEndValue, end, 'endtime');
    };
    DateTimePicker.prototype.hide = function (e) {
        var _this = this;
        if (this.popupObj || this.dateTimeWrapper) {
            this.preventArgs = {
                cancel: false,
                popup: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this.popupObj || this.popupObject,
                event: e || null
            };
            var eventArgs = this.preventArgs;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj)) {
                this.trigger('close', eventArgs, function (eventArgs) {
                    _this.dateTimeCloseEventCallback(e, eventArgs);
                });
            }
            else {
                this.dateTimeCloseEventCallback(e, eventArgs);
            }
        }
        else {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.allowEdit && !this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
            this.setAllowEdit();
        }
    };
    DateTimePicker.prototype.dateTimeCloseEventCallback = function (e, eventArgs) {
        this.preventArgs = eventArgs;
        if (!this.preventArgs.cancel) {
            if (this.isDatePopupOpen()) {
                _super.prototype.hide.call(this, e);
            }
            else if (this.isTimePopupOpen()) {
                this.closePopup(e);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], OVERFLOW);
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.timeModal) {
                    this.timeModal.style.display = 'none';
                    this.timeModal.outerHTML = '';
                    this.timeModal = null;
                }
                this.setTimeActiveDescendant();
            }
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.allowEdit && !this.readonly) {
            this.inputElement.removeAttribute('readonly');
        }
        this.setAllowEdit();
    };
    DateTimePicker.prototype.closePopup = function (e) {
        if (this.isTimePopupOpen() && this.popupObject) {
            var animModel = {
                name: 'FadeOut',
                duration: ANIMATIONDURATION,
                delay: 0
            };
            this.popupObject.hide(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animModel));
            this.inputWrapper.container.classList.remove(ICONANIMATION);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-expanded': 'false' });
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.documentClickHandler);
        }
    };
    DateTimePicker.prototype.preRender = function () {
        this.checkFormat();
        this.dateTimeFormat = this.cldrDateTimeFormat();
        _super.prototype.preRender.call(this);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputElementCopy], [ROOT]);
    };
    ;
    DateTimePicker.prototype.getProperty = function (date, val) {
        if (val === 'min') {
            this.setProperties({ min: this.validateValue(date.min) }, true);
        }
        else {
            this.setProperties({ max: this.validateValue(date.max) }, true);
        }
    };
    DateTimePicker.prototype.checkAttributes = function (isDynamic) {
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['style', 'name', 'step', 'disabled', 'readonly', 'value', 'min', 'max', 'placeholder', 'type'];
        var value;
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute(prop))) {
                switch (prop) {
                    case 'name':
                        this.inputElement.setAttribute('name', this.inputElement.getAttribute(prop));
                        break;
                    case 'step':
                        this.step = parseInt(this.inputElement.getAttribute(prop), 10);
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.inputElement.getAttribute(prop) === 'disabled' ||
                                this.inputElement.getAttribute(prop) === '' ||
                                this.inputElement.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !isDynamic);
                        }
                        break;
                    case 'min':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['min'] === undefined)) || isDynamic) {
                            value = new Date(this.inputElement.getAttribute(prop));
                            if (!this.isNullOrEmpty(value) && !isNaN(+value)) {
                                this.setProperties({ min: value }, !isDynamic);
                            }
                        }
                        break;
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['enabled'] === undefined)) || isDynamic) {
                            var enabled = this.inputElement.getAttribute(prop) === 'disabled' ||
                                this.inputElement.getAttribute(prop) === 'true' ||
                                this.inputElement.getAttribute(prop) === '' ? false : true;
                            this.setProperties({ enabled: enabled }, !isDynamic);
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['value'] === undefined)) || isDynamic) {
                            value = new Date(this.inputElement.getAttribute(prop));
                            if (!this.isNullOrEmpty(value) && !isNaN(+value)) {
                                this.setProperties({ value: value }, !isDynamic);
                            }
                        }
                        break;
                    case 'max':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeOptions) || (this.dateTimeOptions['max'] === undefined)) || isDynamic) {
                            value = new Date(this.inputElement.getAttribute(prop));
                            if (!this.isNullOrEmpty(value) && !isNaN(+value)) {
                                this.setProperties({ max: value }, !isDynamic);
                            }
                        }
                        break;
                }
            }
        }
    };
    DateTimePicker.prototype.requiredModules = function () {
        var modules = [];
        if (this) {
            modules.push({ args: [this], member: 'islamic' });
        }
        return modules;
    };
    DateTimePicker.prototype.getTimeActiveElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateTimeWrapper)) {
            return this.dateTimeWrapper.querySelectorAll('.' + ACTIVE);
        }
        else {
            return null;
        }
    };
    DateTimePicker.prototype.createDateObj = function (val) {
        return val instanceof Date ? val : null;
    };
    DateTimePicker.prototype.getDateObject = function (text) {
        if (!this.isNullOrEmpty(text)) {
            var dateValue = this.createDateObj(text);
            var value = this.valueWithMinutes;
            var status_1 = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value);
            if (this.checkDateValue(dateValue)) {
                var date = status_1 ? value.getDate() : DAY;
                var month = status_1 ? value.getMonth() : MONTH;
                var year = status_1 ? value.getFullYear() : YEAR;
                var hour = status_1 ? value.getHours() : HOUR;
                var minute = status_1 ? value.getMinutes() : MINUTE;
                var second = status_1 ? value.getSeconds() : SECOND;
                var millisecond = status_1 ? value.getMilliseconds() : MILLISECOND;
                if (!this.scrollInvoked) {
                    return new Date(year, month, date, hour, minute, second, millisecond);
                }
                else {
                    this.scrollInvoked = false;
                    return new Date(year, month, date, dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds(), dateValue.getMilliseconds());
                }
            }
        }
        return null;
    };
    DateTimePicker.prototype.findNextTimeElement = function (event) {
        var textVal = (this.inputElement).value;
        var value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.valueWithMinutes) ? this.createDateObj(textVal) :
            this.getDateObject(this.valueWithMinutes);
        var dateTimeVal = null;
        var listCount = this.liCollections.length;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            if (event.action === 'home') {
                dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[0])));
                this.activeIndex = 0;
            }
            else if (event.action === 'end') {
                dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[this.timeCollections.length - 1])));
                this.activeIndex = this.timeCollections.length - 1;
            }
            else {
                if (event.action === 'down') {
                    for (var i = 0; i < listCount; i++) {
                        if (+value < this.timeCollections[i]) {
                            dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[i])));
                            this.activeIndex = i;
                            break;
                        }
                    }
                }
                else {
                    for (var i = listCount - 1; i >= 0; i--) {
                        if (+value > this.timeCollections[i]) {
                            dateTimeVal = +(this.createDateObj(new Date(this.timeCollections[i])));
                            this.activeIndex = i;
                            break;
                        }
                    }
                }
            }
            this.selectedElement = this.liCollections[this.activeIndex];
            this.timeElementValue(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dateTimeVal) ? null : new Date(dateTimeVal));
        }
    };
    DateTimePicker.prototype.setTimeValue = function (date, value) {
        var dateString;
        var time;
        var val = this.validateMinMaxRange(value);
        var newval = this.createDateObj(val);
        if (this.getFormattedValue(newval) !== (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? this.getFormattedValue(this.value) : null)) {
            this.valueWithMinutes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newval) ? null : newval;
            time = new Date(+this.valueWithMinutes);
        }
        else {
            if (this.strictMode) {
                //for strict mode case, when value not present within a range. Reset the nearest range value.
                date = newval;
            }
            this.valueWithMinutes = this.checkDateValue(date);
            time = new Date(+this.valueWithMinutes);
        }
        if (this.calendarMode === 'Gregorian') {
            dateString = this.globalize.formatDate(time, {
                format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.cldrDateTimeFormat(),
                type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
            });
        }
        else {
            dateString = this.globalize.formatDate(time, {
                format: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formatString) ? this.formatString : this.cldrDateTimeFormat(),
                type: 'dateTime', skeleton: 'yMd', calendar: 'islamic'
            });
        }
        if (!this.strictMode && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(time)) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(dateString, this.inputElement, this.floatLabelType, this.showClearButton);
        }
        else {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(dateString, this.inputElement, this.floatLabelType, this.showClearButton);
        }
        return time;
    };
    DateTimePicker.prototype.timeElementValue = function (value) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value)) && !this.isNullOrEmpty(value)) {
            var date = value instanceof Date ? value : this.getDateObject(value);
            return this.setTimeValue(date, value);
        }
        return null;
    };
    DateTimePicker.prototype.timeKeyHandler = function (event) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.step) || this.step <= 0) {
            return;
        }
        var listCount = this.timeCollections.length;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.getTimeActiveElement()) || this.getTimeActiveElement().length === 0) {
            if (this.liCollections.length > 0) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex)) {
                    this.activeIndex = 0;
                    this.selectedElement = this.liCollections[0];
                    this.timeElementValue(new Date(this.timeCollections[0]));
                }
                else {
                    this.findNextTimeElement(event);
                }
            }
        }
        else {
            var nextItemValue = void 0;
            if ((event.keyCode >= 37) && (event.keyCode <= 40)) {
                var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;
                this.activeIndex = index = this.activeIndex === (listCount) ? 0 : this.activeIndex;
                this.activeIndex = index = this.activeIndex < 0 ? (listCount - 1) : this.activeIndex;
                nextItemValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];
            }
            else if (event.action === 'home') {
                this.activeIndex = 0;
                nextItemValue = this.timeCollections[0];
            }
            else if (event.action === 'end') {
                this.activeIndex = listCount - 1;
                nextItemValue = this.timeCollections[listCount - 1];
            }
            this.selectedElement = this.liCollections[this.activeIndex];
            this.timeElementValue(new Date(nextItemValue));
        }
        this.isNavigate = true;
        this.setTimeHover(this.selectedElement, NAVIGATION);
        this.setTimeActiveDescendant();
        if (this.isTimePopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {
            this.setTimeScrollPosition();
        }
    };
    DateTimePicker.prototype.TimeKeyActionHandle = function (event) {
        if (this.enabled) {
            if (event.action !== 'right' && event.action !== 'left' && event.action !== 'tab') {
                event.preventDefault();
            }
            switch (event.action) {
                case 'up':
                case 'down':
                case 'home':
                case 'end':
                    this.timeKeyHandler(event);
                    break;
                case 'enter':
                    if (this.isNavigate) {
                        this.selectedElement = this.liCollections[this.activeIndex];
                        this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
                        this.setInputValue('time');
                        if (+this.previousDateTime !== +this.value) {
                            this.changedArgs.value = this.value;
                            this.addTimeSelection();
                            this.previousDateTime = this.value;
                        }
                    }
                    else {
                        this.updateValue(event);
                    }
                    this.hide(event);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], INPUTFOCUS);
                    this.isNavigate = false;
                    event.stopPropagation();
                    break;
                case 'escape':
                    this.hide(event);
                    break;
                default:
                    this.isNavigate = false;
                    break;
            }
        }
    };
    DateTimePicker.prototype.inputKeyAction = function (event) {
        switch (event.action) {
            case 'altDownArrow':
                this.strictModeUpdate();
                this.updateInput();
                this.toggle(event);
                break;
        }
    };
    /**
     * Called internally if any of the property value changed.
     * returns void

     */
    DateTimePicker.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'value':
                    this.isDynamicValueChanged = true;
                    var options = { format: this.cldrDateTimeFormat(), type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' };
                    this.invalidValueString = null;
                    this.checkInvalidValue(newProp.value);
                    newProp.value = this.value;
                    newProp.value = this.validateValue(newProp.value);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(this.getFormattedValue(newProp.value), this.inputElement, this.floatLabelType, this.showClearButton);
                    this.valueWithMinutes = newProp.value;
                    this.setProperties({ value: newProp.value }, true);
                    if (this.popupObj) {
                        this.popupUpdate();
                    }
                    this.previousDateTime = new Date(this.inputElement.value);
                    this.updateInput();
                    this.changeTrigger(null);
                    break;
                case 'min':
                case 'max':
                    this.getProperty(newProp, prop);
                    this.updateInput();
                    break;
                case 'enableRtl':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnableRtl(this.enableRtl, [this.inputWrapper.container]);
                    break;
                case 'cssClass':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.cssClass)) {
                        oldProp.cssClass = (oldProp.cssClass.replace(/\s+/g, ' ')).trim();
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.cssClass)) {
                        newProp.cssClass = (newProp.cssClass.replace(/\s+/g, ' ')).trim();
                    }
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newProp.cssClass, [this.inputWrapper.container], oldProp.cssClass);
                    if (this.dateTimeWrapper) {
                        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newProp.cssClass, [this.dateTimeWrapper], oldProp.cssClass);
                    }
                    break;
                case 'locale':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.l10n.setLocale(this.locale);
                    this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);
                    this.dateTimeFormat = this.cldrDateTimeFormat();
                    _super.prototype.updateInput.call(this);
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttributeToElement();
                    this.updateHtmlAttributeToWrapper();
                    this.checkAttributes(true);
                    break;
                case 'format':
                    this.setProperties({ format: newProp.format }, true);
                    this.checkFormat();
                    this.dateTimeFormat = this.formatString;
                    this.setValue();
                    break;
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(newProp.placeholder, this.inputElement);
                    this.inputElement.setAttribute('aria-placeholder', newProp.placeholder);
                    break;
                case 'enabled':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnabled(this.enabled, this.inputElement);
                    if (!this.enabled) {
                        this.inputElement.tabIndex = -1;
                    }
                    break;
                case 'strictMode':
                    this.invalidValueString = null;
                    this.updateInput();
                    break;
                case 'width':
                    this.setWidth(newProp.width);
                    break;
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setReadonly(this.readonly, this.inputElement);
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeFloating(this.inputWrapper);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addFloating(this.inputElement, this.floatLabelType, this.placeholder);
                    break;
                case 'scrollTo':
                    if (this.checkDateValue(new Date(this.checkValue(newProp.scrollTo)))) {
                        if (this.dateTimeWrapper) {
                            this.setScrollTo();
                        }
                        this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkValue(newProp.scrollTo))) }, true);
                    }
                    else {
                        this.setProperties({ scrollTo: null }, true);
                    }
                    break;
                default:
                    _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
                    break;
            }
            if (!this.isDynamicValueChanged) {
                this.hide(null);
            }
            this.isDynamicValueChanged = false;
            this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
        }
    };
    /**
     * To get component name.
     * @private
     */
    DateTimePicker.prototype.getModuleName = function () {
        return 'datetimepicker';
    };
    DateTimePicker.prototype.restoreValue = function () {
        this.previousDateTime = this.previousDate;
        this.currentDate = this.value ? this.value : new Date();
        this.valueWithMinutes = this.value;
        this.previousDate = this.value;
        this.previousElementValue = this.previousElementValue = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputValueCopy)) ? '' :
            this.getFormattedValue(this.inputValueCopy);
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "timeFormat", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(30)
    ], DateTimePicker.prototype, "step", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "scrollTo", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], DateTimePicker.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], DateTimePicker.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateTimePicker.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateTimePicker.prototype, "allowEdit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateTimePicker.prototype, "isMultiSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "values", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateTimePicker.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateTimePicker.prototype, "strictMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "serverTimezoneOffset", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(1900, 0, 1))
    ], DateTimePicker.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(2099, 11, 31))
    ], DateTimePicker.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DateTimePicker.prototype, "firstDayOfWeek", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Gregorian')
    ], DateTimePicker.prototype, "calendarMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], DateTimePicker.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Month')
    ], DateTimePicker.prototype, "depth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateTimePicker.prototype, "weekNumber", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DateTimePicker.prototype, "showTodayButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Short')
    ], DateTimePicker.prototype, "dayHeaderFormat", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DateTimePicker.prototype, "openOnFocus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "cleared", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DateTimePicker.prototype, "destroyed", void 0);
    DateTimePicker = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DateTimePicker);
    return DateTimePicker;
}(_datepicker_datepicker__WEBPACK_IMPORTED_MODULE_3__["DatePicker"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/index.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/index.js ***!
  \*****************************************************************************/
/*! exports provided: DateTimePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _datetimepicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./datetimepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/datetimepicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return _datetimepicker__WEBPACK_IMPORTED_MODULE_0__["DateTimePicker"]; });

/**
 * DateTimePicker modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/index.js":
/*!**************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/index.js ***!
  \**************************************************************/
/*! exports provided: CalendarBase, Calendar, Islamic, DatePicker, TimePickerBase, TimePicker, DateTimePicker, Presets, DateRangePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _calendar_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar/index */ "./ej2-resources/18.4.46/scripts/ej2-calendars/calendar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CalendarBase", function() { return _calendar_index__WEBPACK_IMPORTED_MODULE_0__["CalendarBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Calendar", function() { return _calendar_index__WEBPACK_IMPORTED_MODULE_0__["Calendar"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return _calendar_index__WEBPACK_IMPORTED_MODULE_0__["Islamic"]; });

/* harmony import */ var _datepicker_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datepicker/index */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datepicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return _datepicker_index__WEBPACK_IMPORTED_MODULE_1__["DatePicker"]; });

/* harmony import */ var _daterangepicker_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./daterangepicker/index */ "./ej2-resources/18.4.46/scripts/ej2-calendars/daterangepicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Presets", function() { return _daterangepicker_index__WEBPACK_IMPORTED_MODULE_2__["Presets"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateRangePicker", function() { return _daterangepicker_index__WEBPACK_IMPORTED_MODULE_2__["DateRangePicker"]; });

/* harmony import */ var _timepicker_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./timepicker/index */ "./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePickerBase", function() { return _timepicker_index__WEBPACK_IMPORTED_MODULE_3__["TimePickerBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return _timepicker_index__WEBPACK_IMPORTED_MODULE_3__["TimePicker"]; });

/* harmony import */ var _datetimepicker_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datetimepicker/index */ "./ej2-resources/18.4.46/scripts/ej2-calendars/datetimepicker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return _datetimepicker_index__WEBPACK_IMPORTED_MODULE_4__["DateTimePicker"]; });

/**
 * Calendar all modules
 */







/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/index.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/index.js ***!
  \*************************************************************************/
/*! exports provided: TimePickerBase, TimePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _timepicker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timepicker */ "./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/timepicker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePickerBase", function() { return _timepicker__WEBPACK_IMPORTED_MODULE_0__["TimePickerBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return _timepicker__WEBPACK_IMPORTED_MODULE_0__["TimePicker"]; });

/**
 * TimePicker modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/timepicker.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-calendars/timepicker/timepicker.js ***!
  \******************************************************************************/
/*! exports provided: TimePickerBase, TimePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimePickerBase", function() { return TimePickerBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return TimePicker; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








var WRAPPERCLASS = 'e-time-wrapper';
var POPUP = 'e-popup';
var ERROR = 'e-error';
var POPUPDIMENSION = '240px';
var DAY = new Date().getDate();
var MONTH = new Date().getMonth();
var YEAR = new Date().getFullYear();
var ROOT = 'e-timepicker';
var LIBRARY = 'e-lib';
var CONTROL = 'e-control';
var RTL = 'e-rtl';
var CONTENT = 'e-content';
var SELECTED = 'e-active';
var HOVER = 'e-hover';
var NAVIGATION = 'e-navigation';
var DISABLED = 'e-disabled';
var ICONANIMATION = 'e-icon-anim';
var TIMEICON = 'e-time-icon';
var CLEARICON = 'e-clear-icon';
var FOCUS = 'e-input-focus';
var DEVICE = 'e-device';
var LISTCLASS = 'e-list-item';
var HALFPOSITION = 2;
var ANIMATIONDURATION = 50;
var OVERFLOW = 'e-time-overflow';
var OFFSETVAL = 4;
var EDITABLE = 'e-non-edit';
var wrapperAttributes = ['title', 'class', 'style'];
var TimePickerBase;
(function (TimePickerBase) {
    // tslint:disable-next-line
    function createListItems(createdEl, min, max, globalize, timeFormat, step) {
        var formatOptions;
        if (this.calendarMode === 'Gregorian') {
            formatOptions = { format: timeFormat, type: 'time' };
        }
        else {
            formatOptions = { format: timeFormat, type: 'time', calendar: 'islamic' };
        }
        var start;
        var end;
        var interval = step * 60000;
        var listItems = [];
        var timeCollections = [];
        start = +(min.setMilliseconds(0));
        end = +(max.setMilliseconds(0));
        while (end >= start) {
            timeCollections.push(start);
            listItems.push(globalize.formatDate(new Date(start), { format: timeFormat, type: 'time' }));
            start += interval;
        }
        var listTag = _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createList(createdEl, listItems, null, true);
        return { collection: timeCollections, list: listTag };
    }
    TimePickerBase.createListItems = createListItems;
})(TimePickerBase || (TimePickerBase = {}));
/**
 * TimePicker is an intuitive interface component which provides an options to select a time value
 * from popup list or to set a desired time value.
 * ```
 * <input id='timepicker' type='text'/>
 * <script>
 *   var timePickerObj = new TimePicker({ value: new Date() });
 *   timePickerObj.appendTo('#timepicker');
 * </script>
 * ```
 */
var TimePicker = /** @__PURE__ @class */ (function (_super) {
    __extends(TimePicker, _super);
    /**
     * Constructor for creating the widget
     */
    function TimePicker(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.liCollections = [];
        _this.timeCollections = [];
        _this.blazorTimeCollections = [];
        _this.disableItemCollection = [];
        _this.invalidValueString = null;
        _this.isBlazorServer = false;
        _this.isAngular = false;
        _this.preventChange = false;
        _this.timeOptions = options;
        return _this;
    }
    /**
     * Initialize the event handler
     * @private
     */
    TimePicker.prototype.preRender = function () {
        this.keyConfigure = {
            enter: 'enter',
            escape: 'escape',
            end: 'end',
            tab: 'tab',
            home: 'home',
            down: 'downarrow',
            up: 'uparrow',
            left: 'leftarrow',
            right: 'rightarrow',
            open: 'alt+downarrow',
            close: 'alt+uparrow'
        };
        this.cloneElement = this.element.cloneNode(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.cloneElement], [ROOT, CONTROL, LIBRARY]);
        this.inputElement = this.element;
        this.angularTag = null;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        this.isBlazorServer = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.getModuleName() === 'timepicker') ? true : false;
        if (!this.isBlazorServer) {
            if (this.element.tagName === 'EJS-TIMEPICKER') {
                this.angularTag = this.element.tagName;
                this.inputElement = this.createElement('input');
                this.element.appendChild(this.inputElement);
            }
            this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
            this.element.removeAttribute('tabindex');
            this.openPopupEventArgs = {
                appendTo: document.body
            };
        }
    };
    // element creation
    TimePicker.prototype.render = function () {
        if (!this.isBlazorServer) {
            this.initialize();
            this.createInputElement();
            this.updateHtmlAttributeToWrapper();
            this.setTimeAllowEdit();
            this.setEnable();
            this.validateInterval();
        }
        else {
            this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            this.defaultCulture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"]('en');
            this.checkTimeFormat();
            var parentElement = this.element.parentElement;
            this.inputWrapper = {
                container: parentElement,
                clearButton: parentElement.querySelector('.' + CLEARICON),
                buttons: [parentElement.querySelector('.' + TIMEICON)]
            };
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].bindInitialEvent({
                element: this.inputElement,
                floatLabelType: this.floatLabelType
            });
            if (this.showClearButton && this.inputWrapper.clearButton) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].wireClearBtnEvents(this.inputElement, this.inputWrapper.clearButton, this.inputWrapper.container);
            }
        }
        this.bindEvents();
        if (!this.isBlazorServer) {
            this.validateDisable();
            this.setValue(this.getFormattedValue(this.value));
        }
        this.anchor = this.inputElement;
        this.inputElement.setAttribute('value', this.inputElement.value);
        if (!this.isBlazorServer) {
            this.inputEleValue = this.getDateObject(this.inputElement.value);
        }
        this.renderComplete();
    };
    TimePicker.prototype.setTimeAllowEdit = function () {
        if (this.allowEdit) {
            if (!this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'readonly': '' });
        }
        this.clearIconState();
    };
    TimePicker.prototype.clearIconState = function () {
        if (!this.allowEdit && this.inputWrapper && !this.readonly) {
            if (this.inputElement.value === '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [EDITABLE]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [EDITABLE]);
            }
        }
        else if (this.inputWrapper) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [EDITABLE]);
        }
    };
    TimePicker.prototype.validateDisable = function () {
        this.setMinMax(this.initMin, this.initMax);
        this.popupCreation();
        this.popupObj.destroy();
        this.popupWrapper = this.popupObj = null;
        if ((!isNaN(+this.value) && this.value !== null)) {
            if (!this.valueIsDisable(this.value)) {
                //disable value given in value property so reset the date based on current date
                if (this.strictMode) {
                    this.resetState();
                }
                this.initValue = null;
                this.initMax = this.getDateObject(this.initMax);
                this.initMin = this.getDateObject(this.initMin);
                this.timeCollections = this.liCollections = [];
                this.setMinMax(this.initMin, this.initMax);
            }
        }
    };
    TimePicker.prototype.validationAttribute = function (target, input) {
        var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
        input.setAttribute('name', name);
        target.removeAttribute('name');
        var attributes = ['required', 'aria-required', 'form'];
        for (var i = 0; i < attributes.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target.getAttribute(attributes[i]))) {
                continue;
            }
            var attr = target.getAttribute(attributes[i]);
            input.setAttribute(attributes[i], attr);
            target.removeAttribute(attributes[i]);
        }
    };
    TimePicker.prototype.initialize = function () {
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        this.defaultCulture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"]('en');
        this.checkTimeFormat();
        this.checkInvalidValue(this.value);
        // persist the value property.
        this.setProperties({ value: this.checkDateValue(new Date(this.checkInValue(this.value))) }, true);
        this.setProperties({ min: this.checkDateValue(new Date(this.checkInValue(this.min))) }, true);
        this.setProperties({ max: this.checkDateValue(new Date(this.checkInValue(this.max))) }, true);
        this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(this.scrollTo))) }, true);
        if (this.angularTag !== null) {
            this.validationAttribute(this.element, this.inputElement);
        }
        this.updateHtmlAttributeToElement();
        this.checkAttributes(false); //check the input element attributes
        var localeText = { placeholder: this.placeholder };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('timepicker', localeText, this.locale);
        this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
        this.initValue = this.checkDateValue(this.value);
        this.initMin = this.checkDateValue(this.min);
        this.initMax = this.checkDateValue(this.max);
        this.isNavigate = this.isPreventBlur = this.isTextSelected = false;
        this.activeIndex = this.valueWithMinutes = this.prevDate = null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute('id'))) {
            if (this.angularTag !== null) {
                this.inputElement.id = this.element.getAttribute('id') + '_input';
            }
        }
        else {
            //for angular case
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2_timepicker');
            if (this.angularTag !== null) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'id': this.element.id + '_input' });
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute('name'))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'name': this.element.id });
        }
    };
    TimePicker.prototype.checkTimeFormat = function () {
        if (this.format) {
            if (typeof this.format === 'string') {
                this.formatString = this.format;
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.format.skeleton) && this.format.skeleton !== '') {
                var skeletonString = this.format.skeleton;
                this.formatString = this.globalize.getDatePattern({ type: 'time', skeleton: skeletonString });
            }
            else {
                this.formatString = this.globalize.getDatePattern({ type: 'time', skeleton: 'short' });
            }
        }
        else {
            this.formatString = null;
        }
    };
    TimePicker.prototype.checkDateValue = function (value) {
        return (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && value instanceof Date && !isNaN(+value)) ? value : null;
    };
    TimePicker.prototype.createInputElement = function () {
        var updatedCssClassesValue = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassesValue = (this.cssClass.replace(/\s+/g, ' ')).trim();
        }
        this.inputWrapper = _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].createInput({
            element: this.inputElement,
            floatLabelType: this.floatLabelType,
            properties: {
                readonly: this.readonly,
                placeholder: this.placeholder,
                cssClass: updatedCssClassesValue,
                enabled: this.enabled,
                enableRtl: this.enableRtl,
                showClearButton: this.showClearButton,
            },
            buttons: [' e-input-group-icon e-time-icon e-icons']
        }, this.createElement);
        this.inputWrapper.container.style.width = this.setWidth(this.width);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, {
            'aria-haspopup': 'true', 'aria-autocomplete': 'list', 'tabindex': '0', 'aria-activedescendant': 'null',
            'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',
            'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-disabled': 'false', 'aria-invalid': 'false'
        });
        if (!this.isNullOrEmpty(this.inputStyle)) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addAttributes({ 'style': this.inputStyle }, this.inputElement);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], WRAPPERCLASS);
    };
    TimePicker.prototype.getCldrDateTimeFormat = function () {
        var culture = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        var cldrTime;
        var dateFormat = culture.getDatePattern({ skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd' });
        if (this.isNullOrEmpty(this.formatString)) {
            cldrTime = dateFormat + ' ' + this.CldrFormat('time');
        }
        else {
            cldrTime = this.formatString;
        }
        return cldrTime;
    };
    TimePicker.prototype.checkInvalidValue = function (value) {
        var isInvalid = false;
        if (typeof value !== 'object' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            var valueString = value;
            if (typeof valueString === 'string') {
                valueString = valueString.trim();
            }
            var valueExpression = null;
            var valueExp = null;
            if (typeof value === 'number') {
                valueString = value.toString();
            }
            else if (typeof value === 'string') {
                if (!(/^[a-zA-Z0-9- ]*$/).test(value)) {
                    valueExpression = this.setCurrentDate(this.getDateObject(value));
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(valueExpression)) {
                        valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {
                            format: this.getCldrDateTimeFormat(), type: 'datetime'
                        }));
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(valueExpression)) {
                            valueExpression = this.checkDateValue(this.globalize.parseDate(valueString, {
                                format: this.formatString, type: 'dateTime', skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'd' : 'yMd'
                            }));
                        }
                    }
                }
            }
            valueExp = this.globalize.parseDate(valueString, {
                format: this.getCldrDateTimeFormat(), type: 'datetime'
            });
            valueExpression = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(valueExp) && valueExp instanceof Date && !isNaN(+valueExp)) ? valueExp : null;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(valueExpression) && valueString.replace(/\s/g, '').length) {
                var extISOString = null;
                var basicISOString = null;
                // tslint:disable-next-line
                extISOString = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                // tslint:disable-next-line
                basicISOString = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
                if ((!extISOString.test(valueString) && !basicISOString.test(valueString))
                    || ((/^[a-zA-Z0-9- ]*$/).test(value)) || isNaN(+new Date('' + valueString))) {
                    isInvalid = true;
                }
                else {
                    valueExpression = new Date('' + valueString);
                }
            }
            if (isInvalid) {
                if (!this.strictMode) {
                    this.invalidValueString = valueString;
                }
                this.setProperties({ value: null }, true);
                this.initValue = null;
            }
            else {
                this.setProperties({ value: valueExpression }, true);
                this.initValue = this.value;
            }
        }
    };
    TimePicker.prototype.CldrFormat = function (type) {
        var cldrDateTimeString;
        if (this.locale === 'en' || this.locale === 'en-US') {
            cldrDateTimeString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getBlazorCultureFormat('t') :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
        }
        else {
            cldrDateTimeString = (this.getCultureTimeObject(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
        }
        return cldrDateTimeString;
    };
    // destroy function
    TimePicker.prototype.destroy = function () {
        if (this.isBlazorServer) {
            this.unBindEvents();
        }
        else {
            this.hide();
            this.unBindEvents();
            var ariaAttribute = {
                'aria-haspopup': 'true', 'aria-autocomplete': 'list', 'tabindex': '0', 'aria-activedescendant': 'null',
                'aria-owns': this.element.id + '_options', 'aria-expanded': 'false', 'role': 'combobox', 'autocomplete': 'off',
                'autocorrect': 'off', 'autocapitalize': 'off', 'spellcheck': 'false', 'aria-disabled': 'true', 'aria-invalid': 'false'
            };
            if (this.inputElement) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeAttributes(ariaAttribute, this.inputElement);
                if (this.angularTag === null) {
                    this.inputWrapper.container.parentElement.appendChild(this.inputElement);
                }
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cloneElement.getAttribute('tabindex'))) ?
                    this.inputElement.setAttribute('tabindex', this.tabIndex) : this.inputElement.removeAttribute('tabindex');
                this.ensureInputAttribute();
                this.enableElement([this.inputElement]);
                this.inputElement.classList.remove('e-input');
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cloneElement.getAttribute('disabled'))) {
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnabled(true, this.inputElement, this.floatLabelType);
                }
            }
            if (this.inputWrapper.container) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.container);
            }
            this.inputWrapper = this.popupWrapper = this.cloneElement = undefined;
            this.liCollections = this.timeCollections = this.disableItemCollection = [];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.rippleFn)) {
                this.rippleFn();
            }
            _super.prototype.destroy.call(this);
            if (this.formElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
            }
        }
    };
    TimePicker.prototype.ensureInputAttribute = function () {
        var propertyList = [];
        for (var i = 0; i < this.inputElement.attributes.length; i++) {
            propertyList[i] = this.inputElement.attributes[i].name;
        }
        for (var i = 0; i < propertyList.length; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cloneElement.getAttribute(propertyList[i]))) {
                this.inputElement.setAttribute(propertyList[i], this.cloneElement.getAttribute(propertyList[i]));
                if (propertyList[i].toLowerCase() === 'value') {
                    this.inputElement.value = this.cloneElement.getAttribute(propertyList[i]);
                }
            }
            else {
                this.inputElement.removeAttribute(propertyList[i]);
                if (propertyList[i].toLowerCase() === 'value') {
                    this.inputElement.value = '';
                }
            }
        }
    };
    //popup creation
    TimePicker.prototype.popupCreation = function () {
        if (!this.isBlazorServer) {
            this.popupWrapper = this.createElement('div', {
                className: ROOT + ' ' + POPUP,
                attrs: { 'id': this.element.id + '_popup', 'style': 'visibility:hidden' }
            });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
                this.popupWrapper.className += ' ' + this.cssClass;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.step) && this.step > 0) {
                this.generateList();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([this.listWrapper], this.popupWrapper);
            }
            this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper);
        }
        else {
            this.popupWrapper = this.inputWrapper.container.nextElementSibling;
            this.generateList();
        }
        this.addSelection();
        this.renderPopup();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.popupWrapper);
    };
    TimePicker.prototype.getPopupHeight = function () {
        var height = parseInt(POPUPDIMENSION, 10);
        var popupHeight = this.popupWrapper.getBoundingClientRect().height;
        return popupHeight > height ? height : popupHeight;
    };
    TimePicker.prototype.generateList = function () {
        if (!this.isBlazorServer) {
            this.createListItems();
        }
        else {
            this.listWrapper = this.popupWrapper.querySelector('.e-content');
        }
        this.wireListEvents();
        var rippleModel = { duration: 300, selector: '.' + LISTCLASS };
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.listWrapper, rippleModel);
        this.liCollections = this.listWrapper.querySelectorAll('.' + LISTCLASS);
        if (this.isBlazorServer) {
            this.blazorTimeCollections = [];
            for (var index = 0; index < this.liCollections.length; index++) {
                this.blazorTimeCollections.push(this.liCollections[index].getAttribute('data-value'));
            }
        }
    };
    TimePicker.prototype.renderPopup = function () {
        var _this = this;
        this.containerStyle = this.inputWrapper.container.getBoundingClientRect();
        this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](this.popupWrapper, {
            width: this.setPopupWidth(this.width),
            zIndex: this.zIndex,
            targetType: 'relative',
            position: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'center', Y: 'center' } : { X: 'left', Y: 'bottom' },
            collision: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? { X: 'fit', Y: 'fit' } : { X: 'flip', Y: 'flip' },
            enableRtl: this.enableRtl,
            relateTo: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? document.body : this.inputWrapper.container,
            offsetY: OFFSETVAL,
            open: function () {
                _this.popupWrapper.style.visibility = 'visible';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.buttons[0]], SELECTED);
            }, close: function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.inputWrapper.buttons[0]], SELECTED);
                _this.unWireListEvents();
                _this.inputElement.setAttribute('aria-activedescendant', 'null');
                if (!_this.isBlazorServer) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(_this.popupObj.element);
                    _this.popupObj.destroy();
                    _this.popupWrapper.innerHTML = '';
                }
                _this.listWrapper = _this.popupWrapper = _this.listTag = undefined;
            }, targetExitViewport: function () {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.hide();
                }
            }
        });
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.popupObj.collision = { X: 'none', Y: 'flip' };
        }
        this.popupObj.element.style.maxHeight = POPUPDIMENSION;
    };
    //util function
    TimePicker.prototype.getFormattedValue = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            return null;
        }
        else {
            return this.globalize.formatDate(value, { skeleton: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 't' : 'medium', type: 'time' });
        }
    };
    TimePicker.prototype.getDateObject = function (text) {
        if (!this.isNullOrEmpty(text)) {
            var dateValue = this.createDateObj(text);
            var value = !this.isNullOrEmpty(this.initValue);
            if (this.checkDateValue(dateValue)) {
                var date = value ? this.initValue.getDate() : DAY;
                var month = value ? this.initValue.getMonth() : MONTH;
                var year = value ? this.initValue.getFullYear() : YEAR;
                return new Date(year, month, date, dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds());
            }
        }
        return null;
    };
    TimePicker.prototype.updateHtmlAttributeToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttributes.indexOf(key) > -1) {
                    if (key === 'class') {
                        var updatedClassesValue = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
                        if (updatedClassesValue !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], updatedClassesValue.split(' '));
                        }
                    }
                    else if (key === 'style') {
                        var timeStyle = this.inputWrapper.container.getAttribute(key);
                        timeStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timeStyle) ? (timeStyle + this.htmlAttributes[key]) :
                            this.htmlAttributes[key];
                        this.inputWrapper.container.setAttribute(key, timeStyle);
                    }
                    else {
                        this.inputWrapper.container.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    TimePicker.prototype.updateHtmlAttributeToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttributes.indexOf(key) < 0) {
                    this.inputElement.setAttribute(key, this.htmlAttributes[key]);
                }
            }
        }
    };
    TimePicker.prototype.updateCssClass = function (cssClassNew, cssClassOld) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClassOld)) {
            cssClassOld = (cssClassOld.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClassNew)) {
            cssClassNew = (cssClassNew.replace(/\s+/g, ' ')).trim();
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(cssClassNew, [this.inputWrapper.container], cssClassOld);
        if (this.popupWrapper) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(cssClassNew, [this.popupWrapper], cssClassOld);
        }
    };
    TimePicker.prototype.removeErrorClass = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], ERROR);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'false' });
    };
    TimePicker.prototype.checkErrorState = function (val) {
        var value = this.getDateObject(val);
        if (this.validateState(value) && !this.invalidValueString) {
            this.removeErrorClass();
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], ERROR);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-invalid': 'true' });
        }
    };
    TimePicker.prototype.validateInterval = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.step) && this.step > 0) {
            this.enableElement([this.inputWrapper.buttons[0]]);
        }
        else {
            this.disableTimeIcon();
        }
    };
    TimePicker.prototype.disableTimeIcon = function () {
        this.disableElement([this.inputWrapper.buttons[0]]);
        this.hide();
    };
    TimePicker.prototype.disableElement = function (element) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(element, DISABLED);
    };
    TimePicker.prototype.enableElement = function (element) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(element, DISABLED);
    };
    TimePicker.prototype.selectInputText = function () {
        this.inputElement.setSelectionRange(0, (this.inputElement).value.length);
    };
    TimePicker.prototype.setCursorToEnd = function () {
        this.inputElement.setSelectionRange((this.inputElement).value.length, (this.inputElement).value.length);
    };
    TimePicker.prototype.getMeridianText = function () {
        var meridian;
        if (this.locale === 'en' || this.locale === 'en-US') {
            meridian = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? 'dayPeriods.wide' : 'dayPeriods.format.wide'), Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])());
        }
        else {
            var gregorianFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? '.dates.dayPeriods.abbreviated' :
                '.dates.calendars.gregorian.dayPeriods.format.abbreviated');
            var mainVal = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? '' : 'main.';
            meridian = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mainVal + '' + this.locale + gregorianFormat, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]);
        }
        return meridian;
    };
    TimePicker.prototype.getCursorSelection = function () {
        var input = (this.inputElement);
        var start = 0;
        var end = 0;
        if (!isNaN(input.selectionStart)) {
            start = input.selectionStart;
            end = input.selectionEnd;
        }
        return { start: Math.abs(start), end: Math.abs(end) };
    };
    TimePicker.prototype.getActiveElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            return this.popupWrapper.querySelectorAll('.' + SELECTED);
        }
        else {
            return null;
        }
    };
    TimePicker.prototype.isNullOrEmpty = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) || (typeof value === 'string' && value.trim() === '')) {
            return true;
        }
        else {
            return false;
        }
    };
    TimePicker.prototype.setWidth = function (width) {
        if (typeof width === 'number') {
            width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else if (typeof width === 'string') {
            width = (width.match(/px|%|em/)) ? width : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else {
            width = '100%';
        }
        return width;
    };
    TimePicker.prototype.setPopupWidth = function (width) {
        width = this.setWidth(width);
        if (width.indexOf('%') > -1) {
            var inputWidth = this.containerStyle.width * parseFloat(width) / 100;
            width = inputWidth.toString() + 'px';
        }
        return width;
    };
    TimePicker.prototype.setScrollPosition = function () {
        var listHeight = this.getPopupHeight();
        var element;
        element = this.selectedElement;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            this.findScrollTop(element);
        }
        else if (this.popupWrapper && this.checkDateValue(this.scrollTo)) {
            this.setScrollTo();
        }
    };
    TimePicker.prototype.findScrollTop = function (element) {
        var listHeight = this.getPopupHeight();
        var nextEle = element.nextElementSibling;
        var height = nextEle ? nextEle.offsetTop : element.offsetTop;
        var liHeight = element.getBoundingClientRect().height;
        if ((height + element.offsetTop) > listHeight) {
            this.popupWrapper.scrollTop = nextEle ? (height - (listHeight / HALFPOSITION + liHeight / HALFPOSITION)) : height;
        }
        else {
            this.popupWrapper.scrollTop = 0;
        }
    };
    TimePicker.prototype.setScrollTo = function () {
        var element;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            var items = this.popupWrapper.querySelectorAll('.' + LISTCLASS);
            if (items.length) {
                var initialTime = this.isBlazorServer ? new Date(new Date().toDateString() + ' ' +
                    this.blazorTimeCollections[0]).setMilliseconds(0) : this.timeCollections[0];
                var scrollTime = this.isBlazorServer ? new Date(new Date().toDateString() + ' ' +
                    this.scrollTo.toLocaleTimeString()).setMilliseconds(0) :
                    this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();
                element = items[Math.round((scrollTime - initialTime) / (this.step * 60000))];
            }
        }
        else {
            this.popupWrapper.scrollTop = 0;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            this.findScrollTop(element);
        }
        else {
            this.popupWrapper.scrollTop = 0;
        }
    };
    TimePicker.prototype.getText = function () {
        return (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(this.value))) ? '' : this.getValue(this.value);
    };
    TimePicker.prototype.getValue = function (value) {
        return (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) ? null : this.globalize.formatDate(value, {
            format: this.cldrTimeFormat(), type: 'time'
        });
    };
    TimePicker.prototype.cldrDateFormat = function () {
        var cldrDate;
        if (this.locale === 'en' || this.locale === 'en-US') {
            cldrDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('d', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.locale, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))) :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('dateFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
        }
        else {
            cldrDate = (this.getCultureDateObject(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
        }
        return cldrDate;
    };
    TimePicker.prototype.getBlazorCultureFormat = function (formatVal) {
        return (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(formatVal, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.locale, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))).replace(/tt/, 'a');
    };
    TimePicker.prototype.cldrTimeFormat = function () {
        var cldrTime;
        if (this.isNullOrEmpty(this.formatString)) {
            if (this.locale === 'en' || this.locale === 'en-US') {
                cldrTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getBlazorCultureFormat('t') :
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
            }
            else {
                cldrTime = (this.getCultureTimeObject(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"], '' + this.locale));
            }
        }
        else {
            cldrTime = this.formatString;
        }
        return cldrTime;
    };
    TimePicker.prototype.dateToNumeric = function () {
        var cldrTime;
        if (this.locale === 'en' || this.locale === 'en-US') {
            cldrTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getBlazorCultureFormat('T') :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.medium', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])()));
        }
        else {
            cldrTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getBlazorCultureFormat('T') :
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.locale + '.dates.calendars.gregorian.timeFormats.medium', _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        }
        return cldrTime;
    };
    TimePicker.prototype.getExactDateTime = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            return null;
        }
        else {
            return this.globalize.formatDate(value, { format: this.dateToNumeric(), type: 'time' });
        }
    };
    TimePicker.prototype.setValue = function (value) {
        var time = this.checkValue(value);
        if (!this.strictMode && !this.validateState(time)) {
            if (this.checkDateValue(this.valueWithMinutes) === null) {
                this.initValue = this.valueWithMinutes = null;
            }
            this.validateMinMax(this.value, this.min, this.max);
        }
        else {
            if (this.isNullOrEmpty(time)) {
                this.initValue = null;
                this.validateMinMax(this.value, this.min, this.max);
            }
            else {
                this.initValue = this.compareFormatChange(time);
            }
        }
        this.updateInput(true, this.initValue);
    };
    TimePicker.prototype.compareFormatChange = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            return null;
        }
        return (value !== this.getText()) ? this.getDateObject(value) : this.getDateObject(this.value);
    };
    TimePicker.prototype.updatePlaceHolder = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(this.l10n.getConstant('placeholder'), this.inputElement);
    };
    //event related functions
    TimePicker.prototype.updateInputValue = function (value) {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(value, this.inputElement, this.floatLabelType, this.showClearButton);
    };
    TimePicker.prototype.preventEventBubbling = function (e) {
        e.preventDefault();
        // tslint:disable
        this.interopAdaptor.invokeMethodAsync('OnTimeIconClick');
        // tslint:enable
    };
    TimePicker.prototype.updateBlazorTimeCollections = function (listData) {
        this.blazorTimeCollections = listData;
    };
    TimePicker.prototype.popupHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.inputElement.setAttribute('readonly', '');
        }
        if (!this.isBlazorServer) {
            e.preventDefault();
        }
        if (this.isPopupOpen() && !this.isBlazorServer) {
            this.closePopup(0, e);
        }
        else {
            this.inputElement.focus();
            this.show(e);
        }
    };
    TimePicker.prototype.mouseDownHandler = function () {
        if (!this.enabled) {
            return;
        }
        if (!this.readonly) {
            var curPos = this.getCursorSelection();
            this.inputElement.setSelectionRange(0, 0);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'mouseup', this.mouseUpHandler, this);
        }
    };
    TimePicker.prototype.mouseUpHandler = function (event) {
        if (!this.readonly) {
            event.preventDefault();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'mouseup', this.mouseUpHandler);
            var curPos = this.getCursorSelection();
            if (!(curPos.start === 0 && curPos.end === this.inputElement.value.length)) {
                if (this.inputElement.value.length > 0) {
                    this.cursorDetails = this.focusSelection();
                }
                this.inputElement.setSelectionRange(this.cursorDetails.start, this.cursorDetails.end);
            }
        }
    };
    TimePicker.prototype.focusSelection = function () {
        var regex = new RegExp('^[a-zA-Z0-9]+$');
        var split = this.inputElement.value.split('');
        split.push(' ');
        var curPos = this.getCursorSelection();
        var start = 0;
        var end = 0;
        var isSeparator = false;
        if (!this.isTextSelected) {
            for (var i = 0; i < split.length; i++) {
                if (!regex.test(split[i])) {
                    end = i;
                    isSeparator = true;
                }
                if (isSeparator) {
                    if (curPos.start >= start && curPos.end <= end) {
                        end = end;
                        this.isTextSelected = true;
                        break;
                    }
                    else {
                        start = i + 1;
                        isSeparator = false;
                    }
                }
            }
        }
        else {
            start = curPos.start;
            end = curPos.end;
            this.isTextSelected = false;
        }
        return { start: start, end: end };
    };
    TimePicker.prototype.inputHandler = function (event) {
        if (!this.readonly && this.enabled) {
            if (event.action !== 'right' && event.action !== 'left' && event.action !== 'tab') {
                event.preventDefault();
            }
            switch (event.action) {
                case 'home':
                case 'end':
                case 'up':
                case 'down':
                    this.keyHandler(event);
                    break;
                case 'enter':
                    if (this.isNavigate) {
                        this.selectedElement = this.liCollections[this.activeIndex];
                        if (!this.isBlazorServer) {
                            this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
                            this.updateValue(this.valueWithMinutes, event);
                        }
                        else {
                            this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
                            // tslint:disable-next-line
                            this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
                        }
                    }
                    else {
                        if (!this.isBlazorServer) {
                            this.updateValue(this.inputElement.value, event);
                        }
                        else {
                            // tslint:disable-next-line
                            this.interopAdaptor.invokeMethodAsync('OnStrictMode', this.inputElement.value);
                        }
                    }
                    this.hide();
                    this.isNavigate = false;
                    if (this.isPopupOpen()) {
                        event.stopPropagation();
                    }
                    break;
                case 'open':
                    if (this.isBlazorServer) {
                        // tslint:disable
                        this.interopAdaptor.invokeMethodAsync('OnPopupHide', true);
                        // tslint:enable
                    }
                    else {
                        this.show(event);
                    }
                    break;
                case 'escape':
                    if (!this.isBlazorServer) {
                        this.updateInputValue(this.objToString(this.value));
                        this.previousState(this.value);
                    }
                    this.hide();
                    break;
                case 'close':
                    this.hide();
                    break;
                default:
                    this.isNavigate = false;
                    break;
            }
        }
    };
    TimePicker.prototype.onMouseClick = function (event) {
        var target = event.target;
        var li = this.selectedElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTCLASS);
        this.setSelection(li, event);
        if (li && li.classList.contains(LISTCLASS)) {
            this.hide();
        }
    };
    TimePicker.prototype.closePopup = function (delay, e) {
        var _this = this;
        if (this.isPopupOpen() && this.popupWrapper) {
            var args = {
                popup: this.isBlazorServer ? null : this.popupObj,
                event: e || null,
                cancel: false,
                name: 'open'
            };
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], OVERFLOW);
            this.trigger('close', args, function (args) {
                if (!args.cancel) {
                    var animModel = {
                        name: 'FadeOut',
                        duration: ANIMATIONDURATION,
                        delay: delay ? delay : 0
                    };
                    _this.popupObj.hide(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animModel));
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.inputWrapper.container], [ICONANIMATION]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.inputElement, { 'aria-expanded': 'false' });
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', _this.documentClickHandler);
                    if (_this.isBlazorServer) {
                        _this.disposeServerPopup();
                        // tslint:disable
                        _this.inputWrapper.container.parentElement.insertBefore(_this.popupWrapper, _this.inputWrapper.container.nextElementSibling);
                        _this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
                        // tslint:enable
                        _this.popupWrapper = _this.popupObj = null;
                    }
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _this.modal) {
                    _this.modal.style.display = 'none';
                    _this.modal.outerHTML = '';
                    _this.modal = null;
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.mobileTimePopupWrap)) {
                        _this.mobileTimePopupWrap.remove();
                        _this.mobileTimePopupWrap = null;
                    }
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _this.allowEdit && !_this.readonly) {
                    _this.inputElement.removeAttribute('readonly');
                }
            });
        }
        else {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.allowEdit && !this.readonly) {
                this.inputElement.removeAttribute('readonly');
            }
        }
    };
    TimePicker.prototype.disposeServerPopup = function () {
        if (this.popupWrapper) {
            this.popupWrapper.style.visibility = 'hidden';
            this.popupWrapper.style.top = '-9999px';
            this.popupWrapper.style.left = '-9999px';
            this.popupWrapper.style.width = '0px';
            this.popupWrapper.style.height = '0px';
        }
    };
    TimePicker.prototype.checkValueChange = function (event, isNavigation) {
        if (!this.strictMode && !this.validateState(this.valueWithMinutes)) {
            if (this.checkDateValue(this.valueWithMinutes) === null) {
                this.initValue = this.valueWithMinutes = null;
            }
            this.setProperties({ value: this.compareFormatChange(this.inputElement.value) }, true);
            this.initValue = this.valueWithMinutes = this.compareFormatChange(this.inputElement.value);
            this.prevValue = this.inputElement.value;
            if (+this.prevDate !== +this.value) {
                this.changeEvent(event);
            }
        }
        else {
            if (!isNavigation) {
                if ((this.prevValue !== this.inputElement.value) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(this.value))) {
                    this.valueProcess(event, this.compareFormatChange(this.inputElement.value));
                }
            }
            else {
                var value = this.getDateObject(new Date(this.timeCollections[this.activeIndex]));
                if (+this.prevDate !== +value) {
                    this.valueProcess(event, value);
                }
            }
        }
    };
    TimePicker.prototype.onMouseOver = function (event) {
        var currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + LISTCLASS);
        this.setHover(currentLi, HOVER);
    };
    TimePicker.prototype.setHover = function (li, className) {
        if (this.enabled && this.isValidLI(li) && !li.classList.contains(className)) {
            this.removeHover(className);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], className);
            if (className === NAVIGATION) {
                li.setAttribute('aria-selected', 'true');
            }
        }
    };
    TimePicker.prototype.setSelection = function (li, event) {
        if (this.isValidLI(li) && !li.classList.contains(SELECTED)) {
            if (!this.isBlazorServer) {
                this.checkValue(li.getAttribute('data-value'));
                this.selectedElement = li;
                this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
                this.valueWithMinutes = new Date(this.timeCollections[this.activeIndex]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.selectedElement], SELECTED);
                this.selectedElement.setAttribute('aria-selected', 'true');
                this.checkValueChange(event, true);
            }
            else {
                this.selectedElement = li;
                this.activeIndex = Array.prototype.slice.call(this.liCollections).indexOf(li);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.selectedElement], SELECTED);
                this.selectedElement.setAttribute('aria-selected', 'true');
                this.inputElement.setAttribute('value', li.getAttribute('data-value'));
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, false);
                this.addSelection();
            }
        }
    };
    TimePicker.prototype.onMouseLeave = function () {
        this.removeHover(HOVER);
    };
    TimePicker.prototype.scrollHandler = function () {
        if (this.getModuleName() === 'timepicker' && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            return;
        }
        else {
            this.hide();
        }
    };
    TimePicker.prototype.setMinMax = function (minVal, maxVal) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(minVal))) {
            this.initMin = this.getDateObject('12:00:00 AM');
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(maxVal))) {
            this.initMax = this.getDateObject('11:59:59 PM');
        }
    };
    //protected function
    TimePicker.prototype.validateMinMax = function (dateVal, minVal, maxVal) {
        var value = dateVal instanceof Date ? dateVal : this.getDateObject(dateVal);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            dateVal = this.strictOperation(this.initMin, this.initMax, dateVal, value);
        }
        else if (+(this.createDateObj(this.getFormattedValue(this.initMin))) >
            +(this.createDateObj(this.getFormattedValue(this.initMax)))) {
            this.disableTimeIcon();
        }
        if (this.strictMode) {
            dateVal = this.valueIsDisable(dateVal) ? dateVal : null;
        }
        this.checkErrorState(dateVal);
        return dateVal;
    };
    TimePicker.prototype.valueIsDisable = function (value) {
        if (this.disableItemCollection.length > 0) {
            if (this.disableItemCollection.length === this.timeCollections.length) {
                return false;
            }
            var time = value instanceof Date ? this.objToString(value) : value;
            for (var index = 0; index < this.disableItemCollection.length; index++) {
                if (time === this.disableItemCollection[index]) {
                    return false;
                }
            }
        }
        return true;
    };
    TimePicker.prototype.validateState = function (val) {
        if (!this.strictMode) {
            if (this.valueIsDisable(val)) {
                var value = typeof val === 'string' ? this.setCurrentDate(this.getDateObject(val)) :
                    this.setCurrentDate(this.getDateObject(val));
                var maxValue = this.setCurrentDate(this.getDateObject(this.initMax));
                var minValue = this.setCurrentDate(this.getDateObject(this.initMin));
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
                    if ((+(value) > +(maxValue)) || (+(value) < +(minValue))) {
                        return false;
                    }
                }
                else {
                    if ((+(maxValue) < +(minValue)) || this.inputElement.value !== '') {
                        return false;
                    }
                }
            }
            else {
                return false;
            }
        }
        return true;
    };
    TimePicker.prototype.strictOperation = function (minimum, maximum, dateVal, val) {
        var maxValue = this.createDateObj(this.getFormattedValue(maximum));
        var minValue = this.createDateObj(this.getFormattedValue(minimum));
        var value = this.createDateObj(this.getFormattedValue(val));
        if (this.strictMode) {
            if (+minValue > +maxValue) {
                this.disableTimeIcon();
                this.initValue = this.getDateObject(maxValue);
                this.updateInputValue(this.getValue(this.initValue));
                return this.inputElement.value;
            }
            else if (+minValue >= +value) {
                return this.getDateObject(minValue);
            }
            else if (+value >= +maxValue || +minValue === +maxValue) {
                return this.getDateObject(maxValue);
            }
        }
        else {
            if (+minValue > +maxValue) {
                this.disableTimeIcon();
                if (!isNaN(+this.createDateObj(dateVal))) {
                    return dateVal;
                }
            }
        }
        return dateVal;
    };
    TimePicker.prototype.bindEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown', (this.isBlazorServer ? this.preventEventBubbling : this.popupHandler), this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'blur', this.inputBlurHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'focus', this.inputFocusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'change', this.inputChangeHandler, this);
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown', this.clearHandler, this);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.keyConfigure = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.keyConfigure, this.keyConfigs);
            this.inputEvent = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.inputWrapper.container, {
                keyAction: this.inputHandler.bind(this),
                keyConfigs: this.keyConfigure,
                eventName: 'keydown'
            });
            if (this.showClearButton && this.inputElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'mousedown', this.mouseDownHandler, this);
            }
        }
    };
    TimePicker.prototype.formResetHandler = function () {
        if (!this.enabled) {
            return;
        }
        if (!this.inputElement.disabled) {
            var timeValue = this.inputElement.getAttribute('value');
            var val = this.isBlazorServer ? this.inputEleValue : this.checkDateValue(this.inputEleValue);
            if (this.element.tagName === 'EJS-TIMEPICKER') {
                val = null;
                timeValue = '';
                this.inputElement.setAttribute('value', '');
            }
            if (!this.isBlazorServer) {
                this.setProperties({ value: val }, true);
                this.prevDate = this.value;
                this.valueWithMinutes = this.value;
                this.initValue = this.value;
            }
            if (this.inputElement) {
                this.updateInputValue(timeValue);
                if (!this.isBlazorServer) {
                    this.checkErrorState(timeValue);
                }
                this.prevValue = this.inputElement.value;
            }
        }
    };
    TimePicker.prototype.inputChangeHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        e.stopPropagation();
    };
    TimePicker.prototype.unBindEvents = function () {
        if (this.inputWrapper) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown touchstart', (this.isBlazorServer ? this.preventEventBubbling : this.popupHandler));
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'blur', this.inputBlurHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.inputFocusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'change', this.inputChangeHandler);
        if (this.inputEvent) {
            this.inputEvent.destroy();
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'mousedown touchstart', this.mouseDownHandler);
        if (this.showClearButton && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputWrapper.clearButton)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.clearButton, 'mousedown touchstart', this.clearHandler);
        }
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
    };
    TimePicker.prototype.bindClearEvent = function () {
        if (this.showClearButton && this.inputWrapper.clearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown', this.clearHandler, this);
        }
    };
    TimePicker.prototype.raiseClearedEvent = function (e) {
        var clearedArgs = {
            event: e
        };
        this.trigger('cleared', clearedArgs);
    };
    TimePicker.prototype.clearHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        e.preventDefault();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.clear(e);
        }
        else {
            this.resetState();
            this.raiseClearedEvent(e);
        }
        if (this.isBlazorServer) {
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('OnValueCleared');
            // tslint:enable
        }
        if (this.popupWrapper) {
            this.popupWrapper.scrollTop = 0;
        }
    };
    TimePicker.prototype.clear = function (event) {
        if (!this.isBlazorServer) {
            this.setProperties({ value: null }, true);
        }
        this.initValue = null;
        this.resetState();
        this.raiseClearedEvent(event);
        if (!this.isBlazorServer) {
            this.changeEvent(event);
        }
    };
    TimePicker.prototype.setZIndex = function () {
        if (this.popupObj) {
            this.popupObj.zIndex = this.zIndex;
            this.popupObj.dataBind();
        }
    };
    TimePicker.prototype.checkAttributes = function (isDynamic) {
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['step', 'disabled', 'readonly', 'style', 'name', 'value', 'min', 'max', 'placeholder'];
        var value;
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute(prop))) {
                switch (prop) {
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['enabled'] === undefined)) || isDynamic) {
                            var enabled = this.inputElement.getAttribute(prop) === 'disabled' || this.inputElement.getAttribute(prop) === '' ||
                                this.inputElement.getAttribute(prop) === 'true' ? false : true;
                            this.setProperties({ enabled: enabled }, !isDynamic);
                        }
                        break;
                    case 'style':
                        this.inputStyle = this.inputElement.getAttribute(prop);
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.inputElement.getAttribute(prop) === 'readonly' || this.inputElement.getAttribute(prop) === '' ||
                                this.inputElement.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                    case 'name':
                        this.inputElement.setAttribute('name', this.inputElement.getAttribute(prop));
                        break;
                    case 'step':
                        this.step = parseInt(this.inputElement.getAttribute(prop), 10);
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.inputElement.getAttribute(prop) }, !isDynamic);
                        }
                        break;
                    case 'min':
                        if (!this.isBlazorServer) {
                            // tslint:disable-next-line
                            if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['min'] === undefined)) || isDynamic) {
                                value = new Date(this.inputElement.getAttribute(prop));
                                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
                                    this.setProperties({ min: value }, !isDynamic);
                                }
                            }
                        }
                        break;
                    case 'max':
                        if (!this.isBlazorServer) {
                            // tslint:disable-next-line
                            if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['max'] === undefined)) || isDynamic) {
                                value = new Date(this.inputElement.getAttribute(prop));
                                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
                                    this.setProperties({ max: value }, !isDynamic);
                                }
                            }
                        }
                        break;
                    case 'value':
                        if (!this.isBlazorServer) {
                            // tslint:disable-next-line
                            if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeOptions) || (this.timeOptions['value'] === undefined)) || isDynamic) {
                                value = new Date(this.inputElement.getAttribute(prop));
                                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
                                    this.initValue = value;
                                    this.updateInput(false, this.initValue);
                                    this.setProperties({ value: value }, !isDynamic);
                                }
                            }
                        }
                        break;
                }
            }
        }
    };
    TimePicker.prototype.setCurrentDate = function (value) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            return null;
        }
        return new Date(YEAR, MONTH, DAY, value.getHours(), value.getMinutes(), value.getSeconds());
    };
    TimePicker.prototype.getTextFormat = function () {
        var time = 0;
        if (this.cldrTimeFormat().split(' ')[0] === 'a' || this.cldrTimeFormat().indexOf('a') === 0) {
            time = 1;
        }
        else if (this.cldrTimeFormat().indexOf('a') < 0) {
            var strArray = this.cldrTimeFormat().split(' ');
            for (var i = 0; i < strArray.length; i++) {
                if (strArray[i].toLowerCase().indexOf('h') >= 0) {
                    time = i;
                    break;
                }
            }
        }
        return time;
    };
    TimePicker.prototype.updateValue = function (value, event) {
        var val;
        if (this.isNullOrEmpty(value)) {
            this.resetState();
        }
        else {
            val = this.checkValue(value);
            if (this.strictMode) {
                // this case set previous value to the text box when set invalid date
                var inputVal = (val === null && value.trim().length > 0) ?
                    this.previousState(this.prevDate) : this.inputElement.value;
                this.updateInputValue(inputVal);
            }
        }
        this.checkValueChange(event, typeof value === 'string' ? false : true);
    };
    TimePicker.prototype.previousState = function (date) {
        var value = this.getDateObject(date);
        for (var i = 0; i < this.timeCollections.length; i++) {
            if (+value === this.timeCollections[i]) {
                this.activeIndex = i;
                this.selectedElement = this.liCollections[i];
                this.valueWithMinutes = new Date(this.timeCollections[i]);
                break;
            }
        }
        return this.prevValue;
    };
    TimePicker.prototype.resetState = function () {
        this.removeSelection();
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue('', this.inputElement, this.floatLabelType, false);
        this.valueWithMinutes = this.activeIndex = null;
        if (!this.strictMode && !this.isBlazorServer) {
            this.checkErrorState(null);
        }
    };
    TimePicker.prototype.objToString = function (val) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(val))) {
            return null;
        }
        else {
            return this.globalize.formatDate(val, { format: this.cldrTimeFormat(), type: 'time' });
        }
    };
    TimePicker.prototype.checkValue = function (value) {
        if (!this.isNullOrEmpty(value)) {
            var date = value instanceof Date ? value : this.getDateObject(value);
            return this.validateValue(date, value);
        }
        this.resetState();
        return this.valueWithMinutes = null;
    };
    TimePicker.prototype.validateValue = function (date, value) {
        var time;
        var val = this.validateMinMax(value, this.min, this.max);
        var newval = this.createDateObj(val);
        if (this.getFormattedValue(newval) !== this.getFormattedValue(this.value)) {
            this.valueWithMinutes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newval) ? null : newval;
            time = this.objToString(this.valueWithMinutes);
        }
        else {
            if (this.strictMode) {
                //for strict mode case, when value not present within a range. Reset the nearest range value.
                date = newval;
            }
            this.valueWithMinutes = this.checkDateValue(date);
            time = this.objToString(this.valueWithMinutes);
        }
        if (!this.strictMode && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(time)) {
            var value_1 = val.trim().length > 0 ? val : '';
            this.updateInputValue(value_1);
        }
        else {
            this.updateInputValue(time);
        }
        return time;
    };
    TimePicker.prototype.findNextElement = function (event) {
        var textVal = (this.inputElement).value;
        var value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.valueWithMinutes) || this.isBlazorServer ? this.createDateObj(textVal) :
            this.getDateObject(this.valueWithMinutes);
        var timeVal = null;
        var count = this.liCollections.length;
        var collections = this.isBlazorServer ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.blazorTimeCollections) ? [] :
            this.blazorTimeCollections) : this.timeCollections;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value)) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex)) {
            if (event.action === 'home') {
                var index = this.validLiElement(0);
                if (!this.isBlazorServer) {
                    timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                }
                this.activeIndex = index;
            }
            else if (event.action === 'end') {
                var index = this.validLiElement(collections.length - 1, true);
                if (!this.isBlazorServer) {
                    timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                }
                this.activeIndex = index;
            }
            else {
                if (event.action === 'down') {
                    for (var i = 0; i < count; i++) {
                        if (this.isBlazorServer ? (+value < +this.createDateObj(this.blazorTimeCollections[i])) :
                            (+value < this.timeCollections[i])) {
                            var index = this.validLiElement(i);
                            if (!this.isBlazorServer) {
                                timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                            }
                            this.activeIndex = index;
                            break;
                        }
                        else if (i === count - 1) {
                            var index = this.validLiElement(0);
                            if (!this.isBlazorServer) {
                                timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                            }
                            this.activeIndex = index;
                            break;
                        }
                    }
                }
                else {
                    for (var i = count - 1; i >= 0; i--) {
                        if (this.isBlazorServer ? (+value > +this.createDateObj(this.blazorTimeCollections[i])) :
                            (+value > this.timeCollections[i])) {
                            var index = this.validLiElement(i, true);
                            if (!this.isBlazorServer) {
                                timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                            }
                            this.activeIndex = index;
                            break;
                        }
                        else if (i === 0) {
                            var index = this.validLiElement(count - 1);
                            if (!this.isBlazorServer) {
                                timeVal = +(this.createDateObj(new Date(this.timeCollections[index])));
                            }
                            this.activeIndex = index;
                            break;
                        }
                    }
                }
            }
            this.selectedElement = this.liCollections[this.activeIndex];
            if (this.isBlazorServer) {
                this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
            }
            else {
                this.elementValue(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timeVal) ? null : new Date(timeVal));
            }
        }
        else {
            this.selectNextItem(event);
        }
    };
    TimePicker.prototype.selectNextItem = function (event) {
        var index = this.validLiElement(0, event.action === 'down' ? false : true);
        this.activeIndex = index;
        this.selectedElement = this.liCollections[index];
        if (this.isBlazorServer) {
            this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnListItemClick', index, true);
        }
        else {
            this.elementValue(new Date(this.timeCollections[index]));
        }
    };
    TimePicker.prototype.findNextInBlazor = function (event) {
        var count = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.blazorTimeCollections) ? 0 : this.blazorTimeCollections.length;
        var index = 0;
        var value = this.createDateObj(this.inputElement.value);
        switch (event.action) {
            case 'home':
                this.activeIndex = index;
                break;
            case 'end':
                index = count - 1;
                this.activeIndex = index;
                break;
            case 'down':
                for (var i = 0; i < count; i++) {
                    if (this.isBlazorServer ? (+value < +this.createDateObj(this.blazorTimeCollections[i])) :
                        (+value < this.timeCollections[i])) {
                        var index_1 = this.validLiElement(i);
                        this.activeIndex = index_1;
                        break;
                    }
                    else if (i === count - 1) {
                        var index_2 = this.validLiElement(0);
                        this.activeIndex = index_2;
                        break;
                    }
                }
                break;
            case 'up':
                for (var i = count - 1; i >= 0; i--) {
                    if (this.isBlazorServer ? (+value > +this.createDateObj(this.blazorTimeCollections[i])) :
                        (+value > this.timeCollections[i])) {
                        var index_3 = this.validLiElement(i, true);
                        this.activeIndex = index_3;
                        break;
                    }
                    else if (i === 0) {
                        var index_4 = this.validLiElement(count - 1);
                        this.activeIndex = index_4;
                        break;
                    }
                }
                break;
        }
        // tslint:disable-next-line
        this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
    };
    TimePicker.prototype.elementValue = function (value) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) {
            this.checkValue(value);
        }
    };
    TimePicker.prototype.validLiElement = function (index, backward) {
        var elementIndex = null;
        if (this.isBlazorServer && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            var items = this.blazorTimeCollections;
            if (items.length) {
                if (backward) {
                    for (var i = index; i >= 0; i--) {
                        elementIndex = i;
                        break;
                    }
                }
                else {
                    for (var i = index; i <= items.length - 1; i++) {
                        elementIndex = i;
                        break;
                    }
                }
            }
        }
        else {
            var items = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper) ? this.liCollections :
                this.popupWrapper.querySelectorAll('.' + LISTCLASS);
            var isCheck = true;
            if (items.length) {
                if (backward) {
                    for (var i = index; i >= 0; i--) {
                        if (!items[i].classList.contains(DISABLED)) {
                            elementIndex = i;
                            break;
                        }
                        else if (i === 0) {
                            if (isCheck) {
                                index = i = items.length;
                                isCheck = false;
                            }
                        }
                    }
                }
                else {
                    for (var i = index; i <= items.length - 1; i++) {
                        if (!items[i].classList.contains(DISABLED)) {
                            elementIndex = i;
                            break;
                        }
                        else if (i === items.length - 1) {
                            if (isCheck) {
                                index = i = -1;
                                isCheck = false;
                            }
                        }
                    }
                }
            }
        }
        return elementIndex;
    };
    TimePicker.prototype.keyHandler = function (event) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.step) || this.step <= 0 || this.inputWrapper.buttons[0].classList.contains(DISABLED)) {
            return;
        }
        var count = this.isBlazorServer ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.blazorTimeCollections) ? 0 :
            this.blazorTimeCollections.length) : this.timeCollections.length;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.getActiveElement()) || this.getActiveElement().length === 0) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && this.isBlazorServer) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex)) {
                    var index = this.validLiElement(0, event.action === 'down' ? false : true);
                    this.activeIndex = index;
                    // tslint:disable-next-line
                    this.interopAdaptor.invokeMethodAsync('OnListItemClick', index, true);
                }
                else {
                    this.findNextInBlazor(event);
                }
            }
            else {
                if (this.liCollections.length > 0) {
                    if (this.isBlazorServer ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex)) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) &&
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex))) {
                        this.selectNextItem(event);
                    }
                    else {
                        this.findNextElement(event);
                    }
                }
                else {
                    this.findNextElement(event);
                }
            }
        }
        else {
            var nextItem = void 0;
            if ((event.keyCode >= 37) && (event.keyCode <= 40)) {
                var index = (event.keyCode === 40 || event.keyCode === 39) ? ++this.activeIndex : --this.activeIndex;
                this.activeIndex = index = this.activeIndex === (count) ? 0 : this.activeIndex;
                this.activeIndex = index = this.activeIndex < 0 ? (count - 1) : this.activeIndex;
                this.activeIndex = index = this.validLiElement(this.activeIndex, (event.keyCode === 40 || event.keyCode === 39) ?
                    false : true);
                if (!this.isBlazorServer) {
                    nextItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.timeCollections[index]) ? this.timeCollections[0] : this.timeCollections[index];
                }
            }
            else if (event.action === 'home') {
                var index = this.validLiElement(0);
                this.activeIndex = index;
                if (!this.isBlazorServer) {
                    nextItem = this.timeCollections[index];
                }
            }
            else if (event.action === 'end') {
                var index = this.validLiElement(count - 1, true);
                this.activeIndex = index;
                if (!this.isBlazorServer) {
                    nextItem = this.timeCollections[index];
                }
            }
            this.selectedElement = this.liCollections[this.activeIndex];
            if (this.isBlazorServer) {
                this.inputElement.setAttribute('value', this.selectedElement.getAttribute('data-value'));
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnListItemClick', this.activeIndex, true);
            }
            else {
                this.elementValue(new Date(nextItem));
            }
        }
        this.isNavigate = true;
        this.setHover(this.selectedElement, NAVIGATION);
        this.setActiveDescendant();
        if (!this.isBlazorServer) {
            this.selectInputText();
        }
        if (this.isPopupOpen() && this.selectedElement !== null && (!event || event.type !== 'click')) {
            this.setScrollPosition();
        }
    };
    TimePicker.prototype.getCultureTimeObject = function (ld, c) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('t', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(c, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))).replace(/tt/, 'a') :
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + c + '.dates.calendars.gregorian.timeFormats.short', ld);
    };
    TimePicker.prototype.getCultureDateObject = function (ld, c) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('d', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(c, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorCultureFormats"]))) :
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + c + '.dates.calendars.gregorian.dateFormats.short', ld);
    };
    TimePicker.prototype.wireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'click', this.onMouseClick, this);
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseover', this.onMouseOver, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.listWrapper, 'mouseout', this.onMouseLeave, this);
        }
    };
    TimePicker.prototype.unWireListEvents = function () {
        if (this.listWrapper) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.listWrapper, 'click', this.onMouseClick);
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.listWrapper, 'mouseover', this.onMouseOver);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.listWrapper, 'mouseout', this.onMouseLeave);
            }
        }
    };
    TimePicker.prototype.valueProcess = function (event, value) {
        var result = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkDateValue(value))) ? null : value;
        if (+this.prevDate !== +result) {
            this.initValue = result;
            this.changeEvent(event);
        }
    };
    TimePicker.prototype.changeEvent = function (e) {
        this.addSelection();
        this.updateInput(true, this.initValue);
        var eventArgs = {
            event: (e || null),
            value: this.value,
            text: (this.inputElement).value,
            isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e),
            element: this.element
        };
        eventArgs.value = this.valueWithMinutes || this.getDateObject(this.inputElement.value);
        this.prevDate = this.valueWithMinutes || this.getDateObject(this.inputElement.value);
        if (this.isAngular && this.preventChange) {
            this.preventChange = false;
        }
        else {
            this.trigger('change', eventArgs);
        }
        this.invalidValueString = null;
        this.checkErrorState(this.value);
    };
    TimePicker.prototype.updateInput = function (isUpdate, date) {
        if (isUpdate) {
            this.prevValue = this.getValue(date);
        }
        this.prevDate = this.valueWithMinutes = date;
        if ((typeof date !== 'number') || (this.value && +new Date(+this.value).setMilliseconds(0)) !== +date) {
            this.setProperties({ value: date }, true);
        }
        if (!this.strictMode && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.invalidValueString) {
            this.checkErrorState(this.invalidValueString);
            this.updateInputValue(this.invalidValueString);
        }
        this.clearIconState();
    };
    TimePicker.prototype.setActiveDescendant = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedElement)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': this.selectedElement.getAttribute('id') });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': 'null' });
        }
    };
    TimePicker.prototype.removeSelection = function () {
        this.removeHover(HOVER);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            var items = this.popupWrapper.querySelectorAll('.' + SELECTED);
            if (items.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(items, SELECTED);
                items[0].removeAttribute('aria-selected');
            }
        }
    };
    TimePicker.prototype.removeHover = function (className) {
        var hoveredItem = this.getHoverItem(className);
        if (hoveredItem && hoveredItem.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(hoveredItem, className);
            if (className === NAVIGATION) {
                hoveredItem[0].removeAttribute('aria-selected');
            }
        }
    };
    TimePicker.prototype.getHoverItem = function (className) {
        var hoveredItem;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            hoveredItem = this.popupWrapper.querySelectorAll('.' + className);
        }
        return hoveredItem;
    };
    TimePicker.prototype.setActiveClass = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupWrapper)) {
            var items = this.popupWrapper.querySelectorAll('.' + LISTCLASS);
            if (items.length) {
                for (var i = 0; i < items.length; i++) {
                    if ((!this.isBlazorServer && this.timeCollections[i] === +this.getDateObject(this.valueWithMinutes))
                        || (this.isBlazorServer && this.blazorTimeCollections[i] === this.blazorTimeCollections[this.activeIndex])) {
                        items[i].setAttribute('aria-selected', 'true');
                        this.selectedElement = items[i];
                        this.activeIndex = i;
                        break;
                    }
                }
            }
        }
    };
    TimePicker.prototype.addSelection = function () {
        this.selectedElement = null;
        this.removeSelection();
        this.setActiveClass();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedElement)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.selectedElement], SELECTED);
            this.selectedElement.setAttribute('aria-selected', 'true');
        }
    };
    TimePicker.prototype.isValidLI = function (li) {
        return (li && li.classList.contains(LISTCLASS) && !li.classList.contains(DISABLED));
    };
    TimePicker.prototype.createDateObj = function (val) {
        var formatStr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ?
            // tslint:disable-next-line
            'M' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])().dateSeperator + 'd' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])().dateSeperator + 'yy'
            : null;
        var today = this.globalize.formatDate(new Date(), { format: formatStr, skeleton: 'short', type: 'date' });
        var value = null;
        if (typeof val === 'string') {
            if (val.toUpperCase().indexOf('AM') > -1 || val.toUpperCase().indexOf('PM') > -1) {
                today = this.defaultCulture.formatDate(new Date(), { format: formatStr, skeleton: 'short', type: 'date' });
                value = isNaN(+new Date(today + ' ' + val)) ? null : new Date(new Date(today + ' ' + val).setMilliseconds(0));
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
                    value = this.TimeParse(today, val);
                }
            }
            else {
                value = this.TimeParse(today, val);
            }
        }
        else if (val instanceof Date) {
            value = val;
        }
        return value;
    };
    TimePicker.prototype.TimeParse = function (today, val) {
        var value;
        value = this.globalize.parseDate(today + ' ' + val, {
            format: this.cldrDateFormat() + ' ' + this.cldrTimeFormat(), type: 'datetime'
        });
        value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? this.globalize.parseDate(today + ' ' + val, {
            format: this.cldrDateFormat() + ' ' + this.dateToNumeric(), type: 'datetime'
        }) : value;
        value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? value : new Date(value.setMilliseconds(0));
        return value;
    };
    TimePicker.prototype.createListItems = function () {
        var _this = this;
        this.listWrapper = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
        var start;
        var end;
        var interval = this.step * 60000;
        var listItems = [];
        this.timeCollections = [];
        this.disableItemCollection = [];
        start = +(this.getDateObject(this.initMin).setMilliseconds(0));
        end = +(this.getDateObject(this.initMax).setMilliseconds(0));
        while (end >= start) {
            this.timeCollections.push(start);
            listItems.push(this.globalize.formatDate(new Date(start), { format: this.cldrTimeFormat(), type: 'time' }));
            start += interval;
        }
        var listBaseOptions = {
            itemCreated: function (args) {
                var eventArgs = {
                    element: args.item,
                    text: args.text, value: _this.getDateObject(args.text), isDisabled: false
                };
                _this.trigger('itemRender', eventArgs, function (eventArgs) {
                    if (eventArgs.isDisabled) {
                        eventArgs.element.classList.add(DISABLED);
                    }
                    if (eventArgs.element.classList.contains(DISABLED)) {
                        _this.disableItemCollection.push(eventArgs.element.getAttribute('data-value'));
                    }
                });
            }
        };
        this.listTag = _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createList(this.createElement, listItems, listBaseOptions, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.listTag, { 'role': 'listbox', 'aria-hidden': 'false', 'id': this.element.id + '_options' });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([this.listTag], this.listWrapper);
    };
    TimePicker.prototype.documentClickHandler = function (event) {
        var target = event.target;
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && (this.inputWrapper.container.contains(target) ||
            (this.popupObj.element && this.popupObj.element.contains(target)))) && event.type !== 'touchstart') {
            event.preventDefault();
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '[id="' + this.popupObj.element.id + '"]')) && target !== this.inputElement
            && target !== (this.inputWrapper && this.inputWrapper.buttons[0]) &&
            target !== (this.inputWrapper && this.inputWrapper.clearButton) &&
            target !== (this.inputWrapper && this.inputWrapper.container)) {
            if (this.isPopupOpen()) {
                this.hide();
                this.focusOut();
            }
        }
        else if (target !== this.inputElement) {
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.isPreventBlur = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'edge') && (document.activeElement === this.inputElement)
                    && (target === this.popupWrapper);
            }
        }
    };
    TimePicker.prototype.setEnableRtl = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnableRtl(this.enableRtl, [this.inputWrapper.container]);
        if (this.popupObj) {
            this.popupObj.enableRtl = this.enableRtl;
            this.popupObj.dataBind();
        }
    };
    TimePicker.prototype.setEnable = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnabled(this.enabled, this.inputElement, this.floatLabelType);
        if (this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-disabled': 'false' });
            this.inputElement.setAttribute('tabindex', this.tabIndex);
        }
        else {
            this.hide();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], DISABLED);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-disabled': 'true' });
            this.inputElement.tabIndex = -1;
        }
    };
    TimePicker.prototype.getProperty = function (date, val) {
        if (val === 'min') {
            this.initMin = this.checkDateValue(new Date(this.checkInValue(date.min)));
            this.setProperties({ min: this.initMin }, true);
        }
        else {
            this.initMax = this.checkDateValue(new Date(this.checkInValue(date.max)));
            this.setProperties({ max: this.initMax }, true);
        }
        if (this.inputElement.value === '') {
            this.validateMinMax(this.value, this.min, this.max);
        }
        else {
            this.checkValue(this.inputElement.value);
        }
        this.checkValueChange(null, false);
    };
    TimePicker.prototype.inputBlurHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        // IE popup closing issue when click over the scrollbar
        if (this.isPreventBlur && this.isPopupOpen()) {
            this.inputElement.focus();
            return;
        }
        this.closePopup(0, e);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [FOCUS]);
        var blurArguments = {
            model: this.isBlazorServer ? null : this,
        };
        this.trigger('blur', blurArguments);
        if (!this.isBlazorServer && this.getText() !== this.inputElement.value) {
            this.updateValue((this.inputElement).value, e);
        }
        else if (this.inputElement.value.trim().length === 0) {
            this.resetState();
        }
        if (this.isBlazorServer) {
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnStrictMode', this.inputElement.value);
        }
        this.cursorDetails = null;
        this.isNavigate = false;
        if (this.inputElement.value === '') {
            this.invalidValueString = null;
        }
    };
    /**
     * Focuses out the TimePicker textbox element.
     * @returns void
     */
    TimePicker.prototype.focusOut = function () {
        if (document.activeElement === this.inputElement) {
            this.inputElement.blur();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [FOCUS]);
            var blurArguments = {
                model: this.isBlazorServer ? null : this
            };
            this.trigger('blur', blurArguments);
        }
    };
    TimePicker.prototype.isPopupOpen = function () {
        if (this.popupWrapper && this.popupWrapper.classList.contains('' + ROOT)) {
            return true;
        }
        return false;
    };
    TimePicker.prototype.inputFocusHandler = function () {
        if (!this.enabled) {
            return;
        }
        var focusArguments = {
            model: this.isBlazorServer ? null : this
        };
        if (!this.readonly && !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.selectInputText();
        }
        this.trigger('focus', focusArguments);
        this.clearIconState();
        if (this.openOnFocus) {
            this.show();
        }
    };
    /**
     * Focused the TimePicker textbox element.
     * @returns void
     */
    TimePicker.prototype.focusIn = function () {
        if (document.activeElement !== this.inputElement && this.enabled) {
            this.inputElement.focus();
            var focusArguments = {
                model: this
            };
        }
    };
    /**
     * Hides the TimePicker popup.
     * @returns void

     */
    TimePicker.prototype.hide = function () {
        this.closePopup(100, null);
        this.clearIconState();
    };
    /**
     * Opens the popup to show the list items.
     * @returns void

     */
    TimePicker.prototype.show = function (event) {
        var _this = this;
        if ((this.enabled && this.readonly) || !this.enabled || this.popupWrapper) {
            return;
        }
        else {
            this.popupCreation();
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.listWrapper) {
                this.modal = this.createElement('div');
                this.modal.className = '' + ROOT + ' e-time-modal';
                document.body.className += ' ' + OVERFLOW;
                document.body.appendChild(this.modal);
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.mobileTimePopupWrap = this.createElement('div', { className: 'e-timepicker-mob-popup-wrap' });
                document.body.appendChild(this.mobileTimePopupWrap);
            }
            this.openPopupEventArgs = {
                popup: this.isBlazorServer ? null : (this.popupObj || null),
                cancel: false,
                event: event || null,
                name: 'open',
                appendTo: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? this.mobileTimePopupWrap : document.body
            };
            var eventArgs = this.openPopupEventArgs;
            this.trigger('open', eventArgs, function (eventArgs) {
                if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && _this.isServerRendered)) {
                    eventArgs.popup = _this.popupObj || null;
                }
                _this.openPopupEventArgs = eventArgs;
                if (!_this.openPopupEventArgs.cancel && !_this.inputWrapper.buttons[0].classList.contains(DISABLED)) {
                    if (_this.isBlazorServer) {
                        _this.popupWrapper.style.visibility = '';
                        _this.popupWrapper.style.width = _this.inputWrapper.container.offsetWidth + 'px';
                        _this.popupWrapper.style.height = 'auto';
                    }
                    if (_this.isBlazorServer) {
                        _this.openPopupEventArgs.popup = _this.popupObj;
                    }
                    _this.openPopupEventArgs.appendTo.appendChild(_this.popupWrapper);
                    _this.popupAlignment(_this.openPopupEventArgs);
                    _this.setScrollPosition();
                    if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                        _this.inputElement.focus();
                    }
                    var openAnimation = {
                        name: 'FadeIn',
                        duration: ANIMATIONDURATION,
                    };
                    _this.popupObj.refreshPosition(_this.anchor);
                    if (_this.zIndex === 1000) {
                        _this.popupObj.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), _this.element);
                    }
                    else {
                        _this.popupObj.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](openAnimation), null);
                    }
                    _this.setActiveDescendant();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.inputElement, { 'aria-expanded': 'true' });
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.container], FOCUS);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', _this.documentClickHandler, _this);
                    _this.setOverlayIndex(_this.mobileTimePopupWrap, _this.popupObj.element, _this.modal, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice);
                }
                else {
                    _this.popupObj.destroy();
                    if (_this.isBlazorServer) {
                        _this.disposeServerPopup();
                        // tslint:disable
                        _this.inputWrapper.container.parentElement.insertBefore(_this.popupWrapper, _this.inputWrapper.container.nextElementSibling);
                        _this.interopAdaptor.invokeMethodAsync('OnPopupHide', false);
                        // tslint:enable
                    }
                    _this.popupWrapper = _this.listTag = undefined;
                    _this.liCollections = _this.timeCollections = _this.disableItemCollection = [];
                    _this.popupObj = null;
                }
            });
        }
    };
    TimePicker.prototype.setOverlayIndex = function (popupWrapper, timePopupElement, modal, isDevice) {
        if (isDevice && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timePopupElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(modal) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popupWrapper)) {
            var index = parseInt(timePopupElement.style.zIndex, 10) ? parseInt(timePopupElement.style.zIndex, 10) : 1000;
            modal.style.zIndex = (index - 1).toString();
            popupWrapper.style.zIndex = index.toString();
        }
    };
    TimePicker.prototype.formatValues = function (type) {
        var value;
        if (typeof type === 'number') {
            value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(type);
        }
        else if (typeof type === 'string') {
            value = (type.match(/px|%|em/)) ? type : isNaN(parseInt(type, 10)) ? type : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(type);
        }
        return value;
    };
    TimePicker.prototype.popupAlignment = function (args) {
        args.popup.position.X = this.formatValues(args.popup.position.X);
        args.popup.position.Y = this.formatValues(args.popup.position.Y);
        if (!isNaN(parseFloat(args.popup.position.X)) || !isNaN(parseFloat(args.popup.position.Y))) {
            this.popupObj.relateTo = this.anchor = document.body;
            this.popupObj.targetType = 'container';
        }
        if (!isNaN(parseFloat(args.popup.position.X))) {
            this.popupObj.offsetX = parseFloat(args.popup.position.X);
        }
        if (!isNaN(parseFloat(args.popup.position.Y))) {
            this.popupObj.offsetY = parseFloat(args.popup.position.Y);
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            switch (args.popup.position.X) {
                case 'left':
                    break;
                case 'right':
                    args.popup.offsetX = this.containerStyle.width;
                    break;
                case 'center':
                    args.popup.offsetX = -(this.containerStyle.width / 2);
                    break;
            }
            switch (args.popup.position.Y) {
                case 'top':
                    break;
                case 'bottom':
                    break;
                case 'center':
                    args.popup.offsetY = -(this.containerStyle.height / 2);
                    break;
            }
            if (args.popup.position.X === 'center' && args.popup.position.Y === 'center') {
                this.popupObj.relateTo = this.inputWrapper.container;
                this.anchor = this.inputElement;
                this.popupObj.targetType = 'relative';
            }
        }
        else {
            if (args.popup.position.X === 'center' && args.popup.position.Y === 'center') {
                this.popupObj.relateTo = this.anchor = document.body;
                this.popupObj.offsetY = 0;
                this.popupObj.targetType = 'container';
                this.popupObj.collision = { X: 'fit', Y: 'fit' };
            }
        }
    };
    /**
     * Gets the properties to be maintained upon browser refresh.
     * @returns string
     */
    TimePicker.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * To get component name
     * @private
     */
    TimePicker.prototype.getModuleName = function () {
        return 'timepicker';
    };
    /**
     * Called internally if any of the property value changed.
     * returns void
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    TimePicker.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(newProp.placeholder, this.inputElement);
                    this.inputElement.setAttribute('aria-placeholder', newProp.placeholder);
                    break;
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setReadonly(this.readonly, this.inputElement, this.floatLabelType);
                    if (this.readonly) {
                        this.hide();
                    }
                    this.setTimeAllowEdit();
                    break;
                case 'enabled':
                    this.setProperties({ enabled: newProp.enabled }, true);
                    this.setEnable();
                    break;
                case 'allowEdit':
                    this.setTimeAllowEdit();
                    break;
                case 'enableRtl':
                    if (!this.isBlazorServer) {
                        this.setProperties({ enableRtl: newProp.enableRtl }, true);
                        this.setEnableRtl();
                    }
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'zIndex':
                    this.setProperties({ zIndex: newProp.zIndex }, true);
                    this.setZIndex();
                    break;
                case 'htmlAttributes':
                    this.updateHtmlAttributeToElement();
                    this.updateHtmlAttributeToWrapper();
                    this.checkAttributes(true);
                    break;
                case 'min':
                case 'max':
                    if (!this.isBlazorServer) {
                        this.getProperty(newProp, prop);
                    }
                    break;
                case 'showClearButton':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setClearButton(this.showClearButton, this.inputElement, this.inputWrapper);
                    this.bindClearEvent();
                    break;
                case 'locale':
                    this.setProperties({ locale: newProp.locale }, true);
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.l10n.setLocale(this.locale);
                    this.updatePlaceHolder();
                    if (!this.isBlazorServer) {
                        this.setValue(this.value);
                    }
                    break;
                case 'width':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.inputWrapper.container, { 'width': this.setWidth(newProp.width) });
                    this.containerStyle = this.inputWrapper.container.getBoundingClientRect();
                    break;
                case 'format':
                    this.setProperties({ format: newProp.format }, true);
                    this.checkTimeFormat();
                    if (!this.isBlazorServer) {
                        this.setValue(this.value);
                    }
                    break;
                case 'value':
                    if (!this.isBlazorServer) {
                        this.invalidValueString = null;
                        this.checkInvalidValue(newProp.value);
                        newProp.value = this.value;
                        if (!this.invalidValueString) {
                            if (typeof newProp.value === 'string') {
                                this.setProperties({ value: this.checkDateValue(new Date(newProp.value)) }, true);
                                newProp.value = this.value;
                            }
                            else {
                                if ((newProp.value && +new Date(+newProp.value).setMilliseconds(0)) !== +this.value) {
                                    newProp.value = this.checkDateValue(new Date('' + newProp.value));
                                }
                            }
                            this.initValue = newProp.value;
                            newProp.value = this.compareFormatChange(this.checkValue(newProp.value));
                        }
                        else {
                            this.updateInputValue(this.invalidValueString);
                            this.checkErrorState(this.invalidValueString);
                        }
                        this.checkValueChange(null, false);
                        if (this.isPopupOpen()) {
                            this.setScrollPosition();
                        }
                        if (this.isAngular && this.preventChange) {
                            this.preventChange = false;
                        }
                    }
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeFloating(this.inputWrapper);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addFloating(this.inputElement, this.floatLabelType, this.placeholder);
                    break;
                case 'strictMode':
                    if (!this.isBlazorServer) {
                        this.invalidValueString = null;
                        if (newProp.strictMode) {
                            this.checkErrorState(null);
                        }
                        this.setProperties({ strictMode: newProp.strictMode }, true);
                        this.checkValue((this.inputElement).value);
                        this.checkValueChange(null, false);
                    }
                    break;
                case 'scrollTo':
                    if (!this.isBlazorServer) {
                        if (this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo)))) {
                            if (this.popupWrapper) {
                                this.setScrollTo();
                            }
                            this.setProperties({ scrollTo: this.checkDateValue(new Date(this.checkInValue(newProp.scrollTo))) }, true);
                        }
                        else {
                            this.setProperties({ scrollTo: null }, true);
                        }
                    }
                    else {
                        if (this.popupWrapper) {
                            this.setScrollTo();
                        }
                    }
                    break;
            }
        }
    };
    TimePicker.prototype.checkInValue = function (inValue) {
        if (inValue instanceof Date) {
            return (inValue.toUTCString());
        }
        else {
            return ('' + inValue);
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TimePicker.prototype, "strictMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "keyConfigs", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "format", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TimePicker.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TimePicker.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], TimePicker.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], TimePicker.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], TimePicker.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TimePicker.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TimePicker.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(30)
    ], TimePicker.prototype, "step", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "scrollTo", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TimePicker.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TimePicker.prototype, "allowEdit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TimePicker.prototype, "openOnFocus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "itemRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "cleared", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TimePicker.prototype, "focus", void 0);
    TimePicker = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], TimePicker);
    return TimePicker;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-compression/compression-writer.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-compression/compression-writer.js ***!
  \*****************************************************************************/
/*! exports provided: CompressedStreamWriter, CompressorHuffmanTree, ChecksumCalculator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressedStreamWriter", function() { return CompressedStreamWriter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressorHuffmanTree", function() { return CompressorHuffmanTree; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChecksumCalculator", function() { return ChecksumCalculator; });
/* harmony import */ var _ej2_file_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ej2-file-utils */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/index.js");

/**
 * array literal codes
 */
var ARR_LITERAL_CODES = new Int16Array(286);
var ARR_LITERAL_LENGTHS = new Uint8Array(286);
var ARR_DISTANCE_CODES = new Int16Array(30);
var ARR_DISTANCE_LENGTHS = new Uint8Array(30);
/**
 * represent compression stream writer
 * ```typescript
 * let compressedWriter = new CompressedStreamWriter();
 * let text: string = 'Hello world!!!';
 * compressedWriter.write(text, 0, text.length);
 * compressedWriter.close();
 * ```
 */
var CompressedStreamWriter = /** @__PURE__ @class */ (function () {
    /**
     * Initializes compressor and writes ZLib header if needed.
     * @param {boolean} noWrap - optional if true, ZLib header and checksum will not be written.
     */
    function CompressedStreamWriter(noWrap) {
        this.pendingBuffer = new Uint8Array(1 << 16);
        this.pendingBufLength = 0;
        this.pendingBufCache = 0;
        this.pendingBufBitsInCache = 0;
        this.bufferPosition = 0;
        this.extraBits = 0;
        this.currentHash = 0;
        this.matchStart = 0;
        this.matchLength = 0;
        this.matchPrevAvail = false;
        this.blockStart = 0;
        this.stringStart = 0;
        this.lookAhead = 0;
        this.totalBytesIn = 0;
        this.inputOffset = 0;
        this.inputEnd = 0;
        this.windowSize = 1 << 15;
        this.windowMask = this.windowSize - 1;
        this.hashSize = 1 << 15;
        this.hashMask = this.hashSize - 1;
        this.hashShift = Math.floor((15 + 3 - 1) / 3);
        this.maxDist = this.windowSize - 262;
        this.checkSum = 1;
        this.noWrap = false;
        if (!CompressedStreamWriter.isHuffmanTreeInitiated) {
            CompressedStreamWriter.initHuffmanTree();
            CompressedStreamWriter.isHuffmanTreeInitiated = true;
        }
        this.treeLiteral = new CompressorHuffmanTree(this, 286, 257, 15);
        this.treeDistances = new CompressorHuffmanTree(this, 30, 1, 15);
        this.treeCodeLengths = new CompressorHuffmanTree(this, 19, 4, 7);
        this.arrDistances = new Uint16Array((1 << 14));
        this.arrLiterals = new Uint8Array((1 << 14));
        this.stream = [];
        this.dataWindow = new Uint8Array(2 * this.windowSize);
        this.hashHead = new Int16Array(this.hashSize);
        this.hashPrevious = new Int16Array(this.windowSize);
        this.blockStart = this.stringStart = 1;
        this.noWrap = noWrap;
        if (!noWrap) {
            this.writeZLibHeader();
        }
    }
    Object.defineProperty(CompressedStreamWriter.prototype, "compressedData", {
        /**
         * get compressed data
         */
        get: function () {
            return this.stream;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CompressedStreamWriter.prototype, "getCompressedString", {
        get: function () {
            var compressedString = '';
            if (this.stream !== undefined) {
                for (var i = 0; i < this.stream.length; i++) {
                    compressedString += String.fromCharCode.apply(null, this.stream[i]);
                }
            }
            return compressedString;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Compresses data and writes it to the stream.
     * @param {Uint8Array} data - data to compress
     * @param {number} offset - offset in data
     * @param {number} length - length of the data
     * @returns {void}
     */
    CompressedStreamWriter.prototype.write = function (data, offset, length) {
        if (data === undefined || data === null) {
            throw new Error('ArgumentException: data cannot null or undefined');
        }
        var end = offset + length;
        if (0 > offset || offset > end || end > data.length) {
            throw new Error('ArgumentOutOfRangeException: Offset or length is incorrect');
        }
        if (typeof data === 'string') {
            var encode = new _ej2_file_utils__WEBPACK_IMPORTED_MODULE_0__["Encoding"](false);
            encode.type = 'Utf8';
            data = new Uint8Array(encode.getBytes(data, 0, data.length));
            end = offset + data.length;
        }
        this.inputBuffer = data;
        this.inputOffset = offset;
        this.inputEnd = end;
        if (!this.noWrap) {
            this.checkSum = ChecksumCalculator.checksumUpdate(this.checkSum, this.inputBuffer, this.inputOffset, end);
        }
        while (!(this.inputEnd === this.inputOffset) || !(this.pendingBufLength === 0)) {
            this.pendingBufferFlush();
            this.compressData(false);
        }
    };
    /**
     * write ZLib header to the compressed data
     * @return {void}
     */
    CompressedStreamWriter.prototype.writeZLibHeader = function () {
        /* Initialize header.*/
        var headerDate = (8 + (7 << 4)) << 8;
        /* Save compression level.*/
        headerDate |= ((5 >> 2) & 3) << 6;
        /* Align header.*/
        headerDate += 31 - (headerDate % 31);
        /* Write header to stream.*/
        this.pendingBufferWriteShortBytes(headerDate);
    };
    /**
     *  Write Most Significant Bytes in to stream
     * @param {number} s - check sum value
     */
    CompressedStreamWriter.prototype.pendingBufferWriteShortBytes = function (s) {
        this.pendingBuffer[this.pendingBufLength++] = s >> 8;
        this.pendingBuffer[this.pendingBufLength++] = s;
    };
    CompressedStreamWriter.prototype.compressData = function (finish) {
        var success;
        do {
            this.fillWindow();
            var canFlush = (finish && this.inputEnd === this.inputOffset);
            success = this.compressSlow(canFlush, finish);
        } while (this.pendingBufLength === 0 && success);
        return success;
    };
    CompressedStreamWriter.prototype.compressSlow = function (flush, finish) {
        if (this.lookAhead < 262 && !flush) {
            return false;
        }
        while (this.lookAhead >= 262 || flush) {
            if (this.lookAhead === 0) {
                return this.lookAheadCompleted(finish);
            }
            if (this.stringStart >= 2 * this.windowSize - 262) {
                this.slideWindow();
            }
            var prevMatch = this.matchStart;
            var prevLen = this.matchLength;
            if (this.lookAhead >= 3) {
                this.discardMatch();
            }
            if (prevLen >= 3 && this.matchLength <= prevLen) {
                prevLen = this.matchPreviousBest(prevMatch, prevLen);
            }
            else {
                this.matchPreviousAvailable();
            }
            if (this.bufferPosition >= (1 << 14)) {
                return this.huffmanIsFull(finish);
            }
        }
        return true;
    };
    CompressedStreamWriter.prototype.discardMatch = function () {
        var hashHead = this.insertString();
        if (hashHead !== 0 && this.stringStart - hashHead <= this.maxDist && this.findLongestMatch(hashHead)) {
            if (this.matchLength <= 5 && (this.matchLength === 3 && this.stringStart - this.matchStart > 4096)) {
                this.matchLength = 3 - 1;
            }
        }
    };
    CompressedStreamWriter.prototype.matchPreviousAvailable = function () {
        if (this.matchPrevAvail) {
            this.huffmanTallyLit(this.dataWindow[this.stringStart - 1] & 0xff);
        }
        this.matchPrevAvail = true;
        this.stringStart++;
        this.lookAhead--;
    };
    CompressedStreamWriter.prototype.matchPreviousBest = function (prevMatch, prevLen) {
        this.huffmanTallyDist(this.stringStart - 1 - prevMatch, prevLen);
        prevLen -= 2;
        do {
            this.stringStart++;
            this.lookAhead--;
            if (this.lookAhead >= 3) {
                this.insertString();
            }
        } while (--prevLen > 0);
        this.stringStart++;
        this.lookAhead--;
        this.matchPrevAvail = false;
        this.matchLength = 3 - 1;
        return prevLen;
    };
    CompressedStreamWriter.prototype.lookAheadCompleted = function (finish) {
        if (this.matchPrevAvail) {
            this.huffmanTallyLit(this.dataWindow[this.stringStart - 1] & 0xff);
        }
        this.matchPrevAvail = false;
        this.huffmanFlushBlock(this.dataWindow, this.blockStart, this.stringStart - this.blockStart, finish);
        this.blockStart = this.stringStart;
        return false;
    };
    CompressedStreamWriter.prototype.huffmanIsFull = function (finish) {
        var len = this.stringStart - this.blockStart;
        if (this.matchPrevAvail) {
            len--;
        }
        var lastBlock = (finish && this.lookAhead === 0 && !this.matchPrevAvail);
        this.huffmanFlushBlock(this.dataWindow, this.blockStart, len, lastBlock);
        this.blockStart += len;
        return !lastBlock;
    };
    CompressedStreamWriter.prototype.fillWindow = function () {
        if (this.stringStart >= this.windowSize + this.maxDist) {
            this.slideWindow();
        }
        while (this.lookAhead < 262 && this.inputOffset < this.inputEnd) {
            var more = 2 * this.windowSize - this.lookAhead - this.stringStart;
            if (more > this.inputEnd - this.inputOffset) {
                more = this.inputEnd - this.inputOffset;
            }
            this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset, this.inputOffset + more), this.stringStart + this.lookAhead);
            this.inputOffset += more;
            this.totalBytesIn += more;
            this.lookAhead += more;
        }
        if (this.lookAhead >= 3) {
            this.updateHash();
        }
    };
    CompressedStreamWriter.prototype.slideWindow = function () {
        this.dataWindow.set(this.dataWindow.subarray(this.windowSize, this.windowSize + this.windowSize), 0);
        this.matchStart -= this.windowSize;
        this.stringStart -= this.windowSize;
        this.blockStart -= this.windowSize;
        for (var i = 0; i < this.hashSize; ++i) {
            var m = this.hashHead[i] & 0xffff;
            this.hashHead[i] = (((m >= this.windowSize) ? (m - this.windowSize) : 0));
        }
        for (var i = 0; i < this.windowSize; i++) {
            var m = this.hashPrevious[i] & 0xffff;
            this.hashPrevious[i] = ((m >= this.windowSize) ? (m - this.windowSize) : 0);
        }
    };
    CompressedStreamWriter.prototype.insertString = function () {
        var match;
        var hash = ((this.currentHash << this.hashShift) ^ this.dataWindow[this.stringStart + (3 - 1)]) & this.hashMask;
        this.hashPrevious[this.stringStart & this.windowMask] = match = this.hashHead[hash];
        this.hashHead[hash] = this.stringStart;
        this.currentHash = hash;
        return match & 0xffff;
    };
    CompressedStreamWriter.prototype.findLongestMatch = function (curMatch) {
        var chainLen = 4096;
        var niceLen = 258;
        var scan = this.stringStart;
        var match;
        var bestEnd = this.stringStart + this.matchLength;
        var bestLength = Math.max(this.matchLength, 3 - 1);
        var limit = Math.max(this.stringStart - this.maxDist, 0);
        var stringEnd = this.stringStart + 258 - 1;
        var scanEnd1 = this.dataWindow[bestEnd - 1];
        var scanEnd = this.dataWindow[bestEnd];
        var data = this.dataWindow;
        if (bestLength >= 32) {
            chainLen >>= 2;
        }
        if (niceLen > this.lookAhead) {
            niceLen = this.lookAhead;
        }
        do {
            if (data[curMatch + bestLength] !== scanEnd ||
                data[curMatch + bestLength - 1] !== scanEnd1 ||
                data[curMatch] !== data[scan] ||
                data[curMatch + 1] !== data[scan + 1]) {
                continue;
            }
            match = curMatch + 2;
            scan += 2;
            /* tslint:disable */
            while (data[++scan] === data[++match] && data[++scan] === data[++match] &&
                data[++scan] === data[++match] && data[++scan] === data[++match] &&
                data[++scan] === data[++match] && data[++scan] === data[++match] &&
                data[++scan] === data[++match] && data[++scan] === data[++match] && scan < stringEnd) {
                /* tslint:disable */
            }
            if (scan > bestEnd) {
                this.matchStart = curMatch;
                bestEnd = scan;
                bestLength = scan - this.stringStart;
                if (bestLength >= niceLen) {
                    break;
                }
                scanEnd1 = data[bestEnd - 1];
                scanEnd = data[bestEnd];
            }
            scan = this.stringStart;
        } while ((curMatch = (this.hashPrevious[curMatch & this.windowMask] & 0xffff)) > limit && --chainLen !== 0);
        this.matchLength = Math.min(bestLength, this.lookAhead);
        return this.matchLength >= 3;
    };
    CompressedStreamWriter.prototype.updateHash = function () {
        this.currentHash = (this.dataWindow[this.stringStart] << this.hashShift) ^ this.dataWindow[this.stringStart + 1];
    };
    CompressedStreamWriter.prototype.huffmanTallyLit = function (literal) {
        this.arrDistances[this.bufferPosition] = 0;
        this.arrLiterals[this.bufferPosition++] = literal;
        this.treeLiteral.codeFrequencies[literal]++;
        return this.bufferPosition >= (1 << 14);
    };
    CompressedStreamWriter.prototype.huffmanTallyDist = function (dist, len) {
        this.arrDistances[this.bufferPosition] = dist;
        this.arrLiterals[this.bufferPosition++] = (len - 3);
        var lc = this.huffmanLengthCode(len - 3);
        this.treeLiteral.codeFrequencies[lc]++;
        if (lc >= 265 && lc < 285) {
            this.extraBits += Math.floor((lc - 261) / 4);
        }
        var dc = this.huffmanDistanceCode(dist - 1);
        this.treeDistances.codeFrequencies[dc]++;
        if (dc >= 4) {
            this.extraBits += Math.floor((dc / 2 - 1));
        }
        return this.bufferPosition >= (1 << 14);
    };
    CompressedStreamWriter.prototype.huffmanFlushBlock = function (stored, storedOffset, storedLength, lastBlock) {
        this.treeLiteral.codeFrequencies[256]++;
        this.treeLiteral.buildTree();
        this.treeDistances.buildTree();
        this.treeLiteral.calculateBLFreq(this.treeCodeLengths);
        this.treeDistances.calculateBLFreq(this.treeCodeLengths);
        this.treeCodeLengths.buildTree();
        var blTreeCodes = 4;
        for (var i = 18; i > blTreeCodes; i--) {
            if (this.treeCodeLengths.codeLengths[CompressorHuffmanTree.huffCodeLengthOrders[i]] > 0) {
                blTreeCodes = i + 1;
            }
        }
        var opt_len = 14 + blTreeCodes * 3 + this.treeCodeLengths.getEncodedLength() +
            this.treeLiteral.getEncodedLength() + this.treeDistances.getEncodedLength() + this.extraBits;
        var static_len = this.extraBits;
        for (var i = 0; i < 286; i++) {
            static_len += this.treeLiteral.codeFrequencies[i] * ARR_LITERAL_LENGTHS[i];
        }
        for (var i = 0; i < 30; i++) {
            static_len += this.treeDistances.codeFrequencies[i] * ARR_DISTANCE_LENGTHS[i];
        }
        if (opt_len >= static_len) {
            // Force static trees.
            opt_len = static_len;
        }
        if (storedOffset >= 0 && storedLength + 4 < opt_len >> 3) {
            this.huffmanFlushStoredBlock(stored, storedOffset, storedLength, lastBlock);
        }
        else if (opt_len == static_len) {
            // Encode with static tree.
            this.pendingBufferWriteBits((1 << 1) + (lastBlock ? 1 : 0), 3);
            this.treeLiteral.setStaticCodes(ARR_LITERAL_CODES, ARR_LITERAL_LENGTHS);
            this.treeDistances.setStaticCodes(ARR_DISTANCE_CODES, ARR_DISTANCE_LENGTHS);
            this.huffmanCompressBlock();
            this.huffmanReset();
        }
        else {
            this.pendingBufferWriteBits((2 << 1) + (lastBlock ? 1 : 0), 3);
            this.huffmanSendAllTrees(blTreeCodes);
            this.huffmanCompressBlock();
            this.huffmanReset();
        }
    };
    CompressedStreamWriter.prototype.huffmanFlushStoredBlock = function (stored, storedOffset, storedLength, lastBlock) {
        this.pendingBufferWriteBits((0 << 1) + (lastBlock ? 1 : 0), 3);
        this.pendingBufferAlignToByte();
        this.pendingBufferWriteShort(storedLength);
        this.pendingBufferWriteShort(~storedLength);
        this.pendingBufferWriteByteBlock(stored, storedOffset, storedLength);
        this.huffmanReset();
    };
    CompressedStreamWriter.prototype.huffmanLengthCode = function (len) {
        if (len === 255) {
            return 285;
        }
        var code = 257;
        while (len >= 8) {
            code += 4;
            len >>= 1;
        }
        return code + len;
    };
    CompressedStreamWriter.prototype.huffmanDistanceCode = function (distance) {
        var code = 0;
        while (distance >= 4) {
            code += 2;
            distance >>= 1;
        }
        return code + distance;
    };
    CompressedStreamWriter.prototype.huffmanSendAllTrees = function (blTreeCodes) {
        this.treeCodeLengths.buildCodes();
        this.treeLiteral.buildCodes();
        this.treeDistances.buildCodes();
        this.pendingBufferWriteBits(this.treeLiteral.treeLength - 257, 5);
        this.pendingBufferWriteBits(this.treeDistances.treeLength - 1, 5);
        this.pendingBufferWriteBits(blTreeCodes - 4, 4);
        for (var rank = 0; rank < blTreeCodes; rank++) {
            this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[CompressorHuffmanTree.huffCodeLengthOrders[rank]], 3);
        }
        this.treeLiteral.writeTree(this.treeCodeLengths);
        this.treeDistances.writeTree(this.treeCodeLengths);
    };
    CompressedStreamWriter.prototype.huffmanReset = function () {
        this.bufferPosition = 0;
        this.extraBits = 0;
        this.treeLiteral.reset();
        this.treeDistances.reset();
        this.treeCodeLengths.reset();
    };
    CompressedStreamWriter.prototype.huffmanCompressBlock = function () {
        for (var i = 0; i < this.bufferPosition; i++) {
            var literalLen = this.arrLiterals[i] & 255;
            var dist = this.arrDistances[i];
            if (dist-- !== 0) {
                var lc = this.huffmanLengthCode(literalLen);
                this.treeLiteral.writeCodeToStream(lc);
                var bits = Math.floor((lc - 261) / 4);
                if (bits > 0 && bits <= 5) {
                    this.pendingBufferWriteBits(literalLen & ((1 << bits) - 1), bits);
                }
                var dc = this.huffmanDistanceCode(dist);
                this.treeDistances.writeCodeToStream(dc);
                bits = Math.floor(dc / 2 - 1);
                if (bits > 0) {
                    this.pendingBufferWriteBits(dist & ((1 << bits) - 1), bits);
                }
            }
            else {
                this.treeLiteral.writeCodeToStream(literalLen);
            }
        }
        this.treeLiteral.writeCodeToStream(256);
    };
    /**
     * write bits in to internal buffer
     * @param {number} b - source of bits
     * @param {number} count - count of bits to write
     */
    CompressedStreamWriter.prototype.pendingBufferWriteBits = function (b, count) {
        var uint = new Uint32Array(1);
        uint[0] = this.pendingBufCache | (b << this.pendingBufBitsInCache);
        this.pendingBufCache = uint[0];
        this.pendingBufBitsInCache += count;
        this.pendingBufferFlushBits();
    };
    CompressedStreamWriter.prototype.pendingBufferFlush = function (isClose) {
        this.pendingBufferFlushBits();
        if (this.pendingBufLength > 0) {
            var array = new Uint8Array(this.pendingBufLength);
            array.set(this.pendingBuffer.subarray(0, this.pendingBufLength), 0);
            this.stream.push(array);
        }
        this.pendingBufLength = 0;
    };
    CompressedStreamWriter.prototype.pendingBufferFlushBits = function () {
        var result = 0;
        while (this.pendingBufBitsInCache >= 8 && this.pendingBufLength < (1 << 16)) {
            this.pendingBuffer[this.pendingBufLength++] = this.pendingBufCache;
            this.pendingBufCache >>= 8;
            this.pendingBufBitsInCache -= 8;
            result++;
        }
        return result;
    };
    CompressedStreamWriter.prototype.pendingBufferWriteByteBlock = function (data, offset, length) {
        var array = data.subarray(offset, offset + length);
        this.pendingBuffer.set(array, this.pendingBufLength);
        this.pendingBufLength += length;
    };
    CompressedStreamWriter.prototype.pendingBufferWriteShort = function (s) {
        this.pendingBuffer[this.pendingBufLength++] = s;
        this.pendingBuffer[this.pendingBufLength++] = (s >> 8);
    };
    CompressedStreamWriter.prototype.pendingBufferAlignToByte = function () {
        if (this.pendingBufBitsInCache > 0) {
            this.pendingBuffer[this.pendingBufLength++] = this.pendingBufCache;
        }
        this.pendingBufCache = 0;
        this.pendingBufBitsInCache = 0;
    };
    /**
     * Huffman Tree literal calculation
     * @private
     */
    CompressedStreamWriter.initHuffmanTree = function () {
        var i = 0;
        while (i < 144) {
            ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x030 + i) << 8);
            ARR_LITERAL_LENGTHS[i++] = 8;
        }
        while (i < 256) {
            ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x190 - 144 + i) << 7);
            ARR_LITERAL_LENGTHS[i++] = 9;
        }
        while (i < 280) {
            ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x000 - 256 + i) << 9);
            ARR_LITERAL_LENGTHS[i++] = 7;
        }
        while (i < 286) {
            ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x0c0 - 280 + i) << 8);
            ARR_LITERAL_LENGTHS[i++] = 8;
        }
        for (i = 0; i < 30; i++) {
            ARR_DISTANCE_CODES[i] = CompressorHuffmanTree.bitReverse(i << 11);
            ARR_DISTANCE_LENGTHS[i] = 5;
        }
    };
    /**
     * close the stream and write all pending buffer in to stream
     * @returns {void}
     */
    CompressedStreamWriter.prototype.close = function () {
        do {
            this.pendingBufferFlush(true);
            if (!this.compressData(true)) {
                this.pendingBufferFlush(true);
                this.pendingBufferAlignToByte();
                if (!this.noWrap) {
                    this.pendingBufferWriteShortBytes(this.checkSum >> 16);
                    this.pendingBufferWriteShortBytes(this.checkSum & 0xffff);
                }
                this.pendingBufferFlush(true);
            }
        } while (!(this.inputEnd === this.inputOffset) ||
            !(this.pendingBufLength === 0));
    };
    /**
     * release allocated un-managed resource
     * @returns {void}
     */
    CompressedStreamWriter.prototype.destroy = function () {
        this.stream = [];
        this.stream = undefined;
        this.pendingBuffer = undefined;
        this.treeLiteral = undefined;
        this.treeDistances = undefined;
        this.treeCodeLengths = undefined;
        this.arrLiterals = undefined;
        this.arrDistances = undefined;
        this.hashHead = undefined;
        this.hashPrevious = undefined;
        this.dataWindow = undefined;
        this.inputBuffer = undefined;
        this.pendingBufLength = undefined;
        this.pendingBufCache = undefined;
        this.pendingBufBitsInCache = undefined;
        this.bufferPosition = undefined;
        this.extraBits = undefined;
        this.currentHash = undefined;
        this.matchStart = undefined;
        this.matchLength = undefined;
        this.matchPrevAvail = undefined;
        this.blockStart = undefined;
        this.stringStart = undefined;
        this.lookAhead = undefined;
        this.totalBytesIn = undefined;
        this.inputOffset = undefined;
        this.inputEnd = undefined;
        this.windowSize = undefined;
        this.windowMask = undefined;
        this.hashSize = undefined;
        this.hashMask = undefined;
        this.hashShift = undefined;
        this.maxDist = undefined;
        this.checkSum = undefined;
        this.noWrap = undefined;
    };
    CompressedStreamWriter.isHuffmanTreeInitiated = false;
    return CompressedStreamWriter;
}());

/**
 * represent the Huffman Tree
 */
var CompressorHuffmanTree = /** @__PURE__ @class */ (function () {
    /**
     * Create new Huffman Tree
     * @param {CompressedStreamWriter} writer instance
     * @param {number} elementCount - element count
     * @param {number} minCodes - minimum count
     * @param {number} maxLength - maximum count
     */
    function CompressorHuffmanTree(writer, elementCount, minCodes, maxLength) {
        this.writer = writer;
        this.codeMinCount = minCodes;
        this.maxLength = maxLength;
        this.codeFrequency = new Uint16Array(elementCount);
        this.lengthCount = new Int32Array(maxLength);
    }
    Object.defineProperty(CompressorHuffmanTree.prototype, "treeLength", {
        get: function () {
            return this.codeCount;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CompressorHuffmanTree.prototype, "codeLengths", {
        get: function () {
            return this.codeLength;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CompressorHuffmanTree.prototype, "codeFrequencies", {
        get: function () {
            return this.codeFrequency;
        },
        enumerable: true,
        configurable: true
    });
    CompressorHuffmanTree.prototype.setStaticCodes = function (codes, lengths) {
        var temp = new Int16Array(codes.length);
        temp.set(codes, 0);
        this.codes = temp;
        var lengthTemp = new Uint8Array(lengths.length);
        lengthTemp.set(lengths, 0);
        this.codeLength = lengthTemp;
    };
    /**
     * reset all code data in tree
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.reset = function () {
        for (var i = 0; i < this.codeFrequency.length; i++) {
            this.codeFrequency[i] = 0;
        }
        this.codes = undefined;
        this.codeLength = undefined;
    };
    /**
     * write code to the compressor output stream
     * @param {number} code - code to be written
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.writeCodeToStream = function (code) {
        this.writer.pendingBufferWriteBits(this.codes[code] & 0xffff, this.codeLength[code]);
    };
    /**
     * calculate code from their frequencies
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.buildCodes = function () {
        var nextCode = new Int32Array(this.maxLength);
        this.codes = new Int16Array(this.codeCount);
        var code = 0;
        for (var bitsCount = 0; bitsCount < this.maxLength; bitsCount++) {
            nextCode[bitsCount] = code;
            code += this.lengthCount[bitsCount] << (15 - bitsCount);
        }
        for (var i = 0; i < this.codeCount; i++) {
            var bits = this.codeLength[i];
            if (bits > 0) {
                this.codes[i] = CompressorHuffmanTree.bitReverse(nextCode[bits - 1]);
                nextCode[bits - 1] += 1 << (16 - bits);
            }
        }
    };
    CompressorHuffmanTree.bitReverse = function (value) {
        return (CompressorHuffmanTree.reverseBits[value & 15] << 12
            | CompressorHuffmanTree.reverseBits[(value >> 4) & 15] << 8
            | CompressorHuffmanTree.reverseBits[(value >> 8) & 15] << 4
            | CompressorHuffmanTree.reverseBits[value >> 12]);
    };
    /**
     * calculate length of compressed data
     * @returns {number}
     */
    CompressorHuffmanTree.prototype.getEncodedLength = function () {
        var len = 0;
        for (var i = 0; i < this.codeFrequency.length; i++) {
            len += this.codeFrequency[i] * this.codeLength[i];
        }
        return len;
    };
    /**
     * calculate code frequencies
     * @param {CompressorHuffmanTree} blTree
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.calculateBLFreq = function (blTree) {
        var maxCount;
        var minCount;
        var count;
        var curLen = -1;
        var i = 0;
        while (i < this.codeCount) {
            count = 1;
            var nextLen = this.codeLength[i];
            if (nextLen === 0) {
                maxCount = 138;
                minCount = 3;
            }
            else {
                maxCount = 6;
                minCount = 3;
                if (curLen !== nextLen) {
                    blTree.codeFrequency[nextLen]++;
                    count = 0;
                }
            }
            curLen = nextLen;
            i++;
            while (i < this.codeCount && curLen === this.codeLength[i]) {
                i++;
                if (++count >= maxCount) {
                    break;
                }
            }
            if (count < minCount) {
                blTree.codeFrequency[curLen] += count;
            }
            else if (curLen !== 0) {
                blTree.codeFrequency[16]++;
            }
            else if (count <= 10) {
                blTree.codeFrequency[17]++;
            }
            else {
                blTree.codeFrequency[18]++;
            }
        }
    };
    /**
     * @param {CompressorHuffmanTree} blTree - write tree to output stream
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.writeTree = function (blTree) {
        var maxRepeatCount;
        var minRepeatCount;
        var currentRepeatCount;
        var currentCodeLength = -1;
        var i = 0;
        while (i < this.codeCount) {
            currentRepeatCount = 1;
            var nextLen = this.codeLength[i];
            if (nextLen === 0) {
                maxRepeatCount = 138;
                minRepeatCount = 3;
            }
            else {
                maxRepeatCount = 6;
                minRepeatCount = 3;
                if (currentCodeLength !== nextLen) {
                    blTree.writeCodeToStream(nextLen);
                    currentRepeatCount = 0;
                }
            }
            currentCodeLength = nextLen;
            i++;
            while (i < this.codeCount && currentCodeLength === this.codeLength[i]) {
                i++;
                if (++currentRepeatCount >= maxRepeatCount) {
                    break;
                }
            }
            if (currentRepeatCount < minRepeatCount) {
                while (currentRepeatCount-- > 0) {
                    blTree.writeCodeToStream(currentCodeLength);
                }
            }
            else if (currentCodeLength !== 0) {
                blTree.writeCodeToStream(16);
                this.writer.pendingBufferWriteBits(currentRepeatCount - 3, 2);
            }
            else if (currentRepeatCount <= 10) {
                blTree.writeCodeToStream(17);
                this.writer.pendingBufferWriteBits(currentRepeatCount - 3, 3);
            }
            else {
                blTree.writeCodeToStream(18);
                this.writer.pendingBufferWriteBits(currentRepeatCount - 11, 7);
            }
        }
    };
    /**
     * Build huffman tree
     * @returns {void}
     */
    CompressorHuffmanTree.prototype.buildTree = function () {
        var codesCount = this.codeFrequency.length;
        var arrTree = new Int32Array(codesCount);
        var treeLength = 0;
        var maxCount = 0;
        for (var n = 0; n < codesCount; n++) {
            var freq = this.codeFrequency[n];
            if (freq !== 0) {
                var pos = treeLength++;
                var pPos = 0;
                while (pos > 0 && this.codeFrequency[arrTree[pPos = Math.floor((pos - 1) / 2)]] > freq) {
                    arrTree[pos] = arrTree[pPos];
                    pos = pPos;
                }
                arrTree[pos] = n;
                maxCount = n;
            }
        }
        while (treeLength < 2) {
            arrTree[treeLength++] =
                (maxCount < 2) ? ++maxCount : 0;
        }
        this.codeCount = Math.max(maxCount + 1, this.codeMinCount);
        var leafsCount = treeLength;
        var nodesCount = leafsCount;
        var child = new Int32Array(4 * treeLength - 2);
        var values = new Int32Array(2 * treeLength - 1);
        for (var i = 0; i < treeLength; i++) {
            var node = arrTree[i];
            var iIndex = 2 * i;
            child[iIndex] = node;
            child[iIndex + 1] = -1;
            values[i] = (this.codeFrequency[node] << 8);
            arrTree[i] = i;
        }
        this.constructHuffmanTree(arrTree, treeLength, values, nodesCount, child);
        this.buildLength(child);
    };
    CompressorHuffmanTree.prototype.constructHuffmanTree = function (arrTree, treeLength, values, nodesCount, child) {
        do {
            var first = arrTree[0];
            var last = arrTree[--treeLength];
            var lastVal = values[last];
            var pPos = 0;
            var path = 1;
            while (path < treeLength) {
                if (path + 1 < treeLength && values[arrTree[path]] > values[arrTree[path + 1]]) {
                    path++;
                }
                arrTree[pPos] = arrTree[path];
                pPos = path;
                path = pPos * 2 + 1;
            }
            while ((path = pPos) > 0 && values[arrTree[pPos = Math.floor((path - 1) / 2)]] > lastVal) {
                arrTree[path] = arrTree[pPos];
            }
            arrTree[path] = last;
            var second = arrTree[0];
            last = nodesCount++;
            child[2 * last] = first;
            child[2 * last + 1] = second;
            var minDepth = Math.min(values[first] & 0xff, values[second] & 0xff);
            values[last] = lastVal = values[first] + values[second] - minDepth + 1;
            pPos = 0;
            path = 1;
            /* tslint:disable */
            while (path < treeLength) {
                if (path + 1 < treeLength && values[arrTree[path]] > values[arrTree[path + 1]]) {
                    path++;
                }
                arrTree[pPos] = arrTree[path];
                pPos = path;
                path = pPos * 2 + 1;
            } /* tslint:disable */
            while ((path = pPos) > 0 && values[arrTree[pPos = Math.floor((path - 1) / 2)]] > lastVal) {
                arrTree[path] = arrTree[pPos];
            }
            arrTree[path] = last;
        } while (treeLength > 1);
    };
    CompressorHuffmanTree.prototype.buildLength = function (child) {
        this.codeLength = new Uint8Array(this.codeFrequency.length);
        var numNodes = Math.floor(child.length / 2);
        var numLeafs = Math.floor((numNodes + 1) / 2);
        var overflow = 0;
        for (var i = 0; i < this.maxLength; i++) {
            this.lengthCount[i] = 0;
        }
        overflow = this.calculateOptimalCodeLength(child, overflow, numNodes);
        if (overflow === 0) {
            return;
        }
        var iIncreasableLength = this.maxLength - 1;
        do {
            while (this.lengthCount[--iIncreasableLength] === 0) {
                /* tslint:disable */
            }
            do {
                this.lengthCount[iIncreasableLength]--;
                this.lengthCount[++iIncreasableLength]++;
                overflow -= (1 << (this.maxLength - 1 - iIncreasableLength));
            } while (overflow > 0 && iIncreasableLength < this.maxLength - 1);
        } while (overflow > 0);
        this.recreateTree(child, overflow, numLeafs);
    };
    CompressorHuffmanTree.prototype.recreateTree = function (child, overflow, numLeafs) {
        this.lengthCount[this.maxLength - 1] += overflow;
        this.lengthCount[this.maxLength - 2] -= overflow;
        var nodePtr = 2 * numLeafs;
        for (var bits = this.maxLength; bits !== 0; bits--) {
            var n = this.lengthCount[bits - 1];
            while (n > 0) {
                var childPtr = 2 * child[nodePtr++];
                if (child[childPtr + 1] === -1) {
                    this.codeLength[child[childPtr]] = bits;
                    n--;
                }
            }
        }
    };
    CompressorHuffmanTree.prototype.calculateOptimalCodeLength = function (child, overflow, numNodes) {
        var lengths = new Int32Array(numNodes);
        lengths[numNodes - 1] = 0;
        for (var i = numNodes - 1; i >= 0; i--) {
            var childIndex = 2 * i + 1;
            if (child[childIndex] !== -1) {
                var bitLength = lengths[i] + 1;
                if (bitLength > this.maxLength) {
                    bitLength = this.maxLength;
                    overflow++;
                }
                lengths[child[childIndex - 1]] = lengths[child[childIndex]] = bitLength;
            }
            else {
                var bitLength = lengths[i];
                this.lengthCount[bitLength - 1]++;
                this.codeLength[child[childIndex - 1]] = lengths[i];
            }
        }
        return overflow;
    };
    CompressorHuffmanTree.reverseBits = [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15];
    CompressorHuffmanTree.huffCodeLengthOrders = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
    return CompressorHuffmanTree;
}());

/**
 * Checksum calculator, based on Adler32 algorithm.
 */
var ChecksumCalculator = /** @__PURE__ @class */ (function () {
    function ChecksumCalculator() {
    }
    /**
     * Updates checksum by calculating checksum of the
     * given buffer and adding it to current value.
     * @param {number} checksum - current checksum.
     * @param {Uint8Array} buffer - data byte array.
     * @param {number} offset - offset in the buffer.
     * @param {number} length - length of data to be used from the stream.
     * @returns {number}
     */
    ChecksumCalculator.checksumUpdate = function (checksum, buffer, offset, length) {
        var uint = new Uint32Array(1);
        uint[0] = checksum;
        var checksum_uint = uint[0];
        var s1 = uint[0] = checksum_uint & 65535;
        var s2 = uint[0] = checksum_uint >> ChecksumCalculator.checkSumBitOffset;
        while (length > 0) {
            var steps = Math.min(length, ChecksumCalculator.checksumIterationCount);
            length -= steps;
            while (--steps >= 0) {
                s1 = s1 + (uint[0] = (buffer[offset++] & 255));
                s2 = s2 + s1;
            }
            s1 %= ChecksumCalculator.checksumBase;
            s2 %= ChecksumCalculator.checksumBase;
        }
        checksum_uint = (s2 << ChecksumCalculator.checkSumBitOffset) | s1;
        return checksum_uint;
    };
    ChecksumCalculator.checkSumBitOffset = 16;
    ChecksumCalculator.checksumBase = 65521;
    ChecksumCalculator.checksumIterationCount = 3800;
    return ChecksumCalculator;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-compression/index.js":
/*!****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-compression/index.js ***!
  \****************************************************************/
/*! exports provided: ZipArchive, ZipArchiveItem, CompressedStreamWriter, CompressorHuffmanTree, ChecksumCalculator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _zip_archive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./zip-archive */ "./ej2-resources/18.4.46/scripts/ej2-compression/zip-archive.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ZipArchive", function() { return _zip_archive__WEBPACK_IMPORTED_MODULE_0__["ZipArchive"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ZipArchiveItem", function() { return _zip_archive__WEBPACK_IMPORTED_MODULE_0__["ZipArchiveItem"]; });

/* harmony import */ var _compression_writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compression-writer */ "./ej2-resources/18.4.46/scripts/ej2-compression/compression-writer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompressedStreamWriter", function() { return _compression_writer__WEBPACK_IMPORTED_MODULE_1__["CompressedStreamWriter"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompressorHuffmanTree", function() { return _compression_writer__WEBPACK_IMPORTED_MODULE_1__["CompressorHuffmanTree"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChecksumCalculator", function() { return _compression_writer__WEBPACK_IMPORTED_MODULE_1__["ChecksumCalculator"]; });

/**
 * export ZipArchive class
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-compression/zip-archive.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-compression/zip-archive.js ***!
  \**********************************************************************/
/*! exports provided: ZipArchive, ZipArchiveItem */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipArchive", function() { return ZipArchive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipArchiveItem", function() { return ZipArchiveItem; });
/* harmony import */ var _compression_writer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compression-writer */ "./ej2-resources/18.4.46/scripts/ej2-compression/compression-writer.js");
/* harmony import */ var _ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ej2-file-utils */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/index.js");


var CRC32TABLE = [];
/**
 * class provide compression library
 * ```typescript
 * let archive = new ZipArchive();
 * archive.compressionLevel = 'Normal';
 * let archiveItem = new ZipArchiveItem(archive, 'directoryName\fileName.txt');
 * archive.addItem(archiveItem);
 * archive.save(fileName.zip);
 * ```
 */
var ZipArchive = /** @__PURE__ @class */ (function () {
    /**
     * constructor for creating ZipArchive instance
     */
    function ZipArchive() {
        if (CRC32TABLE.length === 0) {
            ZipArchive.initCrc32Table();
        }
        this.files = [];
        this.level = 'Normal';
        _ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__["Save"].isMicrosoftBrowser = !(!navigator.msSaveBlob);
    }
    Object.defineProperty(ZipArchive.prototype, "compressionLevel", {
        /**
         * gets compression level
         */
        get: function () {
            return this.level;
        },
        /**
         * sets compression level
         */
        set: function (level) {
            this.level = level;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ZipArchive.prototype, "length", {
        /**
         * gets items count
         */
        get: function () {
            if (this.files === undefined) {
                return 0;
            }
            return this.files.length;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * add new item to archive
     * @param {ZipArchiveItem} item - item to be added
     * @returns {void}
     */
    ZipArchive.prototype.addItem = function (item) {
        if (item === null || item === undefined) {
            throw new Error('ArgumentException: item cannot be null or undefined');
        }
        for (var i = 0; i < this.files.length; i++) {
            var file = this.files[i];
            if (file instanceof ZipArchiveItem) {
                if (file.name === item.name) {
                    throw new Error('item with same name already exist');
                }
            }
        }
        this.files.push(item);
    };
    /**
     * add new directory to archive
     * @param directoryName directoryName to be created
     * @returns {void}
     */
    ZipArchive.prototype.addDirectory = function (directoryName) {
        if (directoryName === null || directoryName === undefined) {
            throw new Error('ArgumentException: string cannot be null or undefined');
        }
        if (directoryName.length === 0) {
            throw new Error('ArgumentException: string cannot be empty');
        }
        if (directoryName.slice(-1) !== '/') {
            directoryName += '/';
        }
        if (this.files.indexOf(directoryName) !== -1) {
            throw new Error('item with same name already exist');
        }
        this.files.push(directoryName);
    };
    /**
     * gets item at specified index
     * @param {number} index - item index
     * @returns {ZipArchiveItem}
     */
    ZipArchive.prototype.getItem = function (index) {
        if (index >= 0 && index < this.files.length) {
            return this.files[index];
        }
        return undefined;
    };
    /**
     * determines whether an element is in the collection
     * @param {string | ZipArchiveItem} item - item to search
     * @returns {boolean}
     */
    ZipArchive.prototype.contains = function (item) {
        return this.files.indexOf(item) !== -1 ? true : false;
    };
    /**
     * save archive with specified file name
     * @param {string} fileName save archive with specified file name
     * @returns {Promise<ZipArchive>}
     */
    ZipArchive.prototype.save = function (fileName) {
        if (fileName === null || fileName === undefined || fileName.length === 0) {
            throw new Error('ArgumentException: fileName cannot be null or undefined');
        }
        if (this.files.length === 0) {
            throw new Error('InvalidOperation');
        }
        var zipArchive = this;
        var promise;
        return promise = new Promise(function (resolve, reject) {
            zipArchive.saveInternal(fileName, false).then(function () {
                resolve(zipArchive);
            });
        });
    };
    /**
     * Save archive as blob
     * @return {Promise<Blob>}
     */
    ZipArchive.prototype.saveAsBlob = function () {
        var zipArchive = this;
        var promise;
        return promise = new Promise(function (resolve, reject) {
            zipArchive.saveInternal('', true).then(function (blob) {
                resolve(blob);
            });
        });
    };
    ZipArchive.prototype.saveInternal = function (fileName, skipFileSave) {
        var _this = this;
        var zipArchive = this;
        var promise;
        return promise = new Promise(function (resolve, reject) {
            var zipData = [];
            var dirLength = 0;
            for (var i = 0; i < zipArchive.files.length; i++) {
                var compressedObject = _this.getCompressedData(_this.files[i]);
                compressedObject.then(function (data) {
                    dirLength = zipArchive.constructZippedObject(zipData, data, dirLength, data.isDirectory);
                    if (zipData.length === zipArchive.files.length) {
                        var blob = zipArchive.writeZippedContent(fileName, zipData, dirLength, skipFileSave);
                        resolve(blob);
                    }
                });
            }
        });
    };
    /**
     * release allocated un-managed resource
     * @returns {void}
     */
    ZipArchive.prototype.destroy = function () {
        if (this.files !== undefined && this.files.length > 0) {
            for (var i = 0; i < this.files.length; i++) {
                var file = this.files[i];
                if (file instanceof ZipArchiveItem) {
                    file.destroy();
                }
                file = undefined;
            }
            this.files = [];
        }
        this.files = undefined;
        this.level = undefined;
    };
    ZipArchive.prototype.getCompressedData = function (item) {
        var zipArchive = this;
        var promise = new Promise(function (resolve, reject) {
            if (item instanceof ZipArchiveItem) {
                var reader_1 = new FileReader();
                reader_1.onload = function () {
                    var input = new Uint8Array(reader_1.result);
                    var data = {
                        fileName: item.name, crc32Value: 0, compressedData: [],
                        compressedSize: undefined, uncompressedDataSize: input.length, compressionType: undefined,
                        isDirectory: false
                    };
                    if (zipArchive.level === 'Normal') {
                        zipArchive.compressData(input, data, CRC32TABLE);
                        var length_1 = 0;
                        for (var i = 0; i < data.compressedData.length; i++) {
                            length_1 += data.compressedData[i].length;
                        }
                        data.compressedSize = length_1;
                        data.compressionType = '\x08\x00'; //Deflated = 8
                    }
                    else {
                        data.compressedSize = input.length;
                        data.crc32Value = zipArchive.calculateCrc32Value(0, input, CRC32TABLE);
                        data.compressionType = '\x00\x00'; // Stored = 0
                        data.compressedData.push(input);
                    }
                    resolve(data);
                };
                reader_1.readAsArrayBuffer(item.data);
            }
            else {
                var data = {
                    fileName: item, crc32Value: 0, compressedData: '', compressedSize: 0, uncompressedDataSize: 0,
                    compressionType: '\x00\x00', isDirectory: true
                };
                resolve(data);
            }
        });
        return promise;
    };
    ZipArchive.prototype.compressData = function (input, data, crc32Table) {
        var compressor = new _compression_writer__WEBPACK_IMPORTED_MODULE_0__["CompressedStreamWriter"](true);
        var currentIndex = 0;
        var nextIndex = 0;
        do {
            if (currentIndex >= input.length) {
                compressor.close();
                break;
            }
            nextIndex = Math.min(input.length, currentIndex + 16384);
            var subArray = input.subarray(currentIndex, nextIndex);
            data.crc32Value = this.calculateCrc32Value(data.crc32Value, subArray, crc32Table);
            compressor.write(subArray, 0, nextIndex - currentIndex);
            currentIndex = nextIndex;
        } while (currentIndex <= input.length);
        data.compressedData = compressor.compressedData;
        compressor.destroy();
    };
    ZipArchive.prototype.constructZippedObject = function (zipParts, data, dirLength, isDirectory) {
        var extFileAttr = 0;
        var date = new Date();
        if (isDirectory) {
            extFileAttr = extFileAttr | 0x00010; // directory flag
        }
        extFileAttr = extFileAttr | (0 & 0x3F);
        var header = this.writeHeader(data, date);
        var localHeader = 'PK\x03\x04' + header + data.fileName;
        var centralDir = this.writeCentralDirectory(data, header, dirLength, extFileAttr);
        zipParts.push({ localHeader: localHeader, centralDir: centralDir, compressedData: data });
        return dirLength + localHeader.length + data.compressedSize;
    };
    ZipArchive.prototype.writeHeader = function (data, date) {
        var zipHeader = '';
        zipHeader += '\x0A\x00' + '\x00\x00'; // version needed to extract & general purpose bit flag
        zipHeader += data.compressionType; // compression method Deflate=8,Stored=0
        zipHeader += this.getBytes(this.getModifiedTime(date), 2); // last modified Time
        zipHeader += this.getBytes(this.getModifiedDate(date), 2); // last modified date
        zipHeader += this.getBytes(data.crc32Value, 4); // crc-32 value
        zipHeader += this.getBytes(data.compressedSize, 4); // compressed file size
        zipHeader += this.getBytes(data.uncompressedDataSize, 4); // uncompressed file size
        zipHeader += this.getBytes(data.fileName.length, 2); // file name length
        zipHeader += this.getBytes(0, 2); // extra field length
        return zipHeader;
    };
    ZipArchive.prototype.writeZippedContent = function (fileName, zipData, localDirLen, skipFileSave) {
        var cenDirLen = 0;
        var buffer = [];
        for (var i = 0; i < zipData.length; i++) {
            var item = zipData[i];
            cenDirLen += item.centralDir.length;
            buffer.push(this.getArrayBuffer(item.localHeader));
            while (item.compressedData.compressedData.length) {
                buffer.push(item.compressedData.compressedData.shift().buffer);
            }
        }
        for (var i = 0; i < zipData.length; i++) {
            buffer.push(this.getArrayBuffer(zipData[i].centralDir));
        }
        buffer.push(this.getArrayBuffer(this.writeFooter(zipData, cenDirLen, localDirLen)));
        var blob = new Blob(buffer, { type: 'application/zip' });
        if (!skipFileSave) {
            _ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__["Save"].save(fileName, blob);
        }
        return blob;
    };
    ZipArchive.prototype.writeCentralDirectory = function (data, localHeader, offset, externalFileAttribute) {
        var directoryHeader = 'PK\x01\x02' +
            this.getBytes(0x0014, 2) + localHeader + // inherit from file header
            this.getBytes(0, 2) + // comment length
            '\x00\x00' + '\x00\x00' + // internal file attributes 
            this.getBytes(externalFileAttribute, 4) + // external file attributes
            this.getBytes(offset, 4) + // local fileHeader relative offset
            data.fileName;
        return directoryHeader;
    };
    ZipArchive.prototype.writeFooter = function (zipData, centralLength, localLength) {
        var dirEnd = 'PK\x05\x06' + '\x00\x00' + '\x00\x00' +
            this.getBytes(zipData.length, 2) + this.getBytes(zipData.length, 2) +
            this.getBytes(centralLength, 4) + this.getBytes(localLength, 4) +
            this.getBytes(0, 2);
        return dirEnd;
    };
    ZipArchive.prototype.getArrayBuffer = function (input) {
        var a = new Uint8Array(input.length);
        for (var j = 0; j < input.length; ++j) {
            a[j] = input.charCodeAt(j) & 0xFF;
        }
        return a.buffer;
    };
    ZipArchive.prototype.getBytes = function (value, offset) {
        var bytes = '';
        for (var i = 0; i < offset; i++) {
            bytes += String.fromCharCode(value & 0xff);
            value = value >>> 8;
        }
        return bytes;
    };
    ZipArchive.prototype.getModifiedTime = function (date) {
        var modTime = date.getHours();
        modTime = modTime << 6;
        modTime = modTime | date.getMinutes();
        modTime = modTime << 5;
        return modTime = modTime | date.getSeconds() / 2;
    };
    ZipArchive.prototype.getModifiedDate = function (date) {
        var modiDate = date.getFullYear() - 1980;
        modiDate = modiDate << 4;
        modiDate = modiDate | (date.getMonth() + 1);
        modiDate = modiDate << 5;
        return modiDate = modiDate | date.getDate();
    };
    ZipArchive.prototype.calculateCrc32Value = function (crc32Value, input, crc32Table) {
        crc32Value ^= -1;
        for (var i = 0; i < input.length; i++) {
            crc32Value = (crc32Value >>> 8) ^ crc32Table[(crc32Value ^ input[i]) & 0xFF];
        }
        return (crc32Value ^ (-1));
    };
    /**
     * construct cyclic redundancy code table
     * @private
     */
    ZipArchive.initCrc32Table = function () {
        var i;
        for (var j = 0; j < 256; j++) {
            i = j;
            for (var k = 0; k < 8; k++) {
                i = ((i & 1) ? (0xEDB88320 ^ (i >>> 1)) : (i >>> 1));
            }
            CRC32TABLE[j] = i;
        }
    };
    return ZipArchive;
}());

/**
 * Class represent unique ZipArchive item
 * ```typescript
 * let archiveItem = new ZipArchiveItem(archive, 'directoryName\fileName.txt');
 * ```
 */
var ZipArchiveItem = /** @__PURE__ @class */ (function () {
    /**
     * constructor for creating {ZipArchiveItem} instance
     * @param {Blob|ArrayBuffer} data file data
     * @param {itemName} itemName absolute file path
     */
    function ZipArchiveItem(data, itemName) {
        if (data === null || data === undefined) {
            throw new Error('ArgumentException: data cannot be null or undefined');
        }
        if (itemName === null || itemName === undefined) {
            throw new Error('ArgumentException: string cannot be null or undefined');
        }
        if (itemName.length === 0) {
            throw new Error('string cannot be empty');
        }
        this.data = data;
        this.name = itemName;
    }
    Object.defineProperty(ZipArchiveItem.prototype, "name", {
        /**
         * Get the name of archive item
         * @returns string
         */
        get: function () {
            return this.fileName;
        },
        /**
         * Set the name of archive item
         * @param  {string} value
         */
        set: function (value) {
            this.fileName = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * release allocated un-managed resource
     * @returns {void}
     */
    ZipArchiveItem.prototype.destroy = function () {
        this.fileName = undefined;
        this.data = undefined;
    };
    return ZipArchiveItem;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-data/adaptors.js":
/*!************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-data/adaptors.js ***!
  \************************************************************/
/*! exports provided: Adaptor, JsonAdaptor, UrlAdaptor, ODataAdaptor, ODataV4Adaptor, WebApiAdaptor, WebMethodAdaptor, RemoteSaveAdaptor, AjaxAdaptor, CacheAdaptor */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Adaptor", function() { return Adaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonAdaptor", function() { return JsonAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UrlAdaptor", function() { return UrlAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ODataAdaptor", function() { return ODataAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ODataV4Adaptor", function() { return ODataV4Adaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebApiAdaptor", function() { return WebApiAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebMethodAdaptor", function() { return WebMethodAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RemoteSaveAdaptor", function() { return RemoteSaveAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AjaxAdaptor", function() { return AjaxAdaptor; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CacheAdaptor", function() { return CacheAdaptor; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-data/util.js");
/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query */ "./ej2-resources/18.4.46/scripts/ej2-data/query.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();



var consts = { GroupGuid: '{271bbba0-1ee7}' };
/**
 * Adaptors are specific data source type aware interfaces that are used by DataManager to communicate with DataSource.
 * This is the base adaptor class that other adaptors can extend.
 * @hidden
 */
var Adaptor = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for Adaptor class
     * @param  {DataOptions} ds?
     * @hidden
     * @returns aggregates
     */
    function Adaptor(ds) {
        // common options for all the adaptors 
        this.options = {
            from: 'table',
            requestType: 'json',
            sortBy: 'sorted',
            select: 'select',
            skip: 'skip',
            group: 'group',
            take: 'take',
            search: 'search',
            count: 'requiresCounts',
            where: 'where',
            aggregates: 'aggregates',
            expand: 'expand'
        };
        /**
         * Specifies the type of adaptor.
         * @default Adaptor
         */
        this.type = Adaptor;
        this.dataSource = ds;
        this.pvt = {};
    }
    /**
     * Returns the data from the query processing.
     * @param  {Object} data
     * @param  {DataOptions} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @returns Object
     */
    Adaptor.prototype.processResponse = function (data, ds, query, xhr) {
        return data;
    };
    return Adaptor;
}());

/**
 * JsonAdaptor is used to process JSON data. It contains methods to process the given JSON data based on the queries.
 * @hidden
 */
var JsonAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(JsonAdaptor, _super);
    function JsonAdaptor() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Process the JSON data based on the provided queries.
     * @param  {DataManager} dataManager
     * @param  {Query} query
     * @returns Object
     */
    JsonAdaptor.prototype.processQuery = function (dataManager, query) {
        var result = dataManager.dataSource.json.slice(0);
        var count = result.length;
        var countFlg = true;
        var ret;
        var key;
        var lazyLoad = {};
        var keyCount = 0;
        var group = [];
        var page;
        for (var i = 0; i < query.lazyLoad.length; i++) {
            keyCount++;
            lazyLoad[query.lazyLoad[i].key] = query.lazyLoad[i].value;
        }
        var agg = {};
        for (var i = 0; i < query.queries.length; i++) {
            key = query.queries[i];
            if ((key.fn === 'onPage' || key.fn === 'onGroup') && query.lazyLoad.length) {
                if (key.fn === 'onGroup') {
                    group.push(key.e);
                }
                if (key.fn === 'onPage') {
                    page = key.e;
                }
                continue;
            }
            ret = this[key.fn].call(this, result, key.e, query);
            if (key.fn === 'onAggregates') {
                agg[key.e.field + ' - ' + key.e.type] = ret;
            }
            else {
                result = ret !== undefined ? ret : result;
            }
            if (key.fn === 'onPage' || key.fn === 'onSkip' || key.fn === 'onTake' || key.fn === 'onRange') {
                countFlg = false;
            }
            if (countFlg) {
                count = result.length;
            }
        }
        if (keyCount) {
            var args = {
                query: query, lazyLoad: lazyLoad, result: result, group: group, page: page
            };
            var lazyLoadData = this.lazyLoadGroup(args);
            result = lazyLoadData.result;
            count = lazyLoadData.count;
        }
        if (query.isCountRequired) {
            result = {
                result: result,
                count: count,
                aggregates: agg
            };
        }
        return result;
    };
    /**
     * Perform lazy load grouping in JSON array based on the given query and lazy load details.
     * @param  {LazyLoadGroupArgs} args
     */
    JsonAdaptor.prototype.lazyLoadGroup = function (args) {
        var count = 0;
        var agg = this.getAggregate(args.query);
        var result = args.result;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.lazyLoad.onDemandGroupInfo)) {
            var req = args.lazyLoad.onDemandGroupInfo;
            for (var i = req.where.length - 1; i >= 0; i--) {
                result = this.onWhere(result, req.where[i]);
            }
            if (args.group.length !== req.level) {
                var field = args.group[req.level].fieldName;
                result = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].group(result, field, agg, null, null, args.group[0].comparer, true);
            }
            count = result.length;
            var data = result;
            result = result.slice(req.skip);
            result = result.slice(0, req.take);
            if (args.group.length !== req.level) {
                this.formGroupResult(result, data);
            }
        }
        else {
            var field = args.group[0].fieldName;
            result = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].group(result, field, agg, null, null, args.group[0].comparer, true);
            count = result.length;
            var data = result;
            if (args.page) {
                result = this.onPage(result, args.page, args.query);
            }
            this.formGroupResult(result, data);
        }
        return { result: result, count: count };
    };
    JsonAdaptor.prototype.formGroupResult = function (result, data) {
        if (result.length && data.length) {
            var uid = 'GroupGuid';
            var childLevel = 'childLevels';
            var level = 'level';
            var records = 'records';
            result[uid] = data[uid];
            result[childLevel] = data[childLevel];
            result[level] = data[level];
            result[records] = data[records];
        }
        return result;
    };
    /**
     * Separate the aggregate query from the given queries
     * @param  {Query} query
     */
    JsonAdaptor.prototype.getAggregate = function (query) {
        var aggQuery = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onAggregates');
        var agg = [];
        if (aggQuery.length) {
            var tmp = void 0;
            for (var i = 0; i < aggQuery.length; i++) {
                tmp = aggQuery[i].e;
                agg.push({ type: tmp.type, field: _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(tmp.field, query) });
            }
        }
        return agg;
    };
    /**
     * Performs batch update in the JSON array which add, remove and update records.
     * @param  {DataManager} dm
     * @param  {CrudOptions} changes
     * @param  {RemoteArgs} e
     */
    JsonAdaptor.prototype.batchRequest = function (dm, changes, e) {
        var i;
        var deletedRecordsLen = changes.deletedRecords.length;
        for (i = 0; i < changes.addedRecords.length; i++) {
            this.insert(dm, changes.addedRecords[i]);
        }
        for (i = 0; i < changes.changedRecords.length; i++) {
            this.update(dm, e.key, changes.changedRecords[i]);
        }
        for (i = 0; i < deletedRecordsLen; i++) {
            this.remove(dm, e.key, changes.deletedRecords[i]);
        }
        return changes;
    };
    /**
     * Performs filter operation with the given data and where query.
     * @param  {Object[]} ds
     * @param  {{validate:Function}} e
     */
    JsonAdaptor.prototype.onWhere = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        return ds.filter(function (obj) {
            if (e) {
                return e.validate(obj);
            }
        });
    };
    /**
     * Returns aggregate function based on the aggregate type.
     * @param  {Object[]} ds
     * @param  {{field:string} e
     * @param  {string}} type
     */
    JsonAdaptor.prototype.onAggregates = function (ds, e) {
        var fn = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].aggregates[e.type];
        if (!ds || !fn || ds.length === 0) {
            return null;
        }
        return fn(ds, e.field);
    };
    /**
     * Performs search operation based on the given query.
     * @param  {Object[]} ds
     * @param  {QueryOptions} e
     */
    JsonAdaptor.prototype.onSearch = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        if (e.fieldNames.length === 0) {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getFieldList(ds[0], e.fieldNames);
        }
        return ds.filter(function (obj) {
            for (var j = 0; j < e.fieldNames.length; j++) {
                if (e.comparer.call(obj, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(e.fieldNames[j], obj), e.searchKey, e.ignoreCase, e.ignoreAccent)) {
                    return true;
                }
            }
            return false;
        });
    };
    /**
     * Sort the data with given direction and field.
     * @param  {Object[]} ds
     * @param  {{comparer:(a:Object} e
     * @param  {Object} b
     */
    JsonAdaptor.prototype.onSortBy = function (ds, e, query) {
        if (!ds || !ds.length) {
            return ds;
        }
        var fnCompare;
        var field = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.fieldName, query);
        if (!field) {
            return ds.sort(e.comparer);
        }
        if (field instanceof Array) {
            field = field.slice(0);
            for (var i = field.length - 1; i >= 0; i--) {
                if (!field[i]) {
                    continue;
                }
                fnCompare = e.comparer;
                if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].endsWith(field[i], ' desc')) {
                    fnCompare = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].fnSort('descending');
                    field[i] = field[i].replace(' desc', '');
                }
                ds = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].sort(ds, field[i], fnCompare);
            }
            return ds;
        }
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].sort(ds, field, e.comparer);
    };
    /**
     * Group the data based on the given query.
     * @param  {Object[]} ds
     * @param  {QueryOptions} e
     * @param  {Query} query
     */
    JsonAdaptor.prototype.onGroup = function (ds, e, query) {
        if (!ds || !ds.length) {
            return ds;
        }
        var agg = this.getAggregate(query);
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].group(ds, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.fieldName, query), agg, null, null, e.comparer);
    };
    /**
     * Retrieves records based on the given page index and size.
     * @param  {Object[]} ds
     * @param  {{pageSize:number} e
     * @param  {number}} pageIndex
     * @param  {Query} query
     */
    JsonAdaptor.prototype.onPage = function (ds, e, query) {
        var size = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.pageSize, query);
        var start = (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.pageIndex, query) - 1) * size;
        var end = start + size;
        if (!ds || !ds.length) {
            return ds;
        }
        return ds.slice(start, end);
    };
    /**
     * Retrieves records based on the given start and end index from query.
     * @param  {Object[]} ds
     * @param  {{start:number} e
     * @param  {number}} end
     */
    JsonAdaptor.prototype.onRange = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        return ds.slice(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.start), _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.end));
    };
    /**
     * Picks the given count of records from the top of the datasource.
     * @param  {Object[]} ds
     * @param  {{nos:number}} e
     */
    JsonAdaptor.prototype.onTake = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        return ds.slice(0, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.nos));
    };
    /**
     * Skips the given count of records from the data source.
     * @param  {Object[]} ds
     * @param  {{nos:number}} e
     */
    JsonAdaptor.prototype.onSkip = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        return ds.slice(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.nos));
    };
    /**
     * Selects specified columns from the data source.
     * @param  {Object[]} ds
     * @param  {{fieldNames:string}} e
     */
    JsonAdaptor.prototype.onSelect = function (ds, e) {
        if (!ds || !ds.length) {
            return ds;
        }
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].select(ds, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(e.fieldNames));
    };
    /**
     * Inserts new record in the table.
     * @param  {DataManager} dm
     * @param  {Object} data
     * @param  {number} position
     */
    JsonAdaptor.prototype.insert = function (dm, data, tableName, query, position) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(position)) {
            return dm.dataSource.json.push(data);
        }
        else {
            return dm.dataSource.json.splice(position, 0, data);
        }
    };
    /**
     * Remove the data from the dataSource based on the key field value.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName?
     * @returns null
     */
    JsonAdaptor.prototype.remove = function (dm, keyField, value, tableName) {
        var ds = dm.dataSource.json;
        var i;
        if (typeof value === 'object' && !(value instanceof Date)) {
            value = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(keyField, value);
        }
        for (i = 0; i < ds.length; i++) {
            if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(keyField, ds[i]) === value) {
                break;
            }
        }
        return i !== ds.length ? ds.splice(i, 1) : null;
    };
    /**
     * Updates existing record and saves the changes to the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName?
     * @returns null
     */
    JsonAdaptor.prototype.update = function (dm, keyField, value, tableName) {
        var ds = dm.dataSource.json;
        var i;
        var key;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(keyField)) {
            key = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(keyField, value);
        }
        for (i = 0; i < ds.length; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(keyField) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(keyField, ds[i])) === key) {
                break;
            }
        }
        return i < ds.length ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(ds[i], value) : null;
    };
    return JsonAdaptor;
}(Adaptor));

/**
 * URL Adaptor of DataManager can be used when you are required to use remote service to retrieve data.
 * It interacts with server-side for all DataManager Queries and CRUD operations.
 * @hidden
 */
var UrlAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(UrlAdaptor, _super);
    function UrlAdaptor() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Process the query to generate request body.
     * @param  {DataManager} dm
     * @param  {Query} query
     * @param  {Object[]} hierarchyFilters?
     * @returns p
     */
    // tslint:disable-next-line:max-func-body-length
    UrlAdaptor.prototype.processQuery = function (dm, query, hierarchyFilters) {
        var queries = this.getQueryRequest(query);
        var singles = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueryLists(query.queries, ['onSelect', 'onPage', 'onSkip', 'onTake', 'onRange']);
        var params = query.params;
        var url = dm.dataSource.url;
        var temp;
        var skip;
        var take = null;
        var options = this.options;
        var request = { sorts: [], groups: [], filters: [], searches: [], aggregates: [] };
        // calc Paging & Range
        if ('onPage' in singles) {
            temp = singles.onPage;
            skip = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(temp.pageIndex, query);
            take = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(temp.pageSize, query);
            skip = (skip - 1) * take;
        }
        else if ('onRange' in singles) {
            temp = singles.onRange;
            skip = temp.start;
            take = temp.end - temp.start;
        }
        // Sorting
        for (var i = 0; i < queries.sorts.length; i++) {
            temp = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(queries.sorts[i].e.fieldName, query);
            request.sorts.push(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onEachSort', { name: temp, direction: queries.sorts[i].e.direction }, query));
        }
        // hierarchy
        if (hierarchyFilters) {
            temp = this.getFiltersFrom(hierarchyFilters, query);
            if (temp) {
                request.filters.push(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onEachWhere', temp.toJson(), query));
            }
        }
        // Filters
        for (var i = 0; i < queries.filters.length; i++) {
            request.filters.push(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onEachWhere', queries.filters[i].e.toJson(), query));
            var keys_3 = typeof request.filters[i] === 'object' ? Object.keys(request.filters[i]) : [];
            for (var _i = 0, keys_1 = keys_3; _i < keys_1.length; _i++) {
                var prop = keys_1[_i];
                if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull((request)[prop])) {
                    delete request[prop];
                }
            }
        }
        // Searches
        for (var i = 0; i < queries.searches.length; i++) {
            temp = queries.searches[i].e;
            request.searches.push(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onEachSearch', {
                fields: temp.fieldNames,
                operator: temp.operator,
                key: temp.searchKey,
                ignoreCase: temp.ignoreCase
            }, query));
        }
        // Grouping
        for (var i = 0; i < queries.groups.length; i++) {
            request.groups.push(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(queries.groups[i].e.fieldName, query));
        }
        // aggregates
        for (var i = 0; i < queries.aggregates.length; i++) {
            temp = queries.aggregates[i].e;
            request.aggregates.push({ type: temp.type, field: _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(temp.field, query) });
        }
        var req = {};
        this.getRequestQuery(options, query, singles, request, req);
        // Params
        _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'addParams', { dm: dm, query: query, params: params, reqParams: req });
        if (query.lazyLoad.length) {
            for (var i = 0; i < query.lazyLoad.length; i++) {
                req[query.lazyLoad[i].key] = query.lazyLoad[i].value;
            }
        }
        // cleanup
        var keys = Object.keys(req);
        for (var _a = 0, keys_2 = keys; _a < keys_2.length; _a++) {
            var prop = keys_2[_a];
            if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(req[prop]) || req[prop] === '' || req[prop].length === 0) {
                delete req[prop];
            }
        }
        if (!(options.skip in req && options.take in req) && take !== null) {
            req[options.skip] = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onSkip', skip, query);
            req[options.take] = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onTake', take, query);
        }
        var p = this.pvt;
        this.pvt = {};
        if (this.options.requestType === 'json') {
            return {
                data: JSON.stringify(req, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.jsonDateReplacer),
                url: url,
                pvtData: p,
                type: 'POST',
                contentType: 'application/json; charset=utf-8'
            };
        }
        temp = this.convertToQueryString(req, query, dm);
        temp = (dm.dataSource.url.indexOf('?') !== -1 ? '&' : '/') + temp;
        return {
            type: 'GET', url: temp.length ? url.replace(/\/*$/, temp) : url, pvtData: p
        };
    };
    UrlAdaptor.prototype.getRequestQuery = function (options, query, singles, request, request1) {
        var param = 'param';
        var req = request1;
        req[options.from] = query.fromTable;
        if (options.apply && query.distincts.length) {
            req[options.apply] = 'onDistinct' in this ? _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onDistinct', query.distincts) : '';
        }
        if (!query.distincts.length && options.expand) {
            req[options.expand] = 'onExpand' in this && 'onSelect' in singles ?
                _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onExpand', { selects: _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(singles.onSelect.fieldNames, query), expands: query.expands }, query) : query.expands;
        }
        req[options.select] = 'onSelect' in singles && !query.distincts.length ?
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onSelect', _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(singles.onSelect.fieldNames, query), query) : '';
        req[options.count] = query.isCountRequired ? _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onCount', query.isCountRequired, query) : '';
        req[options.search] = request.searches.length ? _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onSearch', request.searches, query) : '';
        req[options.skip] = 'onSkip' in singles ?
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onSkip', _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(singles.onSkip.nos, query), query) : '';
        req[options.take] = 'onTake' in singles ?
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onTake', _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getValue(singles.onTake.nos, query), query) : '';
        req[options.where] = request.filters.length || request.searches.length ?
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onWhere', request.filters, query) : '';
        req[options.sortBy] = request.sorts.length ? _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onSortBy', request.sorts, query) : '';
        req[options.group] = request.groups.length ? _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onGroup', request.groups, query) : '';
        req[options.aggregates] = request.aggregates.length ?
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].callAdaptorFunction(this, 'onAggregates', request.aggregates, query) : '';
        req[param] = [];
    };
    /**
     * Convert the object from processQuery to string which can be added query string.
     * @param  {Object} req
     * @param  {Query} query
     * @param  {DataManager} dm
     */
    UrlAdaptor.prototype.convertToQueryString = function (request, query, dm) {
        return '';
        // this needs to be overridden
    };
    /**
     * Return the data from the data manager processing.
     * @param  {DataResult} data
     * @param  {DataOptions} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @param  {Object} request?
     * @param  {CrudOptions} changes?
     */
    UrlAdaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes) {
        if (xhr && xhr.getResponseHeader('Content-Type') &&
            xhr.getResponseHeader('Content-Type').indexOf('application/json') !== -1) {
            var handleTimeZone = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].timeZoneHandling;
            if (ds && !ds.timeZoneHandling) {
                _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].timeZoneHandling = false;
            }
            data = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(data);
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].timeZoneHandling = handleTimeZone;
        }
        var requests = request;
        var pvt = requests.pvtData || {};
        var groupDs = data ? data.groupDs : [];
        if (xhr && xhr.getResponseHeader('Content-Type') &&
            xhr.getResponseHeader('Content-Type').indexOf('xml') !== -1) {
            return (query.isCountRequired ? { result: [], count: 0 } : []);
        }
        var d = JSON.parse(requests.data);
        if (d && d.action === 'batch' && data && data.addedRecords) {
            changes.addedRecords = data.addedRecords;
            return changes;
        }
        if (data && data.d) {
            data = data.d;
        }
        var args = {};
        if (data && 'count' in data) {
            args.count = data.count;
        }
        args.result = data && data.result ? data.result : data;
        var isExpand = false;
        if (Array.isArray(data.result) && data.result.length) {
            var key = 'key';
            var val = 'value';
            var level = 'level';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.result[0][key])) {
                args.result = this.formRemoteGroupedData(args.result, 1, pvt.groups.length - 1);
            }
            if (query && query.lazyLoad.length && pvt.groups.length) {
                for (var i = 0; i < query.lazyLoad.length; i++) {
                    if (query.lazyLoad[i][key] === 'onDemandGroupInfo') {
                        var value = query.lazyLoad[i][val][level];
                        if (pvt.groups.length === value) {
                            isExpand = true;
                        }
                    }
                }
            }
        }
        if (!isExpand) {
            this.getAggregateResult(pvt, data, args, groupDs, query);
        }
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(args.count) ? args.result : { result: args.result, count: args.count, aggregates: args.aggregates };
    };
    UrlAdaptor.prototype.formRemoteGroupedData = function (data, level, childLevel) {
        for (var i = 0; i < data.length; i++) {
            if (data[i].items.length && Object.keys(data[i].items[0]).indexOf('key') > -1) {
                this.formRemoteGroupedData(data[i].items, level + 1, childLevel - 1);
            }
        }
        var uid = 'GroupGuid';
        var childLvl = 'childLevels';
        var lvl = 'level';
        var records = 'records';
        data[uid] = consts[uid];
        data[lvl] = level;
        data[childLvl] = childLevel;
        data[records] = data[0].items.length ? this.getGroupedRecords(data, !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[0].items[records])) : [];
        return data;
    };
    UrlAdaptor.prototype.getGroupedRecords = function (data, hasRecords) {
        var childGroupedRecords = [];
        var records = 'records';
        for (var i = 0; i < data.length; i++) {
            if (!hasRecords) {
                for (var j = 0; j < data[i].items.length; j++) {
                    childGroupedRecords.push(data[i].items[j]);
                }
            }
            else {
                childGroupedRecords = childGroupedRecords.concat(data[i].items[records]);
            }
        }
        return childGroupedRecords;
    };
    /**
     * Add the group query to the adaptor`s option.
     * @param  {Object[]} e
     * @returns void
     */
    UrlAdaptor.prototype.onGroup = function (e) {
        this.pvt.groups = e;
        return e;
    };
    /**
     * Add the aggregate query to the adaptor`s option.
     * @param  {Aggregates[]} e
     * @returns void
     */
    UrlAdaptor.prototype.onAggregates = function (e) {
        this.pvt.aggregates = e;
    };
    /**
     * Prepare the request body based on the newly added, removed and updated records.
     * The result is used by the batch request.
     * @param  {DataManager} dm
     * @param  {CrudOptions} changes
     * @param  {Object} e
     */
    UrlAdaptor.prototype.batchRequest = function (dm, changes, e, query, original) {
        var url;
        var key;
        return {
            type: 'POST',
            url: dm.dataSource.batchUrl || dm.dataSource.crudUrl || dm.dataSource.removeUrl || dm.dataSource.url,
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                changed: changes.changedRecords,
                added: changes.addedRecords,
                deleted: changes.deletedRecords,
                action: 'batch',
                table: e[url],
                key: e[key]
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    /**
     * Method will trigger before send the request to server side.
     * Used to set the custom header or modify the request options.
     * @param  {DataManager} dm
     * @param  {XMLHttpRequest} request
     * @returns void
     */
    UrlAdaptor.prototype.beforeSend = function (dm, request) {
        // need to extend this method
    };
    /**
     * Prepare and returns request body which is used to insert a new record in the table.
     * @param  {DataManager} dm
     * @param  {Object} data
     * @param  {string} tableName
     */
    UrlAdaptor.prototype.insert = function (dm, data, tableName, query) {
        return {
            url: dm.dataSource.insertUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                value: data,
                table: tableName,
                action: 'insert'
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    /**
     * Prepare and return request body which is used to remove record from the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {number|string} value
     * @param  {string} tableName
     */
    UrlAdaptor.prototype.remove = function (dm, keyField, value, tableName, query) {
        return {
            type: 'POST',
            url: dm.dataSource.removeUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                key: value,
                keyColumn: keyField,
                table: tableName,
                action: 'remove'
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    /**
     * Prepare and return request body which is used to update record.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName
     */
    UrlAdaptor.prototype.update = function (dm, keyField, value, tableName, query) {
        return {
            type: 'POST',
            url: dm.dataSource.updateUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                value: value,
                action: 'update',
                keyColumn: keyField,
                key: _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(keyField, value),
                table: tableName
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    /**
     * To generate the predicate based on the filtered query.
     * @param  {Object[]|string[]|number[]} data
     * @param  {Query} query
     * @hidden
     */
    UrlAdaptor.prototype.getFiltersFrom = function (data, query) {
        var key = query.fKey;
        var value;
        var prop = key;
        var pKey = query.key;
        var predicats = [];
        if (typeof data[0] !== 'object') {
            prop = null;
        }
        for (var i = 0; i < data.length; i++) {
            if (typeof data[0] === 'object') {
                value = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(pKey || prop, data[i]);
            }
            else {
                value = data[i];
            }
            predicats.push(new _query__WEBPACK_IMPORTED_MODULE_2__["Predicate"](key, 'equal', value));
        }
        return _query__WEBPACK_IMPORTED_MODULE_2__["Predicate"].or(predicats);
    };
    UrlAdaptor.prototype.getAggregateResult = function (pvt, data, args, groupDs, query) {
        var pData = data;
        if (data && data.result) {
            pData = data.result;
        }
        if (pvt && pvt.aggregates && pvt.aggregates.length) {
            var agg = pvt.aggregates;
            var fn = void 0;
            var aggregateData = pData;
            var res = {};
            if (data.aggregate) {
                aggregateData = data.aggregate;
            }
            for (var i = 0; i < agg.length; i++) {
                fn = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].aggregates[agg[i].type];
                if (fn) {
                    res[agg[i].field + ' - ' + agg[i].type] = fn(aggregateData, agg[i].field);
                }
            }
            args.aggregates = res;
        }
        var key = 'key';
        var isServerGrouping = Array.isArray(data.result) && data.result.length && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.result[0][key]);
        if (pvt && pvt.groups && pvt.groups.length && !isServerGrouping) {
            var groups = pvt.groups;
            for (var i = 0; i < groups.length; i++) {
                var level = null;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupDs)) {
                    groupDs = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].group(groupDs, groups[i]);
                }
                var groupQuery = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onGroup')[i].e;
                pData = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].group(pData, groups[i], pvt.aggregates, level, groupDs, groupQuery.comparer);
            }
            args.result = pData;
        }
        return args;
    };
    UrlAdaptor.prototype.getQueryRequest = function (query) {
        var req = { sorts: [], groups: [], filters: [], searches: [], aggregates: [] };
        req.sorts = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onSortBy');
        req.groups = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onGroup');
        req.filters = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onWhere');
        req.searches = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onSearch');
        req.aggregates = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueries(query.queries, 'onAggregates');
        return req;
    };
    UrlAdaptor.prototype.addParams = function (options) {
        var req = options.reqParams;
        if (options.params.length) {
            req.params = {};
        }
        for (var _i = 0, _a = options.params; _i < _a.length; _i++) {
            var tmp = _a[_i];
            if (req[tmp.key]) {
                throw new Error('Query() - addParams: Custom Param is conflicting other request arguments');
            }
            req[tmp.key] = tmp.value;
            if (tmp.fn) {
                req[tmp.key] = tmp.fn.call(options.query, tmp.key, options.query, options.dm);
            }
            req.params[tmp.key] = req[tmp.key];
        }
    };
    return UrlAdaptor;
}(Adaptor));

/**
 * OData Adaptor that is extended from URL Adaptor, is used for consuming data through OData Service.
 * @hidden
 */
var ODataAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(ODataAdaptor, _super);
    function ODataAdaptor(props) {
        var _this = _super.call(this) || this;
        // options replaced the default adaptor options
        _this.options = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, _this.options, {
            requestType: 'get',
            accept: 'application/json;odata=light;q=1,application/json;odata=verbose;q=0.5',
            multipartAccept: 'multipart/mixed',
            sortBy: '$orderby',
            select: '$select',
            skip: '$skip',
            take: '$top',
            count: '$inlinecount',
            where: '$filter',
            expand: '$expand',
            batch: '$batch',
            changeSet: '--changeset_',
            batchPre: 'batch_',
            contentId: 'Content-Id: ',
            batchContent: 'Content-Type: multipart/mixed; boundary=',
            changeSetContent: 'Content-Type: application/http\nContent-Transfer-Encoding: binary ',
            batchChangeSetContentType: 'Content-Type: application/json; charset=utf-8 ',
            updateType: 'PUT'
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.options, props || {});
        return _this;
    }
    ODataAdaptor.prototype.getModuleName = function () {
        return 'ODataAdaptor';
    };
    /**
     * Generate request string based on the filter criteria from query.
     * @param  {Predicate} pred
     * @param  {boolean} requiresCast?
     */
    ODataAdaptor.prototype.onPredicate = function (predicate, query, requiresCast) {
        var returnValue = '';
        var operator;
        var guid;
        var val = predicate.value;
        var type = typeof val;
        var field = predicate.field ? ODataAdaptor.getField(predicate.field) : null;
        if (val instanceof Date) {
            val = 'datetime\'' + _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.replacer(val) + '\'';
        }
        if (type === 'string') {
            val = encodeURIComponent(val);
            val = '\'' + val + '\'';
            if (requiresCast) {
                field = 'cast(' + field + ', \'Edm.String\')';
            }
            if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(val)) {
                guid = 'guid';
            }
            if (predicate.ignoreCase) {
                if (!guid) {
                    field = 'tolower(' + field + ')';
                }
                val = val.toLowerCase();
            }
        }
        operator = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].odBiOperator[predicate.operator];
        if (operator) {
            returnValue += field;
            returnValue += operator;
            if (guid) {
                returnValue += guid;
            }
            return returnValue + val;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.getModuleName) && this.getModuleName() === 'ODataV4Adaptor') {
            operator = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].odv4UniOperator[predicate.operator];
        }
        else {
            operator = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].odUniOperator[predicate.operator];
        }
        if (operator === 'substringof') {
            var temp = val;
            val = field;
            field = temp;
        }
        returnValue += operator + '(';
        returnValue += field + ',';
        if (guid) {
            returnValue += guid;
        }
        returnValue += val + ')';
        return returnValue;
    };
    ODataAdaptor.prototype.addParams = function (options) {
        _super.prototype.addParams.call(this, options);
        delete options.reqParams.params;
    };
    /**
     * Generate request string based on the multiple filter criteria from query.
     * @param  {Predicate} pred
     * @param  {boolean} requiresCast?
     */
    ODataAdaptor.prototype.onComplexPredicate = function (predicate, query, requiresCast) {
        var res = [];
        for (var i = 0; i < predicate.predicates.length; i++) {
            res.push('(' + this.onEachWhere(predicate.predicates[i], query, requiresCast) + ')');
        }
        return res.join(' ' + predicate.condition + ' ');
    };
    /**
     * Generate query string based on the multiple filter criteria from query.
     * @param  {Predicate} filter
     * @param  {boolean} requiresCast?
     */
    ODataAdaptor.prototype.onEachWhere = function (filter, query, requiresCast) {
        return filter.isComplex ? this.onComplexPredicate(filter, query, requiresCast) : this.onPredicate(filter, query, requiresCast);
    };
    /**
     * Generate query string based on the multiple filter criteria from query.
     * @param  {string[]} filters
     */
    ODataAdaptor.prototype.onWhere = function (filters) {
        if (this.pvt.search) {
            filters.push(this.onEachWhere(this.pvt.search, null, true));
        }
        return filters.join(' and ');
    };
    /**
     * Generate query string based on the multiple search criteria from query.
     * @param  {{fields:string[]} e
     * @param  {string} operator
     * @param  {string} key
     * @param  {boolean}} ignoreCase
     */
    ODataAdaptor.prototype.onEachSearch = function (e) {
        if (e.fields && e.fields.length === 0) {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].throwError('Query() - Search : oData search requires list of field names to search');
        }
        var filter = this.pvt.search || [];
        for (var i = 0; i < e.fields.length; i++) {
            filter.push(new _query__WEBPACK_IMPORTED_MODULE_2__["Predicate"](e.fields[i], e.operator, e.key, e.ignoreCase));
        }
        this.pvt.search = filter;
    };
    /**
     * Generate query string based on the search criteria from query.
     * @param  {Object} e
     */
    ODataAdaptor.prototype.onSearch = function (e) {
        this.pvt.search = _query__WEBPACK_IMPORTED_MODULE_2__["Predicate"].or(this.pvt.search);
        return '';
    };
    /**
     * Generate query string based on multiple sort criteria from query.
     * @param  {QueryOptions} e
     */
    ODataAdaptor.prototype.onEachSort = function (e) {
        var res = [];
        if (e.name instanceof Array) {
            for (var i = 0; i < e.name.length; i++) {
                res.push(ODataAdaptor.getField(e.name[i]) + (e.direction === 'descending' ? ' desc' : ''));
            }
        }
        else {
            res.push(ODataAdaptor.getField(e.name) + (e.direction === 'descending' ? ' desc' : ''));
        }
        return res.join(',');
    };
    /**
     * Returns sort query string.
     * @param  {string[]} e
     */
    ODataAdaptor.prototype.onSortBy = function (e) {
        return e.reverse().join(',');
    };
    /**
     * Adds the group query to the adaptor option.
     * @param  {Object[]} e
     * @returns string
     */
    ODataAdaptor.prototype.onGroup = function (e) {
        this.pvt.groups = e;
        return [];
    };
    /**
     * Returns the select query string.
     * @param  {string[]} e
     */
    ODataAdaptor.prototype.onSelect = function (e) {
        for (var i = 0; i < e.length; i++) {
            e[i] = ODataAdaptor.getField(e[i]);
        }
        return e.join(',');
    };
    /**
     * Add the aggregate query to the adaptor option.
     * @param  {Object[]} e
     * @returns string
     */
    ODataAdaptor.prototype.onAggregates = function (e) {
        this.pvt.aggregates = e;
        return '';
    };
    /**
     * Returns the query string which requests total count from the data source.
     * @param  {boolean} e
     * @returns string
     */
    ODataAdaptor.prototype.onCount = function (e) {
        return e === true ? 'allpages' : '';
    };
    /**
     * Method will trigger before send the request to server side.
     * Used to set the custom header or modify the request options.
     * @param  {DataManager} dm
     * @param  {XMLHttpRequest} request
     * @param  {Ajax} settings?
     */
    ODataAdaptor.prototype.beforeSend = function (dm, request, settings) {
        if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].endsWith(settings.url, this.options.batch) && settings.type.toLowerCase() === 'post') {
            request.setRequestHeader('Accept', this.options.multipartAccept);
            request.setRequestHeader('DataServiceVersion', '2.0');
            request.overrideMimeType('text/plain; charset=x-user-defined');
        }
        else {
            request.setRequestHeader('Accept', this.options.accept);
        }
        request.setRequestHeader('DataServiceVersion', '2.0');
        request.setRequestHeader('MaxDataServiceVersion', '2.0');
    };
    /**
     * Returns the data from the query processing.
     * @param  {DataResult} data
     * @param  {DataOptions} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @param  {Ajax} request?
     * @param  {CrudOptions} changes?
     * @returns aggregateResult
     */
    ODataAdaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes) {
        var metaCheck = 'odata.metadata';
        if ((request && request.type === 'GET') && !this.rootUrl && data[metaCheck]) {
            var dataUrls = data[metaCheck].split('/$metadata#');
            this.rootUrl = dataUrls[0];
            this.resourceTableName = dataUrls[1];
        }
        var pvtData = 'pvtData';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.d)) {
            var dataCopy = ((query && query.isCountRequired) ? data.d.results : data.d);
            var metaData = '__metadata';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataCopy)) {
                for (var i = 0; i < dataCopy.length; i++) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataCopy[i][metaData])) {
                        delete dataCopy[i][metaData];
                    }
                }
            }
        }
        var pvt = request && request[pvtData];
        var emptyAndBatch = this.processBatchResponse(data, query, xhr, request, changes);
        if (emptyAndBatch) {
            return emptyAndBatch;
        }
        var versionCheck = xhr && request.getResponseHeader('DataServiceVersion');
        var count = null;
        var version = (versionCheck && parseInt(versionCheck, 10)) || 2;
        if (query && query.isCountRequired) {
            var oDataCount = '__count';
            if (data[oDataCount] || data['odata.count']) {
                count = data[oDataCount] || data['odata.count'];
            }
            if (data.d) {
                data = data.d;
            }
            if (data[oDataCount] || data['odata.count']) {
                count = data[oDataCount] || data['odata.count'];
            }
        }
        if (version === 3 && data.value) {
            data = data.value;
        }
        if (data.d) {
            data = data.d;
        }
        if (version < 3 && data.results) {
            data = data.results;
        }
        var args = {};
        args.count = count;
        args.result = data;
        this.getAggregateResult(pvt, data, args, null, query);
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(count) ? args.result : { result: args.result, count: args.count, aggregates: args.aggregates };
    };
    /**
     * Converts the request object to query string.
     * @param  {Object} req
     * @param  {Query} query
     * @param  {DataManager} dm
     * @returns tableName
     */
    ODataAdaptor.prototype.convertToQueryString = function (request, query, dm) {
        var res = [];
        var table = 'table';
        var tableName = request[table] || '';
        var format = '$format';
        delete request[table];
        if (dm.dataSource.requiresFormat) {
            request[format] = 'json';
        }
        var keys = Object.keys(request);
        for (var _i = 0, keys_4 = keys; _i < keys_4.length; _i++) {
            var prop = keys_4[_i];
            res.push(prop + '=' + request[prop]);
        }
        res = res.join('&');
        if (dm.dataSource.url && dm.dataSource.url.indexOf('?') !== -1 && !tableName) {
            return res;
        }
        return res.length ? tableName + '?' + res : tableName || '';
    };
    ODataAdaptor.prototype.localTimeReplacer = function (key, convertObj) {
        for (var _i = 0, _a = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(convertObj) ? Object.keys(convertObj) : []; _i < _a.length; _i++) {
            var prop = _a[_i];
            if ((convertObj[prop] instanceof Date)) {
                convertObj[prop] = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].dateParse.toLocalTime(convertObj[prop]);
            }
        }
        return convertObj;
    };
    /**
     * Prepare and returns request body which is used to insert a new record in the table.
     * @param  {DataManager} dm
     * @param  {Object} data
     * @param  {string} tableName?
     */
    ODataAdaptor.prototype.insert = function (dm, data, tableName) {
        return {
            url: (dm.dataSource.insertUrl || dm.dataSource.url).replace(/\/*$/, tableName ? '/' + tableName : ''),
            data: JSON.stringify(data, this.options.localTime ? this.localTimeReplacer : null)
        };
    };
    /**
     * Prepare and return request body which is used to remove record from the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {number} value
     * @param  {string} tableName?
     */
    ODataAdaptor.prototype.remove = function (dm, keyField, value, tableName) {
        var url;
        if (typeof value === 'string' && !_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(value)) {
            url = "('" + value + "')";
        }
        else {
            url = "(" + value + ")";
        }
        return {
            type: 'DELETE',
            url: (dm.dataSource.removeUrl || dm.dataSource.url).replace(/\/*$/, tableName ? '/' + tableName : '') + url
        };
    };
    /**
     * Updates existing record and saves the changes to the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName?
     * @returns this
     */
    ODataAdaptor.prototype.update = function (dm, keyField, value, tableName, query, original) {
        if (this.options.updateType === 'PATCH' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(original)) {
            value = this.compareAndRemove(value, original, keyField);
        }
        var url;
        if (typeof value[keyField] === 'string' && !_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(value[keyField])) {
            url = "('" + value[keyField] + "')";
        }
        else {
            url = "(" + value[keyField] + ")";
        }
        return {
            type: this.options.updateType,
            url: (dm.dataSource.updateUrl || dm.dataSource.url).replace(/\/*$/, tableName ? '/' + tableName : '') + url,
            data: JSON.stringify(value, this.options.localTime ? this.localTimeReplacer : null),
            accept: this.options.accept
        };
    };
    /**
     * Prepare the request body based on the newly added, removed and updated records.
     * The result is used by the batch request.
     * @param  {DataManager} dm
     * @param  {CrudOptions} changes
     * @param  {RemoteArgs} e
     * @returns {Object}
     */
    ODataAdaptor.prototype.batchRequest = function (dm, changes, e, query, original) {
        var initialGuid = e.guid = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getGuid(this.options.batchPre);
        var url = this.rootUrl ? this.rootUrl + '/' + this.options.batch :
            dm.dataSource.url.replace(/\/*$/, '/' + this.options.batch);
        e.url = this.resourceTableName ? this.resourceTableName : e.url;
        var args = {
            url: e.url,
            key: e.key,
            cid: 1,
            cSet: _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getGuid(this.options.changeSet)
        };
        var req = '--' + initialGuid + '\n';
        req += 'Content-Type: multipart/mixed; boundary=' + args.cSet.replace('--', '') + '\n';
        this.pvt.changeSet = 0;
        req += this.generateInsertRequest(changes.addedRecords, args, dm);
        req += this.generateUpdateRequest(changes.changedRecords, args, dm, original ? original.changedRecords : []);
        req += this.generateDeleteRequest(changes.deletedRecords, args, dm);
        req += args.cSet + '--\n';
        req += '--' + initialGuid + '--';
        return {
            type: 'POST',
            url: url,
            dataType: 'json',
            contentType: 'multipart/mixed; charset=UTF-8;boundary=' + initialGuid,
            data: req
        };
    };
    /**
     * Generate the string content from the removed records.
     * The result will be send during batch update.
     * @param  {Object[]} arr
     * @param  {RemoteArgs} e
     * @returns this
     */
    ODataAdaptor.prototype.generateDeleteRequest = function (arr, e, dm) {
        if (!arr) {
            return '';
        }
        var req = '';
        var stat = {
            'method': 'DELETE ',
            'url': function (data, i, key) {
                var url = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(key, data[i]);
                if (typeof url === 'number' || _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(url)) {
                    return '(' + url + ')';
                }
                else if (url instanceof Date) {
                    var dateTime = data[i][key];
                    return '(' + dateTime.toJSON() + ')';
                }
                else {
                    return "('" + url + "')";
                }
            },
            'data': function (data, i) { return ''; }
        };
        req = this.generateBodyContent(arr, e, stat, dm);
        return req + '\n';
    };
    /**
     * Generate the string content from the inserted records.
     * The result will be send during batch update.
     * @param  {Object[]} arr
     * @param  {RemoteArgs} e
     */
    ODataAdaptor.prototype.generateInsertRequest = function (arr, e, dm) {
        if (!arr) {
            return '';
        }
        var req = '';
        var stat = {
            'method': 'POST ',
            'url': function (data, i, key) { return ''; },
            'data': function (data, i) { return JSON.stringify(data[i]) + '\n\n'; }
        };
        req = this.generateBodyContent(arr, e, stat, dm);
        return req;
    };
    /**
     * Generate the string content from the updated records.
     * The result will be send during batch update.
     * @param  {Object[]} arr
     * @param  {RemoteArgs} e
     */
    ODataAdaptor.prototype.generateUpdateRequest = function (arr, e, dm, org) {
        var _this = this;
        if (!arr) {
            return '';
        }
        var req = '';
        arr.forEach(function (change) { return change = _this.compareAndRemove(change, org.filter(function (o) { return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(e.key, o) === _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(e.key, change); })[0], e.key); });
        var stat = {
            'method': this.options.updateType + ' ',
            'url': function (data, i, key) {
                if (typeof data[i][key] === 'number' || _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(data[i][key])) {
                    return '(' + data[i][key] + ')';
                }
                else if (data[i][key] instanceof Date) {
                    var date = data[i][key];
                    return '(' + date.toJSON() + ')';
                }
                else {
                    return "('" + data[i][key] + "')";
                }
            },
            'data': function (data, i) { return JSON.stringify(data[i]) + '\n\n'; }
        };
        req = this.generateBodyContent(arr, e, stat, dm);
        return req;
    };
    ODataAdaptor.getField = function (prop) {
        return prop.replace(/\./g, '/');
    };
    ODataAdaptor.prototype.generateBodyContent = function (arr, e, stat, dm) {
        var req = '';
        for (var i = 0; i < arr.length; i++) {
            req += '\n' + e.cSet + '\n';
            req += this.options.changeSetContent + '\n\n';
            req += stat.method;
            if (stat.method === 'POST ') {
                req += (dm.dataSource.insertUrl || dm.dataSource.crudUrl || e.url) + stat.url(arr, i, e.key) + ' HTTP/1.1\n';
            }
            else if (stat.method === 'PUT ' || stat.method === 'PATCH ') {
                req += (dm.dataSource.updateUrl || dm.dataSource.crudUrl || e.url) + stat.url(arr, i, e.key) + ' HTTP/1.1\n';
            }
            else if (stat.method === 'DELETE ') {
                req += (dm.dataSource.removeUrl || dm.dataSource.crudUrl || e.url) + stat.url(arr, i, e.key) + ' HTTP/1.1\n';
            }
            req += 'Accept: ' + this.options.accept + '\n';
            req += 'Content-Id: ' + this.pvt.changeSet++ + '\n';
            req += this.options.batchChangeSetContentType + '\n';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(arr[i]['@odata.etag'])) {
                req += 'If-Match: ' + arr[i]['@odata.etag'] + '\n\n';
                delete arr[i]['@odata.etag'];
            }
            else {
                req += '\n';
            }
            req += stat.data(arr, i);
        }
        return req;
    };
    ODataAdaptor.prototype.processBatchResponse = function (data, query, xhr, request, changes) {
        if (xhr && xhr.getResponseHeader('Content-Type') && xhr.getResponseHeader('Content-Type').indexOf('xml') !== -1) {
            return (query.isCountRequired ? { result: [], count: 0 } : []);
        }
        if (request && this.options.batch && _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].endsWith(request.url, this.options.batch) && request.type.toLowerCase() === 'post') {
            var guid = xhr.getResponseHeader('Content-Type');
            var cIdx = void 0;
            var jsonObj = void 0;
            var d = data + '';
            guid = guid.substring(guid.indexOf('=batchresponse') + 1);
            d = d.split(guid);
            if (d.length < 2) {
                return {};
            }
            d = d[1];
            var exVal = /(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(d);
            if (exVal) {
                d.replace(exVal[0], '');
            }
            var changeGuid = exVal ? exVal[1] : '';
            d = d.split(changeGuid);
            for (var i = d.length; i > -1; i--) {
                if (!/\bContent-ID:/i.test(d[i]) || !/\bHTTP.+201/.test(d[i])) {
                    continue;
                }
                cIdx = parseInt(/\bContent-ID: (\d+)/i.exec(d[i])[1], 10);
                if (changes.addedRecords[cIdx]) {
                    jsonObj = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(/^\{.+\}/m.exec(d[i])[0]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, changes.addedRecords[cIdx], this.processResponse(jsonObj));
                }
            }
            return changes;
        }
        return null;
    };
    ODataAdaptor.prototype.compareAndRemove = function (data, original, key) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(original)) {
            return data;
        }
        Object.keys(data).forEach(function (prop) {
            if (prop !== key && prop !== '@odata.etag') {
                if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isPlainObject(data[prop])) {
                    _this.compareAndRemove(data[prop], original[prop]);
                    var final = Object.keys(data[prop]).filter(function (data) { return data !== '@odata.etag'; });
                    if (final.length === 0) {
                        delete data[prop];
                    }
                }
                else if (data[prop] === original[prop]) {
                    delete data[prop];
                }
                else if (data[prop] && original[prop] && data[prop].valueOf() === original[prop].valueOf()) {
                    delete data[prop];
                }
            }
        });
        return data;
    };
    return ODataAdaptor;
}(UrlAdaptor));

/**
 * The OData v4 is an improved version of OData protocols.
 * The DataManager uses the ODataV4Adaptor to consume OData v4 services.
 * @hidden
 */
var ODataV4Adaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(ODataV4Adaptor, _super);
    function ODataV4Adaptor(props) {
        var _this = _super.call(this, props) || this;
        // options replaced the default adaptor options
        _this.options = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, _this.options, {
            requestType: 'get',
            accept: 'application/json, text/javascript, */*; q=0.01',
            multipartAccept: 'multipart/mixed',
            sortBy: '$orderby',
            select: '$select',
            skip: '$skip',
            take: '$top',
            count: '$count',
            search: '$search',
            where: '$filter',
            expand: '$expand',
            batch: '$batch',
            changeSet: '--changeset_',
            batchPre: 'batch_',
            contentId: 'Content-Id: ',
            batchContent: 'Content-Type: multipart/mixed; boundary=',
            changeSetContent: 'Content-Type: application/http\nContent-Transfer-Encoding: binary ',
            batchChangeSetContentType: 'Content-Type: application/json; charset=utf-8 ',
            updateType: 'PATCH',
            localTime: false,
            apply: '$apply'
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.options, props || {});
        return _this;
    }
    /**
     * @hidden
     */
    ODataV4Adaptor.prototype.getModuleName = function () {
        return 'ODataV4Adaptor';
    };
    /**
     * Returns the query string which requests total count from the data source.
     * @param  {boolean} e
     * @returns string
     */
    ODataV4Adaptor.prototype.onCount = function (e) {
        return e === true ? 'true' : '';
    };
    /**
     * Generate request string based on the filter criteria from query.
     * @param  {Predicate} pred
     * @param  {boolean} requiresCast?
     */
    ODataV4Adaptor.prototype.onPredicate = function (predicate, query, requiresCast) {
        var returnValue = '';
        var val = predicate.value;
        var isDate = val instanceof Date;
        if (query instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"]) {
            var queries = this.getQueryRequest(query);
            for (var i = 0; i < queries.filters.length; i++) {
                if (queries.filters[i].e.key === predicate.value) {
                    requiresCast = true;
                }
            }
        }
        returnValue = _super.prototype.onPredicate.call(this, predicate, query, requiresCast);
        if (isDate) {
            returnValue = returnValue.replace(/datetime'(.*)'$/, '$1');
        }
        if (_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(val)) {
            returnValue = returnValue.replace('guid', '').replace(/'/g, '');
        }
        return returnValue;
    };
    /**
     *  Generate query string based on the multiple search criteria from query.
     * @param  {{fields:string[]} e
     * @param  {string} operator
     * @param  {string} key
     * @param  {boolean}} ignoreCase
     */
    ODataV4Adaptor.prototype.onEachSearch = function (e) {
        var search = this.pvt.searches || [];
        search.push(e.key);
        this.pvt.searches = search;
    };
    /**
     *  Generate query string based on the search criteria from query.
     * @param  {Object} e
     */
    ODataV4Adaptor.prototype.onSearch = function (e) {
        return this.pvt.searches.join(' OR ');
    };
    /**
     * Returns the expand query string.
     * @param  {string} e
     */
    ODataV4Adaptor.prototype.onExpand = function (e) {
        var _this = this;
        var selected = {};
        var expanded = {};
        var expands = e.expands.slice();
        var exArr = [];
        var selects = e.selects.filter(function (item) { return item.indexOf('.') > -1; });
        selects.forEach(function (select) {
            var splits = select.split('.');
            if (!(splits[0] in selected)) {
                selected[splits[0]] = [];
            }
            selected[splits[0]].push(splits[1]);
        });
        //Auto expand from select query
        Object.keys(selected).forEach(function (expand) {
            if ((expands.indexOf(expand) === -1)) {
                expands.push(expand);
            }
        });
        expands.forEach(function (expand) {
            expanded[expand] = expand in selected ? expand + "(" + _this.options.select + "=" + selected[expand].join(',') + ")" : expand;
        });
        Object.keys(expanded).forEach(function (ex) { return exArr.push(expanded[ex]); });
        return exArr.join(',');
    };
    /**
     * Returns the groupby query string.
     * @param  {string} e
     */
    ODataV4Adaptor.prototype.onDistinct = function (distinctFields) {
        var fields = distinctFields.map(function (field) { return ODataAdaptor.getField(field); }).join(',');
        return "groupby((" + fields + "))";
    };
    /**
     * Returns the select query string.
     * @param  {string[]} e
     */
    ODataV4Adaptor.prototype.onSelect = function (e) {
        return _super.prototype.onSelect.call(this, e.filter(function (item) { return item.indexOf('.') === -1; }));
    };
    /**
     * Method will trigger before send the request to server side.
     * Used to set the custom header or modify the request options.
     * @param  {DataManager} dm
     * @param  {XMLHttpRequest} request
     * @param  {Ajax} settings
     * @returns void
     */
    ODataV4Adaptor.prototype.beforeSend = function (dm, request, settings) {
        if (settings.type === 'POST' || settings.type === 'PUT' || settings.type === 'PATCH') {
            request.setRequestHeader('Prefer', 'return=representation');
        }
        request.setRequestHeader('Accept', this.options.accept);
    };
    /**
     * Returns the data from the query processing.
     * @param  {DataResult} data
     * @param  {DataOptions} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @param  {Ajax} request?
     * @param  {CrudOptions} changes?
     * @returns aggregateResult
     */
    ODataV4Adaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes) {
        var metaName = '@odata.context';
        if ((request && request.type === 'GET') && !this.rootUrl && data[metaName]) {
            var dataUrl = data[metaName].split('/$metadata#');
            this.rootUrl = dataUrl[0];
            this.resourceTableName = dataUrl[1];
        }
        var pvtData = 'pvtData';
        var pvt = request && request[pvtData];
        var emptyAndBatch = _super.prototype.processBatchResponse.call(this, data, query, xhr, request, changes);
        if (emptyAndBatch) {
            return emptyAndBatch;
        }
        var count = null;
        var dataCount = '@odata.count';
        if (query && query.isCountRequired) {
            if (dataCount in data) {
                count = data[dataCount];
            }
        }
        data = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.value) ? data.value : data;
        var args = {};
        args.count = count;
        args.result = data;
        this.getAggregateResult(pvt, data, args, null, query);
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(count) ? args.result : { result: args.result, count: count, aggregates: args.aggregates };
    };
    return ODataV4Adaptor;
}(ODataAdaptor));

/**
 * The Web API is a programmatic interface to define the request and response messages system that is mostly exposed in JSON or XML.
 * The DataManager uses the WebApiAdaptor to consume Web API.
 * Since this adaptor is targeted to interact with Web API created using OData endpoint, it is extended from ODataAdaptor
 * @hidden
 */
var WebApiAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(WebApiAdaptor, _super);
    function WebApiAdaptor() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    WebApiAdaptor.prototype.getModuleName = function () {
        return 'WebApiAdaptor';
    };
    /**
     * Prepare and returns request body which is used to insert a new record in the table.
     * @param  {DataManager} dm
     * @param  {Object} data
     * @param  {string} tableName?
     */
    WebApiAdaptor.prototype.insert = function (dm, data, tableName) {
        return {
            type: 'POST',
            url: dm.dataSource.url,
            data: JSON.stringify(data)
        };
    };
    /**
     * Prepare and return request body which is used to remove record from the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {number} value
     * @param  {string} tableName?
     */
    WebApiAdaptor.prototype.remove = function (dm, keyField, value, tableName) {
        return {
            type: 'DELETE',
            url: dm.dataSource.url + '/' + value,
            data: JSON.stringify(value)
        };
    };
    /**
     * Prepare and return request body which is used to update record.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName?
     */
    WebApiAdaptor.prototype.update = function (dm, keyField, value, tableName) {
        return {
            type: 'PUT',
            url: dm.dataSource.url,
            data: JSON.stringify(value)
        };
    };
    WebApiAdaptor.prototype.batchRequest = function (dm, changes, e) {
        var _this = this;
        var initialGuid = e.guid = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getGuid(this.options.batchPre);
        var url = dm.dataSource.url.replace(/\/*$/, '/' + this.options.batch);
        e.url = this.resourceTableName ? this.resourceTableName : e.url;
        var req = [];
        var _loop_1 = function (i, x) {
            changes.addedRecords.forEach(function (j, d) {
                var stat = {
                    'method': 'POST ',
                    'url': function (data, i, key) { return ''; },
                    'data': function (data, i) { return JSON.stringify(data[i]) + '\n\n'; }
                };
                req.push('--' + initialGuid);
                req.push('Content-Type: application/http; msgtype=request', '');
                req.push('POST ' + '/api/' + (dm.dataSource.insertUrl || dm.dataSource.crudUrl || e.url)
                    + stat.url(changes.addedRecords, i, e.key) + ' HTTP/1.1');
                req.push('Content-Type: ' + 'application/json; charset=utf-8');
                req.push('Host: ' + location.host);
                req.push('', j ? JSON.stringify(j) : '');
            });
        };
        //insertion
        for (var i = 0, x = changes.addedRecords.length; i < x; i++) {
            _loop_1(i, x);
        }
        var _loop_2 = function (i, x) {
            changes.changedRecords.forEach(function (j, d) {
                var stat = {
                    'method': _this.options.updateType + ' ',
                    'url': function (data, i, key) { return ''; },
                    'data': function (data, i) { return JSON.stringify(data[i]) + '\n\n'; }
                };
                req.push('--' + initialGuid);
                req.push('Content-Type: application/http; msgtype=request', '');
                req.push('PUT ' + '/api/' + (dm.dataSource.updateUrl || dm.dataSource.crudUrl || e.url)
                    + stat.url(changes.changedRecords, i, e.key) + ' HTTP/1.1');
                req.push('Content-Type: ' + 'application/json; charset=utf-8');
                req.push('Host: ' + location.host);
                req.push('', j ? JSON.stringify(j) : '');
            });
        };
        //updation 
        for (var i = 0, x = changes.changedRecords.length; i < x; i++) {
            _loop_2(i, x);
        }
        var _loop_3 = function (i, x) {
            changes.deletedRecords.forEach(function (j, d) {
                var state = {
                    'mtd': 'DELETE ',
                    'url': function (data, i, key) {
                        var url = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(key, data[i]);
                        if (typeof url === 'number' || _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.isGuid(url)) {
                            return '/' + url;
                        }
                        else if (url instanceof Date) {
                            var datTime = data[i][key];
                            return '/' + datTime.toJSON();
                        }
                        else {
                            return "/'" + url + "'";
                        }
                    },
                    'data': function (data, i) { return ''; }
                };
                req.push('--' + initialGuid);
                req.push('Content-Type: application/http; msgtype=request', '');
                req.push('DELETE ' + '/api/' + (dm.dataSource.removeUrl || dm.dataSource.crudUrl || e.url)
                    + state.url(changes.deletedRecords, i, e.key) + ' HTTP/1.1');
                req.push('Content-Type: ' + 'application/json; charset=utf-8');
                req.push('Host: ' + location.host);
                req.push('', j ? JSON.stringify(j) : '');
            });
        };
        //deletion
        for (var i = 0, x = changes.deletedRecords.length; i < x; i++) {
            _loop_3(i, x);
        }
        req.push('--' + initialGuid + '--', '');
        return {
            type: 'POST',
            url: url,
            contentType: 'multipart/mixed; boundary=' + initialGuid,
            data: req.join('\r\n')
        };
    };
    /**
     * Method will trigger before send the request to server side.
     * Used to set the custom header or modify the request options.
     * @param  {DataManager} dm
     * @param  {XMLHttpRequest} request
     * @param  {Ajax} settings
     * @returns void
     */
    WebApiAdaptor.prototype.beforeSend = function (dm, request, settings) {
        request.setRequestHeader('Accept', 'application/json, text/javascript, */*; q=0.01');
    };
    /**
     * Returns the data from the query processing.
     * @param  {DataResult} data
     * @param  {DataOptions} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @param  {Ajax} request?
     * @param  {CrudOptions} changes?
     * @returns aggregateResult
     */
    WebApiAdaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes) {
        var pvtData = 'pvtData';
        var pvt = request && request[pvtData];
        var count = null;
        var args = {};
        if (request && request.type.toLowerCase() !== 'post') {
            var versionCheck = xhr && request.getResponseHeader('DataServiceVersion');
            var version = (versionCheck && parseInt(versionCheck, 10)) || 2;
            if (query && query.isCountRequired) {
                if (!_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(data.Count)) {
                    count = data.Count;
                }
            }
            if (version < 3 && data.Items) {
                data = data.Items;
            }
            args.count = count;
            args.result = data;
            this.getAggregateResult(pvt, data, args, null, query);
        }
        args.result = args.result || data;
        return _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isNull(count) ? args.result : { result: args.result, count: args.count, aggregates: args.aggregates };
    };
    return WebApiAdaptor;
}(ODataAdaptor));

/**
 * WebMethodAdaptor can be used by DataManager to interact with web method.
 * @hidden
 */
var WebMethodAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(WebMethodAdaptor, _super);
    function WebMethodAdaptor() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Prepare the request body based on the query.
     * The query information can be accessed at the WebMethod using variable named `value`.
     * @param  {DataManager} dm
     * @param  {Query} query
     * @param  {Object[]} hierarchyFilters?
     * @returns application
     */
    WebMethodAdaptor.prototype.processQuery = function (dm, query, hierarchyFilters) {
        var obj = new UrlAdaptor().processQuery(dm, query, hierarchyFilters);
        var getData = 'data';
        var data = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(obj[getData]);
        var result = {};
        var value = 'value';
        if (data.param) {
            for (var i = 0; i < data.param.length; i++) {
                var param = data.param[i];
                var key = Object.keys(param)[0];
                result[key] = param[key];
            }
        }
        result[value] = data;
        var pvtData = 'pvtData';
        var url = 'url';
        return {
            data: JSON.stringify(result),
            url: obj[url],
            pvtData: obj[pvtData],
            type: 'POST',
            contentType: 'application/json; charset=utf-8'
        };
    };
    return WebMethodAdaptor;
}(UrlAdaptor));

/**
 * RemoteSaveAdaptor, extended from JsonAdaptor and it is used for binding local data and performs all DataManager queries in client-side.
 * It interacts with server-side only for CRUD operations.
 * @hidden
 */
var RemoteSaveAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(RemoteSaveAdaptor, _super);
    /**
     * @hidden
     */
    function RemoteSaveAdaptor() {
        var _this = _super.call(this) || this;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('beforeSend', UrlAdaptor.prototype.beforeSend, _this);
        return _this;
    }
    RemoteSaveAdaptor.prototype.insert = function (dm, data, tableName, query, position) {
        this.pvt.position = position;
        this.updateType = 'add';
        return {
            url: dm.dataSource.insertUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                value: data,
                table: tableName,
                action: 'insert'
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    RemoteSaveAdaptor.prototype.remove = function (dm, keyField, val, tableName, query) {
        _super.prototype.remove.call(this, dm, keyField, val);
        return {
            type: 'POST',
            url: dm.dataSource.removeUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                key: val,
                keyColumn: keyField,
                table: tableName,
                action: 'remove'
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    RemoteSaveAdaptor.prototype.update = function (dm, keyField, val, tableName, query) {
        this.updateType = 'update';
        this.updateKey = keyField;
        return {
            type: 'POST',
            url: dm.dataSource.updateUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                value: val,
                action: 'update',
                keyColumn: keyField,
                key: val[keyField],
                table: tableName
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    RemoteSaveAdaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes, e) {
        var i;
        data = request ? JSON.parse(request.data) : data;
        if (this.updateType === 'add') {
            _super.prototype.insert.call(this, ds, data, null, null, this.pvt.position);
        }
        if (this.updateType === 'update') {
            _super.prototype.update.call(this, ds, this.updateKey, data);
        }
        this.updateType = undefined;
        if (data.added) {
            for (i = 0; i < data.added.length; i++) {
                _super.prototype.insert.call(this, ds, data.added[i]);
            }
        }
        if (data.changed) {
            for (i = 0; i < data.changed.length; i++) {
                _super.prototype.update.call(this, ds, e.key, data.changed[i]);
            }
        }
        if (data.deleted) {
            for (i = 0; i < data.deleted.length; i++) {
                _super.prototype.remove.call(this, ds, e.key, data.deleted[i]);
            }
        }
        return data;
    };
    /**
     * Prepare the request body based on the newly added, removed and updated records.
     * Also perform the changes in the locally cached data to sync with the remote data.
     * The result is used by the batch request.
     * @param  {DataManager} dm
     * @param  {CrudOptions} changes
     * @param  {RemoteArgs} e
     */
    RemoteSaveAdaptor.prototype.batchRequest = function (dm, changes, e, query, original) {
        return {
            type: 'POST',
            url: dm.dataSource.batchUrl || dm.dataSource.crudUrl || dm.dataSource.url,
            contentType: 'application/json; charset=utf-8',
            dataType: 'json',
            data: JSON.stringify(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
                changed: changes.changedRecords,
                added: changes.addedRecords,
                deleted: changes.deletedRecords,
                action: 'batch',
                table: e.url,
                key: e.key
            }, _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getAddParams(this, dm, query)))
        };
    };
    RemoteSaveAdaptor.prototype.addParams = function (options) {
        var urlParams = new UrlAdaptor();
        urlParams.addParams(options);
    };
    return RemoteSaveAdaptor;
}(JsonAdaptor));

/**
 * Ajax Adaptor that is extended from URL Adaptor, is used for handle data operations with user defined functions.
 * @hidden
 */
var AjaxAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(AjaxAdaptor, _super);
    function AjaxAdaptor(props) {
        var _this = _super.call(this) || this;
        // options replaced the default adaptor options
        _this.options = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, _this.options, {
            getData: new Function(),
            addRecord: new Function(),
            updateRecord: new Function(),
            deleteRecord: new Function(),
            batchUpdate: new Function()
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.options, props || {});
        return _this;
    }
    AjaxAdaptor.prototype.getModuleName = function () {
        return 'AjaxAdaptor';
    };
    return AjaxAdaptor;
}(UrlAdaptor));

/**
 * Cache Adaptor is used to cache the data of the visited pages. It prevents new requests for the previously visited pages.
 * You can configure cache page size and duration of caching by using cachingPageSize and timeTillExpiration properties of the DataManager
 * @hidden
 */
var CacheAdaptor = /** @__PURE__ @class */ (function (_super) {
    __extends(CacheAdaptor, _super);
    /**
     * Constructor for CacheAdaptor class.
     * @param  {CacheAdaptor} adaptor?
     * @param  {number} timeStamp?
     * @param  {number} pageSize?
     * @hidden
     */
    function CacheAdaptor(adaptor, timeStamp, pageSize) {
        var _this = _super.call(this) || this;
        _this.isCrudAction = false;
        _this.isInsertAction = false;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(adaptor)) {
            _this.cacheAdaptor = adaptor;
        }
        _this.pageSize = pageSize;
        _this.guidId = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getGuid('cacheAdaptor');
        var obj = { keys: [], results: [] };
        window.localStorage.setItem(_this.guidId, JSON.stringify(obj));
        var guid = _this.guidId;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timeStamp)) {
            setInterval(function () {
                var data;
                data = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(window.localStorage.getItem(guid));
                var forDel = [];
                for (var i = 0; i < data.results.length; i++) {
                    var currentTime = +new Date();
                    var requestTime = +new Date(data.results[i].timeStamp);
                    data.results[i].timeStamp = currentTime - requestTime;
                    if (currentTime - requestTime > timeStamp) {
                        forDel.push(i);
                    }
                }
                for (var i = 0; i < forDel.length; i++) {
                    data.results.splice(forDel[i], 1);
                    data.keys.splice(forDel[i], 1);
                }
                window.localStorage.removeItem(guid);
                window.localStorage.setItem(guid, JSON.stringify(data));
            }, timeStamp);
        }
        return _this;
    }
    /**
     * It will generate the key based on the URL when we send a request to server.
     * @param  {string} url
     * @param  {Query} query?
     * @hidden
     */
    CacheAdaptor.prototype.generateKey = function (url, query) {
        var queries = this.getQueryRequest(query);
        var singles = _query__WEBPACK_IMPORTED_MODULE_2__["Query"].filterQueryLists(query.queries, ['onSelect', 'onPage', 'onSkip', 'onTake', 'onRange']);
        var key = url;
        var page = 'onPage';
        if (page in singles) {
            key += singles[page].pageIndex;
        }
        queries.sorts.forEach(function (obj) {
            key += obj.e.direction + obj.e.fieldName;
        });
        queries.groups.forEach(function (obj) {
            key += obj.e.fieldName;
        });
        queries.searches.forEach(function (obj) {
            key += obj.e.searchKey;
        });
        for (var filter = 0; filter < queries.filters.length; filter++) {
            var currentFilter = queries.filters[filter];
            if (currentFilter.e.isComplex) {
                var newQuery = query.clone();
                newQuery.queries = [];
                for (var i = 0; i < currentFilter.e.predicates.length; i++) {
                    newQuery.queries.push({ fn: 'onWhere', e: currentFilter.e.predicates[i], filter: query.queries.filter });
                }
                key += currentFilter.e.condition + this.generateKey(url, newQuery);
            }
            else {
                key += currentFilter.e.field + currentFilter.e.operator + currentFilter.e.value;
            }
        }
        return key;
    };
    /**
     * Process the query to generate request body.
     * If the data is already cached, it will return the cached data.
     * @param  {DataManager} dm
     * @param  {Query} query?
     * @param  {Object[]} hierarchyFilters?
     */
    CacheAdaptor.prototype.processQuery = function (dm, query, hierarchyFilters) {
        var key = this.generateKey(dm.dataSource.url, query);
        var cachedItems;
        cachedItems = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(window.localStorage.getItem(this.guidId));
        var data = cachedItems ? cachedItems.results[cachedItems.keys.indexOf(key)] : null;
        if (data != null && !this.isCrudAction && !this.isInsertAction) {
            return data;
        }
        this.isCrudAction = null;
        this.isInsertAction = null;
        return this.cacheAdaptor.processQuery.apply(this.cacheAdaptor, [].slice.call(arguments, 0));
    };
    /**
     * Returns the data from the query processing.
     * It will also cache the data for later usage.
     * @param  {DataResult} data
     * @param  {DataManager} ds?
     * @param  {Query} query?
     * @param  {XMLHttpRequest} xhr?
     * @param  {Ajax} request?
     * @param  {CrudOptions} changes?
     */
    CacheAdaptor.prototype.processResponse = function (data, ds, query, xhr, request, changes) {
        if (this.isInsertAction || (request && this.cacheAdaptor.options.batch &&
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].endsWith(request.url, this.cacheAdaptor.options.batch) && request.type.toLowerCase() === 'post')) {
            return this.cacheAdaptor.processResponse(data, ds, query, xhr, request, changes);
        }
        data = this.cacheAdaptor.processResponse.apply(this.cacheAdaptor, [].slice.call(arguments, 0));
        var key = query ? this.generateKey(ds.dataSource.url, query) : ds.dataSource.url;
        var obj = {};
        obj = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(window.localStorage.getItem(this.guidId));
        var index = obj.keys.indexOf(key);
        if (index !== -1) {
            obj.results.splice(index, 1);
            obj.keys.splice(index, 1);
        }
        obj.results[obj.keys.push(key) - 1] = { keys: key, result: data.result, timeStamp: new Date(), count: data.count };
        while (obj.results.length > this.pageSize) {
            obj.results.splice(0, 1);
            obj.keys.splice(0, 1);
        }
        window.localStorage.setItem(this.guidId, JSON.stringify(obj));
        return data;
    };
    /**
     * Method will trigger before send the request to server side. Used to set the custom header or modify the request options.
     * @param  {DataManager} dm
     * @param  {XMLHttpRequest} request
     * @param  {Ajax} settings?
     */
    CacheAdaptor.prototype.beforeSend = function (dm, request, settings) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cacheAdaptor.options.batch) && _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].endsWith(settings.url, this.cacheAdaptor.options.batch)
            && settings.type.toLowerCase() === 'post') {
            request.setRequestHeader('Accept', this.cacheAdaptor.options.multipartAccept);
        }
        if (!dm.dataSource.crossDomain) {
            request.setRequestHeader('Accept', this.cacheAdaptor.options.accept);
        }
    };
    /**
     * Updates existing record and saves the changes to the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName
     */
    CacheAdaptor.prototype.update = function (dm, keyField, value, tableName) {
        this.isCrudAction = true;
        return this.cacheAdaptor.update(dm, keyField, value, tableName);
    };
    /**
     * Prepare and returns request body which is used to insert a new record in the table.
     * @param  {DataManager} dm
     * @param  {Object} data
     * @param  {string} tableName?
     */
    CacheAdaptor.prototype.insert = function (dm, data, tableName) {
        this.isInsertAction = true;
        return this.cacheAdaptor.insert(dm, data, tableName);
    };
    /**
     * Prepare and return request body which is used to remove record from the table.
     * @param  {DataManager} dm
     * @param  {string} keyField
     * @param  {Object} value
     * @param  {string} tableName?
     */
    CacheAdaptor.prototype.remove = function (dm, keyField, value, tableName) {
        this.isCrudAction = true;
        return this.cacheAdaptor.remove(dm, keyField, value, tableName);
    };
    /**
     * Prepare the request body based on the newly added, removed and updated records.
     * The result is used by the batch request.
     * @param  {DataManager} dm
     * @param  {CrudOptions} changes
     * @param  {RemoteArgs} e
     */
    CacheAdaptor.prototype.batchRequest = function (dm, changes, e) {
        return this.cacheAdaptor.batchRequest(dm, changes, e);
    };
    return CacheAdaptor;
}(UrlAdaptor));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-data/index.js":
/*!*********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-data/index.js ***!
  \*********************************************************/
/*! exports provided: DataManager, Deferred, Query, Predicate, Adaptor, JsonAdaptor, UrlAdaptor, ODataAdaptor, ODataV4Adaptor, WebApiAdaptor, WebMethodAdaptor, RemoteSaveAdaptor, AjaxAdaptor, CacheAdaptor, DataUtil */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _manager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./manager */ "./ej2-resources/18.4.46/scripts/ej2-data/manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataManager", function() { return _manager__WEBPACK_IMPORTED_MODULE_0__["DataManager"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Deferred", function() { return _manager__WEBPACK_IMPORTED_MODULE_0__["Deferred"]; });

/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./query */ "./ej2-resources/18.4.46/scripts/ej2-data/query.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return _query__WEBPACK_IMPORTED_MODULE_1__["Query"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Predicate", function() { return _query__WEBPACK_IMPORTED_MODULE_1__["Predicate"]; });

/* harmony import */ var _adaptors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adaptors */ "./ej2-resources/18.4.46/scripts/ej2-data/adaptors.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Adaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["Adaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JsonAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["JsonAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UrlAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["UrlAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ODataAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["ODataAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ODataV4Adaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["ODataV4Adaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WebApiAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["WebApiAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WebMethodAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["WebMethodAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RemoteSaveAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["RemoteSaveAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AjaxAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["AjaxAdaptor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CacheAdaptor", function() { return _adaptors__WEBPACK_IMPORTED_MODULE_2__["CacheAdaptor"]; });

/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-data/util.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DataUtil", function() { return _util__WEBPACK_IMPORTED_MODULE_3__["DataUtil"]; });

/**
 * Data modules
 */






/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-data/manager.js":
/*!***********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-data/manager.js ***!
  \***********************************************************/
/*! exports provided: DataManager, Deferred */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataManager", function() { return DataManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Deferred", function() { return Deferred; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-data/util.js");
/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query */ "./ej2-resources/18.4.46/scripts/ej2-data/query.js");
/* harmony import */ var _adaptors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adaptors */ "./ej2-resources/18.4.46/scripts/ej2-data/adaptors.js");





/**
 * DataManager is used to manage and manipulate relational data.
 */
var DataManager = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for DataManager class
     * @param  {DataOptions|JSON[]} dataSource?
     * @param  {Query} query?
     * @param  {AdaptorOptions|string} adaptor?
     * @hidden
     */
    function DataManager(dataSource, query, adaptor) {
        var _this = this;
        /** @hidden */
        this.dateParse = true;
        /** @hidden */
        this.timeZoneHandling = true;
        this.requests = [];
        if (!dataSource && !this.dataSource) {
            dataSource = [];
        }
        adaptor = adaptor || dataSource.adaptor;
        if (dataSource && dataSource.timeZoneHandling === false) {
            this.timeZoneHandling = dataSource.timeZoneHandling;
        }
        var data;
        if (dataSource instanceof Array) {
            data = {
                json: dataSource,
                offline: true
            };
        }
        else if (typeof dataSource === 'object') {
            if (!dataSource.json) {
                dataSource.json = [];
            }
            data = {
                url: dataSource.url,
                insertUrl: dataSource.insertUrl,
                removeUrl: dataSource.removeUrl,
                updateUrl: dataSource.updateUrl,
                crudUrl: dataSource.crudUrl,
                batchUrl: dataSource.batchUrl,
                json: dataSource.json,
                headers: dataSource.headers,
                accept: dataSource.accept,
                data: dataSource.data,
                timeTillExpiration: dataSource.timeTillExpiration,
                cachingPageSize: dataSource.cachingPageSize,
                enableCaching: dataSource.enableCaching,
                requestType: dataSource.requestType,
                key: dataSource.key,
                crossDomain: dataSource.crossDomain,
                jsonp: dataSource.jsonp,
                dataType: dataSource.dataType,
                offline: dataSource.offline !== undefined ? dataSource.offline
                    : dataSource.adaptor instanceof _adaptors__WEBPACK_IMPORTED_MODULE_3__["RemoteSaveAdaptor"] || dataSource.adaptor instanceof _adaptors__WEBPACK_IMPORTED_MODULE_3__["AjaxAdaptor"] ?
                        false : dataSource.url ? false : true,
                requiresFormat: dataSource.requiresFormat
            };
        }
        else {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].throwError('DataManager: Invalid arguments');
        }
        if (data.requiresFormat === undefined && !_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].isCors()) {
            data.requiresFormat = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.crossDomain) ? true : data.crossDomain;
        }
        if (data.dataType === undefined) {
            data.dataType = 'json';
        }
        this.dataSource = data;
        this.defaultQuery = query;
        if (data.url && data.offline && !data.json.length) {
            this.isDataAvailable = false;
            this.adaptor = adaptor || new _adaptors__WEBPACK_IMPORTED_MODULE_3__["ODataAdaptor"]();
            this.dataSource.offline = false;
            this.ready = this.executeQuery(query || new _query__WEBPACK_IMPORTED_MODULE_2__["Query"]());
            this.ready.then(function (e) {
                _this.dataSource.offline = true;
                _this.isDataAvailable = true;
                data.json = e.result;
                _this.adaptor = new _adaptors__WEBPACK_IMPORTED_MODULE_3__["JsonAdaptor"]();
            });
        }
        else {
            this.adaptor = data.offline ? new _adaptors__WEBPACK_IMPORTED_MODULE_3__["JsonAdaptor"]() : new _adaptors__WEBPACK_IMPORTED_MODULE_3__["ODataAdaptor"]();
        }
        if (!data.jsonp && this.adaptor instanceof _adaptors__WEBPACK_IMPORTED_MODULE_3__["ODataAdaptor"]) {
            data.jsonp = 'callback';
        }
        this.adaptor = adaptor || this.adaptor;
        if (data.enableCaching) {
            this.adaptor = new _adaptors__WEBPACK_IMPORTED_MODULE_3__["CacheAdaptor"](this.adaptor, data.timeTillExpiration, data.cachingPageSize);
        }
        return this;
    }
    /**
     * Overrides DataManager's default query with given query.
     * @param  {Query} query - Defines the new default query.
     */
    DataManager.prototype.setDefaultQuery = function (query) {
        this.defaultQuery = query;
        return this;
    };
    /**
     * Executes the given query with local data source.
     * @param  {Query} query - Defines the query to retrieve data.
     */
    DataManager.prototype.executeLocal = function (query) {
        if (!this.defaultQuery && !(query instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"])) {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].throwError('DataManager - executeLocal() : A query is required to execute');
        }
        if (!this.dataSource.json) {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].throwError('DataManager - executeLocal() : Json data is required to execute');
        }
        query = query || this.defaultQuery;
        var result = this.adaptor.processQuery(this, query);
        if (query.subQuery) {
            var from = query.subQuery.fromTable;
            var lookup = query.subQuery.lookups;
            var res = query.isCountRequired ? result.result :
                result;
            if (lookup && lookup instanceof Array) {
                _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].buildHierarchy(query.subQuery.fKey, from, res, lookup, query.subQuery.key);
            }
            for (var j = 0; j < res.length; j++) {
                if (res[j][from] instanceof Array) {
                    res[j] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {}, res[j]);
                    res[j][from] = this.adaptor.processResponse(query.subQuery.using(new DataManager(res[j][from].slice(0))).executeLocal(), this, query);
                }
            }
        }
        return this.adaptor.processResponse(result, this, query);
    };
    /**
     * Executes the given query with either local or remote data source.
     * It will be executed as asynchronously and returns Promise object which will be resolved or rejected after action completed.
     * @param  {Query|Function} query - Defines the query to retrieve data.
     * @param  {Function} done - Defines the callback function and triggers when the Promise is resolved.
     * @param  {Function} fail - Defines the callback function and triggers when the Promise is rejected.
     * @param  {Function} always - Defines the callback function and triggers when the Promise is resolved or rejected.
     */
    DataManager.prototype.executeQuery = function (query, done, fail, always) {
        var _this = this;
        var makeRequest = 'makeRequest';
        if (typeof query === 'function') {
            always = fail;
            fail = done;
            done = query;
            query = null;
        }
        if (!query) {
            query = this.defaultQuery;
        }
        if (!(query instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"])) {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].throwError('DataManager - executeQuery() : A query is required to execute');
        }
        var deffered = new Deferred();
        var args = { query: query };
        if (!this.dataSource.offline && (this.dataSource.url !== undefined && this.dataSource.url !== '')
            || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[makeRequest])) || this.isAjaxAdaptor(this.adaptor)) {
            var result = this.adaptor.processQuery(this, query);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[makeRequest])) {
                this.adaptor[makeRequest](result, deffered, args, query);
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(result.url) || this.isAjaxAdaptor(this.adaptor)) {
                this.makeRequest(result, deffered, args, query);
            }
            else {
                args = DataManager.getDeferedArgs(query, result, args);
                deffered.resolve(args);
            }
        }
        else {
            DataManager.nextTick(function () {
                var res = _this.executeLocal(query);
                args = DataManager.getDeferedArgs(query, res, args);
                deffered.resolve(args);
            });
        }
        if (done || fail) {
            deffered.promise.then(done, fail);
        }
        if (always) {
            deffered.promise.then(always, always);
        }
        return deffered.promise;
    };
    DataManager.getDeferedArgs = function (query, result, args) {
        if (query.isCountRequired) {
            args.result = result.result;
            args.count = result.count;
            args.aggregates = result.aggregates;
        }
        else {
            args.result = result;
        }
        return args;
    };
    DataManager.nextTick = function (fn) {
        (window.setImmediate || window.setTimeout)(fn, 0);
    };
    DataManager.prototype.extendRequest = function (url, fnSuccess, fnFail) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
            type: 'GET',
            dataType: this.dataSource.dataType,
            crossDomain: this.dataSource.crossDomain,
            jsonp: this.dataSource.jsonp,
            cache: true,
            processData: false,
            onSuccess: fnSuccess,
            onFailure: fnFail
        }, url);
    };
    // tslint:disable-next-line:max-func-body-length
    DataManager.prototype.makeRequest = function (url, deffered, args, query) {
        var _this = this;
        var isSelector = !!query.subQuerySelector;
        var fnFail = function (e) {
            args.error = e;
            deffered.reject(args);
        };
        var process = function (data, count, xhr, request, actual, aggregates, virtualSelectRecords) {
            args.xhr = xhr;
            args.count = count ? parseInt(count.toString(), 10) : 0;
            args.result = data;
            args.request = request;
            args.aggregates = aggregates;
            args.actual = actual;
            args.virtualSelectRecords = virtualSelectRecords;
            deffered.resolve(args);
        };
        var fnQueryChild = function (data, selector) {
            var subDeffer = new Deferred();
            var childArgs = { parent: args };
            query.subQuery.isChild = true;
            var subUrl = _this.adaptor.processQuery(_this, query.subQuery, data ? _this.adaptor.processResponse(data) : selector);
            var childReq = _this.makeRequest(subUrl, subDeffer, childArgs, query.subQuery);
            if (!isSelector) {
                subDeffer.then(function (subData) {
                    if (data) {
                        _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].buildHierarchy(query.subQuery.fKey, query.subQuery.fromTable, data, subData, query.subQuery.key);
                        process(data, subData.count, subData.xhr);
                    }
                }, fnFail);
            }
            return childReq;
        };
        var fnSuccess = function (data, request) {
            if (_this.isAjaxAdaptor(_this.adaptor)) {
                request = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, _this.ajaxReqOption, request);
            }
            if (request.httpRequest.getResponseHeader('Content-Type').indexOf('xml') === -1 && _this.dateParse) {
                data = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(data);
            }
            var result = _this.adaptor.processResponse(data, _this, query, request.httpRequest, request);
            var count = 0;
            var aggregates = null;
            var virtualSelectRecords = 'virtualSelectRecords';
            var virtualRecords = data[virtualSelectRecords];
            if (query.isCountRequired) {
                count = result.count;
                aggregates = result.aggregates;
                result = result.result;
            }
            if (!query.subQuery) {
                process(result, count, request.httpRequest, request.type, data, aggregates, virtualRecords);
                return;
            }
            if (!isSelector) {
                fnQueryChild(result, request);
            }
        };
        var req = this.extendRequest(url, fnSuccess, fnFail);
        if (!this.isAjaxAdaptor(this.adaptor)) {
            var ajax_1 = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](req);
            ajax_1.beforeSend = function () {
                _this.beforeSend(ajax_1.httpRequest, ajax_1);
            };
            req = ajax_1.send();
            req.catch(function (e) { return true; }); // to handle failure remote requests.        
            this.requests.push(ajax_1);
        }
        else {
            this.ajaxReqOption = req;
            var request = req;
            this.adaptor.options.getData({
                data: request.data,
                onSuccess: request.onSuccess, onFailure: request.onFailure
            });
        }
        if (isSelector) {
            var promise = void 0;
            var res = query.subQuerySelector.call(this, { query: query.subQuery, parent: query });
            if (res && res.length) {
                promise = Promise.all([req, fnQueryChild(null, res)]);
                promise.then(function () {
                    var args = [];
                    for (var _i = 0; _i < arguments.length; _i++) {
                        args[_i] = arguments[_i];
                    }
                    var result = args[0];
                    var pResult = _this.adaptor.processResponse(result[0], _this, query, _this.requests[0].httpRequest, _this.requests[0]);
                    var count = 0;
                    if (query.isCountRequired) {
                        count = pResult.count;
                        pResult = pResult.result;
                    }
                    var cResult = _this.adaptor.processResponse(result[1], _this, query.subQuery, _this.requests[1].httpRequest, _this.requests[1]);
                    count = 0;
                    if (query.subQuery.isCountRequired) {
                        count = cResult.count;
                        cResult = cResult.result;
                    }
                    _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].buildHierarchy(query.subQuery.fKey, query.subQuery.fromTable, pResult, cResult, query.subQuery.key);
                    isSelector = false;
                    process(pResult, count, _this.requests[0].httpRequest);
                });
            }
            else {
                isSelector = false;
            }
        }
        return req;
    };
    DataManager.prototype.beforeSend = function (request, settings) {
        this.adaptor.beforeSend(this, request, settings);
        var headers = this.dataSource.headers;
        var props;
        for (var i = 0; headers && i < headers.length; i++) {
            props = [];
            var keys = Object.keys(headers[i]);
            for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
                var prop = keys_1[_i];
                props.push(prop);
                request.setRequestHeader(prop, headers[i][prop]);
            }
        }
    };
    /**
     * Save bulk changes to the given table name.
     * User can add a new record, edit an existing record, and delete a record at the same time.
     * If the datasource from remote, then updated in a single post.
     * @param  {Object} changes - Defines the CrudOptions.
     * @param  {string} key - Defines the column field.
     * @param  {string|Query} tableName - Defines the table name.
     * @param  {Query} query - Sets default query for the DataManager.
     */
    DataManager.prototype.saveChanges = function (changes, key, tableName, query, original) {
        var _this = this;
        if (tableName instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"]) {
            query = tableName;
            tableName = null;
        }
        var args = {
            url: tableName,
            key: key || this.dataSource.key
        };
        var req = this.adaptor.batchRequest(this, changes, args, query || new _query__WEBPACK_IMPORTED_MODULE_2__["Query"](), original);
        var doAjaxRequest = 'doAjaxRequest';
        if (this.dataSource.offline) {
            return req;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[doAjaxRequest])) {
            return this.adaptor[doAjaxRequest](req);
        }
        else if (!this.isAjaxAdaptor(this.adaptor)) {
            var deff_1 = new Deferred();
            var ajax_2 = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](req);
            ajax_2.beforeSend = function () {
                _this.beforeSend(ajax_2.httpRequest, ajax_2);
            };
            ajax_2.onSuccess = function (data, request) {
                deff_1.resolve(_this.adaptor.processResponse(data, _this, null, request.httpRequest, request, changes, args));
            };
            ajax_2.onFailure = function (e) {
                deff_1.reject([{ error: e }]);
            };
            ajax_2.send().catch(function (e) { return true; }); // to handle the failure requests.        
            return deff_1.promise;
        }
        else {
            return this.doAjaxRequest(req, this.adaptor.options.batchUpdate);
        }
    };
    /**
     * Inserts new record in the given table.
     * @param  {Object} data - Defines the data to insert.
     * @param  {string|Query} tableName - Defines the table name.
     * @param  {Query} query - Sets default query for the DataManager.
     */
    DataManager.prototype.insert = function (data, tableName, query, position) {
        if (tableName instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"]) {
            query = tableName;
            tableName = null;
        }
        var req = this.adaptor.insert(this, data, tableName, query, position);
        var doAjaxRequest = 'doAjaxRequest';
        if (this.dataSource.offline) {
            return req;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[doAjaxRequest])) {
            return this.adaptor[doAjaxRequest](req);
        }
        else {
            return this.doAjaxRequest(req, this.adaptor.options.addRecord);
        }
    };
    /**
     * Removes data from the table with the given key.
     * @param  {string} keyField - Defines the column field.
     * @param  {Object} value - Defines the value to find the data in the specified column.
     * @param  {string|Query} tableName - Defines the table name
     * @param  {Query} query - Sets default query for the DataManager.
     */
    DataManager.prototype.remove = function (keyField, value, tableName, query) {
        if (typeof value === 'object') {
            value = _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].getObject(keyField, value);
        }
        if (tableName instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"]) {
            query = tableName;
            tableName = null;
        }
        var res = this.adaptor.remove(this, keyField, value, tableName, query);
        var doAjaxRequest = 'doAjaxRequest';
        if (this.dataSource.offline) {
            return res;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[doAjaxRequest])) {
            return this.adaptor[doAjaxRequest](res);
        }
        else {
            var remove = this.adaptor.options.deleteRecord;
            return this.doAjaxRequest(res, remove);
        }
    };
    /**
     * Updates existing record in the given table.
     * @param  {string} keyField - Defines the column field.
     * @param  {Object} value - Defines the value to find the data in the specified column.
     * @param  {string|Query} tableName - Defines the table name
     * @param  {Query} query - Sets default query for the DataManager.
     */
    DataManager.prototype.update = function (keyField, value, tableName, query, original) {
        if (tableName instanceof _query__WEBPACK_IMPORTED_MODULE_2__["Query"]) {
            query = tableName;
            tableName = null;
        }
        var res = this.adaptor.update(this, keyField, value, tableName, query, original);
        var doAjaxRequest = 'doAjaxRequest';
        if (this.dataSource.offline) {
            return res;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.adaptor[doAjaxRequest])) {
            return this.adaptor[doAjaxRequest](res);
        }
        else {
            var update = this.adaptor.options.updateRecord;
            return this.doAjaxRequest(res, update);
        }
    };
    DataManager.prototype.isAjaxAdaptor = function (dataSource) {
        return this.adaptor.getModuleName &&
            this.adaptor.getModuleName() === 'AjaxAdaptor';
    };
    DataManager.prototype.successFunc = function (record, request) {
        if (this.isAjaxAdaptor(this.adaptor)) {
            request = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.ajaxReqOption, request);
        }
        try {
            _util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(record);
        }
        catch (e) {
            record = [];
        }
        record = this.adaptor.processResponse(_util__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].parse.parseJson(record), this, null, request.httpRequest, request);
        this.ajaxDeffered.resolve(record);
    };
    ;
    DataManager.prototype.failureFunc = function (e) {
        this.ajaxDeffered.reject([{ error: e }]);
    };
    ;
    DataManager.prototype.doAjaxRequest = function (res, ajaxFunc) {
        var _this = this;
        res = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, {
            type: 'POST',
            contentType: 'application/json; charset=utf-8',
            processData: false
        }, res);
        this.ajaxDeffered = new Deferred();
        if (!this.isAjaxAdaptor(this.adaptor)) {
            var ajax_3 = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](res);
            ajax_3.beforeSend = function () {
                _this.beforeSend(ajax_3.httpRequest, ajax_3);
            };
            ajax_3.onSuccess = this.successFunc.bind(this);
            ajax_3.onFailure = this.failureFunc.bind(this);
            ajax_3.send().catch(function (e) { return true; }); // to handle the failure requests.
        }
        else {
            this.ajaxReqOption = res;
            ajaxFunc.call(this, {
                data: res.data, onSuccess: this.successFunc.bind(this),
                onFailure: this.failureFunc.bind(this)
            });
        }
        return this.ajaxDeffered.promise;
    };
    return DataManager;
}());

/**
 * Deferred is used to handle asynchronous operation.
 */
var Deferred = /** @__PURE__ @class */ (function () {
    function Deferred() {
        var _this = this;
        /**
         * Promise is an object that represents a value that may not be available yet, but will be resolved at some point in the future.
         */
        this.promise = new Promise(function (resolve, reject) {
            _this.resolve = resolve;
            _this.reject = reject;
        });
        /**
         * Defines the callback function triggers when the Deferred object is resolved.
         */
        this.then = this.promise.then.bind(this.promise);
        /**
         * Defines the callback function triggers when the Deferred object is rejected.
         */
        this.catch = this.promise.catch.bind(this.promise);
    }
    return Deferred;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-data/query.js":
/*!*********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-data/query.js ***!
  \*********************************************************/
/*! exports provided: Query, Predicate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Query", function() { return Query; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Predicate", function() { return Predicate; });
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./ej2-resources/18.4.46/scripts/ej2-data/util.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");


/**
 * Query class is used to build query which is used by the DataManager to communicate with datasource.
 */
var Query = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for Query class.
     * @param  {string|string[]} from?
     * @hidden
     */
    function Query(from) {
        /** @hidden */
        this.subQuery = null;
        /** @hidden */
        this.isChild = false;
        /** @hidden */
        this.distincts = [];
        this.queries = [];
        this.key = '';
        this.fKey = '';
        if (typeof from === 'string') {
            this.fromTable = from;
        }
        else if (from && from instanceof Array) {
            this.lookups = from;
        }
        this.expands = [];
        this.sortedColumns = [];
        this.groupedColumns = [];
        this.subQuery = null;
        this.isChild = false;
        this.params = [];
        this.lazyLoad = [];
        return this;
    }
    /**
     * Sets the primary key.
     * @param  {string} field - Defines the column field.
     */
    Query.prototype.setKey = function (field) {
        this.key = field;
        return this;
    };
    /**
     * Sets default DataManager to execute query.
     * @param  {DataManager} dataManager - Defines the DataManager.
     */
    Query.prototype.using = function (dataManager) {
        this.dataManager = dataManager;
        return this;
    };
    /**
     * Executes query with the given DataManager.
     * @param  {DataManager} dataManager - Defines the DataManager.
     * @param  {Function} done - Defines the success callback.
     * @param  {Function} fail - Defines the failure callback.
     * @param  {Function} always - Defines the callback which will be invoked on either success or failure.
     *
     * <pre>
     * let dataManager: DataManager = new DataManager([{ ID: '10' }, { ID: '2' }, { ID: '1' }, { ID: '20' }]);
     * let query: Query = new Query();
     * query.sortBy('ID', (x: string, y: string): number => { return parseInt(x, 10) - parseInt(y, 10) });
     * let promise: Promise< Object > = query.execute(dataManager);
     * promise.then((e: { result: Object }) => { });
     * </pre>
     */
    Query.prototype.execute = function (dataManager, done, fail, always) {
        dataManager = dataManager || this.dataManager;
        if (dataManager) {
            return dataManager.executeQuery(this, done, fail, always);
        }
        return _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument');
    };
    /**
     * Executes query with the local datasource.
     * @param  {DataManager} dataManager - Defines the DataManager.
     */
    Query.prototype.executeLocal = function (dataManager) {
        dataManager = dataManager || this.dataManager;
        if (dataManager) {
            return dataManager.executeLocal(this);
        }
        return _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument');
    };
    /**
     * Creates deep copy of the Query object.
     */
    Query.prototype.clone = function () {
        var cloned = new Query();
        cloned.queries = this.queries.slice(0);
        cloned.key = this.key;
        cloned.isChild = this.isChild;
        cloned.dataManager = this.dataManager;
        cloned.fromTable = this.fromTable;
        cloned.params = this.params.slice(0);
        cloned.expands = this.expands.slice(0);
        cloned.sortedColumns = this.sortedColumns.slice(0);
        cloned.groupedColumns = this.groupedColumns.slice(0);
        cloned.subQuerySelector = this.subQuerySelector;
        cloned.subQuery = this.subQuery;
        cloned.fKey = this.fKey;
        cloned.isCountRequired = this.isCountRequired;
        cloned.distincts = this.distincts.slice(0);
        cloned.lazyLoad = this.lazyLoad.slice(0);
        return cloned;
    };
    /**
     * Specifies the name of table to retrieve data in query execution.
     * @param  {string} tableName - Defines the table name.
     */
    Query.prototype.from = function (tableName) {
        this.fromTable = tableName;
        return this;
    };
    /**
     * Adds additional parameter which will be sent along with the request which will be generated while DataManager execute.
     * @param  {string} key - Defines the key of additional parameter.
     * @param  {Function|string} value - Defines the value for the key.
     */
    Query.prototype.addParams = function (key, value) {
        if (typeof value === 'function') {
            this.params.push({ key: key, fn: value });
        }
        else {
            this.params.push({ key: key, value: value });
        }
        return this;
    };
    /**
     * @hidden
     */
    Query.prototype.distinct = function (fields) {
        if (typeof fields === 'string') {
            this.distincts = [].slice.call([fields], 0);
        }
        else {
            this.distincts = fields.slice(0);
        }
        return this;
    };
    /**
     * Expands the related table.
     * @param  {string|Object[]} tables
     */
    Query.prototype.expand = function (tables) {
        if (typeof tables === 'string') {
            this.expands = [].slice.call([tables], 0);
        }
        else {
            this.expands = tables.slice(0);
        }
        return this;
    };
    /**
     * Filter data with given filter criteria.
     * @param  {string|Predicate} fieldName - Defines the column field or Predicate.
     * @param  {string} operator - Defines the operator how to filter data.
     * @param  {string|number|boolean} value - Defines the values to match with data.
     * @param  {boolean} ignoreCase - If ignore case set to false, then filter data with exact match or else
     * filter data with case insensitive.
     */
    Query.prototype.where = function (fieldName, operator, value, ignoreCase, ignoreAccent) {
        operator = operator ? (operator).toLowerCase() : null;
        var predicate = null;
        if (typeof fieldName === 'string') {
            predicate = new Predicate(fieldName, operator, value, ignoreCase, ignoreAccent);
        }
        else if (fieldName instanceof Predicate) {
            predicate = fieldName;
        }
        this.queries.push({
            fn: 'onWhere',
            e: predicate
        });
        return this;
    };
    /**
     * Search data with given search criteria.
     * @param  {string|number|boolean} searchKey - Defines the search key.
     * @param  {string|string[]} fieldNames - Defines the collection of column fields.
     * @param  {string} operator - Defines the operator how to search data.
     * @param  {boolean} ignoreCase - If ignore case set to false, then filter data with exact match or else
     * filter data with case insensitive.
     */
    Query.prototype.search = function (searchKey, fieldNames, operator, ignoreCase, ignoreAccent) {
        if (typeof fieldNames === 'string') {
            fieldNames = [fieldNames];
        }
        if (!operator || operator === 'none') {
            operator = 'contains';
        }
        var comparer = _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].fnOperators[operator];
        this.queries.push({
            fn: 'onSearch',
            e: {
                fieldNames: fieldNames,
                operator: operator,
                searchKey: searchKey,
                ignoreCase: ignoreCase,
                ignoreAccent: ignoreAccent,
                comparer: comparer
            }
        });
        return this;
    };
    /**
     * Sort the data with given sort criteria.
     * By default, sort direction is ascending.
     * @param  {string|string[]} fieldName - Defines the single or collection of column fields.
     * @param  {string|Function} comparer - Defines the sort direction or custom sort comparer function.
     */
    Query.prototype.sortBy = function (fieldName, comparer, isFromGroup) {
        return this.sortByForeignKey(fieldName, comparer, isFromGroup);
    };
    /**
     * Sort the data with given sort criteria.
     * By default, sort direction is ascending.
     * @param  {string|string[]} fieldName - Defines the single or collection of column fields.
     * @param  {string|Function} comparer - Defines the sort direction or custom sort comparer function.
     * @param  {string} direction - Defines the sort direction .
     */
    Query.prototype.sortByForeignKey = function (fieldName, comparer, isFromGroup, direction) {
        var order = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(direction) ? direction : 'ascending';
        var sorts;
        var temp;
        if (typeof fieldName === 'string' && _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].endsWith(fieldName.toLowerCase(), ' desc')) {
            fieldName = fieldName.replace(/ desc$/i, '');
            comparer = 'descending';
        }
        if (!comparer || typeof comparer === 'string') {
            order = comparer ? comparer.toLowerCase() : 'ascending';
            comparer = _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].fnSort(comparer);
        }
        if (isFromGroup) {
            sorts = Query.filterQueries(this.queries, 'onSortBy');
            for (var i = 0; i < sorts.length; i++) {
                temp = sorts[i].e.fieldName;
                if (typeof temp === 'string') {
                    if (temp === fieldName) {
                        return this;
                    }
                }
                else if (temp instanceof Array) {
                    for (var j = 0; j < temp.length; j++) {
                        if (temp[j] === fieldName || fieldName.toLowerCase() === temp[j] + ' desc') {
                            return this;
                        }
                    }
                }
            }
        }
        this.queries.push({
            fn: 'onSortBy',
            e: {
                fieldName: fieldName,
                comparer: comparer,
                direction: order
            }
        });
        return this;
    };
    /**
     * Sorts data in descending order.
     * @param  {string} fieldName - Defines the column field.
     */
    Query.prototype.sortByDesc = function (fieldName) {
        return this.sortBy(fieldName, 'descending');
    };
    /**
     * Groups data with the given field name.
     * @param  {string} fieldName - Defines the column field.
     */
    Query.prototype.group = function (fieldName, fn, format) {
        this.sortBy(fieldName, null, true);
        this.queries.push({
            fn: 'onGroup',
            e: {
                fieldName: fieldName,
                comparer: fn ? fn : null,
                format: format ? format : null
            }
        });
        return this;
    };
    /**
     * Gets data based on the given page index and size.
     * @param  {number} pageIndex - Defines the current page index.
     * @param  {number} pageSize - Defines the no of records per page.
     */
    Query.prototype.page = function (pageIndex, pageSize) {
        this.queries.push({
            fn: 'onPage',
            e: {
                pageIndex: pageIndex,
                pageSize: pageSize
            }
        });
        return this;
    };
    /**
     * Gets data based on the given start and end index.
     * @param  {number} start - Defines the start index of the datasource.
     * @param  {number} end - Defines the end index of the datasource.
     */
    Query.prototype.range = function (start, end) {
        this.queries.push({
            fn: 'onRange',
            e: {
                start: start,
                end: end
            }
        });
        return this;
    };
    /**
     * Gets data from the top of the data source based on given number of records count.
     * @param  {number} nos - Defines the no of records to retrieve from datasource.
     */
    Query.prototype.take = function (nos) {
        this.queries.push({
            fn: 'onTake',
            e: {
                nos: nos
            }
        });
        return this;
    };
    /**
     * Skips data with given number of records count from the top of the data source.
     * @param  {number} nos - Defines the no of records skip in the datasource.
     */
    Query.prototype.skip = function (nos) {
        this.queries.push({
            fn: 'onSkip',
            e: { nos: nos }
        });
        return this;
    };
    /**
     * Selects specified columns from the data source.
     * @param  {string|string[]} fieldNames - Defines the collection of column fields.
     */
    Query.prototype.select = function (fieldNames) {
        if (typeof fieldNames === 'string') {
            fieldNames = [].slice.call([fieldNames], 0);
        }
        this.queries.push({
            fn: 'onSelect',
            e: { fieldNames: fieldNames }
        });
        return this;
    };
    /**
     * Gets the records in hierarchical relationship from two tables. It requires the foreign key to relate two tables.
     * @param  {Query} query - Defines the query to relate two tables.
     * @param  {Function} selectorFn - Defines the custom function to select records.
     */
    Query.prototype.hierarchy = function (query, selectorFn) {
        this.subQuerySelector = selectorFn;
        this.subQuery = query;
        return this;
    };
    /**
     * Sets the foreign key which is used to get data from the related table.
     * @param  {string} key - Defines the foreign key.
     */
    Query.prototype.foreignKey = function (key) {
        this.fKey = key;
        return this;
    };
    /**
     * It is used to get total number of records in the DataManager execution result.
     */
    Query.prototype.requiresCount = function () {
        this.isCountRequired = true;
        return this;
    };
    //type - sum, avg, min, max
    /**
     * Aggregate the data with given type and field name.
     * @param  {string} type - Defines the aggregate type.
     * @param  {string} field - Defines the column field to aggregate.
     */
    Query.prototype.aggregate = function (type, field) {
        this.queries.push({
            fn: 'onAggregates',
            e: { field: field, type: type }
        });
        return this;
    };
    /**
     * Pass array of filterColumn query for performing filter operation.
     * @param  {QueryOptions[]} queries
     * @param  {string} name
     * @hidden
     */
    Query.filterQueries = function (queries, name) {
        return queries.filter(function (q) {
            return q.fn === name;
        });
    };
    /**
     * To get the list of queries which is already filtered in current data source.
     * @param  {Object[]} queries
     * @param  {string[]} singles
     * @hidden
     */
    Query.filterQueryLists = function (queries, singles) {
        var filtered = queries.filter(function (q) {
            return singles.indexOf(q.fn) !== -1;
        });
        var res = {};
        for (var i = 0; i < filtered.length; i++) {
            if (!res[filtered[i].fn]) {
                res[filtered[i].fn] = filtered[i].e;
            }
        }
        return res;
    };
    return Query;
}());

/**
 * Predicate class is used to generate complex filter criteria.
 * This will be used by DataManager to perform multiple filtering operation.
 */
var Predicate = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for Predicate class.
     * @param  {string|Predicate} field
     * @param  {string} operator
     * @param  {string|number|boolean|Predicate|Predicate[]} value
     * @param  {boolean=false} ignoreCase
     * @hidden
     */
    function Predicate(field, operator, value, ignoreCase, ignoreAccent) {
        if (ignoreCase === void 0) { ignoreCase = false; }
        /** @hidden */
        this.ignoreAccent = false;
        /** @hidden */
        this.isComplex = false;
        if (typeof field === 'string') {
            this.field = field;
            this.operator = operator.toLowerCase();
            this.value = value;
            this.ignoreCase = ignoreCase;
            this.ignoreAccent = ignoreAccent;
            this.isComplex = false;
            this.comparer = _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].fnOperators.processOperator(this.operator);
        }
        else if (field instanceof Predicate && value instanceof Predicate || value instanceof Array) {
            this.isComplex = true;
            this.condition = operator.toLowerCase();
            this.predicates = [field];
            if (value instanceof Array) {
                [].push.apply(this.predicates, value);
            }
            else {
                this.predicates.push(value);
            }
        }
        return this;
    }
    /**
     * Adds n-number of new predicates on existing predicate with “and” condition.
     * @param  {Object[]} args - Defines the collection of predicates.
     */
    Predicate.and = function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        return Predicate.combinePredicates([].slice.call(args, 0), 'and');
    };
    /**
     * Adds new predicate on existing predicate with “and” condition.
     * @param  {string} field - Defines the column field.
     * @param  {string} operator - Defines the operator how to filter data.
     * @param  {string} value - Defines the values to match with data.
     * @param  {boolean} ignoreCase? - If ignore case set to false, then filter data with exact match or else
     * filter data with case insensitive.
     */
    Predicate.prototype.and = function (field, operator, value, ignoreCase, ignoreAccent) {
        return Predicate.combine(this, field, operator, value, 'and', ignoreCase, ignoreAccent);
    };
    /**
     * Adds n-number of new predicates on existing predicate with “or” condition.
     * @param  {Object[]} args - Defines the collection of predicates.
     */
    Predicate.or = function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        return Predicate.combinePredicates([].slice.call(args, 0), 'or');
    };
    /**
     * Adds new predicate on existing predicate with “or” condition.
     * @param  {string} field - Defines the column field.
     * @param  {string} operator - Defines the operator how to filter data.
     * @param  {string} value - Defines the values to match with data.
     * @param  {boolean} ignoreCase? - If ignore case set to false, then filter data with exact match or else
     * filter data with case insensitive.
     */
    Predicate.prototype.or = function (field, operator, value, ignoreCase, ignoreAccent) {
        return Predicate.combine(this, field, operator, value, 'or', ignoreCase, ignoreAccent);
    };
    /**
     * Converts plain JavaScript object to Predicate object.
     * @param  {Predicate[]|Predicate} json - Defines single or collection of Predicate.
     */
    Predicate.fromJson = function (json) {
        if (json instanceof Array) {
            var res = [];
            for (var i = 0, len = json.length; i < len; i++) {
                res.push(this.fromJSONData(json[i]));
            }
            return res;
        }
        var pred = json;
        return this.fromJSONData(pred);
    };
    /**
     * Validate the record based on the predicates.
     * @param  {Object} record - Defines the datasource record.
     */
    Predicate.prototype.validate = function (record) {
        var predicate = this.predicates ? this.predicates : [];
        var isAnd;
        var ret;
        if (!this.isComplex && this.comparer) {
            return this.comparer.call(this, _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].getObject(this.field, record), this.value, this.ignoreCase, this.ignoreAccent);
        }
        isAnd = this.condition === 'and';
        for (var i = 0; i < predicate.length; i++) {
            ret = predicate[i].validate(record);
            if (isAnd) {
                if (!ret) {
                    return false;
                }
            }
            else {
                if (ret) {
                    return true;
                }
            }
        }
        return isAnd;
    };
    /**
     * Converts predicates to plain JavaScript.
     * This method is uses Json stringify when serializing Predicate object.
     */
    Predicate.prototype.toJson = function () {
        var predicates;
        var p;
        if (this.isComplex) {
            predicates = [];
            p = this.predicates;
            for (var i = 0; i < p.length; i++) {
                predicates.push(p[i].toJson());
            }
        }
        return {
            isComplex: this.isComplex,
            field: this.field,
            operator: this.operator,
            value: this.value,
            ignoreCase: this.ignoreCase,
            ignoreAccent: this.ignoreAccent,
            condition: this.condition,
            predicates: predicates
        };
    };
    Predicate.combinePredicates = function (predicates, operator) {
        if (predicates.length === 1) {
            if (!(predicates[0] instanceof Array)) {
                return predicates[0];
            }
            predicates = predicates[0];
        }
        return new Predicate(predicates[0], operator, predicates.slice(1));
    };
    Predicate.combine = function (pred, field, operator, value, condition, ignoreCase, ignoreAccent) {
        if (field instanceof Predicate) {
            return Predicate[condition](pred, field);
        }
        if (typeof field === 'string') {
            return Predicate[condition](pred, new Predicate(field, operator, value, ignoreCase, ignoreAccent));
        }
        return _util__WEBPACK_IMPORTED_MODULE_0__["DataUtil"].throwError('Predicate - ' + condition + ' : invalid arguments');
    };
    Predicate.fromJSONData = function (json) {
        var preds = json.predicates || [];
        var len = preds.length;
        var predicates = [];
        var result;
        for (var i = 0; i < len; i++) {
            predicates.push(this.fromJSONData(preds[i]));
        }
        if (!json.isComplex) {
            result = new Predicate(json.field, json.operator, json.value, json.ignoreCase, json.ignoreAccent);
        }
        else {
            result = new Predicate(predicates[0], json.condition, predicates.slice(1));
        }
        return result;
    };
    return Predicate;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-data/util.js":
/*!********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-data/util.js ***!
  \********************************************************/
/*! exports provided: DataUtil */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataUtil", function() { return DataUtil; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./manager */ "./ej2-resources/18.4.46/scripts/ej2-data/manager.js");
/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query */ "./ej2-resources/18.4.46/scripts/ej2-data/query.js");



var consts = { GroupGuid: '{271bbba0-1ee7}' };
/**
 * Data manager common utility methods.
 * @hidden
 */
var DataUtil = /** @__PURE__ @class */ (function () {
    function DataUtil() {
    }
    /**
     * Returns the value by invoking the provided parameter function.
     * If the paramater is not of type function then it will be returned as it is.
     * @param  {Function|string|string[]|number} value
     * @param  {Object} inst?
     * @hidden
     */
    DataUtil.getValue = function (value, inst) {
        if (typeof value === 'function') {
            return value.call(inst || {});
        }
        return value;
    };
    /**
     * Returns true if the input string ends with given string.
     * @param  {string} input
     * @param  {string} substr
     */
    DataUtil.endsWith = function (input, substr) {
        return input.slice && input.slice(-substr.length) === substr;
    };
    /**
     * Returns true if the input string starts with given string.
     * @param  {string} str
     * @param  {string} startstr
     */
    DataUtil.startsWith = function (input, start) {
        return input.slice(0, start.length) === start;
    };
    /**
     * To return the sorting function based on the string.
     * @param  {string} order
     * @hidden
     */
    DataUtil.fnSort = function (order) {
        order = order ? DataUtil.toLowerCase(order) : 'ascending';
        if (order === 'ascending') {
            return this.fnAscending;
        }
        return this.fnDescending;
    };
    /**
     * Comparer function which is used to sort the data in ascending order.
     * @param  {string|number} x
     * @param  {string|number} y
     * @returns number
     */
    DataUtil.fnAscending = function (x, y) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(x) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(y)) {
            return -1;
        }
        if (y === null || y === undefined) {
            return -1;
        }
        if (typeof x === 'string') {
            return x.localeCompare(y);
        }
        if (x === null || x === undefined) {
            return 1;
        }
        return x - y;
    };
    /**
     * Comparer function which is used to sort the data in descending order.
     * @param  {string|number} x
     * @param  {string|number} y
     * @returns number
     */
    DataUtil.fnDescending = function (x, y) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(x) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(y)) {
            return -1;
        }
        if (y === null || y === undefined) {
            return 1;
        }
        if (typeof x === 'string') {
            return x.localeCompare(y) * -1;
        }
        if (x === null || x === undefined) {
            return -1;
        }
        return y - x;
    };
    DataUtil.extractFields = function (obj, fields) {
        var newObj = {};
        for (var i = 0; i < fields.length; i++) {
            newObj = this.setValue(fields[i], this.getObject(fields[i], obj), newObj);
        }
        return newObj;
    };
    /**
     * Select objects by given fields from jsonArray.
     * @param  {Object[]} jsonArray
     * @param  {string[]} fields
     */
    DataUtil.select = function (jsonArray, fields) {
        var newData = [];
        for (var i = 0; i < jsonArray.length; i++) {
            newData.push(this.extractFields(jsonArray[i], fields));
        }
        return newData;
    };
    /**
     * Group the input data based on the field name.
     * It also performs aggregation of the grouped records based on the aggregates paramater.
     * @param  {Object[]} jsonArray
     * @param  {string} field?
     * @param  {Object[]} agg?
     * @param  {number} level?
     * @param  {Object[]} groupDs?
     */
    DataUtil.group = function (jsonArray, field, aggregates, level, groupDs, format, isLazyLoad) {
        level = level || 1;
        var jsonData = jsonArray;
        var guid = 'GroupGuid';
        if (jsonData.GroupGuid === consts[guid]) {
            var _loop_1 = function (j) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupDs)) {
                    var indx = -1;
                    var temp = groupDs.filter(function (e) { return e.key === jsonData[j].key; });
                    indx = groupDs.indexOf(temp[0]);
                    jsonData[j].items = this_1.group(jsonData[j].items, field, aggregates, jsonData.level + 1, groupDs[indx].items, format, isLazyLoad);
                    jsonData[j].count = groupDs[indx].count;
                }
                else {
                    jsonData[j].items = this_1.group(jsonData[j].items, field, aggregates, jsonData.level + 1, null, format, isLazyLoad);
                    jsonData[j].count = jsonData[j].items.length;
                }
            };
            var this_1 = this;
            for (var j = 0; j < jsonData.length; j++) {
                _loop_1(j);
            }
            jsonData.childLevels += 1;
            return jsonData;
        }
        var grouped = {};
        var groupedArray = [];
        groupedArray.GroupGuid = consts[guid];
        groupedArray.level = level;
        groupedArray.childLevels = 0;
        groupedArray.records = jsonData;
        var _loop_2 = function (i) {
            var val = this_2.getVal(jsonData, i, field);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(format)) {
                val = format(val, field);
            }
            if (!grouped[val]) {
                grouped[val] = {
                    key: val,
                    count: 0,
                    items: [],
                    aggregates: {},
                    field: field
                };
                groupedArray.push(grouped[val]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupDs)) {
                    var tempObj = groupDs.filter(function (e) { return e.key === grouped[val].key; });
                    grouped[val].count = tempObj[0].count;
                }
            }
            grouped[val].count = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupDs) ? grouped[val].count : grouped[val].count += 1;
            if (!isLazyLoad || (isLazyLoad && aggregates.length)) {
                grouped[val].items.push(jsonData[i]);
            }
        };
        var this_2 = this;
        for (var i = 0; i < jsonData.length; i++) {
            _loop_2(i);
        }
        if (aggregates && aggregates.length) {
            var _loop_3 = function (i) {
                var res = {};
                var fn = void 0;
                var aggs = aggregates;
                for (var j = 0; j < aggregates.length; j++) {
                    fn = DataUtil.aggregates[aggregates[j].type];
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupDs)) {
                        var temp = groupDs.filter(function (e) { return e.key === groupedArray[i].key; });
                        if (fn) {
                            res[aggs[j].field + ' - ' + aggs[j].type] = fn(temp[0].items, aggs[j].field);
                        }
                    }
                    else {
                        if (fn) {
                            res[aggs[j].field + ' - ' + aggs[j].type] = fn(groupedArray[i].items, aggs[j].field);
                        }
                    }
                }
                groupedArray[i].aggregates = res;
            };
            for (var i = 0; i < groupedArray.length; i++) {
                _loop_3(i);
            }
        }
        if (isLazyLoad && groupedArray.length && aggregates.length) {
            for (var i = 0; i < groupedArray.length; i++) {
                groupedArray[i].items = [];
            }
        }
        return jsonData.length && groupedArray || jsonData;
    };
    /**
     * It is used to categorize the multiple items based on a specific field in jsonArray.
     * The hierarchical queries are commonly required when you use foreign key binding.
     * @param  {string} fKey
     * @param  {string} from
     * @param  {Object[]} source
     * @param  {Group} lookup?
     * @param  {string} pKey?
     * @hidden
     */
    DataUtil.buildHierarchy = function (fKey, from, source, lookup, pKey) {
        var i;
        var grp = {};
        var temp;
        if (lookup.result) {
            lookup = lookup.result;
        }
        if (lookup.GroupGuid) {
            this.throwError('DataManager: Do not have support Grouping in hierarchy');
        }
        for (i = 0; i < lookup.length; i++) {
            var fKeyData = this.getObject(fKey, lookup[i]);
            temp = grp[fKeyData] || (grp[fKeyData] = []);
            temp.push(lookup[i]);
        }
        for (i = 0; i < source.length; i++) {
            var fKeyData = this.getObject(pKey || fKey, source[i]);
            source[i][from] = grp[fKeyData];
        }
    };
    /**
     * The method used to get the field names which started with specified characters.
     * @param  {Object} obj
     * @param  {string[]} fields?
     * @param  {string} prefix?
     * @hidden
     */
    DataUtil.getFieldList = function (obj, fields, prefix) {
        if (prefix === undefined) {
            prefix = '';
        }
        if (fields === undefined || fields === null) {
            return this.getFieldList(obj, [], prefix);
        }
        var copyObj = obj;
        var keys = Object.keys(obj);
        for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
            var prop = keys_1[_i];
            if (typeof copyObj[prop] === 'object' && !(copyObj[prop] instanceof Array)) {
                this.getFieldList(copyObj[prop], fields, prefix + prop + '.');
            }
            else {
                fields.push(prefix + prop);
            }
        }
        return fields;
    };
    /**
     * Gets the value of the property in the given object.
     * The complex object can be accessed by providing the field names concatenated with dot(.).
     * @param  {string} nameSpace - The name of the property to be accessed.
     * @param  {Object} from - Defines the source object.
     */
    DataUtil.getObject = function (nameSpace, from) {
        if (!nameSpace) {
            return from;
        }
        if (!from) {
            return undefined;
        }
        if (nameSpace.indexOf('.') === -1) {
            return from[nameSpace];
        }
        var value = from;
        var splits = nameSpace.split('.');
        for (var i = 0; i < splits.length; i++) {
            if (value == null) {
                break;
            }
            value = value[splits[i]];
        }
        return value;
    };
    /**
     * To set value for the nameSpace in desired object.
     * @param {string} nameSpace - String value to the get the inner object.
     * @param {Object} value - Value that you need to set.
     * @param {Object} obj - Object to get the inner object value.
     * @return { [key: string]: Object; } | Object
     * @hidden
     */
    DataUtil.setValue = function (nameSpace, value, obj) {
        var keys = nameSpace.toString().split('.');
        var start = obj || {};
        var fromObj = start;
        var i;
        var length = keys.length;
        var key;
        for (i = 0; i < length; i++) {
            key = keys[i];
            if (i + 1 === length) {
                fromObj[key] = value === undefined ? undefined : value;
            }
            else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fromObj[key])) {
                fromObj[key] = {};
            }
            fromObj = fromObj[key];
        }
        return start;
    };
    /**
     * Sort the given data based on the field and comparer.
     * @param  {Object[]} ds - Defines the input data.
     * @param  {string} field - Defines the field to be sorted.
     * @param  {Function} comparer - Defines the comparer function used to sort the records.
     */
    DataUtil.sort = function (ds, field, comparer) {
        if (ds.length <= 1) {
            return ds;
        }
        var middle = parseInt((ds.length / 2).toString(), 10);
        var left = ds.slice(0, middle);
        var right = ds.slice(middle);
        left = this.sort(left, field, comparer);
        right = this.sort(right, field, comparer);
        return this.merge(left, right, field, comparer);
    };
    DataUtil.ignoreDiacritics = function (value) {
        if (typeof value !== 'string') {
            return value;
        }
        var result = value.split('');
        var newValue = result.map(function (temp) { return temp in DataUtil.diacritics ? DataUtil.diacritics[temp] : temp; });
        return newValue.join('');
    };
    DataUtil.merge = function (left, right, fieldName, comparer) {
        var result = [];
        var current;
        while (left.length > 0 || right.length > 0) {
            if (left.length > 0 && right.length > 0) {
                if (comparer) {
                    current = comparer(this.getVal(left, 0, fieldName), this.getVal(right, 0, fieldName), left[0], right[0]) <= 0 ? left : right;
                }
                else {
                    current = left[0][fieldName] < left[0][fieldName] ? left : right;
                }
            }
            else {
                current = left.length > 0 ? left : right;
            }
            result.push(current.shift());
        }
        return result;
    };
    DataUtil.getVal = function (array, index, field) {
        return field ? this.getObject(field, array[index]) : array[index];
    };
    DataUtil.toLowerCase = function (val) {
        return val ? typeof val === 'string' ? val.toLowerCase() : val.toString() : (val === 0 || val === false) ? val.toString() : '';
    };
    /**
     * To perform the filter operation with specified adaptor and returns the result.
     * @param  {Object} adaptor
     * @param  {string} fnName
     * @param  {Object} param1?
     * @param  {Object} param2?
     * @hidden
     */
    DataUtil.callAdaptorFunction = function (adaptor, fnName, param1, param2) {
        if (fnName in adaptor) {
            var res = adaptor[fnName](param1, param2);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(res)) {
                param1 = res;
            }
        }
        return param1;
    };
    DataUtil.getAddParams = function (adp, dm, query) {
        var req = {};
        DataUtil.callAdaptorFunction(adp, 'addParams', {
            dm: dm,
            query: query,
            params: query.params,
            reqParams: req
        });
        return req;
    };
    /**
     * Checks wheather the given input is a plain object or not.
     * @param  {Object|Object[]} obj
     */
    DataUtil.isPlainObject = function (obj) {
        return (!!obj) && (obj.constructor === Object);
    };
    /**
     * Returns true when the browser cross origin request.
     */
    DataUtil.isCors = function () {
        var xhr = null;
        var request = 'XMLHttpRequest';
        try {
            xhr = new window[request]();
        }
        catch (e) {
            // No exception handling
        }
        return !!xhr && ('withCredentials' in xhr);
    };
    /**
     * Generate random GUID value which will be prefixed with the given value.
     * @param  {string} prefix
     */
    DataUtil.getGuid = function (prefix) {
        var hexs = '0123456789abcdef';
        var rand;
        return (prefix || '') + '00000000-0000-4000-0000-000000000000'.replace(/0/g, function (val, i) {
            if ('crypto' in window && 'getRandomValues' in crypto) {
                var arr = new Uint8Array(1);
                window.crypto.getRandomValues(arr);
                rand = arr[0] % 16 | 0;
            }
            else {
                rand = Math.random() * 16 | 0;
            }
            return hexs[i === 19 ? rand & 0x3 | 0x8 : rand];
        });
    };
    /**
     * Checks wheather the given value is null or not.
     * @param  {string|Object} val
     * @returns boolean
     */
    DataUtil.isNull = function (val) {
        return val === undefined || val === null;
    };
    /**
     * To get the required items from collection of objects.
     * @param  {Object[]} array
     * @param  {string} field
     * @param  {Function} comparer
     * @returns Object
     * @hidden
     */
    DataUtil.getItemFromComparer = function (array, field, comparer) {
        var keyVal;
        var current;
        var key;
        var i = 0;
        var castRequired = typeof DataUtil.getVal(array, 0, field) === 'string';
        if (array.length) {
            while (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(keyVal) && i < array.length) {
                keyVal = DataUtil.getVal(array, i, field);
                key = array[i++];
            }
        }
        for (; i < array.length; i++) {
            current = DataUtil.getVal(array, i, field);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(current)) {
                continue;
            }
            if (castRequired) {
                keyVal = +keyVal;
                current = +current;
            }
            if (comparer(keyVal, current) > 0) {
                keyVal = current;
                key = array[i];
            }
        }
        return key;
    };
    /**
     * To get distinct values of Array or Array of Objects.
     * @param  {Object[]} json
     * @param  {string} field
     * @param  {boolean} requiresCompleteRecord
     * @returns Object[]
     * * distinct array of objects is return when requiresCompleteRecord set as true.
     * @hidden
     */
    DataUtil.distinct = function (json, fieldName, requiresCompleteRecord) {
        requiresCompleteRecord = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(requiresCompleteRecord) ? false : requiresCompleteRecord;
        var result = [];
        var val;
        var tmp = {};
        json.forEach(function (data, index) {
            val = typeof (json[index]) === 'object' ? DataUtil.getVal(json, index, fieldName) : json[index];
            if (!(val in tmp)) {
                result.push(!requiresCompleteRecord ? val : json[index]);
                tmp[val] = 1;
            }
        });
        return result;
    };
    /**
     * Specifies the value which will be used to adjust the date value to server timezone.
     * @default null
     */
    DataUtil.serverTimezoneOffset = null;
    /**
     * Species whether are not to be parsed with serverTimezoneOffset value.
     * @hidden
     */
    DataUtil.timeZoneHandling = true;
    /**
     * Throw error with the given string as message.
     * @param  {string} er
     */
    DataUtil.throwError = function (error) {
        try {
            throw new Error(error);
        }
        catch (e) {
            throw e.message + '\n' + e.stack;
        }
    };
    DataUtil.aggregates = {
        /**
         * Calculate sum of the given field in the data.
         * @param  {Object[]} ds
         * @param  {string} field
         */
        sum: function (ds, field) {
            var result = 0;
            var val;
            var castRequired = typeof DataUtil.getVal(ds, 0, field) !== 'number';
            for (var i = 0; i < ds.length; i++) {
                val = DataUtil.getVal(ds, i, field);
                if (!isNaN(val) && val !== null) {
                    if (castRequired) {
                        val = +val;
                    }
                    result += val;
                }
            }
            return result;
        },
        /**
         * Calculate average value of the given field in the data.
         * @param  {Object[]} ds
         * @param  {string} field
         */
        average: function (ds, field) {
            return DataUtil.aggregates.sum(ds, field) / ds.length;
        },
        /**
         * Returns the min value of the data based on the field.
         * @param  {Object[]} ds
         * @param  {string|Function} field
         */
        min: function (ds, field) {
            var comparer;
            if (typeof field === 'function') {
                comparer = field;
                field = null;
            }
            return DataUtil.getObject(field, DataUtil.getItemFromComparer(ds, field, comparer || DataUtil.fnAscending));
        },
        /**
         * Returns the max value of the data based on the field.
         * @param  {Object[]} ds
         * @param  {string} field
         * @returns number
         */
        max: function (ds, field) {
            var comparer;
            if (typeof field === 'function') {
                comparer = field;
                field = null;
            }
            return DataUtil.getObject(field, DataUtil.getItemFromComparer(ds, field, comparer || DataUtil.fnDescending));
        },
        /**
         * Returns the total number of true value present in the data based on the given boolean field name.
         * @param  {Object[]} ds
         * @param  {string} field
         */
        truecount: function (ds, field) {
            return new _manager__WEBPACK_IMPORTED_MODULE_1__["DataManager"](ds).executeLocal(new _query__WEBPACK_IMPORTED_MODULE_2__["Query"]().where(field, 'equal', true, true)).length;
        },
        /**
         * Returns the total number of false value present in the data based on the given boolean field name.
         * @param  {Object[]} ds
         * @param  {string} field
         */
        falsecount: function (ds, field) {
            return new _manager__WEBPACK_IMPORTED_MODULE_1__["DataManager"](ds).executeLocal(new _query__WEBPACK_IMPORTED_MODULE_2__["Query"]().where(field, 'equal', false, true)).length;
        },
        /**
         * Returns the length of the given data.
         * @param  {Object[]} ds
         * @param  {string} field?
         * @returns number
         */
        count: function (ds, field) {
            return ds.length;
        }
    };
    /**
     * Specifies the Object with filter operators.
     */
    DataUtil.operatorSymbols = {
        '<': 'lessthan',
        '>': 'greaterthan',
        '<=': 'lessthanorequal',
        '>=': 'greaterthanorequal',
        '==': 'equal',
        '!=': 'notequal',
        '*=': 'contains',
        '$=': 'endswith',
        '^=': 'startswith'
    };
    /**
     * Specifies the Object with filter operators which will be used for OData filter query generation.
     * * It will be used for date/number type filter query.
     */
    DataUtil.odBiOperator = {
        '<': ' lt ',
        '>': ' gt ',
        '<=': ' le ',
        '>=': ' ge ',
        '==': ' eq ',
        '!=': ' ne ',
        'lessthan': ' lt ',
        'lessthanorequal': ' le ',
        'greaterthan': ' gt ',
        'greaterthanorequal': ' ge ',
        'equal': ' eq ',
        'notequal': ' ne '
    };
    /**
     * Specifies the Object with filter operators which will be used for OData filter query generation.
     * It will be used for string type filter query.
     */
    DataUtil.odUniOperator = {
        '$=': 'endswith',
        '^=': 'startswith',
        '*=': 'substringof',
        'endswith': 'endswith',
        'startswith': 'startswith',
        'contains': 'substringof'
    };
    /**
     * Specifies the Object with filter operators which will be used for ODataV4 filter query generation.
     * It will be used for string type filter query.
     */
    DataUtil.odv4UniOperator = {
        '$=': 'endswith',
        '^=': 'startswith',
        '*=': 'contains',
        'endswith': 'endswith',
        'startswith': 'startswith',
        'contains': 'contains'
    };
    DataUtil.diacritics = {
        '\u24B6': 'A',
        '\uFF21': 'A',
        '\u00C0': 'A',
        '\u00C1': 'A',
        '\u00C2': 'A',
        '\u1EA6': 'A',
        '\u1EA4': 'A',
        '\u1EAA': 'A',
        '\u1EA8': 'A',
        '\u00C3': 'A',
        '\u0100': 'A',
        '\u0102': 'A',
        '\u1EB0': 'A',
        '\u1EAE': 'A',
        '\u1EB4': 'A',
        '\u1EB2': 'A',
        '\u0226': 'A',
        '\u01E0': 'A',
        '\u00C4': 'A',
        '\u01DE': 'A',
        '\u1EA2': 'A',
        '\u00C5': 'A',
        '\u01FA': 'A',
        '\u01CD': 'A',
        '\u0200': 'A',
        '\u0202': 'A',
        '\u1EA0': 'A',
        '\u1EAC': 'A',
        '\u1EB6': 'A',
        '\u1E00': 'A',
        '\u0104': 'A',
        '\u023A': 'A',
        '\u2C6F': 'A',
        '\uA732': 'AA',
        '\u00C6': 'AE',
        '\u01FC': 'AE',
        '\u01E2': 'AE',
        '\uA734': 'AO',
        '\uA736': 'AU',
        '\uA738': 'AV',
        '\uA73A': 'AV',
        '\uA73C': 'AY',
        '\u24B7': 'B',
        '\uFF22': 'B',
        '\u1E02': 'B',
        '\u1E04': 'B',
        '\u1E06': 'B',
        '\u0243': 'B',
        '\u0182': 'B',
        '\u0181': 'B',
        '\u24B8': 'C',
        '\uFF23': 'C',
        '\u0106': 'C',
        '\u0108': 'C',
        '\u010A': 'C',
        '\u010C': 'C',
        '\u00C7': 'C',
        '\u1E08': 'C',
        '\u0187': 'C',
        '\u023B': 'C',
        '\uA73E': 'C',
        '\u24B9': 'D',
        '\uFF24': 'D',
        '\u1E0A': 'D',
        '\u010E': 'D',
        '\u1E0C': 'D',
        '\u1E10': 'D',
        '\u1E12': 'D',
        '\u1E0E': 'D',
        '\u0110': 'D',
        '\u018B': 'D',
        '\u018A': 'D',
        '\u0189': 'D',
        '\uA779': 'D',
        '\u01F1': 'DZ',
        '\u01C4': 'DZ',
        '\u01F2': 'Dz',
        '\u01C5': 'Dz',
        '\u24BA': 'E',
        '\uFF25': 'E',
        '\u00C8': 'E',
        '\u00C9': 'E',
        '\u00CA': 'E',
        '\u1EC0': 'E',
        '\u1EBE': 'E',
        '\u1EC4': 'E',
        '\u1EC2': 'E',
        '\u1EBC': 'E',
        '\u0112': 'E',
        '\u1E14': 'E',
        '\u1E16': 'E',
        '\u0114': 'E',
        '\u0116': 'E',
        '\u00CB': 'E',
        '\u1EBA': 'E',
        '\u011A': 'E',
        '\u0204': 'E',
        '\u0206': 'E',
        '\u1EB8': 'E',
        '\u1EC6': 'E',
        '\u0228': 'E',
        '\u1E1C': 'E',
        '\u0118': 'E',
        '\u1E18': 'E',
        '\u1E1A': 'E',
        '\u0190': 'E',
        '\u018E': 'E',
        '\u24BB': 'F',
        '\uFF26': 'F',
        '\u1E1E': 'F',
        '\u0191': 'F',
        '\uA77B': 'F',
        '\u24BC': 'G',
        '\uFF27': 'G',
        '\u01F4': 'G',
        '\u011C': 'G',
        '\u1E20': 'G',
        '\u011E': 'G',
        '\u0120': 'G',
        '\u01E6': 'G',
        '\u0122': 'G',
        '\u01E4': 'G',
        '\u0193': 'G',
        '\uA7A0': 'G',
        '\uA77D': 'G',
        '\uA77E': 'G',
        '\u24BD': 'H',
        '\uFF28': 'H',
        '\u0124': 'H',
        '\u1E22': 'H',
        '\u1E26': 'H',
        '\u021E': 'H',
        '\u1E24': 'H',
        '\u1E28': 'H',
        '\u1E2A': 'H',
        '\u0126': 'H',
        '\u2C67': 'H',
        '\u2C75': 'H',
        '\uA78D': 'H',
        '\u24BE': 'I',
        '\uFF29': 'I',
        '\u00CC': 'I',
        '\u00CD': 'I',
        '\u00CE': 'I',
        '\u0128': 'I',
        '\u012A': 'I',
        '\u012C': 'I',
        '\u0130': 'I',
        '\u00CF': 'I',
        '\u1E2E': 'I',
        '\u1EC8': 'I',
        '\u01CF': 'I',
        '\u0208': 'I',
        '\u020A': 'I',
        '\u1ECA': 'I',
        '\u012E': 'I',
        '\u1E2C': 'I',
        '\u0197': 'I',
        '\u24BF': 'J',
        '\uFF2A': 'J',
        '\u0134': 'J',
        '\u0248': 'J',
        '\u24C0': 'K',
        '\uFF2B': 'K',
        '\u1E30': 'K',
        '\u01E8': 'K',
        '\u1E32': 'K',
        '\u0136': 'K',
        '\u1E34': 'K',
        '\u0198': 'K',
        '\u2C69': 'K',
        '\uA740': 'K',
        '\uA742': 'K',
        '\uA744': 'K',
        '\uA7A2': 'K',
        '\u24C1': 'L',
        '\uFF2C': 'L',
        '\u013F': 'L',
        '\u0139': 'L',
        '\u013D': 'L',
        '\u1E36': 'L',
        '\u1E38': 'L',
        '\u013B': 'L',
        '\u1E3C': 'L',
        '\u1E3A': 'L',
        '\u0141': 'L',
        '\u023D': 'L',
        '\u2C62': 'L',
        '\u2C60': 'L',
        '\uA748': 'L',
        '\uA746': 'L',
        '\uA780': 'L',
        '\u01C7': 'LJ',
        '\u01C8': 'Lj',
        '\u24C2': 'M',
        '\uFF2D': 'M',
        '\u1E3E': 'M',
        '\u1E40': 'M',
        '\u1E42': 'M',
        '\u2C6E': 'M',
        '\u019C': 'M',
        '\u24C3': 'N',
        '\uFF2E': 'N',
        '\u01F8': 'N',
        '\u0143': 'N',
        '\u00D1': 'N',
        '\u1E44': 'N',
        '\u0147': 'N',
        '\u1E46': 'N',
        '\u0145': 'N',
        '\u1E4A': 'N',
        '\u1E48': 'N',
        '\u0220': 'N',
        '\u019D': 'N',
        '\uA790': 'N',
        '\uA7A4': 'N',
        '\u01CA': 'NJ',
        '\u01CB': 'Nj',
        '\u24C4': 'O',
        '\uFF2F': 'O',
        '\u00D2': 'O',
        '\u00D3': 'O',
        '\u00D4': 'O',
        '\u1ED2': 'O',
        '\u1ED0': 'O',
        '\u1ED6': 'O',
        '\u1ED4': 'O',
        '\u00D5': 'O',
        '\u1E4C': 'O',
        '\u022C': 'O',
        '\u1E4E': 'O',
        '\u014C': 'O',
        '\u1E50': 'O',
        '\u1E52': 'O',
        '\u014E': 'O',
        '\u022E': 'O',
        '\u0230': 'O',
        '\u00D6': 'O',
        '\u022A': 'O',
        '\u1ECE': 'O',
        '\u0150': 'O',
        '\u01D1': 'O',
        '\u020C': 'O',
        '\u020E': 'O',
        '\u01A0': 'O',
        '\u1EDC': 'O',
        '\u1EDA': 'O',
        '\u1EE0': 'O',
        '\u1EDE': 'O',
        '\u1EE2': 'O',
        '\u1ECC': 'O',
        '\u1ED8': 'O',
        '\u01EA': 'O',
        '\u01EC': 'O',
        '\u00D8': 'O',
        '\u01FE': 'O',
        '\u0186': 'O',
        '\u019F': 'O',
        '\uA74A': 'O',
        '\uA74C': 'O',
        '\u01A2': 'OI',
        '\uA74E': 'OO',
        '\u0222': 'OU',
        '\u24C5': 'P',
        '\uFF30': 'P',
        '\u1E54': 'P',
        '\u1E56': 'P',
        '\u01A4': 'P',
        '\u2C63': 'P',
        '\uA750': 'P',
        '\uA752': 'P',
        '\uA754': 'P',
        '\u24C6': 'Q',
        '\uFF31': 'Q',
        '\uA756': 'Q',
        '\uA758': 'Q',
        '\u024A': 'Q',
        '\u24C7': 'R',
        '\uFF32': 'R',
        '\u0154': 'R',
        '\u1E58': 'R',
        '\u0158': 'R',
        '\u0210': 'R',
        '\u0212': 'R',
        '\u1E5A': 'R',
        '\u1E5C': 'R',
        '\u0156': 'R',
        '\u1E5E': 'R',
        '\u024C': 'R',
        '\u2C64': 'R',
        '\uA75A': 'R',
        '\uA7A6': 'R',
        '\uA782': 'R',
        '\u24C8': 'S',
        '\uFF33': 'S',
        '\u1E9E': 'S',
        '\u015A': 'S',
        '\u1E64': 'S',
        '\u015C': 'S',
        '\u1E60': 'S',
        '\u0160': 'S',
        '\u1E66': 'S',
        '\u1E62': 'S',
        '\u1E68': 'S',
        '\u0218': 'S',
        '\u015E': 'S',
        '\u2C7E': 'S',
        '\uA7A8': 'S',
        '\uA784': 'S',
        '\u24C9': 'T',
        '\uFF34': 'T',
        '\u1E6A': 'T',
        '\u0164': 'T',
        '\u1E6C': 'T',
        '\u021A': 'T',
        '\u0162': 'T',
        '\u1E70': 'T',
        '\u1E6E': 'T',
        '\u0166': 'T',
        '\u01AC': 'T',
        '\u01AE': 'T',
        '\u023E': 'T',
        '\uA786': 'T',
        '\uA728': 'TZ',
        '\u24CA': 'U',
        '\uFF35': 'U',
        '\u00D9': 'U',
        '\u00DA': 'U',
        '\u00DB': 'U',
        '\u0168': 'U',
        '\u1E78': 'U',
        '\u016A': 'U',
        '\u1E7A': 'U',
        '\u016C': 'U',
        '\u00DC': 'U',
        '\u01DB': 'U',
        '\u01D7': 'U',
        '\u01D5': 'U',
        '\u01D9': 'U',
        '\u1EE6': 'U',
        '\u016E': 'U',
        '\u0170': 'U',
        '\u01D3': 'U',
        '\u0214': 'U',
        '\u0216': 'U',
        '\u01AF': 'U',
        '\u1EEA': 'U',
        '\u1EE8': 'U',
        '\u1EEE': 'U',
        '\u1EEC': 'U',
        '\u1EF0': 'U',
        '\u1EE4': 'U',
        '\u1E72': 'U',
        '\u0172': 'U',
        '\u1E76': 'U',
        '\u1E74': 'U',
        '\u0244': 'U',
        '\u24CB': 'V',
        '\uFF36': 'V',
        '\u1E7C': 'V',
        '\u1E7E': 'V',
        '\u01B2': 'V',
        '\uA75E': 'V',
        '\u0245': 'V',
        '\uA760': 'VY',
        '\u24CC': 'W',
        '\uFF37': 'W',
        '\u1E80': 'W',
        '\u1E82': 'W',
        '\u0174': 'W',
        '\u1E86': 'W',
        '\u1E84': 'W',
        '\u1E88': 'W',
        '\u2C72': 'W',
        '\u24CD': 'X',
        '\uFF38': 'X',
        '\u1E8A': 'X',
        '\u1E8C': 'X',
        '\u24CE': 'Y',
        '\uFF39': 'Y',
        '\u1EF2': 'Y',
        '\u00DD': 'Y',
        '\u0176': 'Y',
        '\u1EF8': 'Y',
        '\u0232': 'Y',
        '\u1E8E': 'Y',
        '\u0178': 'Y',
        '\u1EF6': 'Y',
        '\u1EF4': 'Y',
        '\u01B3': 'Y',
        '\u024E': 'Y',
        '\u1EFE': 'Y',
        '\u24CF': 'Z',
        '\uFF3A': 'Z',
        '\u0179': 'Z',
        '\u1E90': 'Z',
        '\u017B': 'Z',
        '\u017D': 'Z',
        '\u1E92': 'Z',
        '\u1E94': 'Z',
        '\u01B5': 'Z',
        '\u0224': 'Z',
        '\u2C7F': 'Z',
        '\u2C6B': 'Z',
        '\uA762': 'Z',
        '\u24D0': 'a',
        '\uFF41': 'a',
        '\u1E9A': 'a',
        '\u00E0': 'a',
        '\u00E1': 'a',
        '\u00E2': 'a',
        '\u1EA7': 'a',
        '\u1EA5': 'a',
        '\u1EAB': 'a',
        '\u1EA9': 'a',
        '\u00E3': 'a',
        '\u0101': 'a',
        '\u0103': 'a',
        '\u1EB1': 'a',
        '\u1EAF': 'a',
        '\u1EB5': 'a',
        '\u1EB3': 'a',
        '\u0227': 'a',
        '\u01E1': 'a',
        '\u00E4': 'a',
        '\u01DF': 'a',
        '\u1EA3': 'a',
        '\u00E5': 'a',
        '\u01FB': 'a',
        '\u01CE': 'a',
        '\u0201': 'a',
        '\u0203': 'a',
        '\u1EA1': 'a',
        '\u1EAD': 'a',
        '\u1EB7': 'a',
        '\u1E01': 'a',
        '\u0105': 'a',
        '\u2C65': 'a',
        '\u0250': 'a',
        '\uA733': 'aa',
        '\u00E6': 'ae',
        '\u01FD': 'ae',
        '\u01E3': 'ae',
        '\uA735': 'ao',
        '\uA737': 'au',
        '\uA739': 'av',
        '\uA73B': 'av',
        '\uA73D': 'ay',
        '\u24D1': 'b',
        '\uFF42': 'b',
        '\u1E03': 'b',
        '\u1E05': 'b',
        '\u1E07': 'b',
        '\u0180': 'b',
        '\u0183': 'b',
        '\u0253': 'b',
        '\u24D2': 'c',
        '\uFF43': 'c',
        '\u0107': 'c',
        '\u0109': 'c',
        '\u010B': 'c',
        '\u010D': 'c',
        '\u00E7': 'c',
        '\u1E09': 'c',
        '\u0188': 'c',
        '\u023C': 'c',
        '\uA73F': 'c',
        '\u2184': 'c',
        '\u24D3': 'd',
        '\uFF44': 'd',
        '\u1E0B': 'd',
        '\u010F': 'd',
        '\u1E0D': 'd',
        '\u1E11': 'd',
        '\u1E13': 'd',
        '\u1E0F': 'd',
        '\u0111': 'd',
        '\u018C': 'd',
        '\u0256': 'd',
        '\u0257': 'd',
        '\uA77A': 'd',
        '\u01F3': 'dz',
        '\u01C6': 'dz',
        '\u24D4': 'e',
        '\uFF45': 'e',
        '\u00E8': 'e',
        '\u00E9': 'e',
        '\u00EA': 'e',
        '\u1EC1': 'e',
        '\u1EBF': 'e',
        '\u1EC5': 'e',
        '\u1EC3': 'e',
        '\u1EBD': 'e',
        '\u0113': 'e',
        '\u1E15': 'e',
        '\u1E17': 'e',
        '\u0115': 'e',
        '\u0117': 'e',
        '\u00EB': 'e',
        '\u1EBB': 'e',
        '\u011B': 'e',
        '\u0205': 'e',
        '\u0207': 'e',
        '\u1EB9': 'e',
        '\u1EC7': 'e',
        '\u0229': 'e',
        '\u1E1D': 'e',
        '\u0119': 'e',
        '\u1E19': 'e',
        '\u1E1B': 'e',
        '\u0247': 'e',
        '\u025B': 'e',
        '\u01DD': 'e',
        '\u24D5': 'f',
        '\uFF46': 'f',
        '\u1E1F': 'f',
        '\u0192': 'f',
        '\uA77C': 'f',
        '\u24D6': 'g',
        '\uFF47': 'g',
        '\u01F5': 'g',
        '\u011D': 'g',
        '\u1E21': 'g',
        '\u011F': 'g',
        '\u0121': 'g',
        '\u01E7': 'g',
        '\u0123': 'g',
        '\u01E5': 'g',
        '\u0260': 'g',
        '\uA7A1': 'g',
        '\u1D79': 'g',
        '\uA77F': 'g',
        '\u24D7': 'h',
        '\uFF48': 'h',
        '\u0125': 'h',
        '\u1E23': 'h',
        '\u1E27': 'h',
        '\u021F': 'h',
        '\u1E25': 'h',
        '\u1E29': 'h',
        '\u1E2B': 'h',
        '\u1E96': 'h',
        '\u0127': 'h',
        '\u2C68': 'h',
        '\u2C76': 'h',
        '\u0265': 'h',
        '\u0195': 'hv',
        '\u24D8': 'i',
        '\uFF49': 'i',
        '\u00EC': 'i',
        '\u00ED': 'i',
        '\u00EE': 'i',
        '\u0129': 'i',
        '\u012B': 'i',
        '\u012D': 'i',
        '\u00EF': 'i',
        '\u1E2F': 'i',
        '\u1EC9': 'i',
        '\u01D0': 'i',
        '\u0209': 'i',
        '\u020B': 'i',
        '\u1ECB': 'i',
        '\u012F': 'i',
        '\u1E2D': 'i',
        '\u0268': 'i',
        '\u0131': 'i',
        '\u24D9': 'j',
        '\uFF4A': 'j',
        '\u0135': 'j',
        '\u01F0': 'j',
        '\u0249': 'j',
        '\u24DA': 'k',
        '\uFF4B': 'k',
        '\u1E31': 'k',
        '\u01E9': 'k',
        '\u1E33': 'k',
        '\u0137': 'k',
        '\u1E35': 'k',
        '\u0199': 'k',
        '\u2C6A': 'k',
        '\uA741': 'k',
        '\uA743': 'k',
        '\uA745': 'k',
        '\uA7A3': 'k',
        '\u24DB': 'l',
        '\uFF4C': 'l',
        '\u0140': 'l',
        '\u013A': 'l',
        '\u013E': 'l',
        '\u1E37': 'l',
        '\u1E39': 'l',
        '\u013C': 'l',
        '\u1E3D': 'l',
        '\u1E3B': 'l',
        '\u017F': 'l',
        '\u0142': 'l',
        '\u019A': 'l',
        '\u026B': 'l',
        '\u2C61': 'l',
        '\uA749': 'l',
        '\uA781': 'l',
        '\uA747': 'l',
        '\u01C9': 'lj',
        '\u24DC': 'm',
        '\uFF4D': 'm',
        '\u1E3F': 'm',
        '\u1E41': 'm',
        '\u1E43': 'm',
        '\u0271': 'm',
        '\u026F': 'm',
        '\u24DD': 'n',
        '\uFF4E': 'n',
        '\u01F9': 'n',
        '\u0144': 'n',
        '\u00F1': 'n',
        '\u1E45': 'n',
        '\u0148': 'n',
        '\u1E47': 'n',
        '\u0146': 'n',
        '\u1E4B': 'n',
        '\u1E49': 'n',
        '\u019E': 'n',
        '\u0272': 'n',
        '\u0149': 'n',
        '\uA791': 'n',
        '\uA7A5': 'n',
        '\u01CC': 'nj',
        '\u24DE': 'o',
        '\uFF4F': 'o',
        '\u00F2': 'o',
        '\u00F3': 'o',
        '\u00F4': 'o',
        '\u1ED3': 'o',
        '\u1ED1': 'o',
        '\u1ED7': 'o',
        '\u1ED5': 'o',
        '\u00F5': 'o',
        '\u1E4D': 'o',
        '\u022D': 'o',
        '\u1E4F': 'o',
        '\u014D': 'o',
        '\u1E51': 'o',
        '\u1E53': 'o',
        '\u014F': 'o',
        '\u022F': 'o',
        '\u0231': 'o',
        '\u00F6': 'o',
        '\u022B': 'o',
        '\u1ECF': 'o',
        '\u0151': 'o',
        '\u01D2': 'o',
        '\u020D': 'o',
        '\u020F': 'o',
        '\u01A1': 'o',
        '\u1EDD': 'o',
        '\u1EDB': 'o',
        '\u1EE1': 'o',
        '\u1EDF': 'o',
        '\u1EE3': 'o',
        '\u1ECD': 'o',
        '\u1ED9': 'o',
        '\u01EB': 'o',
        '\u01ED': 'o',
        '\u00F8': 'o',
        '\u01FF': 'o',
        '\u0254': 'o',
        '\uA74B': 'o',
        '\uA74D': 'o',
        '\u0275': 'o',
        '\u01A3': 'oi',
        '\u0223': 'ou',
        '\uA74F': 'oo',
        '\u24DF': 'p',
        '\uFF50': 'p',
        '\u1E55': 'p',
        '\u1E57': 'p',
        '\u01A5': 'p',
        '\u1D7D': 'p',
        '\uA751': 'p',
        '\uA753': 'p',
        '\uA755': 'p',
        '\u24E0': 'q',
        '\uFF51': 'q',
        '\u024B': 'q',
        '\uA757': 'q',
        '\uA759': 'q',
        '\u24E1': 'r',
        '\uFF52': 'r',
        '\u0155': 'r',
        '\u1E59': 'r',
        '\u0159': 'r',
        '\u0211': 'r',
        '\u0213': 'r',
        '\u1E5B': 'r',
        '\u1E5D': 'r',
        '\u0157': 'r',
        '\u1E5F': 'r',
        '\u024D': 'r',
        '\u027D': 'r',
        '\uA75B': 'r',
        '\uA7A7': 'r',
        '\uA783': 'r',
        '\u24E2': 's',
        '\uFF53': 's',
        '\u00DF': 's',
        '\u015B': 's',
        '\u1E65': 's',
        '\u015D': 's',
        '\u1E61': 's',
        '\u0161': 's',
        '\u1E67': 's',
        '\u1E63': 's',
        '\u1E69': 's',
        '\u0219': 's',
        '\u015F': 's',
        '\u023F': 's',
        '\uA7A9': 's',
        '\uA785': 's',
        '\u1E9B': 's',
        '\u24E3': 't',
        '\uFF54': 't',
        '\u1E6B': 't',
        '\u1E97': 't',
        '\u0165': 't',
        '\u1E6D': 't',
        '\u021B': 't',
        '\u0163': 't',
        '\u1E71': 't',
        '\u1E6F': 't',
        '\u0167': 't',
        '\u01AD': 't',
        '\u0288': 't',
        '\u2C66': 't',
        '\uA787': 't',
        '\uA729': 'tz',
        '\u24E4': 'u',
        '\uFF55': 'u',
        '\u00F9': 'u',
        '\u00FA': 'u',
        '\u00FB': 'u',
        '\u0169': 'u',
        '\u1E79': 'u',
        '\u016B': 'u',
        '\u1E7B': 'u',
        '\u016D': 'u',
        '\u00FC': 'u',
        '\u01DC': 'u',
        '\u01D8': 'u',
        '\u01D6': 'u',
        '\u01DA': 'u',
        '\u1EE7': 'u',
        '\u016F': 'u',
        '\u0171': 'u',
        '\u01D4': 'u',
        '\u0215': 'u',
        '\u0217': 'u',
        '\u01B0': 'u',
        '\u1EEB': 'u',
        '\u1EE9': 'u',
        '\u1EEF': 'u',
        '\u1EED': 'u',
        '\u1EF1': 'u',
        '\u1EE5': 'u',
        '\u1E73': 'u',
        '\u0173': 'u',
        '\u1E77': 'u',
        '\u1E75': 'u',
        '\u0289': 'u',
        '\u24E5': 'v',
        '\uFF56': 'v',
        '\u1E7D': 'v',
        '\u1E7F': 'v',
        '\u028B': 'v',
        '\uA75F': 'v',
        '\u028C': 'v',
        '\uA761': 'vy',
        '\u24E6': 'w',
        '\uFF57': 'w',
        '\u1E81': 'w',
        '\u1E83': 'w',
        '\u0175': 'w',
        '\u1E87': 'w',
        '\u1E85': 'w',
        '\u1E98': 'w',
        '\u1E89': 'w',
        '\u2C73': 'w',
        '\u24E7': 'x',
        '\uFF58': 'x',
        '\u1E8B': 'x',
        '\u1E8D': 'x',
        '\u24E8': 'y',
        '\uFF59': 'y',
        '\u1EF3': 'y',
        '\u00FD': 'y',
        '\u0177': 'y',
        '\u1EF9': 'y',
        '\u0233': 'y',
        '\u1E8F': 'y',
        '\u00FF': 'y',
        '\u1EF7': 'y',
        '\u1E99': 'y',
        '\u1EF5': 'y',
        '\u01B4': 'y',
        '\u024F': 'y',
        '\u1EFF': 'y',
        '\u24E9': 'z',
        '\uFF5A': 'z',
        '\u017A': 'z',
        '\u1E91': 'z',
        '\u017C': 'z',
        '\u017E': 'z',
        '\u1E93': 'z',
        '\u1E95': 'z',
        '\u01B6': 'z',
        '\u0225': 'z',
        '\u0240': 'z',
        '\u2C6C': 'z',
        '\uA763': 'z',
        '\u0386': '\u0391',
        '\u0388': '\u0395',
        '\u0389': '\u0397',
        '\u038A': '\u0399',
        '\u03AA': '\u0399',
        '\u038C': '\u039F',
        '\u038E': '\u03A5',
        '\u03AB': '\u03A5',
        '\u038F': '\u03A9',
        '\u03AC': '\u03B1',
        '\u03AD': '\u03B5',
        '\u03AE': '\u03B7',
        '\u03AF': '\u03B9',
        '\u03CA': '\u03B9',
        '\u0390': '\u03B9',
        '\u03CC': '\u03BF',
        '\u03CD': '\u03C5',
        '\u03CB': '\u03C5',
        '\u03B0': '\u03C5',
        '\u03C9': '\u03C9',
        '\u03C2': '\u03C3'
    };
    DataUtil.fnOperators = {
        /**
         * Returns true when the actual input is equal to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         * @param  {boolean} ignoreAccent?
         */
        equal: function (actual, expected, ignoreCase, ignoreAccent) {
            if (ignoreAccent) {
                actual = DataUtil.ignoreDiacritics(actual);
                expected = DataUtil.ignoreDiacritics(expected);
            }
            if (ignoreCase) {
                return DataUtil.toLowerCase(actual) === DataUtil.toLowerCase(expected);
            }
            return actual === expected;
        },
        /**
         * Returns true when the actual input is not equal to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         */
        notequal: function (actual, expected, ignoreCase, ignoreAccent) {
            if (ignoreAccent) {
                actual = DataUtil.ignoreDiacritics(actual);
                expected = DataUtil.ignoreDiacritics(expected);
            }
            return !DataUtil.fnOperators.equal(actual, expected, ignoreCase);
        },
        /**
         * Returns true when the actual input is less than to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         */
        lessthan: function (actual, expected, ignoreCase) {
            if (ignoreCase) {
                return DataUtil.toLowerCase(actual) < DataUtil.toLowerCase(expected);
            }
            return actual < expected;
        },
        /**
         * Returns true when the actual input is greater than to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         */
        greaterthan: function (actual, expected, ignoreCase) {
            if (ignoreCase) {
                return DataUtil.toLowerCase(actual) > DataUtil.toLowerCase(expected);
            }
            return actual > expected;
        },
        /**
         * Returns true when the actual input is less than or equal to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         */
        lessthanorequal: function (actual, expected, ignoreCase) {
            if (ignoreCase) {
                return DataUtil.toLowerCase(actual) <= DataUtil.toLowerCase(expected);
            }
            return actual <= expected;
        },
        /**
         * Returns true when the actual input is greater than or equal to the given input.
         * @param  {string|number|boolean} actual
         * @param  {string|number|boolean} expected
         * @param  {boolean} ignoreCase?
         */
        greaterthanorequal: function (actual, expected, ignoreCase) {
            if (ignoreCase) {
                return DataUtil.toLowerCase(actual) >= DataUtil.toLowerCase(expected);
            }
            return actual >= expected;
        },
        /**
         * Returns true when the actual input contains the given string.
         * @param  {string|number} actual
         * @param  {string|number} expected
         * @param  {boolean} ignoreCase?
         */
        contains: function (actual, expected, ignoreCase, ignoreAccent) {
            if (ignoreAccent) {
                actual = DataUtil.ignoreDiacritics(actual);
                expected = DataUtil.ignoreDiacritics(expected);
            }
            if (ignoreCase) {
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actual) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(expected) &&
                    DataUtil.toLowerCase(actual).indexOf(DataUtil.toLowerCase(expected)) !== -1;
            }
            return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actual) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(expected) &&
                actual.toString().indexOf(expected) !== -1;
        },
        /**
         * Returns true when the given input value is not null.
         * @param  {string|number} actual
         * @returns boolean
         */
        notnull: function (actual) {
            return actual !== null;
        },
        /**
         * Returns true when the given input value is null.
         * @param  {string|number} actual
         * @returns boolean
         */
        isnull: function (actual) {
            return actual === null;
        },
        /**
         * Returns true when the actual input starts with the given string
         * @param  {string} actual
         * @param  {string} expected
         * @param  {boolean} ignoreCase?
         */
        startswith: function (actual, expected, ignoreCase, ignoreAccent) {
            if (ignoreAccent) {
                actual = DataUtil.ignoreDiacritics(actual);
                expected = DataUtil.ignoreDiacritics(expected);
            }
            if (ignoreCase) {
                return actual && expected && DataUtil.startsWith(DataUtil.toLowerCase(actual), DataUtil.toLowerCase(expected));
            }
            return actual && expected && DataUtil.startsWith(actual, expected);
        },
        /**
         * Returns true when the actual input ends with the given string.
         * @param  {string} actual
         * @param  {string} expected
         * @param  {boolean} ignoreCase?
         */
        endswith: function (actual, expected, ignoreCase, ignoreAccent) {
            if (ignoreAccent) {
                actual = DataUtil.ignoreDiacritics(actual);
                expected = DataUtil.ignoreDiacritics(expected);
            }
            if (ignoreCase) {
                return actual && expected && DataUtil.endsWith(DataUtil.toLowerCase(actual), DataUtil.toLowerCase(expected));
            }
            return actual && expected && DataUtil.endsWith(actual, expected);
        },
        /**
         * It will return the filter operator based on the filter symbol.
         * @param  {string} operator
         * @hidden
         */
        processSymbols: function (operator) {
            var fnName = DataUtil.operatorSymbols[operator];
            if (fnName) {
                var fn = DataUtil.fnOperators[fnName];
                return fn;
            }
            return DataUtil.throwError('Query - Process Operator : Invalid operator');
        },
        /**
         * It will return the valid filter operator based on the specified operators.
         * @param  {string} operator
         * @hidden
         */
        processOperator: function (operator) {
            var fn = DataUtil.fnOperators[operator];
            if (fn) {
                return fn;
            }
            return DataUtil.fnOperators.processSymbols(operator);
        }
    };
    /**
     * To perform the parse operation on JSON data, like convert to string from JSON or convert to JSON from string.
     */
    DataUtil.parse = {
        /**
         * Parse the given string to the plain JavaScript object.
         * @param  {string|Object|Object[]} jsonText
         */
        parseJson: function (jsonText) {
            if (typeof jsonText === 'string') {
                jsonText = JSON.parse(jsonText, DataUtil.parse.jsonReviver);
            }
            else if (jsonText instanceof Array) {
                DataUtil.parse.iterateAndReviveArray(jsonText);
            }
            else if (typeof jsonText === 'object' && jsonText !== null) {
                DataUtil.parse.iterateAndReviveJson(jsonText);
            }
            return jsonText;
        },
        /**
         * It will perform on array of values.
         * @param  {string[]|Object[]} array
         * @hidden
         */
        iterateAndReviveArray: function (array) {
            for (var i = 0; i < array.length; i++) {
                if (typeof array[i] === 'object' && array[i] !== null) {
                    DataUtil.parse.iterateAndReviveJson(array[i]);
                }
                else if (typeof array[i] === 'string' && !/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(array[i])) {
                    array[i] = DataUtil.parse.jsonReviver('', array[i]);
                }
                else {
                    array[i] = DataUtil.parse.parseJson(array[i]);
                }
            }
        },
        /**
         * It will perform on JSON values
         * @param  {JSON} json
         * @hidden
         */
        iterateAndReviveJson: function (json) {
            var value;
            var keys = Object.keys(json);
            for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
                var prop = keys_2[_i];
                if (DataUtil.startsWith(prop, '__')) {
                    continue;
                }
                value = json[prop];
                if (typeof value === 'object') {
                    if (value instanceof Array) {
                        DataUtil.parse.iterateAndReviveArray(value);
                    }
                    else if (value) {
                        DataUtil.parse.iterateAndReviveJson(value);
                    }
                }
                else {
                    json[prop] = DataUtil.parse.jsonReviver(json[prop], value);
                }
            }
        },
        /**
         * It will perform on JSON values
         * @param  {string} field
         * @param  {string|Date} value
         * @hidden
         */
        jsonReviver: function (field, value) {
            if (typeof value === 'string') {
                var ms = /^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(value);
                var offSet = DataUtil.timeZoneHandling ? DataUtil.serverTimezoneOffset : null;
                if (ms) {
                    return DataUtil.dateParse.toTimeZone(new Date(parseInt(ms[1], 10)), offSet, true);
                }
                else if (/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(value)) {
                    var isUTC = value.indexOf('Z') > -1 || value.indexOf('z') > -1;
                    var arr = value.split(/[^0-9.]/);
                    if (isUTC) {
                        value = DataUtil.dateParse
                            .toTimeZone(new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, parseInt(arr[2], 10), parseInt(arr[3], 10), parseInt(arr[4], 10), parseInt(arr[5], 10)), DataUtil.serverTimezoneOffset, false);
                    }
                    else {
                        var utcFormat = new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, parseInt(arr[2], 10), parseInt(arr[3], 10), parseInt(arr[4], 10), parseInt(arr[5], 10));
                        var hrs = parseInt(arr[6], 10);
                        var mins = parseInt(arr[7], 10);
                        if (isNaN(hrs) && isNaN(mins)) {
                            return utcFormat;
                        }
                        if (value.indexOf('+') > -1) {
                            utcFormat.setHours(utcFormat.getHours() - hrs, utcFormat.getMinutes() - mins);
                        }
                        else {
                            utcFormat.setHours(utcFormat.getHours() + hrs, utcFormat.getMinutes() + mins);
                        }
                        value = DataUtil.dateParse
                            .toTimeZone(utcFormat, DataUtil.serverTimezoneOffset, false);
                    }
                    if (DataUtil.serverTimezoneOffset == null) {
                        value = DataUtil.dateParse.addSelfOffset(value);
                    }
                }
            }
            return value;
        },
        /**
         * Check wheather the given value is JSON or not.
         * @param  {Object[]} jsonData
         */
        isJson: function (jsonData) {
            if (typeof jsonData[0] === 'string') {
                return jsonData;
            }
            return DataUtil.parse.parseJson(jsonData);
        },
        /**
         * Checks wheather the given value is GUID or not.
         * @param  {string} value
         */
        isGuid: function (value) {
            var regex = /[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i;
            var match = regex.exec(value);
            return match != null;
        },
        /**
         * The method used to replace the value based on the type.
         * @param  {Object} value
         * @param  {boolean} stringify
         * @hidden
         */
        replacer: function (value, stringify) {
            if (DataUtil.isPlainObject(value)) {
                return DataUtil.parse.jsonReplacer(value, stringify);
            }
            if (value instanceof Array) {
                return DataUtil.parse.arrayReplacer(value);
            }
            if (value instanceof Date) {
                return DataUtil.parse.jsonReplacer({ val: value }, stringify).val;
            }
            return value;
        },
        /**
         * It will replace the JSON value.
         * @param  {string} key
         * @param  {Object} val
         * @hidden
         */
        jsonReplacer: function (val, stringify) {
            var value;
            var keys = Object.keys(val);
            for (var _i = 0, keys_3 = keys; _i < keys_3.length; _i++) {
                var prop = keys_3[_i];
                value = val[prop];
                if (!(value instanceof Date)) {
                    continue;
                }
                var d = value;
                if (DataUtil.serverTimezoneOffset == null) {
                    val[prop] = DataUtil.dateParse.toTimeZone(d, null).toJSON();
                }
                else {
                    d = new Date(+d + DataUtil.serverTimezoneOffset * 3600000);
                    val[prop] = DataUtil.dateParse.toTimeZone(DataUtil.dateParse.addSelfOffset(d), null).toJSON();
                }
            }
            return val;
        },
        /**
         * It will replace the Array of value.
         * @param  {string} key
         * @param  {Object[]} val
         * @hidden
         */
        arrayReplacer: function (val) {
            for (var i = 0; i < val.length; i++) {
                if (DataUtil.isPlainObject(val[i])) {
                    val[i] = DataUtil.parse.jsonReplacer(val[i]);
                }
                else if (val[i] instanceof Date) {
                    val[i] = DataUtil.parse.jsonReplacer({ date: val[i] }).date;
                }
            }
            return val;
        },
        /**
         * It will replace the Date object with respective to UTC format value.
         * @param  {string} key
         * @param  {any} value
         * @hidden
         */
        /* tslint:disable-next-line:no-any */
        jsonDateReplacer: function (key, value) {
            if (key === 'value' && value) {
                if (typeof value === 'string') {
                    var ms = /^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(value);
                    if (ms) {
                        value = DataUtil.dateParse.toTimeZone(new Date(parseInt(ms[1], 10)), null, true);
                    }
                    else if (/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(value)) {
                        var arr = value.split(/[^0-9]/);
                        value = DataUtil.dateParse
                            .toTimeZone(new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, parseInt(arr[2], 10), parseInt(arr[3], 10), parseInt(arr[4], 10), parseInt(arr[5], 10)), null, true);
                    }
                }
                if (value instanceof Date) {
                    value = DataUtil.dateParse.addSelfOffset(value);
                    if (DataUtil.serverTimezoneOffset === null) {
                        return DataUtil.dateParse.toTimeZone(DataUtil.dateParse.addSelfOffset(value), null).toJSON();
                    }
                    else {
                        value = DataUtil.dateParse.toTimeZone(value, (((value.getTimezoneOffset() / 60) * 2)
                            - DataUtil.serverTimezoneOffset), false);
                        return value.toJSON();
                    }
                }
            }
            return value;
        }
    };
    /**
     * @hidden
     */
    DataUtil.dateParse = {
        addSelfOffset: function (input) {
            return new Date(+input - (input.getTimezoneOffset() * 60000));
        },
        toUTC: function (input) {
            return new Date(+input + (input.getTimezoneOffset() * 60000));
        },
        toTimeZone: function (input, offset, utc) {
            if (offset === null) {
                return input;
            }
            var unix = utc ? DataUtil.dateParse.toUTC(input) : input;
            return new Date(+unix - (offset * 3600000));
        },
        toLocalTime: function (input) {
            var datefn = input;
            var timeZone = -datefn.getTimezoneOffset();
            var differenceString = timeZone >= 0 ? '+' : '-';
            var localtimefn = function (num) {
                var norm = Math.floor(Math.abs(num));
                return (norm < 10 ? '0' : '') + norm;
            };
            var val = datefn.getFullYear() + '-' + localtimefn(datefn.getMonth() + 1) + '-' + localtimefn(datefn.getDate()) +
                'T' + localtimefn(datefn.getHours()) +
                ':' + localtimefn(datefn.getMinutes()) +
                ':' + localtimefn(datefn.getSeconds()) +
                differenceString + localtimefn(timeZone / 60) +
                ':' + localtimefn(timeZone % 60);
            return val;
        }
    };
    return DataUtil;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/auto-complete.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/auto-complete.js ***!
  \************************************************************************************/
/*! exports provided: AutoComplete */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoComplete", function() { return AutoComplete; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../drop-down-list/drop-down-list */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/drop-down-list.js");
/* harmony import */ var _combo_box_combo_box__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../combo-box/combo-box */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/combo-box.js");
/* harmony import */ var _common_highlight_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/highlight-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/highlight-search.js");
/* harmony import */ var _common_incremental_search__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/incremental-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js");
/* harmony import */ var _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../drop-down-base/drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../combo-box/combo-box-model.d.ts'/>








/* tslint:disable */


/* tslint:enable */
_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].root = 'e-autocomplete';
_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].icon = 'e-input-group-icon e-ddl-icon e-search-icon';
/**
 * The AutoComplete component provides the matched suggestion list when type into the input,
 * from which the user can select one.
 * ```html
 * <input id="list" type="text"/>
 * ```
 * ```typescript
 *   let atcObj:AutoComplete = new AutoComplete();
 *   atcObj.appendTo("#list");
 * ```
 */
var AutoComplete = /** @__PURE__ @class */ (function (_super) {
    __extends(AutoComplete, _super);
    /**
     * * Constructor for creating the widget
     */
    function AutoComplete(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isFiltered = false;
        _this.searchList = false;
        return _this;
    }
    ;
    /**
     * Initialize the event handler
     * @private
     */
    AutoComplete.prototype.preRender = function () {
        _super.prototype.preRender.call(this);
    };
    AutoComplete.prototype.getLocaleName = function () {
        return 'auto-complete';
    };
    ;
    AutoComplete.prototype.getNgDirective = function () {
        return 'EJS-AUTOCOMPLETE';
    };
    AutoComplete.prototype.getQuery = function (query) {
        var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new _ej2_data__WEBPACK_IMPORTED_MODULE_7__["Query"]();
        var filterType = (this.queryString === '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) ? 'equal' : this.filterType;
        var queryString = (this.queryString === '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) ? this.value : this.queryString;
        if (this.isFiltered) {
            return filterQuery;
        }
        if (this.queryString !== null && this.queryString !== '') {
            var dataType = this.typeOfData(this.dataSource).typeof;
            if (!(this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_7__["DataManager"]) && dataType === 'string' || dataType === 'number') {
                filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
            }
            else {
                var mapping = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fields.value) ? this.fields.value : '';
                filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.suggestionCount)) {
            // Since defualt value of suggestioncount is 20, checked the condition
            if (this.suggestionCount !== 20) {
                for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
                    if (filterQuery.queries[queryElements].fn === 'onTake') {
                        filterQuery.queries.splice(queryElements, 1);
                    }
                }
            }
            filterQuery.take(this.suggestionCount);
        }
        return filterQuery;
    };
    AutoComplete.prototype.searchLists = function (e) {
        var _this = this;
        this.isTyped = true;
        this.isDataFetched = this.isSelectCustom = false;
        if (this.isServerBlazor) {
            this.beforePopupOpen = (this.isFiltering() && !this.beforePopupOpen) ? !this.beforePopupOpen : this.beforePopupOpen;
            this.queryString = this.filterInput.value;
            if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnServerFilter', this.filterInput.value);
            }
            else {
                this.hidePopup();
            }
        }
        else {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list)) {
                _super.prototype.renderList.call(this, true);
            }
            this.queryString = this.filterInput.value;
            if (e.keyCode === 40 || e.keyCode === 38) {
                this.queryString = this.queryString === '' ? null : this.queryString;
                this.beforePopupOpen = true;
                this.resetList(this.dataSource, this.fields);
                return;
            }
            this.isSelected = false;
            this.activeIndex = null;
            var eventArgs_1 = {
                preventDefaultAction: false,
                text: this.filterInput.value,
                updateData: function (dataSource, query, fields) {
                    if (eventArgs_1.cancel) {
                        return;
                    }
                    _this.isFiltered = true;
                    _this.filterAction(dataSource, query, fields);
                },
                cancel: false
            };
            this.trigger('filtering', eventArgs_1, function (eventArgs) {
                if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
                    _this.searchList = true;
                    _this.filterAction(_this.dataSource, null, _this.fields);
                }
            });
        }
    };
    /**
     * To filter the data from given data source by using query
     * @param  {Object[] | DataManager } dataSource - Set the data source to filter.
     * @param  {Query} query - Specify the query to filter the data.
     * @param  {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
     * @return {void}.

     */
    AutoComplete.prototype.filter = function (dataSource, query, fields) {
        this.isFiltered = true;
        this.filterAction(dataSource, query, fields);
    };
    AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
        this.beforePopupOpen = true;
        if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
            this.resetList(dataSource, fields, query);
        }
        else {
            this.hidePopup();
        }
        this.renderReactTemplates();
    };
    AutoComplete.prototype.clearAll = function (e, property) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property.dataSource))) {
            _super.prototype.clearAll.call(this, e);
        }
        if (this.beforePopupOpen) {
            this.hidePopup();
        }
    };
    AutoComplete.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
        this.fixedHeaderElement = null;
        _super.prototype.onActionComplete.call(this, ulElement, list, e);
        var item = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].li);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([item], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].focus);
        }
        this.postBackAction();
    };
    AutoComplete.prototype.postBackAction = function () {
        if (this.autofill && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections[0]) && this.searchList) {
            var items = [this.liCollections[0]];
            var searchItem = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_4__["Search"])(this.inputElement.value, items, 'StartsWith', this.ignoreCase);
            this.searchList = false;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(searchItem.item)) {
                _super.prototype.setAutoFill.call(this, this.liCollections[0], true);
            }
        }
    };
    AutoComplete.prototype.setSelection = function (li, e) {
        if (!this.isValidLI(li)) {
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) && e.type === 'keydown' && e.action !== 'enter'
            && e.action !== 'tab' && this.isValidLI(li)) {
            var value = this.getFormattedValue(li.getAttribute('data-value'));
            this.activeIndex = this.getIndexByValue(value);
            if (this.isServerBlazor) {
                this.removeHover();
            }
            this.setHoverList(li);
            this.selectedLI = li;
            this.setScrollPosition(e);
            if (this.autofill && this.isPopupOpen) {
                this.preventAutoFill = false;
                _super.prototype.setAutoFill.call(this, li);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
        }
        else {
            _super.prototype.setSelection.call(this, li, e);
        }
    };
    AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
        var _this = this;
        var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fields.itemCreated)) {
            fields.itemCreated = function (e) {
                if (_this.highlight) {
                    if (_this.element.tagName === _this.getNgDirective() && _this.itemTemplate) {
                        setTimeout(function () { Object(_common_highlight_search__WEBPACK_IMPORTED_MODULE_3__["highlightSearch"])(e.item, _this.queryString, _this.ignoreCase, _this.filterType); }, 0);
                    }
                    else {
                        Object(_common_highlight_search__WEBPACK_IMPORTED_MODULE_3__["highlightSearch"])(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
                    }
                }
            };
        }
        else {
            var itemCreated_1 = fields.itemCreated;
            fields.itemCreated = function (e) {
                if (_this.highlight) {
                    Object(_common_highlight_search__WEBPACK_IMPORTED_MODULE_3__["highlightSearch"])(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
                }
                itemCreated_1.apply(_this, [e]);
            };
        }
        return fields;
    };
    ;
    AutoComplete.prototype.isFiltering = function () {
        return true;
    };
    AutoComplete.prototype.renderPopup = function () {
        this.list.scrollTop = 0;
        _super.prototype.renderPopup.call(this);
    };
    AutoComplete.prototype.isEditTextBox = function () {
        return  true && this.inputElement.value.trim() !== '';
    };
    AutoComplete.prototype.isPopupButton = function () {
        return this.showPopupButton;
    };
    AutoComplete.prototype.isSelectFocusItem = function (element) {
        return false;
    };
    /**
     * Search the entered text and show it in the suggestion list if available.
     * @returns void.

     */
    AutoComplete.prototype.showPopup = function () {
        if (!this.enabled) {
            return;
        }
        if (this.beforePopupOpen && !this.isServerBlazor) {
            this.refreshPopup();
            return;
        }
        this.beforePopupOpen = true;
        this.preventAutoFill = true;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) || this.isServerBlazor) {
            this.renderList();
        }
        else {
            this.resetList(this.dataSource, this.fields);
        }
    };
    /**
     * Hides the popup if it is in open state.
     * @returns void.
     */
    AutoComplete.prototype.hidePopup = function () {
        this.DropDownBaseresetBlazorTemplates(true, false, false, false);
        _super.prototype.hidePopup.call(this);
        this.activeIndex = -1;
    };
    /**
     * Dynamically change the value of properties.
     * @private
     */
    AutoComplete.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (this.getModuleName() === 'autocomplete') {
            this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'showPopupButton':
                    if (this.showPopupButton) {
                        if (!this.isServerBlazor) {
                            var button = _ej2_inputs__WEBPACK_IMPORTED_MODULE_6__["Input"].appendSpan(_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].icon, this.inputWrapper.container, this.createElement);
                            this.inputWrapper.buttons[0] = button;
                        }
                        else if (this.inputWrapper && this.inputWrapper.container) {
                            var button = this.inputWrapper.container.querySelector('.e-input-group-icon.e-ddl-icon');
                            this.inputWrapper.buttons[0] = button;
                        }
                        if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
                            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
                        }
                    }
                    else if (!this.isServerBlazor) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.buttons[0]);
                        this.inputWrapper.buttons[0] = null;
                    }
                    break;
                default:
                    var atcProps = void 0;
                    atcProps = this.getPropObject(prop, newProp, oldProp);
                    _super.prototype.onPropertyChanged.call(this, atcProps.newProperty, atcProps.oldProperty);
                    break;
            }
        }
    };
    AutoComplete.prototype.renderHightSearch = function () {
        if (this.highlight) {
            for (var i = 0; i < this.liCollections.length; i++) {
                var isHighlight = this.ulElement.querySelector('.e-active');
                if (!isHighlight) {
                    Object(_common_highlight_search__WEBPACK_IMPORTED_MODULE_3__["revertHighlightSearch"])(this.liCollections[i]);
                    Object(_common_highlight_search__WEBPACK_IMPORTED_MODULE_3__["highlightSearch"])(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType, this.isServerBlazor);
                }
            }
        }
    };
    /**
     * Return the module name of this component.
     * @private
     */
    AutoComplete.prototype.getModuleName = function () {
        return 'autocomplete';
    };
    /**
     * To initialize the control rendering
     * @private
     */
    AutoComplete.prototype.render = function () {
        _super.prototype.render.call(this);
    };
    ;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ value: null, iconCss: null, groupBy: null }, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_5__["FieldSettings"])
    ], AutoComplete.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], AutoComplete.prototype, "ignoreCase", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], AutoComplete.prototype, "showPopupButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], AutoComplete.prototype, "highlight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(20)
    ], AutoComplete.prototype, "suggestionCount", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], AutoComplete.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AutoComplete.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1)
    ], AutoComplete.prototype, "minLength", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Contains')
    ], AutoComplete.prototype, "filterType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], AutoComplete.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AutoComplete.prototype, "index", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], AutoComplete.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AutoComplete.prototype, "valueTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AutoComplete.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], AutoComplete.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AutoComplete.prototype, "text", void 0);
    AutoComplete = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], AutoComplete);
    return AutoComplete;
}(_combo_box_combo_box__WEBPACK_IMPORTED_MODULE_2__["ComboBox"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/index.js":
/*!****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/index.js ***!
  \****************************************************************************/
/*! exports provided: AutoComplete */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _auto_complete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./auto-complete */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/auto-complete.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoComplete", function() { return _auto_complete__WEBPACK_IMPORTED_MODULE_0__["AutoComplete"]; });

/**
 * export all modules from current location
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/combo-box.js":
/*!****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/combo-box.js ***!
  \****************************************************************************/
/*! exports provided: ComboBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComboBox", function() { return ComboBox; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../drop-down-list/drop-down-list */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/drop-down-list.js");
/* harmony import */ var _common_incremental_search__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/incremental-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../drop-down-list/drop-down-list-model.d.ts'/>





/* tslint:disable */

/* tslint:enable */
var SPINNER_CLASS = 'e-atc-spinner-icon';
_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].root = 'e-combobox';
var inputObject = {
    container: null,
    buttons: []
};
/**
 * The ComboBox component allows the user to type a value or choose an option from the list of predefined options.
 * ```html
 * <select id="list">
 *      <option value='1'>Badminton</option>
 *      <option value='2'>Basketball</option>
 *      <option value='3'>Cricket</option>
 *      <option value='4'>Football</option>
 *      <option value='5'>Tennis</option>
 * </select>
 * ```
 * ```typescript
 *   let games:ComboBox = new ComboBox();
 *   games.appendTo("#list");
 * ```
 */
var ComboBox = /** @__PURE__ @class */ (function (_super) {
    __extends(ComboBox, _super);
    /**
     * *Constructor for creating the component
     */
    function ComboBox(options, element) {
        return _super.call(this, options, element) || this;
    }
    ;
    /**
     * Initialize the event handler
     * @private
     */
    ComboBox.prototype.preRender = function () {
        _super.prototype.preRender.call(this);
    };
    ComboBox.prototype.getLocaleName = function () {
        return 'combo-box';
    };
    ;
    ComboBox.prototype.wireEvent = function () {
        if (this.getModuleName() === 'combobox') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown', this.preventBlur, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.container, 'blur', this.onBlur, this);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputWrapper.buttons[0])) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.buttons[0], 'mousedown', this.dropDownClick, this);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'focus', this.targetFocus, this);
        if (!this.readonly) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'input', this.onInput, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'keyup', this.onFilterUp, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'keydown', this.onFilterDown, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'paste', this.pasteHandler, this);
        }
        this.bindCommonEvent();
    };
    ComboBox.prototype.preventBlur = function (e) {
        if ((!this.allowFiltering && document.activeElement !== this.inputElement &&
            !document.activeElement.classList.contains(_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].input) && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice || !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice)) {
            e.preventDefault();
        }
    };
    ComboBox.prototype.onBlur = function (e) {
        var inputValue = this.inputElement && this.inputElement.value === '' ? null : this.inputElement && this.inputElement.value;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputValue) && inputValue !== this.text) {
            this.customValue(e);
        }
        _super.prototype.onBlur.call(this, e);
    };
    ComboBox.prototype.targetElement = function () {
        return this.inputElement;
    };
    ComboBox.prototype.setOldText = function (text) {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
        this.customValue();
        this.removeSelection();
    };
    ComboBox.prototype.setOldValue = function (value) {
        if (this.allowCustom) {
            this.valueMuteChange(this.value);
        }
        else {
            this.valueMuteChange(null);
        }
        this.removeSelection();
        this.setHiddenValue();
    };
    ComboBox.prototype.valueMuteChange = function (value) {
        var inputValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? null : value.toString();
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
        this.setProperties({ value: value, text: value, index: null }, true);
        this.activeIndex = this.index;
        var fields = this.fields;
        var dataItem = {};
        dataItem[fields.text] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? null : value.toString();
        dataItem[fields.value] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? null : value.toString();
        this.itemData = dataItem;
        this.item = null;
        if (this.previousValue !== this.value) {
            this.detachChangeEvent(null);
        }
    };
    ComboBox.prototype.updateValues = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            var li = this.getElementByValue(this.value);
            if (li) {
                this.setSelection(li, null);
            }
            else if (this.allowCustom) {
                this.valueMuteChange(this.value);
            }
            else {
                this.valueMuteChange(null);
            }
        }
        else if (this.text && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            var li = this.getElementByText(this.text);
            if (li) {
                this.setSelection(li, null);
            }
            else {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
                this.customValue();
            }
        }
        else {
            this.setSelection(this.liCollections[this.activeIndex], null);
        }
        this.setHiddenValue();
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
    };
    ComboBox.prototype.updateIconState = function () {
        if (this.showClearButton) {
            if (this.inputElement && this.inputElement.value !== '' && !this.readonly) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.clearButton], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].clearIconHide);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.clearButton], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].clearIconHide);
            }
        }
    };
    ComboBox.prototype.getAriaAttributes = function () {
        var ariaAttributes = {
            'aria-owns': this.element.id + '_options',
            'role': 'combobox',
            'aria-autocomplete': 'both',
            'aria-labelledby': this.hiddenElement.id,
            'aria-hasPopup': 'true',
            'aria-expanded': 'false',
            'aria-readonly': this.readonly.toString(),
            'autocomplete': 'off',
            'autocorrect': 'off',
            'autocapitalize': 'off',
            'spellcheck': 'false'
        };
        return ariaAttributes;
    };
    ComboBox.prototype.searchLists = function (e) {
        this.isTyped = true;
        if (this.isFiltering()) {
            _super.prototype.searchLists.call(this, e);
            if (this.ulElement && this.filterInput.value.trim() === '') {
                this.setHoverList(this.ulElement.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].li));
            }
        }
        else {
            if (this.ulElement && this.inputElement.value === '' && this.preventAutoFill) {
                this.setHoverList(this.ulElement.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].li));
            }
            this.incrementalSearch(e);
        }
    };
    ComboBox.prototype.getNgDirective = function () {
        return 'EJS-COMBOBOX';
    };
    ComboBox.prototype.setSearchBox = function () {
        this.filterInput = this.inputElement;
        return (this.isFiltering() ? this.inputWrapper : inputObject);
    };
    ComboBox.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
        if (!this.isServerBlazor) {
            _super.prototype.onActionComplete.call(this, ulElement, list, e);
        }
        if (this.isSelectCustom) {
            this.removeSelection();
        }
        if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
            this.inlineSearch();
        }
    };
    ComboBox.prototype.getFocusElement = function () {
        var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
        var selected = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].selected);
        var isSelected = dataItem.text === this.inputElement.value && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selected);
        if (isSelected) {
            return selected;
        }
        if ((_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !this.isDropDownClick || !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) && this.liCollections.length > 0) {
            var inputValue = this.inputElement.value;
            var activeItem = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_2__["Search"])(inputValue, this.liCollections, 'StartsWith', true);
            var activeElement = activeItem.item;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement)) {
                var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
                var height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
                if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
                    this.removeFocus();
                    var fixedHead = this.fields.groupBy ? this.liCollections[0].offsetHeight : 0;
                    this.list.scrollTop = count * height + fixedHead;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([activeElement], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].focus);
                }
            }
            else {
                if (this.isSelectCustom && this.inputElement.value.trim() !== '') {
                    this.removeFocus();
                    this.list.scrollTop = 0;
                }
            }
            return activeElement;
        }
        else {
            return null;
        }
    };
    ComboBox.prototype.setValue = function (e) {
        if (e && e.type === 'keydown' && e.action === 'enter') {
            this.removeFillSelection();
        }
        if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
            this.preventAutoFill = false;
            this.inlineSearch(e);
            return false;
        }
        else {
            return _super.prototype.setValue.call(this, e);
        }
    };
    ComboBox.prototype.checkCustomValue = function () {
        this.itemData = this.getDataByValue(this.value);
        var dataItem = this.getItemData();
        if (!(this.allowCustom && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem.value) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem.text))) {
            this.setProperties({ 'value': dataItem.value, 'text': dataItem.text }, !this.allowCustom);
        }
    };
    /**
     * Shows the spinner loader.
     * @returns void.

     */
    ComboBox.prototype.showSpinner = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinnerElement)) {
            this.spinnerElement = (this.getModuleName() === 'autocomplete') ? (this.inputWrapper.buttons[0] ||
                this.inputWrapper.clearButton ||
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].appendSpan('e-input-group-icon ' + SPINNER_CLASS, this.inputWrapper.container, this.createElement)) :
                (this.inputWrapper.buttons[0] || this.inputWrapper.clearButton);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.spinnerElement], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].disableIcon);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_3__["createSpinner"])({
                target: this.spinnerElement,
                width: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? '16px' : '14px'
            }, this.createElement);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_3__["showSpinner"])(this.spinnerElement);
        }
    };
    /**
     * Hides the spinner loader.
     * @returns void.

     */
    ComboBox.prototype.hideSpinner = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinnerElement)) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_3__["hideSpinner"])(this.spinnerElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.spinnerElement], _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].disableIcon);
            if (this.spinnerElement.classList.contains(SPINNER_CLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.spinnerElement);
            }
            else {
                this.spinnerElement.innerHTML = '';
            }
            this.spinnerElement = null;
        }
    };
    ComboBox.prototype.setAutoFill = function (activeElement, isHover) {
        if (!isHover) {
            this.setHoverList(activeElement);
        }
        if (this.autofill && !this.preventAutoFill) {
            var currentValue = this.getTextByValue(activeElement.getAttribute('data-value')).toString();
            var currentFillValue = this.getFormattedValue(activeElement.getAttribute('data-value'));
            if (this.getModuleName() === 'combobox') {
                if (!this.isSelected && this.previousValue !== currentFillValue) {
                    this.updateSelectedItem(activeElement, null);
                    this.isSelected = true;
                    this.previousValue = this.getFormattedValue(activeElement.getAttribute('data-value'));
                }
                else {
                    this.updateSelectedItem(activeElement, null, true);
                }
            }
            if (!this.isAndroidAutoFill(currentValue)) {
                this.setAutoFillSelection(currentValue);
            }
        }
    };
    ComboBox.prototype.isAndroidAutoFill = function (value) {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isAndroid) {
            var currentPoints = this.getSelectionPoints();
            var prevEnd = this.prevSelectPoints.end;
            var curEnd = currentPoints.end;
            var prevStart = this.prevSelectPoints.start;
            var curStart = currentPoints.start;
            if (prevEnd !== 0 && ((prevEnd === value.length && prevStart === value.length) ||
                (prevStart > curStart && prevEnd > curEnd) || (prevEnd === curEnd && prevStart === curStart))) {
                return true;
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }
    };
    ComboBox.prototype.clearAll = function (e, property) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(property.dataSource))) {
            _super.prototype.clearAll.call(this, e);
            if (this.isServerBlazor && this.isFiltering() && this.isPopupOpen && e) {
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnServerRenderList', this.beforePopupOpen, true);
            }
        }
    };
    ComboBox.prototype.isSelectFocusItem = function (element) {
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element);
    };
    ComboBox.prototype.inlineSearch = function (e) {
        var isKeyNavigate = (e && (e.action === 'down' || e.action === 'up' ||
            e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown'));
        var activeElement = isKeyNavigate ? this.liCollections[this.activeIndex] : this.getFocusElement();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement)) {
            if (!isKeyNavigate) {
                var value = this.getFormattedValue(activeElement.getAttribute('data-value'));
                this.activeIndex = this.getIndexByValue(value);
                this.activeIndex = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex) ? this.activeIndex : null;
            }
            this.preventAutoFill = this.inputElement.value === '' ? false : this.preventAutoFill;
            this.setAutoFill(activeElement, isKeyNavigate);
        }
        else if (this.inputElement.value === '') {
            this.activeIndex = null;
            this.list.scrollTop = 0;
            var focusItem = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].li);
            this.setHoverList(focusItem);
        }
        else {
            this.activeIndex = null;
            this.removeSelection();
            if (this.liCollections && this.liCollections.length < 0) {
                this.removeFocus();
            }
        }
    };
    ComboBox.prototype.incrementalSearch = function (e) {
        this.showPopup();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData)) {
            this.inlineSearch(e);
            e.preventDefault();
        }
    };
    ;
    ComboBox.prototype.setAutoFillSelection = function (currentValue) {
        var selection = this.getSelectionPoints();
        var value = this.inputElement.value.substr(0, selection.start);
        if (value && (value.toLowerCase() === currentValue.substr(0, selection.start).toLowerCase())) {
            var inputValue = value + currentValue.substr(value.length, currentValue.length);
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
            this.inputElement.setSelectionRange(selection.start, this.inputElement.value.length);
        }
        else {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(currentValue, this.inputElement, this.floatLabelType, this.showClearButton);
            this.inputElement.setSelectionRange(0, this.inputElement.value.length);
        }
    };
    ;
    ComboBox.prototype.getValueByText = function (text) {
        return _super.prototype.getValueByText.call(this, text, true, this.ignoreAccent);
    };
    ComboBox.prototype.unWireEvent = function () {
        if (this.getModuleName() === 'combobox') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown', this.preventBlur);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.container, 'blur', this.onBlur);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputWrapper.buttons[0])) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.buttons[0], 'mousedown', this.dropDownClick);
        }
        if (this.inputElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'focus', this.targetFocus);
            if (!this.readonly) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'input', this.onInput);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'keyup', this.onFilterUp);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'keydown', this.onFilterDown);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'paste', this.pasteHandler);
            }
        }
        this.unBindCommonEvent();
    };
    ComboBox.prototype.setSelection = function (li, e) {
        _super.prototype.setSelection.call(this, li, e);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && !this.autofill && !this.isDropDownClick) {
            this.removeFocus();
        }
    };
    ComboBox.prototype.selectCurrentItem = function (e) {
        var li;
        if (this.isPopupOpen) {
            if (this.isSelected) {
                li = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].selected);
            }
            else {
                li = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].focus);
            }
            if (li) {
                this.setSelection(li, e);
                this.isTyped = false;
            }
            if (this.isSelected) {
                this.isSelectCustom = false;
                this.onChangeEvent(e);
            }
        }
        if (e.action === 'enter' && this.inputElement.value.trim() === '') {
            this.clearAll(e);
        }
        else if (this.isTyped && !this.isSelected && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
            this.customValue(e);
        }
        this.hidePopup();
    };
    ComboBox.prototype.setHoverList = function (li) {
        this.removeSelection();
        if (this.isValidLI(li) && !li.classList.contains(_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].selected)) {
            this.removeFocus();
            li.classList.add(_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].focus);
        }
    };
    ;
    ComboBox.prototype.targetFocus = function (e) {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !this.allowFiltering) {
            this.preventFocus = false;
        }
        this.onFocus(e);
    };
    ComboBox.prototype.dropDownClick = function (e) {
        e.preventDefault();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !this.allowFiltering) {
            this.preventFocus = true;
        }
        _super.prototype.dropDownClick.call(this, e);
    };
    ComboBox.prototype.customValue = function (e) {
        var _this = this;
        var value = this.getValueByText(this.inputElement.value);
        if (!this.allowCustom && this.inputElement.value !== '') {
            var previousValue = this.previousValue;
            var currentValue = this.value;
            this.setProperties({ value: value });
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
            }
            if (this.autofill && previousValue === this.value && currentValue !== this.value) {
                this.onChangeEvent(null);
            }
        }
        else if (this.inputElement.value.trim() !== '') {
            var previousValue_1 = this.value;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
                var value_1 = this.inputElement.value === '' ? null : this.inputElement.value;
                var eventArgs = void 0;
                eventArgs = { text: value_1, item: {} };
                if (!this.initial) {
                    this.trigger('customValueSpecifier', eventArgs, function (eventArgs) {
                        _this.updateCustomValueCallback(value_1, eventArgs, previousValue_1, e);
                    });
                }
                else {
                    this.updateCustomValueCallback(value_1, eventArgs, previousValue_1);
                }
            }
            else {
                this.isSelectCustom = false;
                this.setProperties({ value: value });
                if (previousValue_1 !== this.value) {
                    this.onChangeEvent(e);
                }
            }
        }
        else if (this.allowCustom) {
            this.isSelectCustom = true;
        }
    };
    ComboBox.prototype.updateCustomValueCallback = function (value, eventArgs, previousValue, e) {
        var fields = this.fields;
        var item = eventArgs.item;
        var dataItem = {};
        if (item && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, item) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item)) {
            dataItem = item;
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(fields.text, value, dataItem);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(fields.value, value, dataItem);
        }
        this.itemData = dataItem;
        var changeData = {
            text: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, this.itemData),
            value: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, this.itemData),
            index: null
        };
        this.setProperties(changeData, true);
        this.setSelection(null, null);
        this.isSelectCustom = true;
        if (previousValue !== this.value) {
            this.onChangeEvent(e);
        }
    };
    /**
     * Dynamically change the value of properties.
     * @private
     */
    ComboBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (this.getModuleName() === 'combobox') {
            this.checkData(newProp);
            this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setReadonly(this.readonly, this.inputElement);
                    if (this.readonly) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'input', this.onInput);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'keyup', this.onFilterUp);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputElement, 'keydown', this.onFilterDown);
                    }
                    else {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'input', this.onInput, this);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'keyup', this.onFilterUp, this);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputElement, 'keydown', this.onFilterDown, this);
                    }
                    break;
                case 'allowFiltering':
                    this.setSearchBox();
                    if (this.isFiltering() && this.getModuleName() === 'combobox' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list)) {
                        _super.prototype.renderList.call(this);
                    }
                    break;
                case 'allowCustom':
                    break;
                default:
                    var comboProps = void 0;
                    comboProps = this.getPropObject(prop, newProp, oldProp);
                    _super.prototype.onPropertyChanged.call(this, comboProps.newProperty, comboProps.oldProperty);
                    break;
            }
        }
    };
    /**
     * To initialize the control rendering.
     * @private
     */
    ComboBox.prototype.render = function () {
        _super.prototype.render.call(this);
        this.setSearchBox();
        if (this.isFiltering() && this.getModuleName() === 'combobox' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list)) {
            _super.prototype.renderList.call(this);
        }
        this.renderComplete();
    };
    ;
    /**
     * Return the module name of this component.
     * @private
     */
    ComboBox.prototype.getModuleName = function () {
        return 'combobox';
    };
    /**
     * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
     * but you can insert based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
     * @return {void}.

     */
    ComboBox.prototype.addItem = function (items, itemIndex) {
        _super.prototype.addItem.call(this, items, itemIndex);
    };
    /**
     * To filter the data from given data source by using query
     * @param  {Object[] | DataManager } dataSource - Set the data source to filter.
     * @param  {Query} query - Specify the query to filter the data.
     * @param  {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
     * @return {void}.

     */
    ComboBox.prototype.filter = function (dataSource, query, fields) {
        _super.prototype.filter.call(this, dataSource, query, fields);
    };
    /**
     * Opens the popup that displays the list of items.
     * @returns void.

     */
    ComboBox.prototype.showPopup = function () {
        _super.prototype.showPopup.call(this);
    };
    /**
     * Hides the popup if it is in open state.
     * @returns void.

     */
    ComboBox.prototype.hidePopup = function (e) {
        var inputValue = this.inputElement && this.inputElement.value === '' ? null
            : this.inputElement && this.inputElement.value;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData)) {
            var isEscape = this.isEscapeKey;
            if (this.isEscapeKey) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].setValue(this.typedString, this.inputElement, this.floatLabelType, this.showClearButton);
                this.isEscapeKey = false;
            }
            if (this.autofill) {
                this.removeFillSelection();
            }
            var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
            var selected = this.list.querySelector('.' + _drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["dropDownListClasses"].selected);
            if (this.inputElement && dataItem.text === this.inputElement.value && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selected)) {
                if (this.isSelected) {
                    this.onChangeEvent(e);
                    this.isSelectCustom = false;
                }
                _super.prototype.hidePopup.call(this, e);
                return;
            }
            if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
                var searchItem = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_2__["Search"])(this.inputElement.value, this.liCollections, 'Equal', true);
                this.selectedLI = searchItem.item;
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(searchItem.index)) {
                    searchItem.index = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_2__["Search"])(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
                }
                this.activeIndex = searchItem.index;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI)) {
                    this.updateSelectedItem(this.selectedLI, null, true);
                }
                else if (isEscape) {
                    this.isSelectCustom = true;
                    this.removeSelection();
                }
            }
            if (!this.isEscapeKey && this.isTyped && !this.isInteracted) {
                this.customValue(e);
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData) && this.allowCustom && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputValue) && inputValue !== this.value) {
            this.customValue();
        }
        _super.prototype.hidePopup.call(this, e);
    };
    /**
     * Sets the focus to the component for interaction.
     * @returns void.
     */
    ComboBox.prototype.focusIn = function () {
        if (!this.enabled) {
            return;
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !this.allowFiltering) {
            this.preventFocus = true;
        }
        _super.prototype.focusIn.call(this);
    };
    /**
     * Allows you to clear the selected values from the component.
     * @returns void.

     */
    ComboBox.prototype.clear = function () {
        this.value = null;
    };
    /**
     * Moves the focus from the component if the component is already focused.
     * @returns void.

     */
    ComboBox.prototype.focusOut = function (e) {
        _super.prototype.focusOut.call(this, e);
    };
    /**
     * Gets all the list items bound on this component.
     * @returns Element[].

     */
    ComboBox.prototype.getItems = function () {
        return _super.prototype.getItems.call(this);
    };
    /**
     * Gets the data Object that matches the given value.
     * @param { string | number } value - Specifies the value of the list item.
     * @returns Object.
     * @blazorType object

     */
    ComboBox.prototype.getDataByValue = function (value) {
        return _super.prototype.getDataByValue.call(this, value);
    };
    ComboBox.prototype.renderHightSearch = function () {
        // update high light search 
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ComboBox.prototype, "autofill", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ComboBox.prototype, "allowCustom", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], ComboBox.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ComboBox.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "index", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ComboBox.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ComboBox.prototype, "enableRtl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ComboBox.prototype, "customValueSpecifier", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ComboBox.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "valueTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], ComboBox.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "footerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], ComboBox.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('300px')
    ], ComboBox.prototype, "popupHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], ComboBox.prototype, "popupWidth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ComboBox.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ComboBox.prototype, "value", void 0);
    ComboBox = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], ComboBox);
    return ComboBox;
}(_drop_down_list_drop_down_list__WEBPACK_IMPORTED_MODULE_1__["DropDownList"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/index.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/index.js ***!
  \************************************************************************/
/*! exports provided: ComboBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _combo_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combo-box */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/combo-box.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComboBox", function() { return _combo_box__WEBPACK_IMPORTED_MODULE_0__["ComboBox"]; });

/**
 * export all modules from current location
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/highlight-search.js":
/*!********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/highlight-search.js ***!
  \********************************************************************************/
/*! exports provided: highlightSearch, revertHighlightSearch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "highlightSearch", function() { return highlightSearch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revertHighlightSearch", function() { return revertHighlightSearch; });
/**
 * Function helps to find which highlightSearch is to call based on your data.
 * @param  {HTMLElement} element - Specifies an li element.
 * @param  {string} query - Specifies the string to be highlighted.
 * @param  {boolean} ignoreCase - Specifies the ignoreCase option.
 * @param  {HightLightType} type - Specifies the type of highlight.
 */
function highlightSearch(element, query, ignoreCase, type, isBlazor) {
    if (query === '') {
        return;
    }
    else {
        var ignoreRegex = ignoreCase ? 'gim' : 'gm';
        query = /^[a-zA-Z0-9- ]*$/.test(query) ? query : query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
        var replaceQuery = type === 'StartsWith' ? '^(' + query + ')' : type === 'EndsWith' ? '(' + query + ')$' : '(' + query + ')';
        findTextNode(element, new RegExp(replaceQuery, ignoreRegex), isBlazor);
    }
}
function findTextNode(element, pattern, isBlazor) {
    for (var index = 0; element.childNodes && (index < element.childNodes.length); index++) {
        if (element.childNodes[index].nodeType === 3 && element.childNodes[index].textContent.trim() !== '') {
            element = (isBlazor && element.classList.contains('e-highlight')) ? element.parentElement : element;
            if (isBlazor && element.getAttribute('data-value')) {
                element.innerHTML = element.getAttribute('data-value').replace(pattern, '<span class="e-highlight">$1</span>');
            }
            else {
                var value = element.childNodes[index].nodeValue.trim().replace(pattern, '<span class="e-highlight">$1</span>');
                element.childNodes[index].nodeValue = '';
                element.innerHTML = element.innerHTML.trim() + value;
            }
            break;
        }
        else {
            findTextNode(element.childNodes[index], pattern, isBlazor);
        }
    }
}
/**
 * Function helps to remove highlighted element based on your data.
 * @param  {HTMLElement} content - Specifies an content element.
 */
function revertHighlightSearch(content) {
    var contentElement = content.querySelectorAll('.e-highlight');
    for (var i = contentElement.length - 1; i >= 0; i--) {
        var parent_1 = contentElement[i].parentNode;
        var text = document.createTextNode(contentElement[i].textContent);
        parent_1.replaceChild(text, contentElement[i]);
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js ***!
  \**********************************************************************************/
/*! exports provided: incrementalSearch, Search */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "incrementalSearch", function() { return incrementalSearch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return Search; });
/**
 * IncrementalSearch module file
 */
var queryString = '';
var prevString = '';
var matches = [];
var activeClass = 'e-active';
var prevElementId = '';
/**
 * Search and focus the list item based on key code matches with list text content
 * @param  { number } keyCode - Specifies the key code which pressed on keyboard events.
 * @param  { HTMLElement[]] } items - Specifies an array of HTMLElement, from which matches find has done.
 * @param { number } selectedIndex - Specifies the selected item in list item, so that search will happen
 * after selected item otherwise it will do from initial.
 * @param  { boolean } ignoreCase - Specifies the case consideration when search has done.
 */
function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId, isBlazor) {
    queryString += String.fromCharCode(keyCode);
    setTimeout(function () { queryString = ''; }, 1000);
    var index;
    queryString = ignoreCase ? queryString.toLowerCase() : queryString;
    if (prevElementId === elementId && prevString === queryString) {
        for (var i = 0; i < matches.length; i++) {
            if (matches[i].classList.contains(activeClass)) {
                index = i;
                break;
            }
        }
        index = index + 1;
        return matches[index];
    }
    else {
        var listItems = items;
        var strLength = queryString.length;
        var text = void 0;
        var item = void 0;
        selectedIndex = selectedIndex ? selectedIndex + 1 : 0;
        var i = selectedIndex;
        matches = [];
        do {
            if (i === listItems.length) {
                i = -1;
            }
            i === -1 ? index = 0 : index = i;
            item = listItems[index];
            if (isBlazor) {
                text = ignoreCase ? item.textContent.trim().toLowerCase() : item.textContent.trim();
            }
            else {
                text = ignoreCase ? item.innerText.toLowerCase() : item.innerText;
            }
            if (text.substr(0, strLength) === queryString) {
                matches.push(listItems[index]);
            }
            i++;
        } while (i !== selectedIndex);
        prevString = queryString;
        prevElementId = elementId;
        return matches[0];
    }
}
function Search(inputVal, items, searchType, ignoreCase) {
    var listItems = items;
    ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
    var itemData = { item: null, index: null };
    if (inputVal && inputVal.length) {
        var strLength = inputVal.length;
        var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
        for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
            var item = itemsData[i];
            var text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
            if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr)) {
                itemData.item = item;
                itemData.index = i;
                return { item: item, index: i };
            }
        }
        return itemData;
    }
    return itemData;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/index.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/index.js ***!
  \*********************************************************************/
/*! exports provided: incrementalSearch, Search, highlightSearch, revertHighlightSearch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _incremental_search__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./incremental-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "incrementalSearch", function() { return _incremental_search__WEBPACK_IMPORTED_MODULE_0__["incrementalSearch"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return _incremental_search__WEBPACK_IMPORTED_MODULE_0__["Search"]; });

/* harmony import */ var _highlight_search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./highlight-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/highlight-search.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "highlightSearch", function() { return _highlight_search__WEBPACK_IMPORTED_MODULE_1__["highlightSearch"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "revertHighlightSearch", function() { return _highlight_search__WEBPACK_IMPORTED_MODULE_1__["revertHighlightSearch"]; });

/**
 * Common source
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js ***!
  \**************************************************************************************/
/*! exports provided: FieldSettings, dropDownBaseClasses, DropDownBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return FieldSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropDownBaseClasses", function() { return dropDownBaseClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropDownBase", function() { return DropDownBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






var FieldSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(FieldSettings, _super);
    function FieldSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldSettings.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldSettings.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldSettings.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldSettings.prototype, "groupBy", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldSettings.prototype, "htmlAttributes", void 0);
    return FieldSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

var dropDownBaseClasses = {
    root: 'e-dropdownbase',
    rtl: 'e-rtl',
    content: 'e-content',
    selected: 'e-active',
    hover: 'e-hover',
    noData: 'e-nodata',
    fixedHead: 'e-fixed-head',
    focus: 'e-item-focus',
    li: 'e-list-item',
    group: 'e-list-group-item',
    disabled: 'e-disabled',
    grouping: 'e-dd-group'
};
var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
var VALUETEMPLATE_PROPERTY = 'ValueTemplate';
var GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
var FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';
var NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';
var ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';
/**
 * DropDownBase component will generate the list items based on given data and act as base class to drop-down related components
 */
var DropDownBase = /** @__PURE__ @class */ (function (_super) {
    __extends(DropDownBase, _super);
    /**
     * * Constructor for DropDownBase class
     */
    function DropDownBase(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.preventChange = false;
        _this.isAngular = false;
        _this.isPreventChange = false;
        return _this;
    }
    ;
    DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
        var newProperty = new Object();
        var oldProperty = new Object();
        // tslint:disable-next-line:no-function-constructor-with-string-args
        var propName = function (prop) {
            return prop;
        };
        newProperty[propName(prop)] = newProp[propName(prop)];
        oldProperty[propName(prop)] = oldProp[propName(prop)];
        var data = new Object();
        data.newProperty = newProperty;
        data.oldProperty = oldProperty;
        return data;
    };
    DropDownBase.prototype.getValueByText = function (text, ignoreCase, ignoreAccent) {
        var value = null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData)) {
            if (ignoreCase) {
                value = this.checkValueCase(text, true, ignoreAccent);
            }
            else {
                value = this.checkValueCase(text, false, ignoreAccent);
            }
        }
        return value;
    };
    ;
    DropDownBase.prototype.checkValueCase = function (text, ignoreCase, ignoreAccent, isTextByValue) {
        var _this = this;
        var value = null;
        if (isTextByValue) {
            value = text;
        }
        var dataSource = this.listData;
        var fields = this.fields;
        var type = this.typeOfData(dataSource).typeof;
        if (type === 'string' || type === 'number' || type === 'boolean') {
            for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {
                var item = dataSource_1[_i];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                    if (ignoreAccent) {
                        value = this.checkingAccent(String(item), text, ignoreCase);
                    }
                    else {
                        if (ignoreCase) {
                            if (this.checkIgnoreCase(String(item), text)) {
                                value = this.getItemValue(String(item), text, ignoreCase);
                            }
                        }
                        else {
                            if (this.checkNonIgnoreCase(String(item), text)) {
                                value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);
                            }
                        }
                    }
                }
            }
        }
        else {
            if (ignoreCase) {
                dataSource.filter(function (item) {
                    var itemValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemValue) && _this.checkIgnoreCase(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, item).toString(), text)) {
                        value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item);
                    }
                });
            }
            else {
                if (isTextByValue) {
                    dataSource.filter(function (item) {
                        var itemValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemValue) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && itemValue.toString() === value.toString()) {
                            value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, item);
                        }
                    });
                }
                else {
                    dataSource.filter(function (item) {
                        if (_this.checkNonIgnoreCase(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, item), text)) {
                            value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item);
                        }
                    });
                }
            }
        }
        return value;
    };
    DropDownBase.prototype.checkingAccent = function (item, text, ignoreCase) {
        var dataItem = _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].ignoreDiacritics(String(item));
        var textItem = _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataUtil"].ignoreDiacritics(text.toString());
        var value = null;
        if (ignoreCase) {
            if (this.checkIgnoreCase(dataItem, textItem)) {
                value = this.getItemValue(String(item), text, ignoreCase);
            }
        }
        else {
            if (this.checkNonIgnoreCase(String(item), text)) {
                value = this.getItemValue(String(item), text, ignoreCase);
            }
        }
        return value;
    };
    DropDownBase.prototype.checkIgnoreCase = function (item, text) {
        return String(item).toLowerCase() === text.toString().toLowerCase() ? true : false;
    };
    DropDownBase.prototype.checkNonIgnoreCase = function (item, text) {
        return String(item) === text.toString() ? true : false;
    };
    DropDownBase.prototype.getItemValue = function (dataItem, typedText, ignoreCase, isTextByValue) {
        var value = null;
        var dataSource = this.listData;
        var type = this.typeOfData(dataSource).typeof;
        if (isTextByValue) {
            value = dataItem.toString();
        }
        else {
            if (ignoreCase) {
                value = type === 'string' ? String(dataItem) : this.getFormattedValue(String(dataItem));
            }
            else {
                value = type === 'string' ? typedText : this.getFormattedValue(typedText);
            }
        }
        return value;
    };
    DropDownBase.prototype.templateCompiler = function (baseTemplate) {
        var checkTemplate = false;
        if (baseTemplate) {
            var exception = void 0;
            try {
                checkTemplate = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(baseTemplate, document).length) ? true : false;
            }
            catch (exception) {
                checkTemplate = false;
            }
        }
        return checkTemplate;
    };
    DropDownBase.prototype.l10nUpdate = function (actionFailure) {
        var ele = this.getModuleName() === 'listbox' ? this.ulElement : this.list;
        if (this.noRecordsTemplate !== 'No records found' || this.actionFailureTemplate !== 'Request failed') {
            this.DropDownBaseresetBlazorTemplates(false, false, true, true);
            var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
            var compiledString = void 0;
            var templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
            ele.innerHTML = '';
            var tempaltecheck = this.templateCompiler(template);
            if (tempaltecheck) {
                compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(template, document).innerHTML.trim());
            }
            else {
                compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
            }
            var templateName = actionFailure ? 'actionFailureTemplate' : 'noRecordsTemplate';
            // tslint:disable-next-line
            var noDataCompTemp = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);
            if (noDataCompTemp && noDataCompTemp.length > 0) {
                for (var i = 0; i < noDataCompTemp.length; i++) {
                    ele.appendChild(noDataCompTemp[i]);
                }
            }
            this.DropDownBaseupdateBlazorTemplates(false, false, !actionFailure, actionFailure, false, false, false, false);
        }
        else {
            var l10nLocale = { noRecordsTemplate: 'No records found', actionFailureTemplate: 'Request failed' };
            var componentLocale = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getLocaleName(), {}, this.locale);
            if (componentLocale.getConstant('actionFailureTemplate') !== '') {
                this.l10n = componentLocale;
            }
            else {
                this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getModuleName() === 'listbox' ? 'listbox' : 'dropdowns', l10nLocale, this.locale);
            }
            var content = actionFailure ?
                this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
            if (this.getModuleName() === 'listbox') {
                var liElem = this.createElement('li');
                liElem.textContent = content;
                ele.appendChild(liElem);
                liElem.classList.add('e-list-nrt');
            }
            else {
                ele.innerHTML = content;
            }
        }
    };
    DropDownBase.prototype.getLocaleName = function () {
        return 'drop-down-base';
    };
    ;
    DropDownBase.prototype.getTextByValue = function (value) {
        var text;
        text = this.checkValueCase(value, false, false, true);
        return text;
    };
    DropDownBase.prototype.getFormattedValue = function (value) {
        if (this.listData && this.listData.length) {
            var item = this.typeOfData(this.listData);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) || value === 'null') {
                return null;
            }
            if (typeof Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((this.fields.value ? this.fields.value : 'value'), item.item) === 'number'
                || item.typeof === 'number') {
                return parseFloat(value);
            }
            if (typeof Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((this.fields.value ? this.fields.value : 'value'), item.item) === 'boolean'
                || item.typeof === 'boolean') {
                return (value === 'true');
            }
        }
        return value;
    };
    /**
     * Sets RTL to dropdownbase wrapper
     */
    DropDownBase.prototype.setEnableRtl = function () {
        if (this.list) {
            this.enableRtlElements.push(this.list);
        }
        this.enableRtl ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(this.enableRtlElements, dropDownBaseClasses.rtl) :
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.enableRtlElements, dropDownBaseClasses.rtl);
    };
    ;
    /**
     * Initialize the Component.
     */
    DropDownBase.prototype.initialize = function () {
        this.bindEvent = true;
        this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
        if (this.element.tagName === 'UL') {
            var jsonElement = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createJsonFromElement(this.element);
            this.setProperties({ fields: { text: 'text', value: 'text' } }, true);
            this.resetList(jsonElement, this.fields);
        }
        else if (this.element.tagName === 'SELECT') {
            var dataSource = this.dataSource instanceof Array ? (this.dataSource.length > 0 ? true : false)
                : !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dataSource) ? true : false;
            if (!dataSource) {
                this.renderItemsBySelect();
            }
        }
        else {
            this.setListData(this.dataSource, this.fields, this.query);
        }
    };
    ;
    DropDownBase.prototype.DropDownBaseupdateBlazorTemplates = function (item, group, noRecord, action, value, header, footer, isEmpty) {
        if (!this.isStringTemplate) {
            if (this.itemTemplate && item) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.itemTemplateId, ITEMTEMPLATE_PROPERTY, this, isEmpty);
            }
            if (this.groupTemplate && group) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.groupTemplateId, GROUPTEMPLATE_PROPERTY, this, isEmpty);
            }
            if (this.noRecordsTemplate && noRecord) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.noRecordsTemplateId, NORECORDSTEMPLATE_PROPERTY, this, isEmpty);
            }
            if (this.actionFailureTemplate && action) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.actionFailureTemplateId, ACTIONFAILURETEMPLATE_PROPERTY, this, isEmpty);
            }
            if (value) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.valueTemplateId, VALUETEMPLATE_PROPERTY, this, isEmpty);
            }
            if (header) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.headerTemplateId, HEADERTEMPLATE_PROPERTY, this);
            }
            if (footer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.footerTemplateId, FOOTERTEMPLATE_PROPERTY, this);
            }
        }
    };
    DropDownBase.prototype.DropDownBaseresetBlazorTemplates = function (item, group, noRecord, action, value, header, footer) {
        if (!this.isStringTemplate) {
            if (this.itemTemplate && item) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.itemTemplateId, ITEMTEMPLATE_PROPERTY);
            }
            if (this.groupTemplate && group) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.groupTemplateId, GROUPTEMPLATE_PROPERTY);
            }
            if (this.noRecordsTemplate && noRecord) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.noRecordsTemplateId, NORECORDSTEMPLATE_PROPERTY);
            }
            if (this.actionFailureTemplate && action) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.actionFailureTemplateId, ACTIONFAILURETEMPLATE_PROPERTY);
            }
            if (value) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.valueTemplateId, VALUETEMPLATE_PROPERTY);
            }
            if (header) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.headerTemplateId, HEADERTEMPLATE_PROPERTY);
            }
            if (footer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.footerTemplateId, FOOTERTEMPLATE_PROPERTY);
            }
        }
    };
    /**
     * Get the properties to be maintained in persisted state.
     */
    DropDownBase.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    ;
    /**
     * Sets the enabled state to DropDownBase.
     */
    DropDownBase.prototype.setEnabled = function () {
        this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
    };
    ;
    /**
     * Sets the enabled state to DropDownBase.
     */
    DropDownBase.prototype.updateDataAttribute = function (value) {
        var invalidAttr = ['class', 'style', 'id', 'type'];
        var attr = {};
        for (var a = 0; a < this.element.attributes.length; a++) {
            if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
                !(this.getModuleName() === 'dropdownlist' && this.element.attributes[a].name === 'readonly')) {
                attr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(attr, value, attr);
        this.setProperties({ htmlAttributes: attr }, true);
    };
    DropDownBase.prototype.renderItemsBySelect = function () {
        var element = this.element;
        var fields = { value: 'value', text: 'text' };
        var jsonElement = [];
        var group = element.querySelectorAll('select>optgroup');
        var option = element.querySelectorAll('select>option');
        this.getJSONfromOption(jsonElement, option, fields);
        if (group.length) {
            for (var i = 0; i < group.length; i++) {
                var item = group[i];
                var optionGroup = {};
                optionGroup[fields.text] = item.label;
                optionGroup.isHeader = true;
                var child = item.querySelectorAll('option');
                jsonElement.push(optionGroup);
                this.getJSONfromOption(jsonElement, child, fields);
            }
            var items = element.querySelectorAll('select>option');
        }
        this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss);
        this.resetList(jsonElement, fields);
    };
    DropDownBase.prototype.updateFields = function (text, value, groupBy, htmlAttributes, iconCss) {
        var field = {
            'fields': {
                text: text,
                value: value,
                groupBy: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupBy) ? groupBy : this.fields && this.fields.groupBy,
                htmlAttributes: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(htmlAttributes) ? htmlAttributes : this.fields && this.fields.htmlAttributes,
                iconCss: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconCss) ? iconCss : this.fields && this.fields.iconCss
            }
        };
        this.setProperties(field, true);
    };
    DropDownBase.prototype.getJSONfromOption = function (items, options, fields) {
        for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
            var option = options_1[_i];
            var json = {};
            json[fields.text] = option.innerText;
            json[fields.value] = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.getAttribute(fields.value)) ?
                option.getAttribute(fields.value) : option.innerText;
            items.push(json);
        }
    };
    /**
     * Execute before render the list items
     * @private
     */
    DropDownBase.prototype.preRender = function () {
        // there is no event handler
        this.scrollTimer = -1;
        this.enableRtlElements = [];
        this.isRequested = false;
        this.isDataFetched = false;
        this.itemTemplateId = "" + this.element.id + ITEMTEMPLATE_PROPERTY;
        this.valueTemplateId = "" + this.element.id + VALUETEMPLATE_PROPERTY;
        this.groupTemplateId = "" + this.element.id + GROUPTEMPLATE_PROPERTY;
        this.headerTemplateId = "" + this.element.id + HEADERTEMPLATE_PROPERTY;
        this.footerTemplateId = "" + this.element.id + FOOTERTEMPLATE_PROPERTY;
        this.noRecordsTemplateId = "" + this.element.id + NORECORDSTEMPLATE_PROPERTY;
    };
    /**
     * Creates the list items of DropDownBase component.
     */
    DropDownBase.prototype.setListData = function (dataSource, fields, query) {
        var _this = this;
        fields = fields ? fields : this.fields;
        var ulElement;
        this.isActive = true;
        var eventArgs = { cancel: false, data: dataSource, query: query };
        this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
        this.trigger('actionBegin', eventArgs, function (eventArgs) {
            if (!eventArgs.cancel) {
                _this.showSpinner();
                if (dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]) {
                    _this.isRequested = true;
                    if (_this.isDataFetched) {
                        _this.emptyDataRequest(fields);
                        return;
                    }
                    eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
                        _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
                        _this.trigger('actionComplete', e, function (e) {
                            if (!e.cancel) {
                                var listItems = e.result;
                                if (listItems.length === 0) {
                                    _this.isDataFetched = true;
                                }
                                ulElement = _this.renderItems(listItems, fields);
                                _this.onActionComplete(ulElement, listItems, e);
                                if (_this.groupTemplate) {
                                    _this.renderGroupTemplate(ulElement);
                                }
                                _this.isRequested = false;
                                _this.bindChildItems(listItems, ulElement, fields, e);
                            }
                        });
                    }).catch(function (e) {
                        _this.isRequested = false;
                        _this.onActionFailure(e);
                        _this.hideSpinner();
                    });
                }
                else {
                    var dataManager = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](eventArgs.data);
                    var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
                    var localDataArgs = { cancel: false, result: listItems };
                    _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
                    _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
                        if (!localDataArgs.cancel) {
                            ulElement = _this.renderItems(localDataArgs.result, fields);
                            _this.onActionComplete(ulElement, localDataArgs.result);
                            if (_this.groupTemplate) {
                                _this.renderGroupTemplate(ulElement);
                            }
                            _this.bindChildItems(localDataArgs.result, ulElement, fields);
                        }
                    });
                }
            }
        });
    };
    DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {
        var _this = this;
        if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {
            setTimeout(function () {
                var childNode = _this.remainingItems(_this.sortedData, fields);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(childNode, ulElement);
                _this.DropDownBaseupdateBlazorTemplates(true, false, false, false);
                _this.liCollections = _this.list.querySelectorAll('.' + dropDownBaseClasses.li);
                _this.updateListValues();
                _this.raiseDataBound(listItems, e);
            }, 0);
        }
        else {
            this.raiseDataBound(listItems, e);
        }
    };
    DropDownBase.prototype.updateListValues = function () {
        // Used this method in component side.
    };
    DropDownBase.prototype.findListElement = function (list, findNode, attribute, value) {
        var liElement = null;
        if (list) {
            var listArr = [].slice.call(list.querySelectorAll(findNode));
            for (var index = 0; index < listArr.length; index++) {
                if (listArr[index].getAttribute(attribute) === (value + '')) {
                    liElement = listArr[index];
                    break;
                }
            }
        }
        return liElement;
    };
    DropDownBase.prototype.raiseDataBound = function (listItems, e) {
        this.hideSpinner();
        var dataBoundEventArgs = {
            items: listItems,
            e: e
        };
        this.trigger('dataBound', dataBoundEventArgs);
    };
    DropDownBase.prototype.remainingItems = function (dataSource, fields) {
        var spliceData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](dataSource).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().skip(100));
        if (this.itemTemplate) {
            var listElements = this.templateListItem(spliceData, fields);
            return [].slice.call(listElements.childNodes);
        }
        var type = this.typeOfData(spliceData).typeof;
        if (type === 'string' || type === 'number' || type === 'boolean') {
            return _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromArray(this.createElement, spliceData, true, this.listOption(spliceData, fields), this);
        }
        return _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromJson(this.createElement, spliceData, this.listOption(spliceData, fields), 1, true, this);
    };
    DropDownBase.prototype.emptyDataRequest = function (fields) {
        var listItems = [];
        this.onActionComplete(this.renderItems(listItems, fields), listItems);
        this.isRequested = false;
        this.hideSpinner();
    };
    DropDownBase.prototype.showSpinner = function () {
        // Used this method in component side.
    };
    DropDownBase.prototype.hideSpinner = function () {
        // Used this method in component side.
    };
    DropDownBase.prototype.onActionFailure = function (e) {
        this.liCollections = [];
        this.trigger('actionFailure', e);
        this.l10nUpdate(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.list], dropDownBaseClasses.noData);
    };
    DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
        this.listData = list;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.getModuleName() === 'listbox') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.list.querySelector('.e-list-parent'));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.list.querySelector('.e-hidden-select'));
        }
        else {
            // tslint:disable-next-line         
            if (this.isReact) {
                this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
            }
            this.list.innerHTML = '';
        }
        this.fixedHeaderElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
        this.list.appendChild(ulElement);
        this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
        this.ulElement = this.list.querySelector('ul');
        this.postRender(this.list, list, this.bindEvent);
    };
    DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {
        var focusItem = listElement.querySelector('.' + dropDownBaseClasses.li);
        var selectedItem = listElement.querySelector('.' + dropDownBaseClasses.selected);
        if (focusItem && !selectedItem) {
            focusItem.classList.add(dropDownBaseClasses.focus);
        }
        if (list.length <= 0) {
            this.l10nUpdate();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([listElement], dropDownBaseClasses.noData);
        }
        else {
            listElement.classList.remove(dropDownBaseClasses.noData);
        }
    };
    /**
     * Get the query to do the data operation before list item generation.
     */
    DropDownBase.prototype.getQuery = function (query) {
        return query ? query : this.query ? this.query : new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]();
    };
    /**
     * To render the template content for group header element.
     */
    DropDownBase.prototype.renderGroupTemplate = function (listEle) {
        if (this.fields.groupBy !== null && this.dataSource || this.element.querySelector('.' + dropDownBaseClasses.group)) {
            var dataSource = this.dataSource;
            var option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };
            var headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);
            var groupcheck = this.templateCompiler(this.groupTemplate);
            if (groupcheck) {
                var groupValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.groupTemplate, document).innerHTML.trim();
                var tempHeaders = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
            }
            else {
                var tempHeaders = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].renderGroupTemplate(this.groupTemplate, dataSource, this.fields.properties, headerItems, option, this);
            }
            this.DropDownBaseupdateBlazorTemplates(false, true, false, false, false, false, false, false);
        }
    };
    /**
     * To create the ul li list items
     */
    DropDownBase.prototype.createListItems = function (dataSource, fields) {
        if (dataSource && fields.groupBy || this.element.querySelector('optgroup')) {
            if (fields.groupBy) {
                if (this.sortOrder !== 'None') {
                    dataSource = this.getSortedDataSource(dataSource);
                }
                dataSource = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].groupDataSource(dataSource, fields.properties, this.sortOrder);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.list], dropDownBaseClasses.grouping);
        }
        else {
            dataSource = this.getSortedDataSource(dataSource);
        }
        var options = this.listOption(dataSource, fields);
        var spliceData = (dataSource.length > 100) ?
            new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](dataSource).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().take(100))
            : dataSource;
        this.sortedData = dataSource;
        return _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createList(this.createElement, (this.getModuleName() === 'autocomplete') ? spliceData : dataSource, options, true, this);
    };
    ;
    DropDownBase.prototype.listOption = function (dataSource, fields) {
        var iconCss = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fields.iconCss) ? false : true;
        var fieldValues = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fields.properties) ?
            fields.properties : fields;
        var options = (fields.text !== null || fields.value !== null) ? {
            fields: fieldValues,
            showIcon: iconCss, ariaAttributes: { groupItemRole: 'presentation' }
        } : { fields: { value: 'text' } };
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, options, fields, true);
    };
    ;
    DropDownBase.prototype.setFloatingHeader = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement)) {
            this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
            if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
                this.fixedHeaderElement.style.display = 'none';
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.fixedHeaderElement], this.list);
            this.setFixedHeader();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
            this.setFixedHeader();
        }
        this.scrollStop(e);
    };
    DropDownBase.prototype.scrollStop = function (e) {
        var target = e.target;
        var liHeight = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
        var topIndex = Math.round(target.scrollTop / liHeight);
        var liCollections = this.list.querySelectorAll('li');
        for (var i = topIndex; i > -1; i--) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liCollections[i]) && liCollections[i].classList.contains(dropDownBaseClasses.group)) {
                var currentLi = liCollections[i];
                this.fixedHeaderElement.innerHTML = currentLi.innerHTML;
                this.fixedHeaderElement.style.top = e.target.scrollTop + 'px';
                this.fixedHeaderElement.style.display = 'block';
                break;
            }
            else {
                this.fixedHeaderElement.style.display = 'none';
                this.fixedHeaderElement.style.top = 'none';
            }
        }
    };
    /**
     * To render the list items
     */
    DropDownBase.prototype.renderItems = function (listData, fields) {
        var ulElement;
        if (this.itemTemplate && listData) {
            var dataSource = listData;
            if (dataSource && fields.groupBy) {
                if (this.sortOrder !== 'None') {
                    dataSource = this.getSortedDataSource(dataSource);
                }
                dataSource = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].groupDataSource(dataSource, fields.properties, this.sortOrder);
            }
            else {
                dataSource = this.getSortedDataSource(dataSource);
            }
            this.sortedData = dataSource;
            var spliceData = (dataSource.length > 100) ?
                new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](dataSource).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().take(100))
                : dataSource;
            ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);
            var isTempEmpty = (this.getModuleName() === 'listbox') ? true : false;
            this.DropDownBaseupdateBlazorTemplates(true, false, false, false, false, false, false, isTempEmpty);
        }
        else {
            ulElement = this.createListItems(listData, fields);
        }
        return ulElement;
    };
    ;
    DropDownBase.prototype.templateListItem = function (dataSource, fields) {
        this.DropDownBaseresetBlazorTemplates(true, false, false, false);
        var option = this.listOption(dataSource, fields);
        option.templateID = this.itemTemplateId;
        option.isStringTemplate = this.isStringTemplate;
        var itemcheck = this.templateCompiler(this.itemTemplate);
        if (itemcheck) {
            var itemValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.itemTemplate, document).innerHTML.trim();
            return _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].renderContentTemplate(this.createElement, itemValue, dataSource, fields.properties, option, this);
        }
        else {
            return _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].renderContentTemplate(this.createElement, this.itemTemplate, dataSource, fields.properties, option, this);
        }
    };
    ;
    DropDownBase.prototype.typeOfData = function (items) {
        var item = { typeof: null, item: null };
        for (var i = 0; (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(items) && i < items.length); i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(items[i])) {
                var listDataType = typeof (items[i]) === 'string' ||
                    typeof (items[i]) === 'number' || typeof (items[i]) === 'boolean';
                var isNullData = listDataType ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(items[i]) :
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((this.fields.value ? this.fields.value : 'value'), items[i]));
                if (!isNullData) {
                    return item = { typeof: typeof items[i], item: items[i] };
                }
            }
        }
        return item;
    };
    DropDownBase.prototype.setFixedHeader = function () {
        this.list.parentElement.style.display = 'block';
        var borderWidth = 0;
        if (this.list && this.list.parentElement) {
            borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
        }
        var liWidth = this.liCollections[0].offsetWidth - borderWidth;
        this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.fixedHeaderElement, { zIndex: 10 });
        var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group);
        this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
    };
    DropDownBase.prototype.getSortedDataSource = function (dataSource) {
        if (dataSource && this.sortOrder !== 'None') {
            var textField = this.fields.text ? this.fields.text : 'text';
            if (this.typeOfData(dataSource).typeof === 'string' || this.typeOfData(dataSource).typeof === 'number'
                || this.typeOfData(dataSource).typeof === 'boolean') {
                textField = '';
            }
            dataSource = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].getDataSource(dataSource, _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].addSorting(this.sortOrder, textField));
        }
        return dataSource;
    };
    /**
     * Return the index of item which matched with given value in data source
     */
    DropDownBase.prototype.getIndexByValue = function (value) {
        var index;
        var listItems = this.getItems();
        for (var i = 0; i < listItems.length; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && listItems[i].getAttribute('data-value') === value.toString()) {
                index = i;
                break;
            }
        }
        return index;
    };
    ;
    /**
     * To dispatch the event manually
     */
    DropDownBase.prototype.dispatchEvent = function (element, type) {
        var evt = document.createEvent('HTMLEvents');
        evt.initEvent(type, false, true);
        element.dispatchEvent(evt);
    };
    /**
     * To set the current fields
     */
    DropDownBase.prototype.setFields = function () {
        if (this.fields.value && !this.fields.text) {
            this.updateFields(this.fields.value, this.fields.value);
        }
        else if (!this.fields.value && this.fields.text) {
            this.updateFields(this.fields.text, this.fields.text);
        }
        else if (!this.fields.value && !this.fields.text) {
            this.updateFields('text', 'text');
        }
    };
    /**
     * reset the items list.
     */
    DropDownBase.prototype.resetList = function (dataSource, fields, query) {
        if (this.list) {
            if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
                || (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
                var data = dataSource instanceof Array ? (dataSource.length > 0)
                    : !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataSource);
                if (!data && this.selectData && this.selectData.length > 0) {
                    dataSource = this.selectData;
                }
            }
            this.setListData(dataSource, fields, query);
        }
    };
    DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
        if (isFiltering && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectData) && this.listData && this.listData.length > 0) {
            this.selectData = this.listData;
        }
    };
    DropDownBase.prototype.updateSelection = function () {
        // This is for after added the item, need to update the selected index values.
    };
    DropDownBase.prototype.renderList = function () {
        // This is for render the list items.
        this.render();
    };
    DropDownBase.prototype.updateDataSource = function (props) {
        this.resetList(this.dataSource);
    };
    DropDownBase.prototype.setUpdateInitial = function (props, newProp) {
        this.isDataFetched = false;
        var updateData = {};
        for (var j = 0; props.length > j; j++) {
            if (newProp[props[j]] && props[j] === 'fields') {
                this.setFields();
                updateData[props[j]] = newProp[props[j]];
            }
            else if (newProp[props[j]]) {
                updateData[props[j]] = newProp[props[j]];
            }
        }
        if (Object.keys(updateData).length > 0) {
            if (Object.keys(updateData).indexOf('dataSource') === -1) {
                updateData.dataSource = this.dataSource;
            }
            this.updateDataSource(updateData);
        }
    };
    /**
     * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
     * @private
     */
    DropDownBase.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (this.getModuleName() === 'dropdownbase') {
            this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
        }
        this.setUpdateInitial(['sortOrder', 'itemTemplate'], newProp);
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'query':
                case 'sortOrder':
                case 'dataSource':
                case 'itemTemplate':
                    break;
                case 'enableRtl':
                    this.setEnableRtl();
                    break;
                case 'enabled':
                    this.setEnabled();
                    break;
                case 'groupTemplate':
                    this.renderGroupTemplate(this.list);
                    if (this.ulElement && this.fixedHeaderElement) {
                        var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group);
                        this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
                    }
                    break;
                case 'locale':
                    if (this.list && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) && this.liCollections.length === 0)) {
                        this.l10nUpdate();
                    }
                    break;
                case 'zIndex':
                    this.setProperties({ zIndex: newProp.zIndex }, true);
                    this.setZIndex();
                    break;
            }
        }
    };
    ;
    /**
     * Build and render the component
     * @private
     */
    DropDownBase.prototype.render = function (isEmptyData) {
        this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
        this.list.classList.add(dropDownBaseClasses.root);
        this.setFields();
        var rippleModel = { duration: 300, selector: '.' + dropDownBaseClasses.li };
        this.rippleFun = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.list, rippleModel);
        var group = this.element.querySelector('select>optgroup');
        if ((this.fields.groupBy || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(group)) && !this.isGroupChecking) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.list, 'scroll', this.setFloatingHeader, this);
        }
        if (this.getModuleName() === 'dropdownbase') {
            if (this.element.getAttribute('tabindex')) {
                this.list.setAttribute('tabindex', this.element.getAttribute('tabindex'));
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], dropDownBaseClasses.root);
            this.element.style.display = 'none';
            var wrapperElement = this.createElement('div');
            this.element.parentElement.insertBefore(wrapperElement, this.element);
            wrapperElement.appendChild(this.element);
            wrapperElement.appendChild(this.list);
        }
        this.setEnableRtl();
        this.setEnabled();
        if (!isEmptyData) {
            this.initialize();
        }
    };
    ;
    /**
     * Return the module name of this component.
     * @private
     */
    DropDownBase.prototype.getModuleName = function () {
        return 'dropdownbase';
    };
    ;
    /**
     * Gets all the list items bound on this component.
     * @returns Element[].
     */
    DropDownBase.prototype.getItems = function () {
        return this.ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
    };
    ;
    /**
     * Adds a new item to the popup list. By default, new item appends to the list as the last item,
     * but you can insert based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
     * @return {void}.

     */
    DropDownBase.prototype.addItem = function (items, itemIndex) {
        if (!this.list || (this.list.textContent === this.noRecordsTemplate && this.getModuleName() !== 'listbox')) {
            this.renderList();
        }
        if (this.sortOrder !== 'None' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemIndex)) {
            var newList = [].slice.call(this.listData);
            newList.push(items);
            newList = this.getSortedDataSource(newList);
            if (this.fields.groupBy) {
                newList = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].groupDataSource(newList, this.fields.properties, this.sortOrder);
                itemIndex = newList.indexOf(items);
            }
            else {
                itemIndex = newList.indexOf(items);
            }
        }
        this.DropDownBaseresetBlazorTemplates(true, false, false, false);
        var itemsCount = this.getItems().length;
        var selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);
        items = (items instanceof Array ? items : [items]);
        var index;
        index = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemIndex) || itemIndex < 0 || itemIndex > itemsCount - 1) ? itemsCount : itemIndex;
        var fields = this.fields;
        if (items && fields.groupBy) {
            items = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].groupDataSource(items, fields.properties);
        }
        var liCollections = [];
        for (var i = 0; i < items.length; i++) {
            var item = items[i];
            var isHeader = item.isHeader;
            var li = this.createElement('li', { className: isHeader ? dropDownBaseClasses.group : dropDownBaseClasses.li, id: 'option-add-' + i });
            var itemText = item instanceof Object ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, item) : item;
            if (isHeader) {
                li.innerText = itemText;
            }
            if (this.itemTemplate && !isHeader) {
                var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.itemTemplate);
                // tslint:disable-next-line
                var addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
                if (addItemTemplate) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(addItemTemplate, li);
                }
                this.DropDownBaseupdateBlazorTemplates(true, false, false, false);
            }
            else if (!isHeader) {
                li.appendChild(document.createTextNode(itemText));
            }
            li.setAttribute('data-value', item instanceof Object ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, item) : item);
            li.setAttribute('role', 'option');
            this.notify('addItem', { module: 'CheckBoxSelection', item: li });
            liCollections.push(li);
            this.listData.push(item);
            if (this.sortOrder === 'None' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemIndex) && index === 0) {
                index = null;
            }
            this.updateActionCompleteData(li, item, index);
            //Listbox event
            this.trigger('beforeItemRender', { element: li, item: item });
        }
        if (itemsCount === 0 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list.querySelector('ul'))) {
            this.list.innerHTML = '';
            this.list.classList.remove(dropDownBaseClasses.noData);
            this.list.appendChild(this.ulElement);
            this.liCollections = liCollections;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(liCollections, this.ulElement);
            this.updateAddItemList(this.list, itemsCount);
        }
        else {
            if (this.getModuleName() === 'listbox' && itemsCount === 0) {
                this.ulElement.innerHTML = '';
            }
            var attr = [];
            for (var i = 0; i < items.length; i++) {
                var listGroupItem = this.ulElement.querySelectorAll('.e-list-group-item');
                for (var j = 0; j < listGroupItem.length; j++) {
                    attr[j] = listGroupItem[j].innerText;
                }
                if (attr.indexOf(liCollections[i].innerText) > -1 && fields.groupBy) {
                    for (var j = 0; j < listGroupItem.length; j++) {
                        if (attr[j] === liCollections[i].innerText) {
                            if (this.sortOrder === 'None') {
                                this.ulElement.insertBefore(liCollections[i + 1], listGroupItem[j + 1]);
                            }
                            else {
                                this.ulElement.insertBefore(liCollections[i + 1], this.ulElement.childNodes[itemIndex]);
                            }
                            i = i + 1;
                            break;
                        }
                    }
                }
                else {
                    if (this.liCollections[index]) {
                        this.liCollections[index].parentNode.insertBefore(liCollections[i], this.liCollections[index]);
                    }
                    else {
                        this.ulElement.appendChild(liCollections[i]);
                    }
                }
                var tempLi = [].slice.call(this.liCollections);
                tempLi.splice(index, 0, liCollections[i]);
                this.liCollections = tempLi;
                index += 1;
                if (this.getModuleName() === 'multiselect') {
                    this.updateDataList();
                }
            }
        }
        if (selectedItemValue || itemIndex === 0) {
            this.updateSelection();
        }
    };
    DropDownBase.prototype.validationAttribute = function (target, hidden) {
        var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
        hidden.setAttribute('name', name);
        target.removeAttribute('name');
        var attributes = ['required', 'aria-required', 'form'];
        for (var i = 0; i < attributes.length; i++) {
            if (!target.getAttribute(attributes[i])) {
                continue;
            }
            var attr = target.getAttribute(attributes[i]);
            hidden.setAttribute(attributes[i], attr);
            target.removeAttribute(attributes[i]);
        }
    };
    DropDownBase.prototype.setZIndex = function () {
        // this is for component wise
    };
    DropDownBase.prototype.updateActionCompleteData = function (li, item, index) {
        // this is for ComboBox custom value
    };
    DropDownBase.prototype.updateAddItemList = function (list, itemCount) {
        // this is for multiselect add item
    };
    DropDownBase.prototype.updateDataList = function () {
        // this is for multiselect update list items
    };
    /**
     * Gets the data Object that matches the given value.
     * @param { string | number } value - Specifies the value of the list item.
     * @returns Object.
     * @blazorType object
     */
    DropDownBase.prototype.getDataByValue = function (value) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listData)) {
            var type = this.typeOfData(this.listData).typeof;
            if (type === 'string' || type === 'number' || type === 'boolean') {
                for (var _i = 0, _a = this.listData; _i < _a.length; _i++) {
                    var item = _a[_i];
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) && item === value) {
                        return item;
                    }
                }
            }
            else {
                for (var _b = 0, _c = this.listData; _b < _c.length; _b++) {
                    var item = _c[_b];
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((this.fields.value ? this.fields.value : 'value'), item) === value) {
                        return item;
                    }
                }
            }
        }
        return null;
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. It also removes the attributes and classes.
     * @method destroy
     * @return {void}.
     */
    DropDownBase.prototype.destroy = function () {
        if (document.body.contains(this.list)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'scroll', this.setFloatingHeader);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.rippleFun)) {
                this.rippleFun();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.list);
        }
        _super.prototype.destroy.call(this);
    };
    ;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
    ], DropDownBase.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownBase.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownBase.prototype, "itemTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownBase.prototype, "groupTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('No records found')
    ], DropDownBase.prototype, "noRecordsTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Request failed')
    ], DropDownBase.prototype, "actionFailureTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], DropDownBase.prototype, "sortOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DropDownBase.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], DropDownBase.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownBase.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('StartsWith')
    ], DropDownBase.prototype, "filterType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], DropDownBase.prototype, "ignoreCase", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], DropDownBase.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownBase.prototype, "ignoreAccent", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], DropDownBase.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "actionBegin", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "actionComplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "actionFailure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "dataBound", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownBase.prototype, "destroyed", void 0);
    DropDownBase = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DropDownBase);
    return DropDownBase;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/index.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/index.js ***!
  \*****************************************************************************/
/*! exports provided: FieldSettings, dropDownBaseClasses, DropDownBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _drop_down_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return _drop_down_base__WEBPACK_IMPORTED_MODULE_0__["FieldSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropDownBaseClasses", function() { return _drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownBase", function() { return _drop_down_base__WEBPACK_IMPORTED_MODULE_0__["DropDownBase"]; });

/**
 * export all modules from current location
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/drop-down-list.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/drop-down-list.js ***!
  \**************************************************************************************/
/*! exports provided: dropDownListClasses, DropDownList */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropDownListClasses", function() { return dropDownListClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropDownList", function() { return DropDownList; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _common_incremental_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/incremental-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js");
/* harmony import */ var _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../drop-down-base/drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>








/* tslint:disable */

// don't use space in classnames 
var dropDownListClasses = {
    root: 'e-dropdownlist',
    hover: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover,
    selected: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected,
    rtl: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].rtl,
    li: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li,
    disable: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].disabled,
    base: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].root,
    focus: _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].focus,
    input: 'e-input-group',
    inputFocus: 'e-input-focus',
    icon: 'e-input-group-icon e-ddl-icon',
    iconAnimation: 'e-icon-anim',
    value: 'e-input-value',
    device: 'e-ddl-device',
    backIcon: 'e-input-group-icon e-back-icon e-icons',
    filterBarClearIcon: 'e-input-group-icon e-clear-icon e-icons',
    filterInput: 'e-input-filter',
    filterParent: 'e-filter-parent',
    mobileFilter: 'e-ddl-device-filter',
    footer: 'e-ddl-footer',
    header: 'e-ddl-header',
    clearIcon: 'e-clear-icon',
    clearIconHide: 'e-clear-icon-hide',
    popupFullScreen: 'e-popup-full-page',
    disableIcon: 'e-ddl-disable-icon',
    hiddenElement: 'e-ddl-hidden'
};
var inputObject = {
    container: null,
    buttons: []
};
/**
 * The DropDownList component contains a list of predefined values from which you can
 * choose a single value.
 * ```html
 * <input type="text" tabindex="1" id="list"> </input>
 * ```
 * ```typescript
 *   let dropDownListObj:DropDownList = new DropDownList();
 *   dropDownListObj.appendTo("#list");
 * ```
 */
var DropDownList = /** @__PURE__ @class */ (function (_super) {
    __extends(DropDownList, _super);
    /**
     * * Constructor for creating the DropDownList component.
     */
    function DropDownList(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.previousValue = null;
        _this.isListSearched = false;
        _this.preventChange = false;
        _this.isAngular = false;
        return _this;
    }
    ;
    /**
     * Initialize the event handler.
     * @private
     */
    DropDownList.prototype.preRender = function () {
        var checkBlazor = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered;
        this.isServerBlazor = (checkBlazor) ? true : false;
        if (this.isServerBlazor) {
            this.initializeData();
        }
        else {
            this.element.style.opacity = '0';
            this.initializeData();
            _super.prototype.preRender.call(this);
        }
        this.activeIndex = this.index;
        this.queryString = '';
    };
    DropDownList.prototype.initializeData = function () {
        this.isPopupOpen = false;
        this.isDocumentClick = false;
        this.isInteracted = false;
        this.isFilterFocus = false;
        this.beforePopupOpen = false;
        this.initial = true;
        this.initRemoteRender = false;
        this.isNotSearchList = false;
        this.isTyped = false;
        this.isSelected = false;
        this.preventFocus = false;
        this.preventAutoFill = false;
        this.isValidKey = false;
        this.typedString = '';
        this.isEscapeKey = false;
        this.isPreventBlur = false;
        this.isTabKey = false;
        this.actionCompleteData = { isUpdated: false };
        this.prevSelectPoints = {};
        this.isSelectCustom = false;
        this.isDropDownClick = false;
        this.preventAltUp = false;
        this.isCustomFilter = false;
        this.isSecondClick = false;
        this.keyConfigure = {
            tab: 'tab',
            enter: '13',
            escape: '27',
            end: '35',
            home: '36',
            down: '40',
            up: '38',
            pageUp: '33',
            pageDown: '34',
            open: 'alt+40',
            close: 'shift+tab',
            hide: 'alt+38',
            space: '32'
        };
    };
    DropDownList.prototype.setZIndex = function () {
        if (this.popupObj) {
            this.popupObj.setProperties({ 'zIndex': this.zIndex });
        }
    };
    DropDownList.prototype.renderList = function (isEmptyData) {
        if (!this.isServerBlazor) {
            _super.prototype.render.call(this, isEmptyData);
            this.unWireListEvents();
            this.wireListEvents();
        }
        else {
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnServerRenderList', this.beforePopupOpen, false);
        }
    };
    DropDownList.prototype.floatLabelChange = function () {
        if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
            var floatElement = this.inputWrapper.container.querySelector('.e-float-text');
            if (this.inputElement.value !== '' || this.isInteracted) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(floatElement, ['e-label-top'], ['e-label-bottom']);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(floatElement, ['e-label-bottom'], ['e-label-top']);
            }
        }
    };
    DropDownList.prototype.resetHandler = function (e) {
        e.preventDefault();
        this.clearAll(e);
    };
    DropDownList.prototype.resetFocusElement = function () {
        this.removeHover();
        this.removeSelection();
        this.removeFocus();
        this.list.scrollTop = 0;
        if (this.getModuleName() !== 'autocomplete' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ulElement)) {
            var li = this.ulElement.querySelector('.' + dropDownListClasses.li);
            if (li) {
                li.classList.add(dropDownListClasses.focus);
            }
        }
    };
    DropDownList.prototype.clearAll = function (e, properties) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties) &&
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties.dataSource) ||
                (!(properties.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) && properties.dataSource.length === 0)))) {
            this.isActive = true;
            this.resetSelection(properties);
        }
        var dataItem = this.getItemData();
        if (this.previousValue === dataItem.value) {
            return;
        }
        this.onChangeEvent(e);
    };
    DropDownList.prototype.resetSelection = function (properties) {
        if (this.list) {
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties) &&
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(properties.dataSource) ||
                    (!(properties.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) && properties.dataSource.length === 0)))) {
                this.selectedLI = null;
                this.actionCompleteData.isUpdated = false;
                this.actionCompleteData.ulElement = null;
                this.actionCompleteData.list = null;
                this.resetList(properties.dataSource);
            }
            else {
                if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
                    && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionCompleteData.ulElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionCompleteData.list)) {
                    this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
                }
                this.resetFocusElement();
            }
        }
        if (!this.isServerBlazor) {
            this.hiddenElement.innerHTML = '';
        }
        this.inputElement.value = '';
        this.value = null;
        this.itemData = null;
        this.text = null;
        this.index = null;
        this.activeIndex = null;
        this.item = null;
        this.queryString = '';
        if (this.valueTempElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.valueTempElement);
            this.inputElement.style.display = 'block';
            this.valueTempElement = null;
        }
        this.setSelection(null, null);
        this.isSelectCustom = false;
        this.updateIconState();
        this.cloneElements();
    };
    DropDownList.prototype.setHTMLAttributes = function () {
        if (Object.keys(this.htmlAttributes).length) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var htmlAttr = _a[_i];
                if (htmlAttr === 'class') {
                    var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
                    if (updatedClassValue !== '') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], updatedClassValue.split(' '));
                    }
                }
                else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
                    this.enabled = false;
                    this.setEnable();
                }
                else if (htmlAttr === 'readonly' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes[htmlAttr])) {
                    this.readonly = true;
                    this.dataBind();
                }
                else if (htmlAttr === 'style') {
                    this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
                }
                else {
                    var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
                        'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
                    var validateAttr = ['name', 'required'];
                    if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
                        defaultAttr.push('tabindex');
                    }
                    if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
                        this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                    else if (defaultAttr.indexOf(htmlAttr) > -1) {
                        htmlAttr === 'placeholder' ? _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement) :
                            this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                    else {
                        this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                }
            }
        }
        if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
            this.inputWrapper.container.removeAttribute('tabindex');
        }
    };
    DropDownList.prototype.getAriaAttributes = function () {
        return {
            'aria-disabled': 'false',
            'aria-owns': this.element.id + '_options',
            'role': 'listbox',
            'aria-haspopup': 'true',
            'aria-expanded': 'false',
            'aria-activedescendant': 'null',
            'aria-live': 'polite',
            'aria-labelledby': this.hiddenElement.id
        };
    };
    DropDownList.prototype.setEnableRtl = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnableRtl(this.enableRtl, [this.inputElement.parentElement]);
        if (this.popupObj) {
            this.popupObj.enableRtl = this.enableRtl;
            this.popupObj.dataBind();
        }
    };
    DropDownList.prototype.setEnable = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setEnabled(this.enabled, this.inputElement);
        if (this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], dropDownListClasses.disable);
            this.inputElement.setAttribute('aria-disabled', 'false');
            this.targetElement().setAttribute('tabindex', this.tabIndex);
        }
        else {
            this.hidePopup();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], dropDownListClasses.disable);
            this.inputElement.setAttribute('aria-disabled', 'true');
            this.targetElement().tabIndex = -1;
        }
    };
    /**
     * Get the properties to be maintained in the persisted state.
     */
    DropDownList.prototype.getPersistData = function () {
        return this.addOnPersist(['value']);
    };
    ;
    DropDownList.prototype.getLocaleName = function () {
        return 'drop-down-list';
    };
    ;
    DropDownList.prototype.preventTabIndex = function (element) {
        if (this.getModuleName() === 'dropdownlist') {
            element.tabIndex = -1;
        }
    };
    DropDownList.prototype.targetElement = function () {
        return this.inputWrapper.container;
    };
    DropDownList.prototype.getNgDirective = function () {
        return 'EJS-DROPDOWNLIST';
    };
    DropDownList.prototype.getElementByText = function (text) {
        return this.getElementByValue(this.getValueByText(text));
    };
    DropDownList.prototype.getElementByValue = function (value) {
        var item;
        var listItems = this.getItems();
        for (var _i = 0, listItems_1 = listItems; _i < listItems_1.length; _i++) {
            var liItem = listItems_1[_i];
            if (this.getFormattedValue(liItem.getAttribute('data-value')) === value) {
                item = liItem;
                break;
            }
        }
        return item;
    };
    ;
    DropDownList.prototype.initValue = function () {
        this.renderList();
        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
            this.initRemoteRender = true;
        }
        else {
            this.updateValues();
        }
    };
    DropDownList.prototype.updateValues = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.setSelection(this.getElementByValue(this.value), null);
        }
        else if (this.text && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            var element = this.getElementByText(this.text);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
                this.setProperties({ text: null });
                return;
            }
            else {
                this.setSelection(element, null);
            }
        }
        else {
            this.setSelection(this.liCollections[this.activeIndex], null);
        }
        this.setHiddenValue();
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
    };
    DropDownList.prototype.onBlur = function (e) {
        if (!this.enabled) {
            return;
        }
        var target = e.relatedTarget;
        var currentTarget = e.target;
        var isPreventBlur = this.isPreventBlur;
        this.isPreventBlur = false;
        //IE 11 - issue
        if (isPreventBlur && !this.isDocumentClick && this.isPopupOpen && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currentTarget) ||
            !this.isFilterLayout() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target))) {
            if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.isPopupOpen) {
                this.filterInput.focus();
            }
            else {
                this.targetElement().focus();
            }
            return;
        }
        if (this.isDocumentClick || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj)
            && document.body.contains(this.popupObj.element) &&
            this.popupObj.element.classList.contains(dropDownListClasses.mobileFilter))) {
            if (!this.beforePopupOpen) {
                this.isDocumentClick = false;
            }
            return;
        }
        if (((this.getModuleName() === 'dropdownlist' && !this.isFilterFocus && target !== this.inputElement)
            && (document.activeElement !== target || (document.activeElement === target &&
                currentTarget.classList.contains(dropDownListClasses.inputFocus)))) ||
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) && this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
                currentTarget !== this.inputWrapper.container) || this.getModuleName() !== 'dropdownlist' &&
            !this.inputWrapper.container.contains(target) || this.isTabKey) {
            this.isDocumentClick = this.isPopupOpen ? true : false;
            this.focusOutAction(e);
            this.isTabKey = false;
        }
        if (this.isRequested && !this.isPopupOpen && !this.isPreventBlur) {
            this.isActive = false;
            this.beforePopupOpen = false;
        }
    };
    DropDownList.prototype.focusOutAction = function (e) {
        this.isInteracted = false;
        this.focusOut(e);
        this.onFocusOut();
    };
    DropDownList.prototype.onFocusOut = function () {
        if (!this.enabled) {
            return;
        }
        if (this.isSelected) {
            this.isSelectCustom = false;
            this.onChangeEvent(null);
        }
        this.floatLabelChange();
        this.dispatchEvent(this.hiddenElement, 'change');
        if (this.getModuleName() === 'dropdownlist' && this.element.tagName !== 'INPUT') {
            this.dispatchEvent(this.inputElement, 'blur');
        }
        if (this.inputWrapper.clearButton) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);
        }
        this.trigger('blur');
    };
    DropDownList.prototype.onFocus = function (e) {
        if (!this.isInteracted) {
            this.isInteracted = true;
            var args = { isInteracted: e ? true : false, event: e };
            this.trigger('focus', args);
        }
        this.updateIconState();
    };
    DropDownList.prototype.resetValueHandler = function (e) {
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.inputElement, 'form');
        if (formElement && e.target === formElement) {
            var val = (this.element.tagName === this.getNgDirective()) ? null : this.inputElement.getAttribute('value');
            this.text = val;
        }
    };
    DropDownList.prototype.wireEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.container, 'mousedown', this.dropDownClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.container, 'focus', this.focusIn, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.container, 'keypress', this.onSearch, this);
        this.bindCommonEvent();
    };
    DropDownList.prototype.bindCommonEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.targetElement(), 'blur', this.onBlur, this);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.inputElement, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(formElement, 'reset', this.resetValueHandler, this);
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.targetElement(), {
                keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
            });
        }
        else {
            this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.targetElement(), {
                keyAction: this.mobileKeyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
            });
        }
        this.bindClearEvent();
    };
    DropDownList.prototype.bindClearEvent = function () {
        if (this.showClearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown', this.resetHandler, this);
        }
    };
    DropDownList.prototype.unBindCommonEvent = function () {
        if (this.targetElement()) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.targetElement(), 'blur', this.onBlur);
        }
        var formElement = this.inputElement && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.inputElement, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(formElement, 'reset', this.resetValueHandler);
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.keyboardModule.destroy();
        }
        if (this.showClearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.clearButton, 'mousedown', this.resetHandler);
        }
    };
    DropDownList.prototype.updateIconState = function () {
        if (this.showClearButton) {
            if (this.inputElement.value !== '' && !this.readonly) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);
            }
        }
    };
    /**
     * Event binding for list
     */
    DropDownList.prototype.wireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.list, 'click', this.onMouseClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.list, 'mouseover', this.onMouseOver, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.list, 'mouseout', this.onMouseLeave, this);
    };
    ;
    DropDownList.prototype.onSearch = function (e) {
        if (e.charCode !== 32 && e.charCode !== 13) {
            if (this.list === undefined) {
                if (!this.isServerBlazor) {
                    this.renderList();
                }
                else {
                    this.isServerIncrementalSearch = true;
                    // tslint:disable-next-line
                    this.interopAdaptor.invokeMethodAsync('OnServerRenderList', true, false);
                }
            }
            this.searchKeyEvent = e;
            this.onServerIncrementalSearch(e);
        }
    };
    DropDownList.prototype.onServerIncrementalSearch = function (e) {
        if (!this.isRequested && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list.querySelector('li')) && this.enabled && !this.readonly) {
            this.incrementalSearch(e);
        }
    };
    DropDownList.prototype.onMouseClick = function (e) {
        var target = e.target;
        var classList = target.classList;
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li);
        if (!this.isValidLI(li)) {
            return;
        }
        this.setSelection(li, e);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isFilterLayout()) {
            history.back();
        }
        else {
            var delay = 100;
            this.closePopup(delay);
        }
    };
    DropDownList.prototype.onMouseOver = function (e) {
        var currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li);
        this.setHover(currentLi);
    };
    ;
    DropDownList.prototype.setHover = function (li) {
        if (this.enabled && this.isValidLI(li) && !li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover)) {
            this.removeHover();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover);
        }
    };
    ;
    DropDownList.prototype.onMouseLeave = function (e) {
        this.removeHover();
    };
    ;
    DropDownList.prototype.removeHover = function () {
        if (this.list) {
            var hoveredItem = (this.isServerBlazor && this.popupObj && this.popupObj.element) ?
                this.popupObj.element.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover) :
                this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover);
            if (hoveredItem && hoveredItem.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(hoveredItem, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover);
            }
        }
    };
    ;
    DropDownList.prototype.isValidLI = function (li) {
        return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
    };
    ;
    DropDownList.prototype.incrementalSearch = function (e) {
        if (this.liCollections.length > 0) {
            var li = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_3__["incrementalSearch"])(e.charCode, this.liCollections, this.activeIndex, true, this.element.id, this.isServerBlazor);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
                this.setSelection(li, e);
                this.setScrollPosition();
            }
        }
    };
    ;
    /**
     * Hides the spinner loader.
     * @returns void.
     */
    DropDownList.prototype.hideSpinner = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinnerElement)) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(this.spinnerElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.spinnerElement], dropDownListClasses.disableIcon);
            this.spinnerElement.innerHTML = '';
            this.spinnerElement = null;
        }
    };
    /**
     * Shows the spinner loader.
     * @returns void.
     */
    DropDownList.prototype.showSpinner = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinnerElement)) {
            this.spinnerElement = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.filterInputObj) && this.filterInputObj.buttons[1] ||
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.filterInputObj) && this.filterInputObj.buttons[0] || this.inputWrapper.buttons[0];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.spinnerElement], dropDownListClasses.disableIcon);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({
                target: this.spinnerElement,
                width: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? '16px' : '14px'
            }, this.createElement);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(this.spinnerElement);
        }
    };
    DropDownList.prototype.keyActionHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        var preventAction = e.action === 'pageUp' || e.action === 'pageDown';
        var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
        this.isEscapeKey = e.action === 'escape';
        this.isTabKey = !this.isPopupOpen && e.action === 'tab';
        var isNavAction = e.action === 'down' || e.action === 'up' || e.action === 'home' || e.action === 'end';
        var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
            || e.action === 'home' || e.action === 'end');
        if ((this.isEditTextBox() || preventAction || preventHomeEnd) && !this.isPopupOpen) {
            return;
        }
        if (!this.readonly) {
            var isTabAction = e.action === 'tab' || e.action === 'close';
            if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
                this.searchKeyEvent = e;
                this.renderList();
            }
            if (!(this.isServerBlazor && (e.action === 'open' || e.action === 'space')) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) ||
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) && isNavigation && this.liCollections.length === 0) || this.isRequested) {
                if (!(this.isServerBlazor && isNavAction)) {
                    return;
                }
            }
            if ((isTabAction && this.getModuleName() !== 'autocomplete') && this.isPopupOpen
                || e.action === 'escape') {
                e.preventDefault();
            }
            this.isSelected = e.action === 'escape' ? false : this.isSelected;
            this.isTyped = (isNavigation || e.action === 'escape') ? false : this.isTyped;
            switch (e.action) {
                case 'down':
                case 'up':
                    this.updateUpDownAction(e);
                    break;
                case 'pageUp':
                    this.pageUpSelection(this.activeIndex - this.getPageCount(), e);
                    e.preventDefault();
                    break;
                case 'pageDown':
                    this.pageDownSelection(this.activeIndex + this.getPageCount(), e);
                    e.preventDefault();
                    break;
                case 'home':
                    this.updateHomeEndAction(e);
                    break;
                case 'end':
                    this.updateHomeEndAction(e);
                    break;
                case 'space':
                    if (this.getModuleName() === 'dropdownlist') {
                        if (!this.beforePopupOpen) {
                            this.showPopup();
                        }
                    }
                    break;
                case 'open':
                    this.showPopup();
                    break;
                case 'hide':
                    this.preventAltUp = this.isPopupOpen;
                    this.hidePopup(e);
                    this.focusDropDown(e);
                    break;
                case 'enter':
                    this.selectCurrentItem(e);
                    break;
                case 'tab':
                    this.selectCurrentValueOnTab(e);
                    break;
                case 'escape':
                case 'close':
                    if (this.isPopupOpen) {
                        this.hidePopup(e);
                        this.focusDropDown(e);
                    }
                    break;
            }
        }
    };
    DropDownList.prototype.updateUpDownAction = function (e) {
        if (this.isServerBlazor && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list)) {
            this.isServerNavigation = true;
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnServerRenderList', true, false);
        }
        else {
            this.isServerNavigation = false;
            var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
            if (this.isSelectFocusItem(focusEle)) {
                this.setSelection(focusEle, e);
            }
            else {
                var nextItem = void 0;
                var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
                var startIndex = 0;
                if (this.getModuleName() === 'autocomplete') {
                    startIndex = e.action === 'down' && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex) ? 0 : this.liCollections.length - 1;
                    index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
                }
                nextItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nextItem)) {
                    this.setSelection(nextItem, e);
                }
            }
            e.preventDefault();
        }
    };
    DropDownList.prototype.updateHomeEndAction = function (e) {
        if (this.getModuleName() === 'dropdownlist') {
            if (this.isServerBlazor && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list)) {
                this.isServerNavigation = true;
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnServerRenderList', true, false);
            }
            else {
                this.isServerNavigation = false;
                var findLi = 0;
                if (e.action === 'home') {
                    findLi = 0;
                }
                else {
                    findLi = this.getItems().length - 1;
                }
                e.preventDefault();
                if (this.activeIndex === findLi) {
                    return;
                }
                this.setSelection(this.liCollections[findLi], e);
            }
        }
    };
    DropDownList.prototype.selectCurrentValueOnTab = function (e) {
        if (this.getModuleName() === 'autocomplete') {
            this.selectCurrentItem(e);
        }
        else {
            if (this.isPopupOpen) {
                this.hidePopup(e);
                this.focusDropDown(e);
            }
        }
    };
    DropDownList.prototype.mobileKeyActionHandler = function (e) {
        if (!this.enabled) {
            return;
        }
        if ((this.isEditTextBox()) && !this.isPopupOpen) {
            return;
        }
        if (!this.readonly) {
            if (this.list === undefined && !this.isRequested) {
                this.searchKeyEvent = e;
                this.renderList();
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) &&
                this.liCollections.length === 0) || this.isRequested) {
                return;
            }
            if (e.action === 'enter') {
                this.selectCurrentItem(e);
            }
        }
    };
    DropDownList.prototype.selectCurrentItem = function (e) {
        if (this.isPopupOpen) {
            var li = this.list.querySelector('.' + dropDownListClasses.focus);
            if (li) {
                this.setSelection(li, e);
                this.isTyped = false;
            }
            if (this.isSelected) {
                this.isSelectCustom = false;
                this.onChangeEvent(e);
            }
            this.hidePopup();
            this.focusDropDown(e);
        }
        else {
            this.showPopup();
        }
    };
    DropDownList.prototype.isSelectFocusItem = function (element) {
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element);
    };
    DropDownList.prototype.getPageCount = function () {
        var liHeight = this.list.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].noData) ? null :
            getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
        return Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
    };
    DropDownList.prototype.pageUpSelection = function (steps, event) {
        var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
        this.setSelection(previousItem, event);
    };
    ;
    DropDownList.prototype.pageDownSelection = function (steps, event) {
        var list = this.getItems();
        var previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
        this.setSelection(previousItem, event);
    };
    ;
    DropDownList.prototype.unWireEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.container, 'keypress', this.onSearch);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.inputWrapper.container, 'focus', this.focusIn);
        this.unBindCommonEvent();
    };
    /**
     * Event un binding for list items.
     */
    DropDownList.prototype.unWireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'click', this.onMouseClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'mouseover', this.onMouseOver);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'mouseout', this.onMouseLeave);
    };
    ;
    DropDownList.prototype.checkSelector = function (id) {
        return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
    };
    DropDownList.prototype.onDocumentClick = function (e) {
        var target = e.target;
        if (!(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, this.checkSelector(this.popupObj.element.id))) &&
            !this.inputWrapper.container.contains(e.target)) {
            if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
                this.isDocumentClick = true;
                var isActive = this.isRequested;
                this.isInteracted = false;
                this.hidePopup(e);
                if (!isActive) {
                    this.onFocusOut();
                    this.inputWrapper.container.classList.remove(dropDownListClasses.inputFocus);
                }
            }
        }
        else if (target !== this.inputElement && !(this.allowFiltering && target === this.filterInput)
            && !(this.getModuleName() === 'combobox' &&
                !this.allowFiltering && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && target === this.inputWrapper.buttons[0])) {
            this.isPreventBlur = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'edge') && (document.activeElement === this.targetElement() ||
                document.activeElement === this.filterInput);
            e.preventDefault();
        }
    };
    DropDownList.prototype.activeStateChange = function () {
        if (this.isDocumentClick) {
            this.hidePopup();
            this.onFocusOut();
            this.inputWrapper.container.classList.remove(dropDownListClasses.inputFocus);
        }
    };
    DropDownList.prototype.focusDropDown = function (e) {
        if (!this.initial && this.isFilterLayout()) {
            this.focusIn(e);
        }
    };
    DropDownList.prototype.dropDownClick = function (e) {
        if (e.which === 3 || e.button === 2) {
            return;
        }
        if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
            return;
        }
        var target = e.target;
        if (target !== this.inputElement && !(this.allowFiltering && target === this.filterInput) && this.getModuleName() !== 'combobox') {
            e.preventDefault();
        }
        if (!this.readonly) {
            if (this.isPopupOpen) {
                this.hidePopup();
                if (this.isFilterLayout()) {
                    this.focusDropDown(e);
                }
            }
            else {
                this.focusIn(e);
                this.floatLabelChange();
                this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
                this.isDropDownClick = true;
                this.showPopup();
            }
            var proxy_1 = this;
            var duration = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) ? 1000 : (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;
            if (!this.isSecondClick) {
                setTimeout(function () { proxy_1.cloneElements(); proxy_1.isSecondClick = true; }, duration);
            }
        }
        else {
            this.focusIn(e);
        }
    };
    DropDownList.prototype.cloneElements = function () {
        if (this.list) {
            var ulElement = this.list.querySelector('ul');
            if (ulElement) {
                ulElement = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
                this.actionCompleteData.ulElement = ulElement;
            }
        }
    };
    DropDownList.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
        var _this = this;
        this.removeSelection();
        li.classList.add(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
        this.removeHover();
        var value = this.getFormattedValue(li.getAttribute('data-value'));
        var selectedData = this.getDataByValue(value);
        if (!this.initial && !preventSelect && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)) {
            var items = this.detachChanges(selectedData);
            this.isSelected = true;
            var eventArgs = {
                e: e,
                item: li,
                itemData: items,
                isInteracted: e ? true : false,
                cancel: false
            };
            this.trigger('select', eventArgs, function (eventArgs) {
                if (eventArgs.cancel) {
                    li.classList.remove(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
                }
                else {
                    _this.selectEventCallback(li, e, preventSelect, selectedData, value);
                    if (_this.isServerBlazor) {
                        // tslint:disable-next-line
                        _this.interopAdaptor.invokeMethodAsync('OnServerItemData', _this.itemData);
                    }
                    if (isSelection) {
                        _this.setSelectOptions(li, e);
                    }
                }
            });
        }
        else {
            this.selectEventCallback(li, e, preventSelect, selectedData, value);
            if (this.isServerBlazor) {
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('OnServerItemData', this.itemData);
            }
            if (isSelection) {
                this.setSelectOptions(li, e);
            }
        }
    };
    DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
        this.previousItemData = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData)) ? this.itemData : null;
        this.item = li;
        this.itemData = selectedData;
        var focusedItem = this.list.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].focus);
        if (focusedItem) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([focusedItem], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].focus);
        }
        li.setAttribute('aria-selected', 'true');
        this.activeIndex = this.getIndexByValue(value);
    };
    DropDownList.prototype.activeItem = function (li) {
        if (this.isValidLI(li) && !li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected)) {
            this.removeSelection();
            li.classList.add(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
            this.removeHover();
            li.setAttribute('aria-selected', 'true');
        }
    };
    DropDownList.prototype.setValue = function (e) {
        var dataItem = this.getItemData();
        if (dataItem.value === null) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && dataItem.text !== null || dataItem.text !== '') {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(dataItem.text, this.inputElement, this.floatLabelType, this.showClearButton);
            }
            else {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
            }
        }
        else {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(dataItem.text, this.inputElement, this.floatLabelType, this.showClearButton);
        }
        if (this.isServerBlazor) {
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnServerValueTemplate', dataItem);
        }
        if (this.valueTemplate && this.itemData !== null && !this.isServerBlazor) {
            this.DropDownBaseresetBlazorTemplates(false, false, false, false, true);
            this.setValueTemplate();
        }
        else if (this.inputElement.previousSibling === this.valueTempElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.valueTempElement);
            this.inputElement.style.display = 'block';
        }
        if (this.previousValue === dataItem.value) {
            this.isSelected = false;
            return true;
        }
        else {
            this.isSelected = !this.initial ? true : false;
            this.isSelectCustom = false;
            if (this.getModuleName() === 'dropdownlist') {
                this.updateIconState();
            }
            return false;
        }
    };
    DropDownList.prototype.setSelection = function (li, e) {
        if (this.isValidLI(li) && (!li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected) || (this.isPopupOpen && this.isSelected
            && li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected)))) {
            this.updateSelectedItem(li, e, false, true);
        }
        else {
            this.setSelectOptions(li, e);
        }
    };
    DropDownList.prototype.setSelectOptions = function (li, e) {
        if (this.list) {
            this.removeHover();
        }
        this.previousSelectedLI = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI)) ? this.selectedLI : null;
        this.selectedLI = li;
        if (this.setValue(e)) {
            return;
        }
        if (this.isPopupOpen) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
            if (this.isFilterLayout() && this.filterInput) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
            }
        }
        if ((!this.isPopupOpen && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) || (this.isPopupOpen && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) &&
            (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
            this.isSelectCustom = false;
            this.onChangeEvent(e);
        }
        if (this.isPopupOpen && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI) && this.itemData !== null && (!e || e.type !== 'click')) {
            this.setScrollPosition(e);
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name !== 'mozilla') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.inputElement, { 'aria-label': this.inputElement.value });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.targetElement(), { 'aria-describedby': this.inputElement.id });
            this.targetElement().removeAttribute('aria-live');
        }
    };
    DropDownList.prototype.dropdownCompiler = function (dropdownTemplate) {
        var checkTemplate = false;
        if (dropdownTemplate) {
            var exception = void 0;
            try {
                checkTemplate = (document.querySelectorAll(dropdownTemplate).length) ? true : false;
            }
            catch (exception) {
                checkTemplate = false;
            }
        }
        return checkTemplate;
    };
    DropDownList.prototype.setValueTemplate = function () {
        var compiledString;
        // tslint:disable-next-line
        if (this.isReact) {
            this.clearTemplate(['valueTemplate']);
        }
        if (!this.valueTempElement) {
            this.valueTempElement = this.createElement('span', { className: dropDownListClasses.value });
            this.inputElement.parentElement.insertBefore(this.valueTempElement, this.inputElement);
            this.inputElement.style.display = 'none';
        }
        this.valueTempElement.innerHTML = '';
        var templateData = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) ? JSON.parse(JSON.stringify(this.itemData)) : this.itemData;
        var valuecheck = this.dropdownCompiler(this.valueTemplate);
        if (valuecheck) {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(document.querySelector(this.valueTemplate).innerHTML.trim());
        }
        else {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.valueTemplate);
        }
        // tslint:disable-next-line
        var valueCompTemp = compiledString(templateData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, this.valueTempElement);
        if (valueCompTemp && valueCompTemp.length > 0) {
            for (var i = 0; i < valueCompTemp.length; i++) {
                this.valueTempElement.appendChild(valueCompTemp[i]);
            }
        }
        this.renderReactTemplates();
        this.DropDownBaseupdateBlazorTemplates(false, false, false, false, true, true, true);
    };
    DropDownList.prototype.removeSelection = function () {
        if (this.list) {
            var selectedItems = this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
            if (selectedItems.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selectedItems, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
                selectedItems[0].removeAttribute('aria-selected');
            }
        }
    };
    ;
    DropDownList.prototype.getItemData = function () {
        var fields = this.fields;
        var dataItem = null;
        dataItem = this.itemData;
        var dataValue;
        var dataText;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem)) {
            dataValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.value, dataItem);
            dataText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(fields.text, dataItem);
        }
        var value = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(dataValue) ? dataValue : dataItem);
        var text = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(dataValue) ? dataText : dataItem);
        return { value: value, text: text };
    };
    /**
     * To trigger the change event for list.
     */
    DropDownList.prototype.onChangeEvent = function (eve) {
        var dataItem = this.getItemData();
        var index = this.isSelectCustom ? null : this.activeIndex;
        this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
        this.detachChangeEvent(eve);
    };
    ;
    DropDownList.prototype.detachChanges = function (value) {
        var items;
        if (typeof value === 'string' ||
            typeof value === 'boolean' ||
            typeof value === 'number') {
            items = Object.defineProperties({}, {
                value: {
                    value: value,
                    enumerable: true
                },
                text: {
                    value: value,
                    enumerable: true
                }
            });
        }
        else {
            items = value;
        }
        return items;
    };
    DropDownList.prototype.detachChangeEvent = function (eve) {
        this.isSelected = false;
        this.previousValue = this.value;
        this.activeIndex = this.index;
        this.typedString = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.text) ? this.text : '';
        if (!this.initial) {
            var items = this.detachChanges(this.itemData);
            var preItems = void 0;
            if (typeof this.previousItemData === 'string' ||
                typeof this.previousItemData === 'boolean' ||
                typeof this.previousItemData === 'number') {
                preItems = Object.defineProperties({}, {
                    value: {
                        value: this.previousItemData,
                        enumerable: true
                    },
                    text: {
                        value: this.previousItemData,
                        enumerable: true
                    }
                });
            }
            else {
                preItems = this.previousItemData;
            }
            this.setHiddenValue();
            var eventArgs = {
                e: eve,
                item: this.item,
                itemData: items,
                previousItem: this.previousSelectedLI,
                previousItemData: preItems,
                isInteracted: eve ? true : false,
                value: this.value,
                element: this.element
            };
            if (this.isAngular && this.preventChange) {
                this.preventChange = false;
            }
            else {
                this.trigger('change', eventArgs);
            }
            if (this.isServerBlazor && this.enablePersistence) {
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('ServerChange');
            }
        }
        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) || this.value === '') && this.floatLabelType !== 'Always') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], 'e-valid-input');
        }
    };
    DropDownList.prototype.setHiddenValue = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            if (this.isServerBlazor && this.hiddenElement.querySelector('option')) {
                var selectedElement = this.hiddenElement.querySelector('option');
                selectedElement.textContent = this.text;
                selectedElement.setAttribute('value', this.value.toString());
            }
            else if (!this.isServerBlazor) {
                this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
                var selectedElement = this.hiddenElement.querySelector('option');
                selectedElement.setAttribute('value', this.value.toString());
            }
        }
        else if (!this.isServerBlazor) {
            this.hiddenElement.innerHTML = '';
        }
    };
    /**
     * Filter bar implementation
     */
    DropDownList.prototype.onFilterUp = function (e) {
        if (!(e.ctrlKey && e.keyCode === 86) && (this.isValidKey || e.keyCode === 40 || e.keyCode === 38)) {
            this.isValidKey = false;
            switch (e.keyCode) {
                case 38: //up arrow 
                case 40: //down arrow 
                    if (this.getModuleName() === 'autocomplete' && !this.isPopupOpen && !this.preventAltUp && !this.isRequested) {
                        this.preventAutoFill = true;
                        this.searchLists(e);
                    }
                    else {
                        this.preventAutoFill = false;
                    }
                    this.preventAltUp = false;
                    e.preventDefault();
                    break;
                case 46: //delete
                case 8: //backspace
                    this.typedString = this.filterInput.value;
                    if (!this.isPopupOpen && this.typedString !== '' || this.isPopupOpen && this.queryString.length > 0) {
                        this.preventAutoFill = true;
                        this.searchLists(e);
                    }
                    else if (this.typedString === '' && this.queryString === '' && this.getModuleName() !== 'autocomplete') {
                        this.preventAutoFill = true;
                        this.searchLists(e);
                    }
                    else if (this.typedString === '') {
                        if (this.list) {
                            this.resetFocusElement();
                        }
                        this.activeIndex = null;
                        if (this.getModuleName() === 'autocomplete') {
                            this.hidePopup();
                        }
                    }
                    e.preventDefault();
                    break;
                default:
                    this.typedString = this.filterInput.value;
                    this.preventAutoFill = false;
                    this.searchLists(e);
                    break;
            }
        }
        else {
            this.isValidKey = false;
        }
    };
    DropDownList.prototype.onFilterDown = function (e) {
        switch (e.keyCode) {
            case 13: //enter
                break;
            case 40: //down arrow
            case 38: //up arrow 
                this.queryString = this.filterInput.value;
                e.preventDefault();
                break;
            case 9: //tab 
                if (this.isPopupOpen && this.getModuleName() !== 'autocomplete') {
                    e.preventDefault();
                }
                break;
            default:
                this.prevSelectPoints = this.getSelectionPoints();
                this.queryString = this.filterInput.value;
                break;
        }
    };
    DropDownList.prototype.removeFillSelection = function () {
        if (this.isInteracted) {
            var selection = this.getSelectionPoints();
            this.inputElement.setSelectionRange(selection.end, selection.end);
        }
    };
    DropDownList.prototype.getQuery = function (query) {
        var filterQuery;
        if (!this.isCustomFilter && this.allowFiltering && this.filterInput) {
            filterQuery = query ? query.clone() : this.query ? this.query.clone() : new _ej2_data__WEBPACK_IMPORTED_MODULE_5__["Query"]();
            var filterType = this.typedString === '' ? 'contains' : this.filterType;
            var dataType = this.typeOfData(this.dataSource).typeof;
            if (!(this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) && dataType === 'string' || dataType === 'number') {
                filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
            }
            else {
                var fields = (this.fields.text) ? this.fields.text : '';
                filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
            }
        }
        else {
            filterQuery = query ? query : this.query ? this.query : new _ej2_data__WEBPACK_IMPORTED_MODULE_5__["Query"]();
        }
        return filterQuery;
    };
    DropDownList.prototype.getSelectionPoints = function () {
        var input = this.inputElement;
        return { start: Math.abs(input.selectionStart), end: Math.abs(input.selectionEnd) };
    };
    DropDownList.prototype.searchLists = function (e) {
        var _this = this;
        this.isTyped = true;
        this.activeIndex = null;
        this.isListSearched = true;
        if (this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon)) {
            var clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);
            clearElement.style.visibility = this.filterInput.value === '' ? 'hidden' : 'visible';
        }
        this.isDataFetched = false;
        if (this.isFiltering()) {
            if (this.isServerBlazor) {
                this.beforePopupOpen = (this.getModuleName() === 'combobox' && this.isFiltering() && !this.beforePopupOpen)
                    ? !this.beforePopupOpen : this.beforePopupOpen;
                if (this.filterInput.value === '' && this.getModuleName() !== 'dropdownlist') {
                    // tslint:disable-next-line
                    this.interopAdaptor.invokeMethodAsync('OnServerRenderList', this.beforePopupOpen, false);
                }
                else {
                    // tslint:disable-next-line
                    this.interopAdaptor.invokeMethodAsync('OnServerFilter', this.filterInput.value);
                }
            }
            else {
                var eventArgs_1 = {
                    preventDefaultAction: false,
                    text: this.filterInput.value,
                    updateData: function (dataSource, query, fields) {
                        if (eventArgs_1.cancel) {
                            return;
                        }
                        _this.isCustomFilter = true;
                        _this.filteringAction(dataSource, query, fields);
                    },
                    baseEventArgs: e,
                    cancel: false
                };
                this.trigger('filtering', eventArgs_1, function (eventArgs) {
                    if (!eventArgs.cancel && !_this.isCustomFilter && !eventArgs.preventDefaultAction) {
                        _this.filteringAction(_this.dataSource, null, _this.fields);
                    }
                });
            }
        }
    };
    /**
     * To filter the data from given data source by using query
     * @param  {Object[] | DataManager } dataSource - Set the data source to filter.
     * @param  {Query} query - Specify the query to filter the data.
     * @param  {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
     * @return {void}.

     */
    DropDownList.prototype.filter = function (dataSource, query, fields) {
        this.isCustomFilter = true;
        this.filteringAction(dataSource, query, fields);
    };
    DropDownList.prototype.filteringAction = function (dataSource, query, fields) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.filterInput)) {
            this.beforePopupOpen = true;
            if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
                this.actionCompleteData.isUpdated = false;
                this.isTyped = false;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionCompleteData.ulElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionCompleteData.list)) {
                    this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
                }
                this.isTyped = true;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData) && this.getModuleName() === 'dropdownlist') {
                    this.focusIndexItem();
                    this.setScrollPosition();
                }
                this.isNotSearchList = true;
            }
            else {
                this.isNotSearchList = false;
                query = (this.filterInput.value.trim() === '') ? null : query;
                this.resetList(dataSource, fields, query);
            }
            this.renderReactTemplates();
        }
    };
    DropDownList.prototype.setSearchBox = function (popupElement) {
        if (this.isFiltering()) {
            var parentElement = popupElement.querySelector('.' + dropDownListClasses.filterParent) ?
                popupElement.querySelector('.' + dropDownListClasses.filterParent) : this.createElement('span', {
                className: dropDownListClasses.filterParent
            });
            if (this.isServerBlazor) {
                parentElement.innerHTML = '';
            }
            this.filterInput = this.createElement('input', {
                attrs: { type: 'text' },
                className: dropDownListClasses.filterInput
            });
            this.element.parentNode.insertBefore(this.filterInput, this.element);
            var backIcon = false;
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                backIcon = true;
            }
            this.filterInputObj = _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].createInput({
                element: this.filterInput,
                buttons: backIcon ?
                    [dropDownListClasses.backIcon, dropDownListClasses.filterBarClearIcon] : [dropDownListClasses.filterBarClearIcon],
                properties: { placeholder: this.filterBarPlaceholder }
            }, this.createElement);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
                if (this.cssClass.split(' ').indexOf('e-outline') !== -1) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.filterInputObj.container], 'e-outline');
                }
                else if (this.cssClass.split(' ').indexOf('e-filled') !== -1) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.filterInputObj.container], 'e-filled');
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([this.filterInputObj.container], parentElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([parentElement], popupElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.filterInput, {
                'aria-disabled': 'false',
                'aria-owns': this.element.id + '_options',
                'role': 'listbox',
                'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
                'autocomplete': 'off',
                'autocorrect': 'off',
                'autocapitalize': 'off',
                'spellcheck': 'false'
            });
            this.clearIconElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.clearIconElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.clearIconElement, 'click', this.clearText, this);
                this.clearIconElement.style.visibility = 'hidden';
            }
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.searchKeyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.filterInput, {
                    keyAction: this.keyActionHandler.bind(this),
                    keyConfigs: this.keyConfigure,
                    eventName: 'keydown'
                });
            }
            else {
                this.searchKeyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.filterInput, {
                    keyAction: this.mobileKeyActionHandler.bind(this),
                    keyConfigs: this.keyConfigure,
                    eventName: 'keydown'
                });
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.filterInput, 'input', this.onInput, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.filterInput, 'keyup', this.onFilterUp, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.filterInput, 'keydown', this.onFilterDown, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.filterInput, 'blur', this.onBlur, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.filterInput, 'paste', this.pasteHandler, this);
            return this.filterInputObj;
        }
        else {
            return inputObject;
        }
    };
    ;
    DropDownList.prototype.onInput = function (e) {
        this.isValidKey = true;
        // For filtering works in mobile firefox.
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'mozilla') {
            this.typedString = this.filterInput.value;
            this.preventAutoFill = true;
            this.searchLists(e);
        }
    };
    DropDownList.prototype.pasteHandler = function (e) {
        var _this = this;
        setTimeout(function () {
            _this.typedString = _this.filterInput.value;
            _this.searchLists(e);
        });
    };
    DropDownList.prototype.onActionFailure = function (e) {
        _super.prototype.onActionFailure.call(this, e);
        if (this.beforePopupOpen) {
            this.renderPopup();
        }
    };
    DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
        var _this = this;
        if (this.isNotSearchList) {
            this.isNotSearchList = false;
            return;
        }
        if (this.isActive) {
            var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
            _super.prototype.onActionComplete.call(this, ulElement, list, e);
            this.updateSelectElementData(this.allowFiltering);
            if (this.isRequested && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
                this.isRequested = false;
                this.keyActionHandler(this.searchKeyEvent);
                this.searchKeyEvent = null;
            }
            if (this.isRequested && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.searchKeyEvent)) {
                this.incrementalSearch(this.searchKeyEvent);
                this.searchKeyEvent = null;
            }
            this.list.scrollTop = 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ulElement)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
            }
            if (this.initRemoteRender) {
                this.initial = true;
                this.activeIndex = this.index;
                this.updateValues();
                this.initRemoteRender = false;
                this.initial = false;
                if (this.value && this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
                    var checkField_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fields.value) ? this.fields.text : this.fields.value;
                    var checkVal = list.some(function (x) { return x[checkField_1] === _this.value; });
                    if (!checkVal) {
                        this.dataSource.executeQuery(this.getQuery(this.query).where(new _ej2_data__WEBPACK_IMPORTED_MODULE_5__["Predicate"](checkField_1, 'equal', this.value)))
                            .then(function (e) {
                            if (e.result.length > 0) {
                                _this.addItem(e.result, list.length);
                                _this.updateValues();
                            }
                        });
                    }
                }
            }
            if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
                if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
                    && !this.isFilterFocus) || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData) && this.allowFiltering)
                    && ((this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"])
                        || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dataSource) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dataSource.length) &&
                            this.dataSource.length !== 0)))) {
                    if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
                        setTimeout(function () {
                            _this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
                        }, 0);
                    }
                    else {
                        this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
                    }
                }
                this.addNewItem(list, selectedItem);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData)) {
                    this.focusIndexItem();
                }
            }
            if (this.beforePopupOpen) {
                this.renderPopup();
            }
        }
    };
    DropDownList.prototype.addNewItem = function (listData, newElement) {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newElement)) {
            var value_1 = this.getItemData().value;
            var isExist = listData.some(function (data) {
                return (((typeof data === 'string' || typeof data === 'number') && data === value_1) ||
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(_this.fields.value, data) === value_1));
            });
            if (!isExist) {
                this.addItem(this.itemData);
            }
        }
    };
    DropDownList.prototype.updateActionCompleteData = function (li, item, index) {
        var _this = this;
        if (this.getModuleName() !== 'autocomplete' && this.actionCompleteData.ulElement) {
            if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
                setTimeout(function () {
                    _this.actionCompleteDataUpdate(li, item, index);
                }, 0);
            }
            else {
                this.actionCompleteDataUpdate(li, item, index);
            }
        }
    };
    DropDownList.prototype.actionCompleteDataUpdate = function (li, item, index) {
        if (index != null) {
            this.actionCompleteData.ulElement.insertBefore(li.cloneNode(true), this.actionCompleteData.ulElement.childNodes[index]);
        }
        else {
            this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));
        }
        if (this.isFiltering() && this.actionCompleteData.list.indexOf(item) < 0) {
            this.actionCompleteData.list.push(item);
        }
    };
    DropDownList.prototype.focusIndexItem = function () {
        var value = this.getItemData().value;
        this.activeIndex = this.getIndexByValue(value);
        var element = this.findListElement(this.list, 'li', 'data-value', value);
        this.selectedLI = element;
        this.activeItem(element);
        this.removeFocus();
    };
    DropDownList.prototype.updateSelection = function () {
        var selectedItem = this.list.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].selected);
        if (selectedItem) {
            this.setProperties({ 'index': this.getIndexByValue(selectedItem.getAttribute('data-value')) });
            this.activeIndex = this.index;
        }
        else {
            this.removeFocus();
            this.list.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li).classList.add(dropDownListClasses.focus);
        }
    };
    DropDownList.prototype.removeFocus = function () {
        var highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
        if (highlightedItem && highlightedItem.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(highlightedItem, dropDownListClasses.focus);
        }
    };
    ;
    DropDownList.prototype.renderPopup = function () {
        var _this = this;
        if (this.popupObj && document.body.contains(this.popupObj.element)) {
            this.refreshPopup();
            return;
        }
        var args = { cancel: false };
        this.trigger('beforeOpen', args, function (args) {
            if (!args.cancel) {
                var popupEle = (_this.serverPopupEle) ? _this.serverPopupEle : _this.createElement('div', {
                    id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
                });
                var searchBox = _this.setSearchBox(popupEle);
                _this.listHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(_this.popupHeight);
                if (_this.headerTemplate && !_this.isServerBlazor) {
                    _this.setHeaderTemplate(popupEle);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([_this.list], popupEle);
                if (_this.footerTemplate && !_this.isServerBlazor) {
                    _this.setFooterTemplate(popupEle);
                }
                if (_this.isServerRendered && popupEle && popupEle.querySelector('.e-ddl-footer')) {
                    popupEle.appendChild(popupEle.querySelector('.e-ddl-footer'));
                }
                document.body.appendChild(popupEle);
                _this.updateServerPopup(popupEle);
                popupEle.style.visibility = 'hidden';
                if (_this.popupHeight !== 'auto') {
                    _this.searchBoxHeight = 0;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(searchBox.container)) {
                        _this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
                        _this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';
                    }
                    if (_this.headerTemplate || (_this.isServerRendered && popupEle && popupEle.querySelector('.e-ddl-header'))) {
                        _this.header = _this.header ? _this.header : popupEle.querySelector('.e-ddl-header');
                        var height = Math.round(_this.header.getBoundingClientRect().height);
                        _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';
                    }
                    if (_this.footerTemplate || (_this.isServerRendered && popupEle && popupEle.querySelector('.e-ddl-footer'))) {
                        _this.footer = _this.footer ? _this.footer : popupEle.querySelector('.e-ddl-footer');
                        var height = Math.round(_this.footer.getBoundingClientRect().height);
                        _this.listHeight = (parseInt(_this.listHeight, 10) - (height + _this.searchBoxHeight)).toString() + 'px';
                    }
                    _this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
                    popupEle.style.maxHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(_this.popupHeight);
                }
                else {
                    popupEle.style.height = 'auto';
                }
                var offsetValue = 0;
                var left = void 0;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.selectedLI) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.activeIndex) && _this.activeIndex >= 0)) {
                    _this.setScrollPosition();
                }
                else {
                    _this.list.scrollTop = 0;
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && (!_this.allowFiltering && (_this.getModuleName() === 'dropdownlist' ||
                    (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
                    offsetValue = _this.getOffsetValue(popupEle);
                    var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
                    left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
                        parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
                        parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
                }
                _this.getFocusElement();
                _this.createPopup(popupEle, offsetValue, left);
                _this.checkCollision(popupEle);
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.popupObj.element.classList.add(dropDownListClasses.device);
                    if (_this.getModuleName() === 'dropdownlist' || (_this.getModuleName() === 'combobox'
                        && !_this.allowFiltering && _this.isDropDownClick)) {
                        _this.popupObj.collision = { X: 'fit', Y: 'fit' };
                    }
                    if (_this.isFilterLayout()) {
                        _this.popupObj.element.classList.add(dropDownListClasses.mobileFilter);
                        _this.popupObj.position = { X: 0, Y: 0 };
                        _this.popupObj.dataBind();
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.popupObj.element, { style: 'left:0px;right:0px;top:0px;bottom:0px;' });
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([document.body, _this.popupObj.element], dropDownListClasses.popupFullScreen);
                        _this.setSearchBoxPosition();
                        _this.backIconElement = searchBox.container.querySelector('.e-back-icon');
                        _this.clearIconElement = searchBox.container.querySelector('.' + dropDownListClasses.clearIcon);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(_this.backIconElement, 'click', _this.clickOnBackIcon, _this);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(_this.clearIconElement, 'click', _this.clearText, _this);
                    }
                }
                popupEle.style.visibility = 'visible';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([popupEle], 'e-popup-close');
                var scrollParentElements = _this.popupObj.getScrollableParent(_this.inputWrapper.container);
                for (var _i = 0, scrollParentElements_1 = scrollParentElements; _i < scrollParentElements_1.length; _i++) {
                    var element = scrollParentElements_1[_i];
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'scroll', _this.scrollHandler, _this);
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _this.isFilterLayout()) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(_this.list, 'scroll', _this.listScroll, _this);
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.list)) {
                    _this.unWireListEvents();
                    _this.wireListEvents();
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(_this.targetElement(), { 'aria-expanded': 'true' });
                var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([inputParent], [dropDownListClasses.inputFocus]);
                var animModel = { name: 'FadeIn', duration: 100 };
                _this.beforePopupOpen = true;
                var popupInstance = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && _this.isServerRendered) ? null : _this.popupObj;
                var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
                _this.trigger('open', eventArgs, function (eventArgs) {
                    if (!eventArgs.cancel) {
                        _this.serverBlazorUpdateSelection();
                        _this.bindServerScrollEvent();
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
                        _this.renderReactTemplates();
                        _this.popupObj.show(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
                    }
                    else {
                        _this.beforePopupOpen = false;
                        _this.destroyPopup();
                    }
                });
            }
            else {
                _this.beforePopupOpen = false;
            }
        });
    };
    DropDownList.prototype.checkCollision = function (popupEle) {
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice || (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !(this.getModuleName() === 'dropdownlist' || this.isDropDownClick))) {
            var collision = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["isCollide"])(popupEle);
            if (collision.length > 0) {
                popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
            }
            this.popupObj.resolveCollision();
        }
    };
    DropDownList.prototype.serverBlazorUpdateSelection = function () {
        if (this.isServerBlazor && (this.value !== null || this.index !== null || this.text !== null) ||
            (this.getModuleName() !== 'dropdownlist' && !this.isTyped)) {
            if (this.getModuleName() === 'dropdownlist') {
                this.removeSelection();
                this.removeFocus();
                this.removeHover();
                this.updateValues();
            }
            if (this.getModuleName() === 'combobox' && this.ulElement &&
                this.findListElement(this.ulElement, 'li', 'data-value', this.value) && !this.isTyped) {
                this.updateValues();
            }
            if (this.isServerBlazor && this.getModuleName() !== 'dropdownlist' &&
                (this.text === '' || this.text === null) && this.ulElement) {
                if (!this.ulElement.querySelector('li').classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.ulElement.querySelector('li')], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].hover);
                }
            }
        }
    };
    DropDownList.prototype.bindServerScrollEvent = function () {
        if (this.isServerBlazor && this.list) {
            if ((this.fields.groupBy) && !this.isGroupChecking) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'scroll', this.setFloatingHeader);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.list, 'scroll', this.setFloatingHeader, this);
            }
        }
    };
    DropDownList.prototype.updateServerPopup = function (popupEle) {
        if (this.isServerBlazor) {
            if (popupEle && popupEle.querySelector('li')) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([popupEle.querySelector('.e-content')], ['e-nodata']);
            }
            this.initial = false;
            popupEle.removeAttribute('style');
        }
    };
    DropDownList.prototype.getOffsetValue = function (popupEle) {
        var popupStyles = getComputedStyle(popupEle);
        var borderTop = parseInt(popupStyles.borderTopWidth, 10);
        var borderBottom = parseInt(popupStyles.borderBottomWidth, 10);
        return this.setPopupPosition(borderTop + borderBottom);
    };
    DropDownList.prototype.createPopup = function (element, offsetValue, left) {
        var _this = this;
        this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](element, {
            width: this.setWidth(), targetType: 'relative',
            relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
            enableRtl: this.enableRtl, offsetX: left, position: { X: 'left', Y: 'bottom' },
            zIndex: this.zIndex,
            close: function () {
                if (!_this.isDocumentClick) {
                    _this.focusDropDown();
                }
                // tslint:disable-next-line
                if (_this.isReact) {
                    _this.clearTemplate(['headerTemplate', 'footerTemplate']);
                }
                var isResetItem = (_this.getModuleName() === 'autocomplete') ? true : false;
                _this.DropDownBaseresetBlazorTemplates(isResetItem, isResetItem, true, true, false, true, true);
                _this.isNotSearchList = false;
                _this.isDocumentClick = false;
                _this.destroyPopup();
                var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(_this.inputElement, 'form');
                if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
                    _this.isActive = true;
                    _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
                }
            },
            open: function () {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown', _this.onDocumentClick, _this);
                _this.isPopupOpen = true;
                var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
                    _this.actionCompleteData.ulElement.querySelector('li');
                var ulElement = _this.list.querySelector('ul li');
                if (_this.isFiltering() && _this.itemTemplate && (_this.element.tagName === _this.getNgDirective()) &&
                    (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
                    _this.element.tagName !== 'EJS-COMBOBOX') {
                    _this.cloneElements();
                }
                if (_this.isFilterLayout()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.inputWrapper.container], [dropDownListClasses.inputFocus]);
                    _this.isFilterFocus = true;
                    _this.filterInput.focus();
                    if (_this.inputWrapper.clearButton) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.inputWrapper.clearButton], dropDownListClasses.clearIconHide);
                    }
                }
                _this.activeStateChange();
            },
            targetExitViewport: function () {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    _this.hidePopup();
                }
            }
        });
    };
    DropDownList.prototype.isEmptyList = function () {
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) && this.liCollections.length === 0;
    };
    DropDownList.prototype.getFocusElement = function () {
        // combo-box used this method
    };
    DropDownList.prototype.isFilterLayout = function () {
        return this.getModuleName() === 'dropdownlist' && this.allowFiltering;
    };
    DropDownList.prototype.scrollHandler = function () {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && ((this.getModuleName() === 'dropdownlist' &&
            !this.isFilterLayout()) || (this.getModuleName() === 'combobox' && !this.allowFiltering && this.isDropDownClick))) {
            this.hidePopup();
        }
    };
    DropDownList.prototype.setSearchBoxPosition = function () {
        var searchBoxHeight = this.filterInput.parentElement.getBoundingClientRect().height;
        this.popupObj.element.style.maxHeight = '100%';
        this.popupObj.element.style.width = '100%';
        this.list.style.maxHeight = (window.innerHeight - searchBoxHeight) + 'px';
        this.list.style.height = (window.innerHeight - searchBoxHeight) + 'px';
        var clearElement = this.filterInput.parentElement.querySelector('.' + dropDownListClasses.clearIcon);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.filterInput);
        clearElement.parentElement.insertBefore(this.filterInput, clearElement);
    };
    DropDownList.prototype.setPopupPosition = function (border) {
        var offsetValue;
        var popupOffset = border;
        var selectedLI = this.list.querySelector('.' + dropDownListClasses.focus) || this.selectedLI;
        var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
        var lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
        var liHeight = firstItem.getBoundingClientRect().height;
        var listHeight = this.list.offsetHeight / 2;
        var height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
        var lastItemOffsetValue = lastItem.offsetTop;
        if (lastItemOffsetValue - listHeight < height && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.liCollections) &&
            this.liCollections.length > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedLI)) {
            var count = this.list.offsetHeight / liHeight;
            var paddingBottom = parseInt(getComputedStyle(this.list).paddingBottom, 10);
            offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
            this.list.scrollTop = selectedLI.offsetTop;
        }
        else if (height > listHeight) {
            offsetValue = listHeight - liHeight / 2;
            this.list.scrollTop = height - listHeight + liHeight / 2;
        }
        else {
            offsetValue = height;
        }
        var inputHeight = this.inputWrapper.container.offsetHeight;
        offsetValue = offsetValue + liHeight + popupOffset - ((liHeight - inputHeight) / 2);
        return -offsetValue;
    };
    DropDownList.prototype.setWidth = function () {
        var width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.popupWidth);
        if (width.indexOf('%') > -1) {
            var inputWidth = this.inputWrapper.container.offsetWidth * parseFloat(width) / 100;
            width = inputWidth.toString() + 'px';
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
            (this.isDropDownClick && this.getModuleName() === 'combobox')))) {
            var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
            width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -
                parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
                parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10)) * 2) + 'px';
        }
        return width;
    };
    DropDownList.prototype.scrollBottom = function (isInitial) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI)) {
            var currentOffset = this.list.offsetHeight;
            var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
            var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
            nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
            var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
            boxRange = this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement) ?
                boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
            if (this.activeIndex === 0) {
                this.list.scrollTop = 0;
            }
            else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
                this.list.scrollTop = nextOffset;
            }
        }
    };
    DropDownList.prototype.scrollTop = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI)) {
            var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
            var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
            nextOffset = this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement) ?
                nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
            var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
            if (this.activeIndex === 0) {
                this.list.scrollTop = 0;
            }
            else if (nextOffset < 0) {
                this.list.scrollTop = this.list.scrollTop + nextOffset;
            }
            else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
                this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fixedHeaderElement) ?
                    this.fixedHeaderElement.offsetHeight : 0);
            }
        }
    };
    DropDownList.prototype.isEditTextBox = function () {
        return false;
    };
    DropDownList.prototype.isFiltering = function () {
        return this.allowFiltering;
    };
    DropDownList.prototype.isPopupButton = function () {
        return true;
    };
    DropDownList.prototype.setScrollPosition = function (e) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)) {
            switch (e.action) {
                case 'pageDown':
                case 'down':
                case 'end':
                    this.scrollBottom();
                    break;
                default:
                    this.scrollTop();
                    break;
            }
        }
        else {
            this.scrollBottom(true);
        }
    };
    DropDownList.prototype.clearText = function () {
        this.filterInput.value = this.typedString = '';
        this.searchLists(null);
    };
    DropDownList.prototype.listScroll = function () {
        this.filterInput.blur();
    };
    DropDownList.prototype.setEleWidth = function (width) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(width)) {
            if (typeof width === 'number') {
                this.inputWrapper.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
            }
            else if (typeof width === 'string') {
                this.inputWrapper.container.style.width = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width));
            }
        }
    };
    DropDownList.prototype.closePopup = function (delay) {
        var _this = this;
        this.isTyped = false;
        if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
            return;
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown', this.onDocumentClick);
        this.isActive = false;
        this.filterInputObj = null;
        this.isDropDownClick = false;
        this.preventAutoFill = false;
        var scrollableParentElements = this.popupObj.getScrollableParent(this.inputWrapper.container);
        for (var _i = 0, scrollableParentElements_1 = scrollableParentElements; _i < scrollableParentElements_1.length; _i++) {
            var element = scrollableParentElements_1[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(element, 'scroll', this.scrollHandler);
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isFilterLayout()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'scroll', this.listScroll);
        }
        if (this.isFilterLayout()) {
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.searchKeyModule.destroy();
                if (this.clearIconElement) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.clearIconElement, 'click', this.clearText);
                }
            }
            if (this.backIconElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.backIconElement, 'click', this.clickOnBackIcon);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.clearIconElement, 'click', this.clearText);
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.filterInput, 'input', this.onInput);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.filterInput, 'keyup', this.onFilterUp);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.filterInput, 'keydown', this.onFilterDown);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.filterInput, 'blur', this.onBlur);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.filterInput, 'paste', this.pasteHandler);
            this.filterInput = null;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.targetElement(), { 'aria-expanded': 'false', 'aria-activedescendant': null });
        this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
        if (this.isFiltering()) {
            this.actionCompleteData.isUpdated = false;
        }
        this.beforePopupOpen = false;
        var animModel = {
            name: 'FadeOut',
            duration: 100,
            delay: delay ? delay : 0
        };
        var popupInstance = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? null : this.popupObj;
        var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
        this.trigger('close', eventArgs, function (eventArgs) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.popupObj) &&
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.popupObj.element.querySelector('.e-fixed-head'))) {
                var fixedHeader = _this.popupObj.element.querySelector('.e-fixed-head');
                fixedHeader.parentNode.removeChild(fixedHeader);
                _this.fixedHeaderElement = null;
            }
            if (!eventArgs.cancel) {
                if (_this.getModuleName() === 'autocomplete' && !_this.isServerBlazor) {
                    _this.rippleFun();
                }
                if (_this.isPopupOpen) {
                    _this.popupObj.hide(new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](eventArgs.animation));
                }
                else {
                    _this.destroyPopup();
                }
            }
        });
    };
    DropDownList.prototype.destroyPopup = function () {
        var popupHolderEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + this.element.id + '_popup_holder', document);
        if (this.isServerBlazor && this.serverPopupEle && popupHolderEle) {
            popupHolderEle.appendChild(this.serverPopupEle);
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('OnServerClosePopup');
        }
        this.isPopupOpen = false;
        this.isFilterFocus = false;
        this.popupObj.destroy();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.popupObj.element);
    };
    DropDownList.prototype.clickOnBackIcon = function () {
        this.hidePopup();
        this.focusIn();
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    // tslint:disable-next-line
    DropDownList.prototype.render = function () {
        if (this.isServerBlazor) {
            this.inputElement = this.element;
            this.inputWrapper = { container: this.element.parentElement };
            this.hiddenElement = this.inputWrapper.container.querySelector('select');
            this.inputWrapper.buttons = [this.inputWrapper.container.querySelector('.e-input-group-icon.e-ddl-icon')];
            if (this.showClearButton) {
                this.inputWrapper.clearButton = this.inputWrapper.container.querySelector('.e-clear-icon');
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].wireClearBtnEvents(this.element, this.inputWrapper.clearButton, this.inputWrapper.container);
            }
            if (this.floatLabelType === 'Auto') {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].wireFloatingEvents(this.element);
            }
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].bindInitialEvent({
                element: this.element,
                buttons: null, customTag: null,
                floatLabelType: this.floatLabelType,
                properties: this.properties
            });
            this.setFields();
            this.wireEvent();
            this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
            if (!this.enabled) {
                this.targetElement().tabIndex = -1;
            }
            if (this.element.hasAttribute('autofocus')) {
                this.focusIn();
            }
            this.initial = false;
        }
        else {
            if (this.element.tagName === 'INPUT') {
                this.inputElement = this.element;
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute('role'))) {
                    this.inputElement.setAttribute('role', 'textbox');
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inputElement.getAttribute('type'))) {
                    this.inputElement.setAttribute('type', 'text');
                }
            }
            else {
                this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
                if (this.element.tagName !== this.getNgDirective()) {
                    this.element.style.display = 'none';
                }
                this.element.parentElement.insertBefore(this.inputElement, this.element);
                this.preventTabIndex(this.inputElement);
            }
            var updatedCssClassValues = this.cssClass;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
                updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
            }
            this.inputWrapper = _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].createInput({
                element: this.inputElement,
                buttons: this.isPopupButton() ? [dropDownListClasses.icon] : null,
                floatLabelType: this.floatLabelType,
                properties: {
                    readonly: this.getModuleName() === 'dropdownlist' ? true : this.readonly,
                    placeholder: this.placeholder,
                    cssClass: updatedCssClassValues,
                    enabled: this.enabled,
                    enableRtl: this.enableRtl,
                    showClearButton: this.showClearButton
                },
            }, this.createElement);
            if (this.element.tagName === this.getNgDirective()) {
                this.element.appendChild(this.inputWrapper.container);
            }
            else {
                this.inputElement.parentElement.insertBefore(this.element, this.inputElement);
            }
            this.hiddenElement = this.createElement('select', {
                attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': dropDownListClasses.hiddenElement }
            });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.hiddenElement], this.inputWrapper.container);
            this.validationAttribute(this.element, this.hiddenElement);
            this.setFields();
            this.inputWrapper.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
            this.inputWrapper.container.classList.add('e-ddl');
            this.wireEvent();
            this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
            this.element.removeAttribute('tabindex');
            var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2_dropdownlist');
            this.element.id = id;
            this.hiddenElement.id = id + '_hidden';
            this.targetElement().setAttribute('tabindex', this.tabIndex);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.targetElement(), this.getAriaAttributes());
            this.updateDataAttribute(this.htmlAttributes);
            this.setHTMLAttributes();
            if (this.value !== null || this.activeIndex !== null || this.text !== null) {
                this.initValue();
            }
            else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
                var selectElement = this.element;
                this.value = selectElement.options[selectElement.selectedIndex].value;
                this.text = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
                this.initValue();
            }
            this.preventTabIndex(this.element);
            if (!this.enabled) {
                this.targetElement().tabIndex = -1;
            }
            this.initial = false;
            this.element.style.opacity = '';
            this.inputElement.onselect = function (e) { e.stopImmediatePropagation(); };
            this.inputElement.onchange = function (e) { e.stopImmediatePropagation(); };
            if (this.element.hasAttribute('autofocus')) {
                this.focusIn();
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.text)) {
                this.inputElement.setAttribute('value', this.text);
            }
        }
        if (this.element.hasAttribute('data-val')) {
            this.element.setAttribute('data-val', 'false');
        }
        this.renderComplete();
    };
    ;
    DropDownList.prototype.setFooterTemplate = function (popupEle) {
        var compiledString;
        if (this.footer) {
            this.footer.innerHTML = '';
        }
        else {
            this.footer = this.createElement('div');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.footer], dropDownListClasses.footer);
        }
        var footercheck = this.dropdownCompiler(this.footerTemplate);
        if (footercheck) {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.footerTemplate, document).innerHTML.trim());
        }
        else {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.footerTemplate);
        }
        // tslint:disable-next-line
        var footerCompTemp = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);
        if (footerCompTemp && footerCompTemp.length > 0) {
            for (var i = 0; i < footerCompTemp.length; i++) {
                this.footer.appendChild(footerCompTemp[i]);
            }
        }
        this.DropDownBaseupdateBlazorTemplates(false, false, false, false, false, false, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([this.footer], popupEle);
    };
    DropDownList.prototype.setHeaderTemplate = function (popupEle) {
        var compiledString;
        if (this.header) {
            this.header.innerHTML = '';
        }
        else {
            this.header = this.createElement('div');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.header], dropDownListClasses.header);
        }
        var headercheck = this.dropdownCompiler(this.headerTemplate);
        if (headercheck) {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.headerTemplate, document).innerHTML.trim());
        }
        else {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.headerTemplate);
        }
        // tslint:disable-next-line
        var headerCompTemp = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);
        if (headerCompTemp && headerCompTemp.length) {
            for (var i = 0; i < headerCompTemp.length; i++) {
                this.header.appendChild(headerCompTemp[i]);
            }
        }
        this.DropDownBaseupdateBlazorTemplates(false, false, false, false, false, true, false);
        var contentEle = popupEle.querySelector('div.e-content');
        popupEle.insertBefore(this.header, contentEle);
    };
    DropDownList.prototype.setOldText = function (text) {
        this.text = text;
    };
    DropDownList.prototype.setOldValue = function (value) {
        this.value = value;
    };
    DropDownList.prototype.refreshPopup = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj) && document.body.contains(this.popupObj.element) &&
            ((this.allowFiltering && !(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isFilterLayout())) || this.getModuleName() === 'autocomplete')) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.popupObj.element], 'e-popup-close');
            this.popupObj.refreshPosition(this.inputWrapper.container);
            this.popupObj.resolveCollision();
        }
    };
    DropDownList.prototype.checkData = function (newProp) {
        if (newProp.dataSource && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object.keys(newProp.dataSource)) && this.itemTemplate && this.allowFiltering &&
            !(this.isListSearched && (newProp.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]))) {
            this.list = null;
            this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
        }
        this.isListSearched = false;
        var isChangeValue = Object.keys(newProp).indexOf('value') !== -1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value);
        var isChangeText = Object.keys(newProp).indexOf('text') !== -1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.text);
        if (this.getModuleName() !== 'autocomplete' && this.allowFiltering && (isChangeValue || isChangeText)) {
            this.itemData = null;
        }
        if (this.allowFiltering && newProp.dataSource && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object.keys(newProp.dataSource))) {
            this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
        }
    };
    DropDownList.prototype.updateDataSource = function (props) {
        if (this.inputElement.value !== '' || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(props) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(props.dataSource)
            || (!(props.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) && props.dataSource.length === 0)))) {
            this.clearAll(null, props);
        }
        if (!(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(props) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(props.dataSource)
            || (!(props.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) && props.dataSource.length === 0))) || !(props.dataSource === [])) {
            this.typedString = '';
            this.resetList(this.dataSource);
        }
        if (!this.isCustomFilter && !this.isFilterFocus && document.activeElement !== this.filterInput) {
            this.checkCustomValue();
        }
    };
    DropDownList.prototype.checkCustomValue = function () {
        this.itemData = this.getDataByValue(this.value);
        var dataItem = this.getItemData();
        this.setProperties({ 'value': dataItem.value, 'text': dataItem.text });
    };
    DropDownList.prototype.updateInputFields = function () {
        if (this.getModuleName() === 'dropdownlist') {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
        }
    };
    /**
     * Dynamically change the value of properties.
     * @private
     */
    DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (this.getModuleName() === 'dropdownlist') {
            if (!this.isServerBlazor) {
                this.checkData(newProp);
                this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
            }
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'query':
                case 'dataSource': break;
                case 'htmlAttributes':
                    this.setHTMLAttributes();
                    break;
                case 'width':
                    this.setEleWidth(newProp.width);
                    break;
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(newProp.placeholder, this.inputElement);
                    break;
                case 'filterBarPlaceholder':
                    if (this.filterInput) {
                        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setPlaceholder(newProp.filterBarPlaceholder, this.filterInput);
                    }
                    break;
                case 'readonly':
                    if (this.getModuleName() !== 'dropdownlist') {
                        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setReadonly(newProp.readonly, this.inputElement);
                    }
                    break;
                case 'cssClass':
                    this.setCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'enableRtl':
                    this.setEnableRtl();
                    break;
                case 'enabled':
                    this.setEnable();
                    break;
                case 'text':
                    if (newProp.text === null) {
                        this.clearAll();
                        break;
                    }
                    if (!this.list) {
                        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
                            this.initRemoteRender = true;
                        }
                        this.renderList();
                    }
                    if (!this.initRemoteRender) {
                        var li = this.getElementByText(newProp.text);
                        if (!this.checkValidLi(li)) {
                            if (this.liCollections && this.liCollections.length === 100 &&
                                this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
                                this.setSelectionData(newProp.text, oldProp.text, 'text');
                            }
                            else if (!this.isServerBlazor) {
                                this.setOldText(oldProp.text);
                            }
                        }
                        this.updateInputFields();
                    }
                    break;
                case 'value':
                    if (newProp.value === null) {
                        this.clearAll();
                        break;
                    }
                    this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
                    if (!this.list) {
                        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
                            this.initRemoteRender = true;
                        }
                        this.renderList();
                    }
                    if (!this.initRemoteRender) {
                        var item = this.getElementByValue(newProp.value);
                        if (!this.checkValidLi(item)) {
                            if (this.liCollections && this.liCollections.length === 100 &&
                                this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
                                this.setSelectionData(newProp.value, oldProp.value, 'value');
                            }
                            else if (!this.isServerBlazor) {
                                this.setOldValue(oldProp.value);
                            }
                        }
                        this.updateInputFields();
                    }
                    break;
                case 'index':
                    if (newProp.index === null) {
                        this.clearAll();
                        break;
                    }
                    if (!this.list) {
                        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
                            this.initRemoteRender = true;
                        }
                        this.renderList();
                    }
                    if (!this.initRemoteRender && this.liCollections) {
                        var element = this.liCollections[newProp.index];
                        if (!this.checkValidLi(element)) {
                            if (this.liCollections && this.liCollections.length === 100 &&
                                this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
                                this.setSelectionData(newProp.index, oldProp.index, 'index');
                            }
                            else if (!this.isServerBlazor) {
                                this.index = oldProp.index;
                            }
                        }
                        this.updateInputFields();
                    }
                    break;
                case 'footerTemplate':
                    if (this.popupObj) {
                        this.setFooterTemplate(this.popupObj.element);
                    }
                    break;
                case 'headerTemplate':
                    if (this.popupObj) {
                        this.setHeaderTemplate(this.popupObj.element);
                    }
                    break;
                case 'valueTemplate':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.itemData) && this.valueTemplate != null) {
                        this.setValueTemplate();
                    }
                    break;
                case 'allowFiltering':
                    if (this.allowFiltering) {
                        this.actionCompleteData = { ulElement: this.ulElement,
                            list: this.listData, isUpdated: true };
                        this.updateSelectElementData(this.allowFiltering);
                    }
                    break;
                case 'floatLabelType':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].removeFloating(this.inputWrapper);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);
                    break;
                case 'showClearButton':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);
                    this.bindClearEvent();
                    break;
                default:
                    var ddlProps = void 0;
                    ddlProps = this.getPropObject(prop, newProp, oldProp);
                    _super.prototype.onPropertyChanged.call(this, ddlProps.newProperty, ddlProps.oldProperty);
                    break;
            }
        }
        this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
    };
    DropDownList.prototype.checkValidLi = function (element) {
        if (this.isValidLI(element)) {
            this.setSelection(element, null);
            return true;
        }
        return false;
    };
    DropDownList.prototype.setSelectionData = function (newProp, oldProp, prop) {
        var _this = this;
        var li;
        this.updateListValues = function () {
            if (prop === 'text') {
                li = _this.getElementByText(newProp);
                if (!_this.checkValidLi(li)) {
                    _this.setOldText(oldProp);
                }
            }
            else if (prop === 'value') {
                li = _this.getElementByValue(newProp);
                if (!_this.checkValidLi(li)) {
                    _this.setOldValue(oldProp);
                }
            }
            else if (prop === 'index') {
                li = _this.liCollections[newProp];
                if (!_this.checkValidLi(li)) {
                    _this.index = oldProp;
                }
            }
        };
    };
    DropDownList.prototype.setCssClass = function (newClass, oldClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldClass)) {
            oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newClass)) {
            newClass = (newClass.replace(/\s+/g, ' ')).trim();
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newClass, [this.inputWrapper.container], oldClass);
        if (this.popupObj) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setCssClass(newClass, [this.popupObj.element], oldClass);
        }
    };
    /**
     * Return the module name.
     * @private
     */
    DropDownList.prototype.getModuleName = function () {
        return 'dropdownlist';
    };
    /**
     * Opens the popup that displays the list of items.
     * @returns void.
     */
    DropDownList.prototype.showPopup = function () {
        if (!this.enabled) {
            return;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.itemTemplate) {
            this.DropDownBaseupdateBlazorTemplates(true, false, false, false);
        }
        if (this.beforePopupOpen) {
            this.refreshPopup();
            return;
        }
        this.beforePopupOpen = true;
        if (this.isFiltering() && !this.isActive && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
            this.isActive = true;
            this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
        }
        else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.list) && (this.list.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].noData) ||
            this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li).length <= 0)) {
            this.renderList();
        }
        else if (this.isFiltering() && this.isServerBlazor) {
            this.renderList();
        }
        if (!this.isServerBlazor) {
            this.invokeRenderPopup();
        }
        var popupHolderEle = !this.isFiltering() || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + this.element.id + '_popup_holder', document);
        var isDropdownComp = this.getModuleName() === 'dropdownlist' || !this.isFiltering();
        if (this.isServerBlazor && popupHolderEle && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list) && isDropdownComp) {
            this.invokeRenderPopup();
        }
    };
    DropDownList.prototype.invokeRenderPopup = function () {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isFilterLayout()) {
            var proxy_2 = this;
            window.onpopstate = function () {
                proxy_2.hidePopup();
            };
            history.pushState({}, '');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.list.children[0]) || this.list.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].noData)) {
            this.renderPopup();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
    };
    DropDownList.prototype.clientRenderPopup = function (data, popupEle) {
        if (popupEle) {
            this.serverPopupEle = popupEle;
            this.list = popupEle.querySelector('.e-dropdownbase.e-content') ?
                popupEle.querySelector('.e-dropdownbase.e-content') : this.list;
            this.ulElement = this.list.querySelector('ul');
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ulElement) && !this.list.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].noData)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.list], [_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].noData]);
            }
            this.liCollections = this.ulElement ?
                this.ulElement.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li) : [];
            this.listData = data;
            if (this.getModuleName() === 'autocomplete' && this.liCollections.length > 0) {
                this.renderHightSearch();
            }
            this.initRemoteRender = false;
            if (!this.isPopupOpen) {
                this.serverBlazorUpdateSelection();
            }
            this.unWireListEvents();
            this.wireListEvents();
            if (this.isServerIncrementalSearch && this.searchKeyEvent) {
                this.isServerIncrementalSearch = false;
                this.initial = false;
                this.onServerIncrementalSearch(this.searchKeyEvent);
            }
            if (this.isServerNavigation && this.searchKeyEvent) {
                if (this.searchKeyEvent.action === 'down' || this.searchKeyEvent.action === 'up') {
                    this.isServerNavigation = false;
                    this.updateUpDownAction(this.searchKeyEvent);
                }
                else if (this.searchKeyEvent.action === 'home' || this.searchKeyEvent.action === 'end') {
                    this.isServerNavigation = false;
                    this.updateHomeEndAction(this.searchKeyEvent);
                }
            }
            if (this.beforePopupOpen) {
                this.invokeRenderPopup();
            }
            if (this.getModuleName() !== 'dropdownlist') {
                this.onActionComplete(this.ulElement, this.listData);
            }
        }
        else if (data != null && this.listData !== data) {
            this.listData = data;
            this.initRemoteRender = false;
        }
    };
    DropDownList.prototype.renderHightSearch = function () {
        // update high light search 
    };
    DropDownList.prototype.updateclientItemData = function (data) {
        this.listData = data;
    };
    DropDownList.prototype.initValueItemData = function (selectData) {
        this.itemData = selectData;
        this.previousValue = this.value;
        this.initial = false;
    };
    DropDownList.prototype.serverUpdateListElement = function (data, popupEle) {
        this.listData = data;
        if (this.ulElement) {
            this.liCollections = this.ulElement.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["dropDownBaseClasses"].li);
        }
    };
    /**
     * Hides the popup if it is in an open state.
     * @returns void.
     */
    DropDownList.prototype.hidePopup = function (e) {
        var isHeader = (this.headerTemplate) ? true : false;
        var isFooter = (this.headerTemplate) ? true : false;
        this.DropDownBaseresetBlazorTemplates(false, false, false, false, false, isHeader, isFooter);
        if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
            this.isEscapeKey = false;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.index)) {
                var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
                this.selectedLI = this.liCollections[this.index] || element;
                if (this.selectedLI) {
                    this.updateSelectedItem(this.selectedLI, null, true);
                    if (this.valueTemplate && this.itemData !== null) {
                        this.setValueTemplate();
                    }
                }
            }
            else {
                this.resetSelection();
            }
        }
        this.closePopup();
        var dataItem = this.getItemData();
        var isSelectVal = this.isServerBlazor ? !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) : !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedLI);
        if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
            isSelectVal && this.inputElement.value !== dataItem.text)) {
            this.isSelectCustom = false;
            this.clearAll(e);
        }
    };
    /**
     * Sets the focus on the component for interaction.
     * @returns void.
     */
    DropDownList.prototype.focusIn = function (e) {
        if (!this.enabled) {
            return;
        }
        if (this.targetElement().classList.contains(dropDownListClasses.disable)) {
            return;
        }
        var isFocused = false;
        if (this.preventFocus && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.inputWrapper.container.tabIndex = 1;
            this.inputWrapper.container.focus();
            this.preventFocus = false;
            isFocused = true;
        }
        if (!isFocused) {
            this.targetElement().focus();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
        this.onFocus(e);
    };
    /**
     * Moves the focus from the component if the component is already focused.
     * @returns void.
     */
    DropDownList.prototype.focusOut = function (e) {
        if (!this.enabled) {
            return;
        }
        this.isTyped = true;
        this.hidePopup(e);
        if (this.targetElement()) {
            this.targetElement().blur();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
     * @method destroy
     * @return {void}.
     */
    DropDownList.prototype.destroy = function () {
        this.isActive = false;
        // tslint:disable-next-line
        if (this.isReact) {
            this.clearTemplate();
        }
        if (!this.isServerBlazor || (this.popupObj && document.body.contains(this.popupObj.element))) {
            this.hidePopup();
        }
        this.unWireEvent();
        if (this.list) {
            this.unWireListEvents();
            if (this.isServerBlazor) {
                if ((this.fields.groupBy) && !this.isGroupChecking) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.list, 'scroll', this.setFloatingHeader);
                }
            }
        }
        if (!this.isServerBlazor) {
            if (this.element && !this.element.classList.contains('e-' + this.getModuleName())) {
                return;
            }
            if (this.inputElement) {
                var attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',
                    'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',
                    'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',
                    'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
                for (var i = 0; i < attrArray.length; i++) {
                    this.inputElement.removeAttribute(attrArray[i]);
                }
                this.inputElement.setAttribute('tabindex', this.tabIndex);
                this.inputElement.classList.remove('e-input');
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["Input"].setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
            }
            this.element.style.display = 'block';
            if (this.inputWrapper.container.parentElement.tagName === this.getNgDirective()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.container);
            }
            else {
                this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputWrapper.container);
            }
            _super.prototype.destroy.call(this);
        }
    };
    ;
    /**
     * Gets all the list items bound on this component.
     * @returns Element[].
     */
    DropDownList.prototype.getItems = function () {
        if (!this.list) {
            if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_5__["DataManager"]) {
                this.initRemoteRender = true;
            }
            this.renderList();
        }
        return this.ulElement ? _super.prototype.getItems.call(this) : [];
    };
    /**
     * Gets the data Object that matches the given value.
     * @param { string | number } value - Specifies the value of the list item.
     * @returns Object.
     * @blazorType object
     */
    DropDownList.prototype.getDataByValue = function (value) {
        return _super.prototype.getDataByValue.call(this, value);
    };
    /**
     * Allows you to clear the selected values from the component.
     * @returns void.
     */
    DropDownList.prototype.clear = function () {
        this.value = null;
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], DropDownList.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('300px')
    ], DropDownList.prototype, "popupHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], DropDownList.prototype, "popupWidth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], DropDownList.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "valueTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "footerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownList.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownList.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], DropDownList.prototype, "index", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], DropDownList.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownList.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownList.prototype, "focus", void 0);
    DropDownList = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DropDownList);
    return DropDownList;
}(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_4__["DropDownBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/index.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/index.js ***!
  \*****************************************************************************/
/*! exports provided: dropDownListClasses, DropDownList */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _drop_down_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drop-down-list */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/drop-down-list.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropDownListClasses", function() { return _drop_down_list__WEBPACK_IMPORTED_MODULE_0__["dropDownListClasses"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownList", function() { return _drop_down_list__WEBPACK_IMPORTED_MODULE_0__["DropDownList"]; });

/**
 * export all modules from current location
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/drop-down-tree.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/drop-down-tree.js ***!
  \**************************************************************************************/
/*! exports provided: Fields, TreeSettings, DropDownTree */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Fields", function() { return Fields; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeSettings", function() { return TreeSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropDownTree", function() { return DropDownTree; });
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_navigations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ej2-navigations */ "./ej2-resources/18.4.46/scripts/ej2-navigations/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};










var RTL = 'e-rtl';
var DROPDOWNTREE = 'e-ddt';
var HIDDENELEMENT = 'e-ddt-hidden';
var DROPDOWNICON = 'e-input-group-icon e-ddt-icon e-icons';
var SHOW_CHIP = 'e-show-chip';
var SHOW_CLEAR = 'e-show-clear';
var SHOW_DD_ICON = 'e-show-dd-icon';
var CHIP_INPUT = 'e-chip-input';
var INPUTFOCUS = 'e-input-focus';
var INPUTGROUP = 'e-input-group';
var ICONANIMATION = 'e-icon-anim';
var CLOSEICON_CLASS = 'e-clear-icon e-icons';
var CHIP_WRAPPER = 'e-chips-wrapper';
var CHIP_COLLECTION = 'e-chips-collection';
var CHIP = 'e-chips';
var CHIP_CONTENT = 'e-chipcontent';
var CHIP_CLOSE = 'e-chips-close';
var HIDEICON = 'e-icon-hide';
var POPUP_CLASS = 'e-ddt e-popup';
var PARENTITEM = 'e-list-parent';
var CONTENT = 'e-popup-content';
var DROPDOWN = 'e-dropdown';
var DISABLED = 'e-disabled';
var ICONS = 'e-icons';
var CHECKALLPARENT = 'e-selectall-parent';
var CHECKALLHIDE = 'e-hide-selectall';
var BIGGER = 'e-bigger';
var SMALL = 'e-small';
var ALLTEXT = 'e-all-text';
var CHECKBOXFRAME = 'e-frame';
var CHECK = 'e-check';
var CHECKBOXWRAP = 'e-checkbox-wrapper';
var FILTERWRAP = 'e-filter-wrap';
var DDTICON = 'e-ddt-icon';
var FOOTER = 'e-ddt-footer';
var HEADER = 'e-ddt-header';
var NODATACONTAINER = 'e-ddt-nodata';
var NODATA = 'e-no-data';
var HEADERTEMPLATE = 'HeaderTemplate';
var FOOTERTEMPLATE = 'FooterTemplate';
var NORECORDSTEMPLATE = 'NoRecordsTemplate';
var ACTIONFAILURETEMPLATE = 'ActionFailureTemplate';
var REMAIN_WRAPPER = 'e-remain';
var OVERFLOW_VIEW = 'e-overflow';
var SHOW_TEXT = 'e-show-text';
var TOTAL_COUNT_WRAPPER = 'e-total-count';
var REMAIN_COUNT = 'e-wrap-count';
var Fields = /** @__PURE__ @class */ (function (_super) {
    __extends(Fields, _super);
    function Fields() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('child')
    ], Fields.prototype, "child", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])([])
    ], Fields.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('expanded')
    ], Fields.prototype, "expanded", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('hasChildren')
    ], Fields.prototype, "hasChildren", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('htmlAttributes')
    ], Fields.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('iconCss')
    ], Fields.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('imageUrl')
    ], Fields.prototype, "imageUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('parentValue')
    ], Fields.prototype, "parentValue", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], Fields.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('selected')
    ], Fields.prototype, "selected", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], Fields.prototype, "tableName", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('text')
    ], Fields.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('tooltip')
    ], Fields.prototype, "tooltip", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('value')
    ], Fields.prototype, "value", void 0);
    return Fields;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["ChildProperty"]));

var TreeSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(TreeSettings, _super);
    function TreeSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], TreeSettings.prototype, "autoCheck", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Auto')
    ], TreeSettings.prototype, "expandOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], TreeSettings.prototype, "loadOnDemand", void 0);
    return TreeSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["ChildProperty"]));

/**
 * The Dropdown Tree control allows you to select single or multiple values from hierarchical data in a tree-like structure.
 * It has several out-of-the-box features, such as data binding, check boxes, templates, filter,
 * UI customization, accessibility, and preselected values.
 * ```html
 *  <input type="text" id="tree"></input>
 * ```
 * ```typescript
 *  let ddtObj: DropDownTree = new DropDownTree();
 *  ddtObj.appendTo("#tree");
 * ```
 */
var DropDownTree = /** @__PURE__ @class */ (function (_super) {
    __extends(DropDownTree, _super);
    function DropDownTree(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.filterTimer = null;
        _this.isFilteredData = false;
        _this.isFilterRestore = false;
        _this.selectedData = [];
        _this.filterDelayTime = 300;
        return _this;
    }
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     * @hidden
     */
    DropDownTree.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    DropDownTree.prototype.getLocaleName = function () {
        return 'drop-down-tree';
    };
    /**
     * Initialize the event handler.
     * @private
     */
    DropDownTree.prototype.preRender = function () {
        this.inputFocus = false;
        this.isPopupOpen = false;
        this.isFirstRender = true;
        this.isInitialized = false;
        this.currentText = null;
        this.currentValue = null;
        this.oldValue = null;
        this.removeValue = false;
        this.selectedText = [];
        this.treeItems = [];
        this.dataValue = null;
        this.isNodeSelected = false;
        this.isDynamicChange = false;
        this.clearIconWidth = 0;
        this.isBlazorPlatForm = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])();
        this.headerTemplateId = "" + this.element.id + HEADERTEMPLATE;
        this.footerTemplateId = "" + this.element.id + FOOTERTEMPLATE;
        this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE;
        this.noRecordsTemplateId = "" + this.element.id + NORECORDSTEMPLATE;
        this.keyConfigs = {
            escape: 'escape',
            altUp: 'alt+uparrow',
            altDown: 'alt+downarrow',
            tab: 'tab',
            shiftTab: 'shift+tab',
            end: 'end',
            enter: 'enter',
            home: 'home',
            moveDown: 'downarrow',
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            moveUp: 'uparrow',
            ctrlDown: 'ctrl+downarrow',
            ctrlUp: 'ctrl+uparrow',
            ctrlEnter: 'ctrl+enter',
            ctrlHome: 'ctrl+home',
            ctrlEnd: 'ctrl+end',
            shiftDown: 'shift+downarrow',
            shiftUp: 'shift+uparrow',
            shiftEnter: 'shift+enter',
            shiftHome: 'shift+home',
            shiftEnd: 'shift+end',
            csDown: 'ctrl+shift+downarrow',
            csUp: 'ctrl+shift+uparrow',
            csEnter: 'ctrl+shift+enter',
            csHome: 'ctrl+shift+home',
            csEnd: 'ctrl+shift+end',
            space: 'space',
            ctrlA: 'ctrl+A'
        };
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    DropDownTree.prototype.render = function () {
        this.ensureAutoCheck();
        if (this.element.tagName === 'INPUT') {
            this.inputEle = this.element;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.inputEle.getAttribute('role'))) {
                this.inputEle.setAttribute('role', 'textbox');
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.inputEle.getAttribute('type'))) {
                this.inputEle.setAttribute('type', 'text');
            }
        }
        else {
            this.inputEle = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
            this.element.parentElement.insertBefore(this.inputEle, this.element);
        }
        this.inputObj = _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].createInput({
            element: this.inputEle,
            floatLabelType: this.floatLabelType,
            buttons: this.showDropDownIcon ? [DROPDOWNICON] : null,
            properties: {
                readonly: true,
                placeholder: this.placeholder,
                enabled: this.enabled,
                cssClass: this.cssClass,
                enableRtl: this.enableRtl,
            },
        }, this.createElement);
        this.inputWrapper = this.inputObj.container;
        if (!this.inputWrapper.classList.contains(INPUTGROUP)) {
            this.inputWrapper.classList.add(INPUTGROUP);
        }
        if (this.showDropDownIcon) {
            this.inputWrapper.classList.add(SHOW_DD_ICON);
        }
        if (this.element.tagName === this.getDirective()) {
            this.element.appendChild(this.inputWrapper);
        }
        this.createHiddenElement();
        this.createClearIcon();
        this.inputWrapper.classList.add(DROPDOWNTREE);
        this.setElementWidth(this.width);
        this.setAttributes();
        this.updateDataAttribute();
        this.setHTMLAttributes();
        this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
        this.popupDiv.classList.add(DROPDOWN);
        this.tree = this.createElement('div', { id: this.element.id + '_tree', });
        this.popupDiv.appendChild(this.tree);
        document.body.appendChild(this.popupDiv);
        this.wireTreeEvents();
        this.popupDiv.style.display = 'none';
        this.renderTree();
        this.isRemoteData = this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"];
        if (this.allowMultiSelection || this.showCheckBox) {
            if (this.mode !== 'Delimiter') {
                this.createChip();
            }
            if (!this.wrapText) {
                this.overFlowWrapper = this.createElement('span', { className: OVERFLOW_VIEW + ' ' + HIDEICON });
                this.inputWrapper.insertBefore(this.overFlowWrapper, this.hiddenElement);
                if (this.mode !== 'Box') {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], SHOW_TEXT);
                }
            }
        }
        if (!this.isRemoteData) {
            this.setTreeValue();
            this.setTreeText();
            this.updateHiddenValue();
            this.setSelectedValue();
            if (!this.wrapText) {
                this.updateView();
            }
        }
        this.wireEvents();
        var firstUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + PARENTITEM, this.treeObj.element);
        if (firstUl && firstUl.getAttribute('aria-multiselectable')) {
            firstUl.removeAttribute('aria-multiselectable');
        }
        this.oldValue = this.value;
        this.isInitialized = true;
        this.hasTemplate = this.itemTemplate || this.headerTemplate || this.footerTemplate || this.actionFailureTemplate
            || this.noRecordsTemplate;
        this.renderComplete();
    };
    DropDownTree.prototype.ensureAutoCheck = function () {
        if (this.allowFiltering && this.treeSettings.autoCheck) {
            this.setProperties({ treeSettings: { autoCheck: false } }, true);
        }
    };
    DropDownTree.prototype.hideCheckAll = function (flag) {
        var checkAllEle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.popupEle) ? this.popupEle.querySelector('.' + CHECKALLPARENT) : null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(checkAllEle)) {
            if (flag && !checkAllEle.classList.contains(CHECKALLHIDE)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([checkAllEle], CHECKALLHIDE);
            }
            else if (!flag && checkAllEle.classList.contains(CHECKALLHIDE)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([checkAllEle], CHECKALLHIDE);
            }
        }
    };
    DropDownTree.prototype.renderFilter = function () {
        this.filterContainer = this.createElement('div', {
            id: this.element.id + '_filter_wrap',
            className: FILTERWRAP
        });
        var filterInput = this.createElement('input', {
            id: this.element.id + '_filter',
            attrs: { autocomplete: 'off', 'aria-label': this.filterBarPlaceholder }
        });
        this.filterContainer.appendChild(filterInput);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.filterContainer], this.popupEle);
        this.filterObj = new _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["TextBox"]({
            value: '',
            showClearButton: true,
            placeholder: this.filterBarPlaceholder,
            input: this.filterChangeHandler.bind(this),
        });
        this.filterObj.appendTo('#' + this.element.id + '_filter');
    };
    DropDownTree.prototype.filterChangeHandler = function (args) {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(args.value)) {
            window.clearTimeout(this.filterTimer);
            this.filterTimer = window.setTimeout(function () { _this.filterHandler(args.value, args.event); }, this.filterDelayTime);
        }
    };
    DropDownTree.prototype.filterHandler = function (value, event) {
        var _this = this;
        if (!this.isFilteredData) {
            this.treeData = this.treeObj.getTreeData();
        }
        var filterFields = this.cloneFields(this.fields);
        var args = {
            cancel: false,
            preventDefaultAction: false,
            event: event,
            text: value,
            fields: filterFields
        };
        this.trigger('filtering', args, function (args) {
            if (!args.cancel) {
                var flag = false;
                var fields = void 0;
                _this.isFilteredData = true;
                if (value === '') {
                    _this.isFilteredData = false;
                    _this.isFilterRestore = true;
                    fields = _this.cloneFields(_this.fields);
                }
                else if (args.preventDefaultAction) {
                    fields = args.fields;
                }
                else {
                    if (_this.treeDataType === 1) {
                        fields = _this.selfReferencefilter(value, args.fields);
                    }
                    else {
                        if (_this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"]) {
                            flag = true;
                        }
                        else {
                            fields = _this.nestedFilter(value, args.fields);
                        }
                    }
                }
                _this.hideCheckAll(_this.isFilteredData);
                if (flag) {
                    return;
                }
                _this.treeObj.fields = _this.getTreeFields(fields);
                _this.treeObj.dataBind();
            }
        });
    };
    DropDownTree.prototype.nestedFilter = function (value, filteredFields) {
        var matchedDataSource = [];
        for (var i = 0; i < this.treeData.length; i++) {
            var filteredChild = this.nestedChildFilter(value, this.treeData[i]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(filteredChild)) {
                matchedDataSource.push(filteredChild);
            }
        }
        filteredFields.dataSource = matchedDataSource;
        return filteredFields;
    };
    DropDownTree.prototype.nestedChildFilter = function (value, node) {
        var children = node[this.fields.child];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(children)) {
            return (this.isMatchedNode(value, node)) ? node : null;
        }
        else {
            var matchedChildren = [];
            for (var i = 0; i < children.length; i++) {
                var filteredChild = this.nestedChildFilter(value, children[i]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(filteredChild)) {
                    matchedChildren.push(filteredChild);
                }
            }
            if (matchedChildren.length !== 0) {
                node[this.fields.child] = matchedChildren;
                return node;
            }
            else {
                node[this.fields.child] = null;
                return (this.isMatchedNode(value, node)) ? node : null;
            }
        }
    };
    DropDownTree.prototype.selfReferencefilter = function (value, filteredFields) {
        var matchedData = [];
        var matchedDataSource = [];
        for (var i = 0; i < this.treeData.length; i++) {
            if (this.isMatchedNode(value, this.treeData[i])) {
                matchedData.push(this.treeData[i]);
            }
        }
        for (var i = 0; i < matchedData.length; i++) {
            if (matchedDataSource.indexOf(matchedData[i]) === -1) {
                matchedDataSource.push(matchedData[i]);
                var parentId = matchedData[i][this.fields.parentValue];
                while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(parentId)) {
                    var parent_1 = null;
                    for (var j = 0; j < this.treeData.length; j++) {
                        var value_1 = this.treeData[j][this.fields.value];
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(value_1) && (value_1 === parentId)) {
                            parent_1 = this.treeData[j];
                            break;
                        }
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(parent_1) && (matchedDataSource.indexOf(parent_1) === -1)) {
                        matchedDataSource.push(parent_1);
                        parentId = parent_1[this.fields.parentValue];
                    }
                    else {
                        break;
                    }
                }
            }
        }
        filteredFields.dataSource = matchedDataSource;
        return filteredFields;
    };
    DropDownTree.prototype.isMatchedNode = function (value, node) {
        var checkValue = node[this.fields.text];
        if (this.ignoreCase) {
            checkValue = checkValue.toLowerCase();
            value = value.toLowerCase();
        }
        if (this.ignoreAccent) {
            checkValue = _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataUtil"].ignoreDiacritics(checkValue);
            value = _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataUtil"].ignoreDiacritics(value);
        }
        if (this.filterType === 'StartsWith') {
            return checkValue.slice(0, value.length) === value;
        }
        else if (this.filterType === 'EndsWith') {
            return checkValue.slice(-value.length) === value;
        }
        else {
            return checkValue.indexOf(value) !== -1;
        }
    };
    /* To wire events for the dropdown tree */
    DropDownTree.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputWrapper, 'mouseup', this.dropDownClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputWrapper, 'focus', this.focusIn, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputWrapper, 'blur', this.focusOut, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputWrapper, 'mousemove', this.mouseIn, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputWrapper, 'mouseout', this.onMouseLeave, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.overAllClear, 'mousedown', this.clearAll, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(window, 'resize', this.windowResize, this);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputWrapper, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(formElement, 'reset', this.resetValueHandler, this);
        }
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["KeyboardEvents"](this.inputWrapper, {
            keyAction: this.keyActionHandler.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown',
        });
    };
    DropDownTree.prototype.wireTreeEvents = function () {
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["KeyboardEvents"](this.tree, {
            keyAction: this.treeAction.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown',
        });
    };
    DropDownTree.prototype.wireCheckAllWrapperEvents = function () {
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["KeyboardEvents"](this.checkAllParent, {
            keyAction: this.checkAllAction.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown',
        });
    };
    /* To unwire events for the dropdown tree */
    DropDownTree.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputWrapper, 'mouseup', this.dropDownClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputWrapper, 'focus', this.focusIn);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputWrapper, 'blur', this.focusOut);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputWrapper, 'mousemove', this.mouseIn);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputWrapper, 'mouseout', this.onMouseLeave);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.overAllClear, 'mousedown', this.clearAll);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(window, 'resize', this.windowResize);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputWrapper, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(formElement, 'reset', this.resetValueHandler);
        }
    };
    /* Trigger when the dropdown is clicked */
    DropDownTree.prototype.dropDownClick = function (e) {
        if (!this.enabled || this.readonly) {
            return;
        }
        if (this.isClearButtonClick) {
            this.isClearButtonClick = false;
            return;
        }
        if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {
            this.removeChip(e);
        }
        if (this.isPopupOpen) {
            this.hidePopup();
        }
        else {
            this.focusIn(e);
            this.renderPopup();
        }
        this.showOverAllClear();
    };
    DropDownTree.prototype.mouseIn = function () {
        if (this.enabled || !this.readonly) {
            this.showOverAllClear();
        }
    };
    DropDownTree.prototype.onMouseLeave = function () {
        if (!this.inputFocus) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllClear], HIDEICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CLEAR);
        }
    };
    DropDownTree.prototype.getDirective = function () {
        return 'EJS-DROPDOWNTREE';
    };
    DropDownTree.prototype.focusOut = function (e) {
        if (!this.enabled || this.readonly || !this.inputFocus) {
            return;
        }
        if ((_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].info.name === 'edge') && (e.target === this.inputWrapper)) {
            return;
        }
        var target = e.relatedTarget;
        if ((target !== this.inputEle) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(target)) && (e.target !== this.inputWrapper || !this.isPopupOpen)) {
            this.onFocusOut(e);
        }
    };
    DropDownTree.prototype.onFocusOut = function (event) {
        this.inputFocus = false;
        if (this.isPopupOpen) {
            this.hidePopup();
        }
        if (this.isClearButtonClick) {
            this.isClearButtonClick = false;
        }
        if (this.showClearButton) {
            this.clearIconWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.e-clear-icon', this.inputWrapper).offsetWidth;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllClear], HIDEICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CLEAR);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], [INPUTFOCUS]);
        if ((this.allowMultiSelection || this.showCheckBox)) {
            var isValue = this.value ? (this.value.length ? true : false) : false;
            if (this.mode !== 'Delimiter') {
                if (this.chipWrapper && (this.mode === 'Default')) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
                }
            }
            if (!this.wrapText && isValue) {
                this.updateView();
            }
        }
        if (this.changeOnBlur) {
            this.triggerChangeEvent(event);
        }
        this.removeValue = false;
        this.oldValue = this.value;
        this.trigger('blur');
    };
    DropDownTree.prototype.updateView = function () {
        if (!this.showCheckBox && !this.allowMultiSelection) {
            return;
        }
        if (this.mode !== 'Box') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper, this.overFlowWrapper], SHOW_TEXT);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CHIP);
        }
        if (this.value && this.value.length !== 0) {
            if (this.inputWrapper.contains(this.chipWrapper)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
            this.updateOverFlowView();
            this.ensurePlaceHolder();
        }
    };
    DropDownTree.prototype.triggerChangeEvent = function (event) {
        var isEqual = this.ddtCompareValues(this.oldValue, this.value);
        if ((!isEqual || this.isChipDelete) && !this.removeValue) {
            var eventArgs = {
                e: event,
                oldValue: this.oldValue,
                value: this.value,
                isInteracted: event ? true : false,
                element: this.element
            };
            this.trigger('change', eventArgs);
            this.oldValue = this.value;
        }
    };
    DropDownTree.prototype.ddtCompareValues = function (oldValue, newValue) {
        if (oldValue === null || newValue === null) {
            var isValid = oldValue === null ? ((newValue === oldValue) ? true : false) :
                (oldValue.length === 0 ? (newValue === oldValue) : false);
            return isValid;
        }
        else if (oldValue.length !== newValue.length) {
            return false;
        }
        for (var i = 0; i < oldValue.length; i++) {
            if (oldValue[i] !== newValue[i]) {
                return false;
            }
        }
        return true;
    };
    DropDownTree.prototype.focusIn = function (e) {
        if (!this.enabled || this.readonly || this.inputFocus) {
            return;
        }
        this.showOverAllClear();
        this.inputFocus = true;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], [INPUTFOCUS]);
        if (this.allowMultiSelection || this.showCheckBox) {
            if (this.mode !== 'Delimiter' && this.inputFocus) {
                if (this.chipWrapper && (this.value && this.value.length !== 0)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.chipWrapper], HIDEICON);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CHIP);
                if (this.popupObj) {
                    this.popupObj.refreshPosition();
                }
            }
            if (!this.wrapText) {
                if (this.inputWrapper.contains(this.overFlowWrapper)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], HIDEICON);
                }
                if (this.mode === 'Delimiter') {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CHIP);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_TEXT);
                this.ensurePlaceHolder();
            }
        }
        var args = { isInteracted: e ? true : false, event: e };
        this.trigger('focus', args);
    };
    DropDownTree.prototype.treeAction = function (e) {
        var _this = this;
        var eventArgs = {
            cancel: false,
            event: e,
        };
        this.trigger('keyPress', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                switch (e.action) {
                    case 'escape':
                    case 'altUp':
                        _this.inputWrapper.focus();
                        e.preventDefault();
                        if (_this.isPopupOpen) {
                            _this.hidePopup();
                        }
                        break;
                    case 'tab':
                    case 'shiftTab':
                        if (_this.isPopupOpen) {
                            _this.hidePopup();
                        }
                        break;
                    case 'enter':
                    case 'ctrlEnter':
                    case 'shiftEnter':
                    case 'csEnter':
                        if (!_this.showCheckBox) {
                            _this.isValueChange = true;
                            _this.keyEventArgs = e;
                        }
                        break;
                    case 'space':
                        _this.isValueChange = true;
                        _this.keyEventArgs = e;
                        break;
                    case 'ctrlA':
                        if (_this.allowMultiSelection) {
                            _this.selectAll(true);
                        }
                        break;
                    case 'moveRight':
                    case 'moveLeft':
                    case 'shiftDown':
                    case 'moveDown':
                    case 'ctrlDown':
                    case 'csDown':
                    case 'shiftUp':
                    case 'moveUp':
                    case 'ctrlUp':
                    case 'csUp':
                    case 'home':
                    case 'shiftHome':
                    case 'ctrlHome':
                    case 'csHome':
                    case 'end':
                    case 'shiftEnd':
                    case 'ctrlEnd':
                    case 'csEnd':
                }
            }
            else {
                e.stopImmediatePropagation();
            }
        });
    };
    DropDownTree.prototype.keyActionHandler = function (e) {
        var _this = this;
        var eventArgs = {
            cancel: false,
            event: e,
        };
        this.trigger('keyPress', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                switch (e.action) {
                    case 'escape':
                    case 'altUp':
                    case 'shiftTab':
                    case 'tab':
                        if (_this.isPopupOpen) {
                            _this.hidePopup();
                        }
                        break;
                    case 'altDown':
                        if (!_this.isPopupOpen) {
                            _this.showPopup();
                            e.preventDefault();
                        }
                        break;
                    case 'moveDown':
                        if (_this.showSelectAll && _this.showCheckBox) {
                            _this.checkAllParent.focus();
                        }
                        break;
                }
            }
        });
    };
    DropDownTree.prototype.checkAllAction = function (e) {
        var _this = this;
        var eventArgs = {
            cancel: false,
            event: e,
        };
        this.trigger('keyPress', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                switch (e.action) {
                    case 'space':
                        _this.clickHandler(e);
                        break;
                    case 'moveDown':
                        _this.treeObj.element.focus();
                }
            }
        });
    };
    DropDownTree.prototype.windowResize = function () {
        if (this.popupObj) {
            this.popupObj.setProperties({ width: this.setWidth() });
            this.popupObj.refreshPosition();
        }
    };
    DropDownTree.prototype.resetValueHandler = function (e) {
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputWrapper, 'form');
        if (formElement && e.target === formElement) {
            this.isDynamicChange = true;
            this.setProperties({ value: null }, true);
            this.resetValue(true);
            this.isDynamicChange = false;
        }
    };
    DropDownTree.prototype.getAriaAttributes = function () {
        var disable = this.enabled ? 'false' : 'true';
        return {
            'aria-disabled': disable,
            'aria-owns': this.element.id + '_options',
            'role': 'listbox',
            'aria-haspopup': 'true',
            'aria-expanded': 'false',
            'aria-activedescendant': 'null',
            'aria-labelledby': this.hiddenElement.id
        };
    };
    DropDownTree.prototype.updateOverFlowView = function () {
        this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overFlowWrapper], HIDEICON);
        if (this.value && this.value.length) {
            var data = '';
            var overAllContainer = void 0;
            var temp = void 0;
            var tempData = void 0;
            var tempIndex = 1;
            var wrapperleng = void 0;
            var remaining = void 0;
            var downIconWidth = 0;
            this.overFlowWrapper.innerHTML = '';
            var l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
            this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getLocaleName(), l10nLocale, this.locale);
            var remainContent = this.l10n.getConstant('overflowCountTemplate');
            var remainElement = this.createElement('span', { className: REMAIN_WRAPPER });
            var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(remainContent);
            var totalCompiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(this.l10n.getConstant('totalCountTemplate'));
            remainElement.appendChild(compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0]);
            this.overFlowWrapper.appendChild(remainElement);
            var remainSize = remainElement.offsetWidth;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(remainElement);
            if (this.showDropDownIcon) {
                downIconWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + DDTICON, this.inputWrapper).offsetWidth;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
                if (this.mode !== 'Box') {
                    for (var index = 0; !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value[index]); index++) {
                        data += (index === 0) ? '' : this.delimiterChar + ' ';
                        temp = this.getOverflowVal(index);
                        data += temp;
                        temp = this.overFlowWrapper.innerHTML;
                        this.overFlowWrapper.innerHTML = data;
                        wrapperleng = this.overFlowWrapper.offsetWidth;
                        overAllContainer = this.inputWrapper.offsetWidth;
                        if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
                            if (tempData !== undefined && tempData !== '') {
                                temp = tempData;
                                index = tempIndex + 1;
                            }
                            this.overFlowWrapper.innerHTML = temp;
                            remaining = this.value.length - index;
                            wrapperleng = this.overFlowWrapper.offsetWidth;
                            while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer)
                                && wrapperleng !== 0 && this.overFlowWrapper.innerHTML !== '') {
                                var textArr = this.overFlowWrapper.innerHTML.split(this.delimiterChar);
                                textArr.pop();
                                this.overFlowWrapper.innerHTML = textArr.join(this.delimiterChar);
                                remaining++;
                                wrapperleng = this.overFlowWrapper.offsetWidth;
                            }
                            break;
                        }
                        else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
                            tempData = data;
                            tempIndex = index;
                        }
                        else if (index === 0) {
                            tempData = '';
                            tempIndex = -1;
                        }
                    }
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
                    var ele = this.chipWrapper.cloneNode(true);
                    var chips = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["selectAll"])('.' + CHIP, ele);
                    for (var i = 0; i < chips.length; i++) {
                        temp = this.overFlowWrapper.innerHTML;
                        this.overFlowWrapper.appendChild(chips[i]);
                        data = this.overFlowWrapper.innerHTML;
                        wrapperleng = this.overFlowWrapper.offsetWidth;
                        overAllContainer = this.inputWrapper.offsetWidth;
                        if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
                            if (tempData !== undefined && tempData !== '') {
                                temp = tempData;
                                i = tempIndex + 1;
                            }
                            this.overFlowWrapper.innerHTML = temp;
                            remaining = this.value.length - i;
                            wrapperleng = this.overFlowWrapper.offsetWidth;
                            while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer)
                                && wrapperleng !== 0 && this.overFlowWrapper.innerHTML !== '') {
                                this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild);
                                remaining++;
                                wrapperleng = this.overFlowWrapper.offsetWidth;
                            }
                            break;
                        }
                        else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
                            tempData = data;
                            tempIndex = i;
                        }
                        else if (i === 0) {
                            tempData = '';
                            tempIndex = -1;
                        }
                    }
                }
            }
            if (remaining > 0) {
                var totalWidth = overAllContainer - (downIconWidth + this.clearIconWidth);
                this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, compiledString, totalCompiledString, totalWidth));
            }
            if (this.mode === 'Box' && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([remainElement], REMAIN_COUNT);
            }
        }
        else {
            this.overFlowWrapper.innerHTML = '';
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], HIDEICON);
        }
        this.updateDelimMode();
    };
    DropDownTree.prototype.updateRemainTemplate = function (remainElement, remaining, compiledString, totalCompiledString, totalWidth) {
        if (this.overFlowWrapper.firstChild && this.overFlowWrapper.firstChild.nodeType === 3 &&
            this.overFlowWrapper.firstChild.nodeValue === '') {
            this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild);
        }
        remainElement.innerHTML = '';
        remainElement.appendChild((this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) ?
            compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0] :
            totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate)[0]);
        if (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overFlowWrapper], REMAIN_COUNT);
        }
        return remainElement;
    };
    DropDownTree.prototype.getOverflowVal = function (index) {
        var temp;
        var selectedData = this.getSelectedData(this.value[index]);
        temp = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
        return temp;
    };
    DropDownTree.prototype.updateDelimMode = function () {
        if (this.mode !== 'Box') {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + REMAIN_WRAPPER, this.overFlowWrapper) && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], REMAIN_COUNT);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], SHOW_TEXT);
            }
            else {
                this.overFlowWrapper.classList.remove(REMAIN_COUNT);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overFlowWrapper], REMAIN_COUNT);
            }
        }
        else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + REMAIN_WRAPPER, this.overFlowWrapper)) {
            this.overFlowWrapper.classList.remove(REMAIN_COUNT);
        }
    };
    DropDownTree.prototype.createHiddenElement = function () {
        if (this.allowMultiSelection || this.showCheckBox) {
            this.hiddenElement = this.createElement('select', {
                attrs: { 'aria-hidden': 'true', 'class': HIDDENELEMENT, 'tabindex': '-1', 'multiple': '' }
            });
        }
        else {
            this.hiddenElement = this.createElement('select', {
                attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': HIDDENELEMENT }
            });
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.hiddenElement], this.inputWrapper);
        this.validationAttribute();
    };
    DropDownTree.prototype.createClearIcon = function () {
        this.overAllClear = this.createElement('span', {
            className: CLOSEICON_CLASS
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllClear], HIDEICON);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CLEAR);
        if (this.showClearButton) {
            this.inputWrapper.insertBefore(this.overAllClear, this.inputObj.buttons[0]);
        }
    };
    DropDownTree.prototype.validationAttribute = function () {
        var name = this.inputEle.getAttribute('name') ? this.inputEle.getAttribute('name') : this.inputEle.getAttribute('id');
        this.hiddenElement.setAttribute('name', name);
        this.inputEle.removeAttribute('name');
        var attributes = ['required', 'aria-required', 'form'];
        for (var i = 0; i < attributes.length; i++) {
            var attr = this.inputEle.getAttribute(attributes[i]);
            if (attr) {
                this.hiddenElement.setAttribute(attributes[i], attr);
                this.inputEle.removeAttribute(attributes[i]);
            }
        }
    };
    DropDownTree.prototype.createChip = function () {
        if (!this.inputWrapper.contains(this.chipWrapper)) {
            this.chipWrapper = this.createElement('span', {
                className: CHIP_WRAPPER,
            });
            this.chipCollection = this.createElement('span', {
                className: CHIP_COLLECTION
            });
            this.chipWrapper.appendChild(this.chipCollection);
            this.inputWrapper.insertBefore(this.chipWrapper, this.hiddenElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CHIP);
            var isValid = this.getValidMode();
            if (isValid && this.value !== null) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
            }
            else if (this.value === null) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
            }
        }
    };
    DropDownTree.prototype.getValidMode = function () {
        if (this.allowMultiSelection || this.showCheckBox) {
            return this.mode === 'Box' ? true : (this.mode === 'Default' && this.inputFocus) ? true : false;
        }
        else {
            return false;
        }
    };
    DropDownTree.prototype.createSelectAllWrapper = function () {
        this.checkAllParent = this.createElement('div', {
            className: CHECKALLPARENT, attrs: { 'tabindex': '0' }
        });
        this.selectAllSpan = this.createElement('span', {
            className: ALLTEXT
        });
        this.selectAllSpan.textContent = '';
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.element, '.' + BIGGER);
        var touchClass = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ele) ? '' : SMALL;
        this.checkBoxElement = Object(_ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["createCheckBox"])(this.createElement, true, { cssClass: touchClass });
        this.checkBoxElement.setAttribute('role', 'checkbox');
        this.checkAllParent.appendChild(this.checkBoxElement);
        this.checkAllParent.appendChild(this.selectAllSpan);
        this.setLocale();
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.checkAllParent, 'mouseup', this.clickHandler, this);
        this.wireCheckAllWrapperEvents();
    };
    DropDownTree.prototype.clickHandler = function (e) {
        var target;
        if ((e.currentTarget && e.currentTarget.classList.contains(CHECKALLPARENT))) {
            target = e.currentTarget.firstElementChild.lastElementChild;
        }
        else {
            target = e.target;
        }
        this.checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + CHECKBOXWRAP);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.checkWrapper)) {
            var checkElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + CHECKBOXFRAME, this.checkWrapper);
            this.changeState(this.checkWrapper, checkElement.classList.contains(CHECK) ? 'uncheck' : 'check', e);
        }
        e.preventDefault();
    };
    DropDownTree.prototype.changeState = function (wrapper, state, e) {
        var ariaState;
        var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME)[0];
        if (state === 'check' && !frameSpan.classList.contains(CHECK)) {
            frameSpan.classList.add(CHECK);
            ariaState = 'true';
            if (!this.isReverseUpdate) {
                this.treeObj.checkAll();
                if (!this.changeOnBlur) {
                    this.triggerChangeEvent(e);
                }
            }
            this.setLocale(true);
        }
        else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK))) {
            frameSpan.classList.remove(CHECK);
            ariaState = 'false';
            if (!this.isReverseUpdate) {
                this.treeObj.uncheckAll();
                if (!this.changeOnBlur) {
                    this.triggerChangeEvent(e);
                }
            }
            this.setLocale(false);
        }
        this.setMultiSelect();
        this.ensurePlaceHolder();
        ariaState = state === 'check' ? 'true' : 'false';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ariaState)) {
            wrapper.setAttribute('aria-checked', ariaState);
        }
    };
    DropDownTree.prototype.setLocale = function (unSelect) {
        if (!this.selectAllSpan) {
            return;
        }
        if (this.selectAllText !== 'Select All' || this.unSelectAllText !== 'Unselect All') {
            var template = unSelect ? this.unSelectAllText : this.selectAllText;
            var compiledString = void 0;
            this.selectAllSpan.textContent = '';
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(template);
            var templateName = unSelect ? 'unSelectAllText' : 'selectAllText';
            for (var _i = 0, _a = compiledString({}, this, templateName, null, !this.isStringTemplate); _i < _a.length; _i++) {
                var item = _a[_i];
                this.selectAllSpan.textContent = item.textContent;
            }
        }
        else {
            this.selectAllSpan.textContent = unSelect ? this.unSelectAllText : this.selectAllText;
        }
    };
    DropDownTree.prototype.setAttributes = function () {
        this.element.removeAttribute('tabindex');
        var id = this.element.getAttribute('id');
        this.hiddenElement.id = id + '_hidden';
        this.inputWrapper.setAttribute('tabindex', '0');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputWrapper, this.getAriaAttributes());
    };
    DropDownTree.prototype.setHTMLAttributes = function () {
        if (Object.keys(this.htmlAttributes).length) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var htmlAttr = _a[_i];
                if (htmlAttr === 'class') {
                    this.inputWrapper.classList.add(this.htmlAttributes[htmlAttr]);
                }
                else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
                    this.setProperties({ enabled: false }, true);
                    this.setEnable();
                }
                else if (htmlAttr === 'readonly' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.htmlAttributes[htmlAttr])) {
                    this.setProperties({ readonly: true }, true);
                    this.dataBind();
                }
                else if (htmlAttr === 'style') {
                    this.inputWrapper.setAttribute('style', this.htmlAttributes[htmlAttr]);
                }
                else {
                    var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
                        'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
                    var validateAttr = ['name', 'required'];
                    if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
                        this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                    else if (defaultAttr.indexOf(htmlAttr) > -1) {
                        htmlAttr === 'placeholder' ? _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setPlaceholder(this.htmlAttributes[htmlAttr], this.inputEle) :
                            this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                    else {
                        this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                    }
                }
            }
        }
    };
    DropDownTree.prototype.updateDataAttribute = function () {
        var value = this.htmlAttributes;
        var invalidAttr = ['class', 'style', 'id', 'type'];
        var attr = {};
        for (var a = 0; a < this.element.attributes.length; a++) {
            if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
                !(this.element.attributes[a].name === 'readonly')) {
                attr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(attr, value, attr);
        this.setProperties({ htmlAttributes: attr }, true);
    };
    DropDownTree.prototype.showOverAllClear = function () {
        if (!this.enabled || this.readonly) {
            return;
        }
        if (this.overAllClear) {
            var isValue = this.value ? (this.value.length ? true : false) : false;
            if (isValue && this.showClearButton) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overAllClear], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CLEAR);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllClear], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CLEAR);
            }
        }
    };
    DropDownTree.prototype.setTreeValue = function () {
        if (this.value !== null && this.value.length !== 0) {
            var data = void 0;
            if (this.showCheckBox || this.allowMultiSelection) {
                for (var i = 0; i < this.value.length; i++) {
                    data = this.treeObj.getTreeData(this.value[i])[0];
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
                        this.value.splice(this.value.indexOf(this.value[i]), 1);
                    }
                }
                if (this.value.length !== 0) {
                    this.setValidValue();
                }
            }
            else {
                data = this.treeObj.getTreeData(this.value[0])[0];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
                    this.setProperties({ text: data[this.fields.text] }, true);
                    this.setValidValue();
                }
                else {
                    this.setProperties({ value: this.currentValue }, true);
                }
            }
        }
    };
    DropDownTree.prototype.setTreeText = function () {
        if (this.value !== null && !this.isInitialized) {
            return;
        }
        if (this.text !== null) {
            var data = void 0;
            var valArr = [];
            if (this.showCheckBox || this.allowMultiSelection) {
                var textArr = this.text.split(this.delimiterChar);
                for (var i = 0; i < textArr.length; i++) {
                    data = this.getItems(textArr[i]);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
                        valArr.push(data[this.fields.value].toString());
                    }
                }
                if (valArr.length !== 0) {
                    this.oldValue = this.value;
                    this.setProperties({ value: valArr }, true);
                    this.setValidValue();
                }
                else {
                    this.setProperties({ text: this.currentText }, true);
                }
            }
            else {
                data = this.getItems(this.text);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
                    this.oldValue = this.value;
                    this.setProperties({ value: [data[this.fields.value].toString()] }, true);
                    this.setValidValue();
                }
                else {
                    this.setProperties({ text: this.currentText }, true);
                }
            }
        }
    };
    DropDownTree.prototype.setSelectedValue = function () {
        if (this.value != null) {
            return;
        }
        if (!this.isInitialized) {
            this.oldValue = this.value;
            if (this.treeObj.selectedNodes.length > 0 && !this.showCheckBox) {
                this.setProperties({ value: this.treeObj.selectedNodes }, true);
                if (this.allowMultiSelection) {
                    this.updateMode();
                }
            }
            else if (this.showCheckBox && this.treeObj.checkedNodes) {
                if (this.treeObj.checkedNodes.length > 0) {
                    this.setProperties({ value: this.treeObj.checkedNodes }, true);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])('selectedNodes', [], this.treeObj);
                    this.treeObj.dataBind();
                    this.updateMode();
                }
            }
            this.updateSelectedValues();
            this.currentText = this.text;
            this.currentValue = this.value;
        }
    };
    DropDownTree.prototype.setValidValue = function () {
        if (!this.showCheckBox && !this.allowMultiSelection) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setValue(this.text, this.inputEle, this.floatLabelType);
            var id = this.value[0].toString();
            if (this.treeObj.selectedNodes[0] !== id) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])('selectedNodes', [id], this.treeObj);
            }
        }
        else {
            if (this.showCheckBox) {
                this.treeObj.checkedNodes = this.value.slice();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])('selectedNodes', [], this.treeObj);
                this.treeObj.dataBind();
                this.setMultiSelect();
            }
            else {
                this.treeObj.selectedNodes = this.value.slice();
                this.selectedText = [];
                this.updateSelectedValues();
            }
            this.treeObj.dataBind();
        }
        this.currentText = this.text;
        this.currentValue = this.value;
        if (this.isInitialized) {
            this.triggerChangeEvent();
        }
    };
    DropDownTree.prototype.getItems = function (givenText) {
        var data;
        if (this.treeDataType === 1) {
            for (var i = 0; i < this.treeItems.length; i++) {
                var text = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.fields.text, this.treeItems[i]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.treeItems[i]) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(text) && text === givenText) {
                    data = this.treeItems[i];
                    break;
                }
            }
        }
        else {
            data = this.getNestedItems(this.treeItems, this.fields, givenText);
        }
        return data;
    };
    DropDownTree.prototype.getNestedItems = function (data, field, givenText) {
        var newData;
        for (var i = 0, objlen = data.length; i < objlen; i++) {
            var dataId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.fields.text, data[i]);
            if (data[i] && dataId && dataId.toString() === givenText) {
                return data[i];
            }
            else if (typeof field.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.child, data[i]))) {
                var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.child, data[i]);
                newData = this.getNestedItems(childData, this.getChildType(field), givenText);
                if (newData !== undefined) {
                    break;
                }
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])('child', data[i]))) {
                var child = 'child';
                newData = this.getNestedItems(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(child, data[i]), this.getChildType(field), givenText);
                if (newData !== undefined) {
                    break;
                }
            }
        }
        return newData;
    };
    DropDownTree.prototype.getChildType = function (mapper) {
        return (typeof mapper.child === 'string' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(mapper.child)) ? mapper : mapper.child;
    };
    /* To render the treeview */
    DropDownTree.prototype.renderTree = function () {
        this.treeObj = new _ej2_navigations__WEBPACK_IMPORTED_MODULE_5__["TreeView"]({
            fields: this.getTreeFields(this.fields),
            enableRtl: this.enableRtl,
            nodeSelected: this.onNodeSelected.bind(this),
            nodeChecked: this.onNodeChecked.bind(this),
            nodeChecking: this.beforeCheck.bind(this),
            actionFailure: this.onActionFailure.bind(this),
            nodeClicked: this.onNodeClicked.bind(this),
            dataBound: this.OnDataBound.bind(this),
            allowMultiSelection: this.allowMultiSelection,
            showCheckBox: this.showCheckBox,
            autoCheck: this.treeSettings.autoCheck,
            sortOrder: this.sortOrder,
            expandOn: this.treeSettings.expandOn,
            loadOnDemand: this.treeSettings.loadOnDemand,
            nodeSelecting: this.onBeforeSelect.bind(this),
            nodeTemplate: this.itemTemplate
        });
        this.treeObj.appendTo('#' + this.tree.id);
    };
    /* To render the popup element */
    DropDownTree.prototype.renderPopup = function () {
        var _this = this;
        if (this.isFilteredData) {
            this.filterObj.value = '';
            this.treeObj.fields = this.getTreeFields(this.fields);
            this.isFilterRestore = true;
            this.isFilteredData = false;
            this.hideCheckAll(false);
        }
        var isCancelled = false;
        var args = { cancel: false };
        this.trigger('beforeOpen', args, function (args) {
            if (!args.cancel) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([_this.inputWrapper], [ICONANIMATION]);
                if (_this.isFirstRender) {
                    _this.popupEle = _this.createElement('div', {
                        id: _this.element.id + '_popup', className: POPUP_CLASS + ' ' + (_this.cssClass != null ? _this.cssClass : '')
                    });
                    document.body.appendChild(_this.popupEle);
                    _this.createPopup(_this.popupEle);
                }
                else {
                    _this.popupEle = _this.popupObj.element;
                }
            }
            else {
                isCancelled = true;
            }
            if (_this.isFirstRender && !isCancelled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([_this.popupDiv], _this.popupEle);
                _this.popupDiv.style.display = 'block';
                if (_this.allowFiltering) {
                    _this.renderFilter();
                }
                if (_this.showCheckBox && _this.showSelectAll && (!_this.popupDiv.classList.contains(NODATA))) {
                    _this.createSelectAllWrapper();
                    _this.popupEle.insertBefore(_this.checkAllParent, _this.popupDiv);
                }
                if (_this.headerTemplate) {
                    _this.setHeaderTemplate();
                }
                if (_this.footerTemplate) {
                    _this.setFooterTemplate();
                }
                _this.isFirstRender = false;
                // tslint:disable
                if (_this.hasTemplate && _this.portals) {
                    // tslint:disable
                    _this.portals = _this.portals.concat(_this.treeObj.portals);
                    _this.renderReactTemplates();
                }
            }
            if (!isCancelled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(_this.inputWrapper, { 'aria-expanded': 'true' });
                _this.popupObj.show(null, (_this.zIndex === 1000) ? _this.inputEle : null);
                _this.popupEle.style.display = 'block';
                _this.updatePopupHeight();
                _this.popupObj.refreshPosition();
                if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
                    && _this.treeItems.length > 0)) {
                    _this.treeObj.element.focus();
                }
                if (_this.checkSelectAll && _this.checkBoxElement) {
                    var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(_this.checkBoxElement, '.' + CHECKBOXWRAP);
                    _this.changeState(wrap, 'check');
                    _this.checkSelectAll = false;
                }
                if (_this.allowFiltering) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([_this.inputWrapper], [INPUTFOCUS]);
                    _this.filterObj.element.focus();
                }
                var eventArgs = { popup: _this.popupObj };
                _this.trigger('open', eventArgs);
            }
        });
    };
    DropDownTree.prototype.updatePopupHeight = function () {
        if (this.isFirstRender) {
            return;
        }
        var popupHeight = this.getHeight();
        this.popupEle.style.maxHeight = popupHeight;
        if (this.allowFiltering) {
            var height = Math.round(this.filterContainer.getBoundingClientRect().height);
            popupHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(parseInt(popupHeight, 10) - height + 'px');
        }
        if (this.headerTemplate) {
            var height = Math.round(this.header.getBoundingClientRect().height);
            popupHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(parseInt(popupHeight, 10) - height + 'px');
        }
        if (this.showCheckBox && this.showSelectAll) {
            var height = Math.round(this.checkAllParent.getBoundingClientRect().height);
            popupHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(parseInt(popupHeight, 10) - height + 'px');
        }
        if (this.footerTemplate) {
            var height = Math.round(this.footer.getBoundingClientRect().height);
            popupHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(parseInt(popupHeight, 10) - height + 'px');
        }
        var border = parseInt(window.getComputedStyle(this.popupEle).borderTopWidth, 10);
        border = border + parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth, 10);
        popupHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(parseInt(popupHeight, 10) - border + 'px');
        this.popupDiv.style.maxHeight = popupHeight;
    };
    DropDownTree.prototype.createPopup = function (element) {
        var _this = this;
        if (this.isFirstRender) {
            this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_4__["Popup"](element, {
                width: this.setWidth(),
                targetType: 'relative',
                collision: { X: 'flip', Y: 'flip' },
                relateTo: this.inputWrapper,
                zIndex: this.zIndex,
                enableRtl: this.enableRtl,
                position: { X: 'left', Y: 'bottom' },
                close: function () {
                    _this.isPopupOpen = false;
                },
                open: function () {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(document, 'mousedown', _this.onDocumentClick, _this);
                    _this.isPopupOpen = true;
                },
                targetExitViewport: function () {
                    if (!_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                        _this.hidePopup();
                    }
                }
            });
        }
    };
    /* To calculate the width when change via set model */
    DropDownTree.prototype.setElementWidth = function (inputWidth) {
        var ddElement = this.inputWrapper;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(inputWidth)) {
            if (typeof inputWidth === 'number') {
                ddElement.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(inputWidth);
            }
            else if (typeof inputWidth === 'string') {
                ddElement.style.width = (inputWidth.match(/px|%|em/)) ? (inputWidth) :
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(inputWidth));
            }
        }
    };
    /* To calculate the width of the popup */
    DropDownTree.prototype.setWidth = function () {
        var width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.popupWidth);
        if (width.indexOf('%') > -1) {
            var inputWidth = this.inputWrapper.offsetWidth * parseFloat(width) / 100;
            width = inputWidth.toString() + 'px';
        }
        else if (typeof this.popupWidth === 'string') {
            width = (this.popupWidth.match(/px|em/)) ? (this.popupWidth) : width;
        }
        return width;
    };
    /* To calculate the height of the popup */
    DropDownTree.prototype.getHeight = function () {
        var height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.popupHeight);
        if (height.indexOf('%') > -1) {
            // Will set the height of the popup according to the view port height
            var viewPortHeight = document.documentElement.clientHeight * parseFloat(height) / 100;
            height = viewPortHeight.toString() + 'px';
        }
        else if (typeof this.popupHeight === 'string') {
            height = (this.popupHeight.match(/px|em/)) ? (this.popupHeight) : height;
        }
        return height;
    };
    DropDownTree.prototype.onDocumentClick = function (e) {
        var target = e.target;
        var isTree = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + PARENTITEM);
        var isFilter = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + FILTERWRAP);
        var isScroller = target.classList.contains(DROPDOWN) ? true :
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["matches"])(target, '.e-ddt .e-popup') || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["matches"])(target, '.e-ddt .e-treeview'));
        if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isFilter || isScroller)) ||
            ((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
                (this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
                    || target.classList.contains(CHECKBOXFRAME)))))) {
            this.isDocumentClick = false;
            e.preventDefault();
        }
        else if (!this.inputWrapper.contains(target) && this.inputFocus) {
            this.focusOut(e);
        }
    };
    DropDownTree.prototype.onActionFailure = function (e) {
        this.trigger('actionFailure', e);
        this.l10nUpdate(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.popupDiv], NODATA);
    };
    DropDownTree.prototype.OnDataBound = function (args) {
        this.treeItems = args.data;
        if (this.treeItems.length <= 0) {
            this.l10nUpdate();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.popupDiv], NODATA);
            this.hideCheckAll(true);
        }
        else if (this.popupDiv.classList.contains(NODATA) && this.treeItems.length >= 1) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.popupDiv], NODATA);
            this.hideCheckAll(false);
        }
        this.treeDataType = this.getTreeDataType(this.treeItems, this.fields);
        if (this.isFirstRender && this.isRemoteData) {
            this.setTreeValue();
            this.setTreeText();
            this.updateHiddenValue();
            this.setSelectedValue();
            if (!this.wrapText) {
                this.updateView();
            }
            this.treeObj.element.focus();
        }
        var eventArgs = { data: args.data };
        this.trigger('dataBound', eventArgs);
        if (this.isFilteredData) {
            this.treeObj.expandAll();
        }
        if (this.isFilterRestore) {
            this.restoreFilterSelection();
            this.isFilterRestore = false;
        }
    };
    DropDownTree.prototype.restoreFilterSelection = function () {
        if (this.showCheckBox) {
            this.treeObj.checkedNodes = this.value ? this.value : [];
        }
        else {
            this.treeObj.selectedNodes = this.value ? this.value : [];
        }
    };
    /* To set cssclass for the dropdowntree */
    DropDownTree.prototype.setCssClass = function (newClass, oldClass) {
        var elements = this.popupObj ? [this.inputWrapper, this.popupObj.element] : [this.inputWrapper];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(oldClass) && oldClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(elements, oldClass.split(' '));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(newClass) && newClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])(elements, newClass.split(' '));
        }
    };
    DropDownTree.prototype.setEnableRTL = function (state) {
        if (state) {
            this.inputWrapper.classList.add(RTL);
        }
        else {
            this.inputWrapper.classList.remove(RTL);
        }
        if (this.popupObj) {
            this.popupObj.enableRtl = state;
            this.popupObj.dataBind();
        }
        if (this.treeObj) {
            this.treeObj.enableRtl = state;
            this.treeObj.dataBind();
        }
    };
    /* To set enable property */
    DropDownTree.prototype.setEnable = function () {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setEnabled(this.enabled, this.inputEle);
        if (this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], DISABLED);
            this.inputEle.setAttribute('aria-disabled', 'false');
            this.inputWrapper.setAttribute('aria-disabled', 'false');
        }
        else {
            if (this.isPopupOpen) {
                this.hidePopup();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], DISABLED);
            if (this.inputWrapper && this.inputWrapper.classList.contains(INPUTFOCUS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], [INPUTFOCUS]);
            }
            this.inputEle.setAttribute('aria-disabled', 'true');
            this.inputWrapper.setAttribute('aria-disabled', 'true');
        }
    };
    DropDownTree.prototype.cloneFields = function (fields) {
        var clonedField = {
            dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
            child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
            iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
            selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
        };
        return clonedField;
    };
    DropDownTree.prototype.cloneChildField = function (fields) {
        if (typeof fields === 'string') {
            return fields;
        }
        else {
            var clonedField = {
                dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
                child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
                expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
                query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
            };
            return clonedField;
        }
    };
    DropDownTree.prototype.getTreeFields = function (fields) {
        var treeFields = {
            dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
            child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
            iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
            htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
            tableName: fields.tableName, tooltip: fields.tooltip
        };
        return treeFields;
    };
    DropDownTree.prototype.getTreeChildren = function (mapper) {
        if (typeof mapper === 'string') {
            return mapper;
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(mapper)) {
            var childFields = void 0;
            mapper = this.getActualProperties(mapper);
            childFields = mapper;
            if (mapper.value) {
                childFields.id = mapper.value;
            }
            if (mapper.parentValue) {
                childFields.parentID = mapper.parentValue;
            }
            if (mapper.child) {
                childFields.child = this.getTreeChildren(mapper.child);
            }
            if (mapper.selected && this.showCheckBox) {
                childFields.isChecked = mapper.selected;
            }
            return childFields;
        }
        return null;
    };
    DropDownTree.prototype.getTreeDataType = function (ds, field) {
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"]) {
            for (var i = 0; i < ds.length; i++) {
                if ((typeof field.child === 'string') && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.child, ds[i]))) {
                    return 1;
                }
            }
            return 2;
        }
        for (var i = 0, len = ds.length; i < len; i++) {
            if ((typeof field.child === 'string') && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.child, ds[i]))) {
                return 2;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.parentValue, ds[i])) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(field.hasChildren, ds[i]))) {
                return 1;
            }
        }
        return 1;
    };
    /* Triggers when the tree fields is changed dynamically */
    DropDownTree.prototype.setFields = function () {
        this.resetValue();
        if (this.hasTemplate) {
            this.updateTemplate();
        }
        this.treeObj.fields = this.getTreeFields(this.fields);
        this.treeObj.dataBind();
    };
    DropDownTree.prototype.getEventArgs = function (args) {
        var checkData = args.data;
        var selectData = args.nodeData;
        var state;
        if (this.showCheckBox) {
            if (args.action === 'check') {
                state = 'select';
            }
            else if (args.action === 'uncheck') {
                state = 'un-select';
            }
        }
        var eventArgs = {
            action: this.showCheckBox ? state : args.action,
            isInteracted: args.isInteracted,
            item: args.node,
            itemData: this.showCheckBox ? checkData[0] : selectData
        };
        return eventArgs;
    };
    DropDownTree.prototype.onBeforeSelect = function (args) {
        if (args.isInteracted) {
            this.oldValue = this.value ? this.value.slice() : this.value;
            if (this.value === null) {
                this.setProperties({ value: [] }, true);
            }
        }
    };
    DropDownTree.prototype.updateHiddenValue = function () {
        if (this.allowMultiSelection || this.showCheckBox) {
            return;
        }
        if (this.value && this.value.length) {
            this.hiddenElement.innerHTML = '<option selected value ="' + this.value[0] + '">' + this.text + '</option>';
        }
        else {
            this.hiddenElement.innerHTML = '';
        }
    };
    /* Triggers when the tree node is selected */
    DropDownTree.prototype.onNodeSelected = function (args) {
        if (this.showCheckBox) {
            return;
        }
        var selectedText;
        if (args.isInteracted) {
            var id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])('id', args.nodeData).toString();
            if (!this.allowMultiSelection) {
                this.hiddenElement.innerHTML = '';
                this.setProperties({ value: [id] }, true);
                if (this.itemTemplate) {
                    selectedText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])('text', this.treeObj.getNode(id));
                }
                else {
                    selectedText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])('text', args.nodeData).toString();
                }
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setValue(selectedText, this.inputEle, this.floatLabelType);
                this.setProperties({ text: selectedText }, true);
                this.currentText = this.text;
                this.currentValue = this.value;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputWrapper, { 'aria-describedby': this.element.id });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputWrapper, { 'aria-activedescendant': id.toString() });
                this.updateHiddenValue();
                this.showOverAllClear();
                this.hidePopup();
                this.isNodeSelected = true;
            }
            else if (this.allowMultiSelection) {
                this.setMultiSelect();
            }
        }
        var eventArgs = this.getEventArgs(args);
        this.trigger('select', eventArgs);
        if (this.isValueChange && !this.changeOnBlur) {
            this.triggerChangeEvent(this.keyEventArgs);
            this.isValueChange = false;
        }
    };
    DropDownTree.prototype.onNodeClicked = function (args) {
        if (!this.changeOnBlur && this.isNodeSelected) {
            this.triggerChangeEvent(args.event);
            this.isNodeSelected = false;
        }
        var target = args.event.target;
        if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
            var getNodeDetails = this.treeObj.getNode(args.node);
            if (getNodeDetails.isChecked === 'true') {
                this.treeObj.uncheckAll([args.node]);
            }
            else {
                this.treeObj.checkAll([args.node]);
            }
            this.setMultiSelect();
            this.ensurePlaceHolder();
        }
        if (!this.changeOnBlur && (this.allowMultiSelection || this.showCheckBox)) {
            this.triggerChangeEvent(args.event);
        }
    };
    DropDownTree.prototype.onNodeChecked = function (args) {
        var eventArgs = this.getEventArgs(args);
        this.trigger('select', eventArgs);
        if (this.isFilteredData && args.action === 'uncheck') {
            var id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])('id', args.data[0]).toString();
            this.removeSelectedData(id, true);
        }
        if (!this.isChipDelete && args.isInteracted) {
            this.setMultiSelect();
            this.ensurePlaceHolder();
        }
        if (this.showSelectAll && this.checkBoxElement) {
            var nodes = this.treeObj.element.querySelectorAll('li');
            var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
            var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.checkBoxElement, '.' + CHECKBOXWRAP);
            if (wrap && args.action === 'uncheck') {
                this.isReverseUpdate = true;
                this.changeState(wrap, 'uncheck');
                this.isReverseUpdate = false;
            }
            else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
                this.isReverseUpdate = true;
                this.changeState(wrap, 'check');
                this.isReverseUpdate = false;
            }
        }
    };
    DropDownTree.prototype.beforeCheck = function (args) {
        if (args.isInteracted) {
            this.oldValue = this.value ? this.value.slice() : this.value;
        }
    };
    DropDownTree.prototype.updateClearButton = function (state) {
        if (state) {
            if (!this.inputWrapper.contains(this.overAllClear)) {
                this.inputEle.parentElement.insertBefore(this.overAllClear, this.inputEle.nextSibling);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overAllClear], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CLEAR);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllClear], HIDEICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CLEAR);
        }
        if ((this.allowMultiSelection || this.showCheckBox) && this.chipWrapper) {
            var chipClose = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["selectAll"])('.' + CHIP_CLOSE, this.chipWrapper);
            for (var i = 0; i < chipClose.length; i++) {
                if (!state) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([chipClose[i]], HIDEICON);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([chipClose[i]], HIDEICON);
                }
            }
        }
    };
    DropDownTree.prototype.updateDropDownIconState = function (state) {
        var spinIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + DDTICON, this.inputWrapper);
        if (state) {
            if (!spinIcon) {
                _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].appendSpan(DROPDOWNICON, this.inputWrapper, this.createElement);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([spinIcon], HIDEICON);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_DD_ICON);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([spinIcon], HIDEICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_DD_ICON);
        }
    };
    DropDownTree.prototype.updateMode = function () {
        if (this.mode !== 'Delimiter') {
            if (!this.inputWrapper.contains(this.chipWrapper)) {
                this.createChip();
            }
            var isValid = this.getValidMode();
            if (this.chipWrapper.classList.contains(HIDEICON) && isValid) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.chipWrapper], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], SHOW_CHIP);
            }
            else if (!isValid) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
            }
            var isValue = this.value !== null ? (this.value.length !== 0 ? true : false) : false;
            if (isValid && isValue) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
            }
        }
        else if (this.inputEle.classList.contains(CHIP_INPUT)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
            if (this.chipWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
            }
        }
    };
    DropDownTree.prototype.ensurePlaceHolder = function () {
        if (this.value && this.value.length === 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
            if (this.chipWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
            }
        }
    };
    DropDownTree.prototype.ensureClearIconPosition = function (floatLabelType) {
        if (floatLabelType !== 'Never') {
            this.inputWrapper.insertBefore(this.overAllClear, this.inputObj.buttons[0]);
        }
    };
    DropDownTree.prototype.setMultiSelectValue = function (newValues) {
        if (!this.isFilteredData) {
            this.setProperties({ value: newValues }, true);
            if (newValues && newValues.length !== 0 && !this.showCheckBox) {
                this.treeObj.selectedNodes = this.value.slice();
                this.treeObj.dataBind();
            }
        }
        else {
            var selectedValues = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) ? [] : this.value;
            for (var i = 0; i < newValues.length; i++) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.indexOf(newValues[i]) === -1) {
                    selectedValues.push(newValues[i]);
                }
            }
            this.setProperties({ value: selectedValues }, true);
        }
    };
    DropDownTree.prototype.setMultiSelect = function () {
        if (this.showCheckBox && !this.isDynamicChange) {
            this.setMultiSelectValue(this.treeObj.checkedNodes.slice());
        }
        else {
            var ddtValue = this.allowMultiSelection ? (this.showCheckBox ? this.treeObj.checkedNodes
                : this.treeObj.selectedNodes) : (this.value ? (this.showCheckBox ? this.value : [this.value[0]]) : null);
            this.setMultiSelectValue(ddtValue);
            if (this.showCheckBox && this.value !== null) {
                this.treeObj.checkedNodes = this.value;
                this.treeObj.dataBind();
            }
        }
        this.selectedText = [];
        var checkSelection = this.allowMultiSelection ? true : (this.showCheckBox ? true : false);
        if (this.inputWrapper.contains(this.chipWrapper) && !checkSelection) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.chipWrapper);
        }
        var isValid = this.getValidMode();
        if (isValid && this.value !== null) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
            if (this.chipWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.chipWrapper], HIDEICON);
            }
        }
        var isValue = this.value ? (this.value.length ? true : false) : false;
        if (this.chipWrapper && (this.mode === 'Box' && !isValue)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
        }
        this.updateSelectedValues();
    };
    DropDownTree.prototype.getSelectedData = function (value) {
        var data = null;
        if (this.isFilteredData) {
            for (var i = 0; i < this.selectedData.length; i++) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.treeSettings.loadOnDemand ? this.fields.value : 'id', this.selectedData[i]).toString() === value) {
                    data = this.selectedData[i];
                    break;
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
            if (this.treeSettings.loadOnDemand) {
                data = this.treeObj.getTreeData(value)[0];
            }
            else {
                data = this.treeObj.getNode(value);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
                this.selectedData.push(data);
            }
        }
        return data;
    };
    DropDownTree.prototype.removeSelectedData = function (value, muteOnChange) {
        var selectedValues = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) ? [] : this.value.slice();
        selectedValues.splice(selectedValues.indexOf(value), 1);
        this.setProperties({ value: selectedValues }, muteOnChange);
        for (var i = 0; i < this.selectedData.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.treeSettings.loadOnDemand ? this.fields.value : 'id', this.selectedData[i]).toString() === value) {
                this.selectedData.splice(i, 1);
                break;
            }
        }
    };
    DropDownTree.prototype.updateSelectedValues = function () {
        this.dataValue = '';
        var temp;
        var text;
        var textValue = '';
        var selectedData;
        this.hiddenElement.innerHTML = '';
        if ((!this.isChipDelete || this.treeSettings.autoCheck) && (this.inputWrapper.contains(this.chipWrapper))) {
            this.chipCollection.innerHTML = '';
        }
        if (!this.isFilteredData) {
            this.selectedData = [];
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
            for (var i = 0, len = this.value.length; i < len; i++) {
                selectedData = this.getSelectedData(this.value[i]);
                text = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
                this.selectedText.push(text);
                temp = this.selectedText[this.selectedText.length - 1];
                if (this.selectedText.length > 1) {
                    this.dataValue += (this.delimiterChar + ' ' + temp);
                    textValue += (',' + temp);
                    this.setProperties({ text: textValue }, true);
                }
                else {
                    this.dataValue += temp;
                    textValue += temp;
                }
                if (this.mode !== 'Delimiter' && (!this.isChipDelete || this.treeSettings.autoCheck) &&
                    (this.allowMultiSelection || this.showCheckBox)) {
                    this.setChipValues(temp, this.value[i]);
                }
                this.hiddenElement.innerHTML += '<option selected value ="' + this.value[i] + '">' +
                    this.selectedText[this.selectedText.length - 1] + '</option>';
            }
        }
        var isValid = this.getValidMode();
        if (this.mode !== 'Box' && (this.allowMultiSelection || this.showCheckBox) && !isValid) {
            if (this.chipWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.chipWrapper], HIDEICON);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
            }
        }
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setValue(this.dataValue, this.inputEle, this.floatLabelType);
        if (textValue === '') {
            this.setProperties({ text: null }, true);
        }
        else {
            this.setProperties({ text: textValue }, true);
        }
        if (this.showClearButton && this.inputFocus) {
            this.showOverAllClear();
        }
        if ((this.allowMultiSelection || this.showCheckBox) && this.popupObj) {
            this.popupObj.refreshPosition();
        }
        this.currentText = this.text;
        this.currentValue = this.value;
    };
    DropDownTree.prototype.setChipValues = function (text, value) {
        if (!this.inputWrapper.contains(this.chipWrapper)) {
            this.createChip();
        }
        var chip = this.createElement('span', {
            className: CHIP,
            attrs: { 'data-value': value }
        });
        var chipContent = this.createElement('span', { className: CHIP_CONTENT });
        var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
        chipContent.innerHTML = text;
        chip.appendChild(chipContent);
        this.chipCollection.appendChild(chip);
        if (this.showClearButton) {
            chip.appendChild(chipClose);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(chipClose, 'mousedown', this.removeChip, this);
        }
    };
    DropDownTree.prototype.setSelectAllWrapper = function (state) {
        if (this.isFirstRender) {
            return;
        }
        if (state && !this.popupEle.contains(this.checkAllParent) && this.showCheckBox) {
            this.createSelectAllWrapper();
            this.popupEle.insertBefore(this.checkAllParent, this.popupDiv);
        }
        else if (this.popupEle.contains(this.checkAllParent)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.checkAllParent);
            this.checkAllParent = null;
        }
    };
    DropDownTree.prototype.setHeaderTemplate = function () {
        var compiledString;
        if (this.header) {
            this.header.innerHTML = '';
        }
        else {
            this.header = this.createElement('div');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.header], HEADER);
        }
        compiledString = this.templateComplier(this.headerTemplate);
        var tempArr = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, undefined, this.header);
        if (tempArr) {
            tempArr = Array.prototype.slice.call(tempArr);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])(tempArr, this.header);
        }
        this.ddtupdateBlazorTemplates(false, false, true, false);
        this.popupEle.insertBefore(this.header, this.checkAllParent ? this.checkAllParent : this.popupDiv);
    };
    DropDownTree.prototype.templateComplier = function (template) {
        if (template) {
            var e = void 0;
            try {
                if (document.querySelectorAll(template).length) {
                    return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(document.querySelector(template).innerHTML.trim());
                }
            }
            catch (e) {
                return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(template);
            }
        }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(template);
    };
    DropDownTree.prototype.setFooterTemplate = function () {
        var compiledString;
        if (this.footer) {
            this.footer.innerHTML = '';
        }
        else {
            this.footer = this.createElement('div');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.footer], FOOTER);
        }
        compiledString = this.templateComplier(this.footerTemplate);
        var tempArr = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, undefined, this.footer);
        if (tempArr) {
            tempArr = Array.prototype.slice.call(tempArr);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])(tempArr, this.footer);
        }
        this.ddtupdateBlazorTemplates(false, false, false, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.footer], this.popupEle);
    };
    DropDownTree.prototype.clearAll = function (e) {
        if (!this.enabled || this.readonly) {
            return;
        }
        this.resetValue();
        this.showOverAllClear();
        if ((this.allowMultiSelection || this.showCheckBox)) {
            if (this.popupObj) {
                this.popupObj.refreshPosition();
            }
            if (!this.wrapText) {
                this.updateOverflowWrapper(true);
            }
        }
        if (e) {
            this.isClearButtonClick = true;
        }
        if (!this.changeOnBlur) {
            this.triggerChangeEvent(e);
        }
    };
    DropDownTree.prototype.removeChip = function (e) {
        if (!this.enabled || this.readonly) {
            return;
        }
        var element = e.target.parentElement;
        var value = element.getAttribute('data-value');
        if (this.chipCollection) {
            if (element) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(element);
            }
        }
        this.isChipDelete = true;
        this.isClearButtonClick = true;
        this.removeSelectedData(value, true);
        this.selectedText = [];
        if (this.allowMultiSelection) {
            this.treeObj.selectedNodes = this.value.slice();
            this.updateSelectedValues();
        }
        if (this.showCheckBox) {
            this.treeObj.uncheckAll([value]);
            this.clearCheckAll();
            this.setMultiSelect();
        }
        this.triggerChangeEvent(e);
        this.isChipDelete = false;
        this.ensurePlaceHolder();
    };
    DropDownTree.prototype.resetValue = function (isDynamicChange) {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setValue(null, this.inputEle, this.floatLabelType);
        if (!isDynamicChange) {
            this.oldValue = this.value;
            this.setProperties({ value: [] }, true);
        }
        this.dataValue = null;
        this.setProperties({ text: null }, true);
        this.selectedData = [];
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])('selectedNodes', [], this.treeObj);
        this.hiddenElement.innerHTML = '';
        if (this.showCheckBox) {
            this.treeObj.uncheckAll();
            this.setMultiSelect();
            this.clearCheckAll();
        }
        if (this.oldValue === null && !isDynamicChange) {
            this.removeValue = true;
        }
        else if (isDynamicChange) {
            this.triggerChangeEvent();
        }
        if ((this.allowMultiSelection || this.showCheckBox) && this.chipWrapper) {
            this.chipCollection.innerHTML = '';
            if (!this.wrapText) {
                this.updateOverflowWrapper(true);
            }
            this.ensurePlaceHolder();
        }
    };
    DropDownTree.prototype.clearCheckAll = function () {
        if (this.showSelectAll && this.value && this.value.length === 0) {
            this.setLocale(false);
        }
    };
    DropDownTree.prototype.selectAllItems = function (state) {
        if (this.showCheckBox) {
            state ? this.treeObj.checkAll() : this.treeObj.uncheckAll();
            this.checkSelectAll = true;
        }
        else if (this.allowMultiSelection) {
            if (!state) {
                this.treeObj.selectedNodes = [];
            }
            else {
                var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["selectAll"])('li', this.treeObj.element);
                var id = void 0;
                var arr = [];
                for (var i = 0; i < li.length; i++) {
                    id = li[i].getAttribute('data-uid').toString();
                    arr.push(id);
                }
                this.treeObj.selectedNodes = arr;
            }
        }
        this.updateMode();
        this.setMultiSelect();
        if (!this.wrapText) {
            state ? this.updateView() : this.updateOverflowWrapper(true);
        }
    };
    DropDownTree.prototype.updateTreeSettings = function (prop) {
        var value = Object.keys(prop.treeSettings)[0];
        if (value === 'autoCheck') {
            this.ensureAutoCheck();
            this.treeObj.autoCheck = this.treeSettings.autoCheck;
        }
        else if (value === 'loadOnDemand') {
            this.treeObj.loadOnDemand = this.treeSettings.loadOnDemand;
        }
        else if (value === 'expandOn') {
            this.treeObj.expandOn = this.treeSettings.expandOn;
            this.treeObj.dataBind();
            return;
        }
        this.treeObj.dataBind();
        this.setMultiSelect();
        this.updateValue(this.value);
    };
    DropDownTree.prototype.updateCheckBoxState = function (checkBox) {
        if (this.hasTemplate) {
            this.updateTemplate();
        }
        if (!this.wrapText) {
            this.updateOverflowWrapper(false);
        }
        this.treeObj.showCheckBox = checkBox;
        this.treeObj.dataBind();
        this.isDynamicChange = true;
        this.setSelectAllWrapper(this.showSelectAll);
        if (this.showSelectAll) {
            this.setLocale();
        }
        if (this.showCheckBox) {
            this.updateMode();
        }
        this.setMultiSelect();
        this.isDynamicChange = false;
    };
    DropDownTree.prototype.updateTemplate = function () {
        if (this.popupObj) {
            this.clearTemplate();
            // tslint:disable
            this.portals = [];
            this.popupObj.destroy();
            if (this.isPopupOpen) {
                this.hidePopup();
                this.isFirstRender = true;
                this.renderPopup();
            }
            else {
                this.isFirstRender = true;
            }
        }
    };
    DropDownTree.prototype.l10nUpdate = function (actionFailure) {
        if (this.noRecord) {
            this.noRecord.innerHTML = '';
        }
        else {
            this.noRecord = this.createElement('div');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.noRecord], NODATACONTAINER);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.noRecord], this.popupDiv);
        }
        if (this.noRecordsTemplate !== 'No Records Found' || this.actionFailureTemplate !== 'The Request Failed') {
            var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
            var compiledString = void 0;
            var templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
            var templatestring = actionFailure ? 'actionFailureTemplate' : 'noRecordsTemplate';
            compiledString = this.templateComplier(template);
            var tempArr = compiledString({}, this, templatestring, templateId, this.isStringTemplate, undefined, this.noRecord);
            if (tempArr) {
                tempArr = Array.prototype.slice.call(tempArr);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])(tempArr, this.noRecord);
            }
            this.ddtupdateBlazorTemplates(!actionFailure, actionFailure);
        }
        else {
            var l10nLocale = { noRecordsTemplate: 'No Records Found', actionFailureTemplate: 'The Request Failed' };
            this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getLocaleName(), l10nLocale, this.locale);
            this.noRecord.innerHTML = actionFailure ?
                this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
        }
    };
    DropDownTree.prototype.ddtupdateBlazorTemplates = function (noRecord, action, header, footer, isEmpty) {
        if (!this.isStringTemplate) {
            if (this.noRecordsTemplate && noRecord) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["updateBlazorTemplate"])(this.noRecordsTemplateId, NORECORDSTEMPLATE, this, isEmpty);
            }
            if (this.actionFailureTemplate && action) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["updateBlazorTemplate"])(this.actionFailureTemplateId, ACTIONFAILURETEMPLATE, this, isEmpty);
            }
            if (header) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["updateBlazorTemplate"])(this.headerTemplateId, HEADERTEMPLATE, this);
            }
            if (footer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["updateBlazorTemplate"])(this.footerTemplateId, FOOTERTEMPLATE, this);
            }
        }
    };
    DropDownTree.prototype.ddtresetBlazorTemplates = function (noRecord, action, header, footer) {
        if (!this.isStringTemplate) {
            if (this.noRecordsTemplate && noRecord) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["resetBlazorTemplate"])(this.noRecordsTemplateId, NORECORDSTEMPLATE);
            }
            if (this.actionFailureTemplate && action) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["resetBlazorTemplate"])(this.actionFailureTemplateId, ACTIONFAILURETEMPLATE);
            }
            if (header) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["resetBlazorTemplate"])(this.headerTemplateId, HEADERTEMPLATE);
            }
            if (footer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["resetBlazorTemplate"])(this.footerTemplateId, FOOTERTEMPLATE);
            }
        }
    };
    DropDownTree.prototype.updateRecordTemplate = function (action) {
        if (this.treeItems && this.treeItems.length <= 0) {
            this.l10nUpdate(action);
            if (this.hasTemplate) {
                this.updateTemplate();
            }
        }
    };
    DropDownTree.prototype.updateOverflowWrapper = function (state) {
        if (!state) {
            if (!this.inputWrapper.contains(this.overFlowWrapper)) {
                this.overFlowWrapper = this.createElement('span', { className: OVERFLOW_VIEW + ' ' + HIDEICON });
                this.inputWrapper.insertBefore(this.overFlowWrapper, this.hiddenElement);
            }
        }
        else if (this.inputWrapper.contains(this.overFlowWrapper) && state) {
            this.overFlowWrapper.innerHTML = '';
        }
    };
    DropDownTree.prototype.updateMultiSelection = function (state) {
        if (!this.wrapText) {
            this.updateOverflowWrapper(false);
        }
        this.treeObj.allowMultiSelection = state;
        this.treeObj.dataBind();
        this.updateOption();
        if (this.allowMultiSelection) {
            this.updateMode();
        }
        this.setMultiSelect();
    };
    DropDownTree.prototype.updateAllowFiltering = function (state) {
        if (!this.isFirstRender) {
            if (state) {
                this.renderFilter();
            }
            else {
                this.destroyFilter();
            }
        }
        this.ensureAutoCheck();
    };
    DropDownTree.prototype.updateFilterPlaceHolder = function () {
        if (this.filterObj) {
            this.filterObj.placeholder = this.filterBarPlaceholder;
            this.filterObj.element.setAttribute('aria-label', this.filterBarPlaceholder);
        }
    };
    DropDownTree.prototype.updateValue = function (value) {
        this.isDynamicChange = true;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(value) || value.length === 0) {
            this.resetValue(true);
        }
        else {
            this.setTreeValue();
            if ((this.allowMultiSelection || this.showCheckBox) && !this.wrapText) {
                this.updateOverflowWrapper(false);
                this.updateView();
            }
        }
        this.updateHiddenValue();
        this.isDynamicChange = false;
    };
    DropDownTree.prototype.updateText = function (text) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(text)) {
            this.resetValue();
        }
        else {
            this.setTreeText();
            if ((this.allowMultiSelection || this.showCheckBox) && !this.wrapText) {
                this.updateOverflowWrapper(false);
                this.updateView();
            }
        }
        this.updateHiddenValue();
    };
    DropDownTree.prototype.updateModelMode = function () {
        var validMode = this.allowMultiSelection ? true : (this.showCheckBox ? true : false);
        if (!validMode) {
            return;
        }
        if (!this.wrapText) {
            var overFlow = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + OVERFLOW_VIEW, this.inputWrapper);
            if (overFlow) {
                overFlow.innerHTML = '';
            }
        }
        this.updateMode();
        this.setMultiSelect();
        if (!this.wrapText && (this.value && this.value.length !== 0)) {
            this.updateOverFlowView();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputEle], CHIP_INPUT);
            if (this.mode === 'Box') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overFlowWrapper, this.inputWrapper], SHOW_TEXT);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper, this.inputWrapper], SHOW_TEXT);
            }
        }
    };
    DropDownTree.prototype.updateOption = function () {
        if (!this.hiddenElement.hasAttribute('multiple') && (this.allowMultiSelection || this.showCheckBox)) {
            this.hiddenElement.setAttribute('multiple', '');
        }
        else if (this.hiddenElement.hasAttribute('multiple') && (!this.allowMultiSelection && !this.showCheckBox)) {
            this.hiddenElement.removeAttribute('multiple');
        }
    };
    /**
     * Dynamically change the value of properties.
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    DropDownTree.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'width':
                    this.setElementWidth(newProp.width);
                    if (this.popupObj) {
                        this.popupObj.element.style.width = this.setWidth();
                    }
                    break;
                case 'placeholder':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setPlaceholder(newProp.placeholder, this.inputEle);
                    break;
                case 'cssClass':
                    this.setCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'enableRtl':
                    this.setEnableRTL(this.enableRtl);
                    break;
                case 'fields':
                    this.setFields();
                    break;
                case 'readonly':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setReadonly(newProp.readonly, this.inputEle);
                    break;
                case 'enabled':
                    this.setEnable();
                    break;
                case 'floatLabelType':
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].removeFloating(this.inputObj);
                    _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].addFloating(this.inputEle, newProp.floatLabelType, this.placeholder, this.createElement);
                    this.ensureClearIconPosition(newProp.floatLabelType);
                    break;
                case 'showClearButton':
                    this.updateClearButton(newProp.showClearButton);
                    break;
                case 'allowFiltering':
                    this.updateAllowFiltering(newProp.allowFiltering);
                    break;
                case 'filterBarPlaceholder':
                    this.updateFilterPlaceHolder();
                    break;
                case 'value':
                    this.oldValue = oldProp.value;
                    this.updateValue(newProp.value);
                    break;
                case 'text':
                    this.updateText(newProp.text);
                    break;
                case 'allowMultiSelection':
                    this.updateMultiSelection(newProp.allowMultiSelection);
                    break;
                case 'mode':
                    this.updateModelMode();
                    break;
                case 'delimiterChar':
                    if (this.mode === 'Box') {
                        return;
                    }
                    if (this.showCheckBox || this.allowMultiSelection) {
                        this.setMultiSelect();
                    }
                    break;
                case 'selectAllText':
                    if (this.showCheckBox && this.showSelectAll) {
                        this.setLocale();
                    }
                    break;
                case 'unSelectAllText':
                    if (this.showCheckBox && this.showSelectAll) {
                        this.setLocale(false);
                    }
                    break;
                case 'showSelectAll':
                    if (this.showCheckBox) {
                        this.setSelectAllWrapper(newProp.showSelectAll);
                        this.updatePopupHeight();
                    }
                    break;
                case 'showCheckBox':
                    this.updateCheckBoxState(newProp.showCheckBox);
                    if (!this.wrapText) {
                        this.updateOverflowWrapper(true);
                    }
                    this.updatePopupHeight();
                    this.updateOption();
                    break;
                case 'treeSettings':
                    this.updateTreeSettings(newProp);
                    break;
                case 'sortOrder':
                    if (this.hasTemplate) {
                        this.updateTemplate();
                    }
                    this.treeObj.sortOrder = newProp.sortOrder;
                    this.updateValue(this.value);
                    this.treeObj.dataBind();
                    break;
                case 'showDropDownIcon':
                    this.updateDropDownIconState(newProp.showDropDownIcon);
                    break;
                case 'popupWidth':
                    if (this.popupObj) {
                        this.popupObj.element.style.width = this.setWidth();
                    }
                    break;
                case 'popupHeight':
                    if (this.popupObj) {
                        this.updatePopupHeight();
                    }
                    break;
                case 'zIndex':
                    if (this.popupObj) {
                        this.popupObj.zIndex = newProp.zIndex;
                        this.popupObj.dataBind();
                    }
                    break;
                case 'headerTemplate':
                    this.updateTemplate();
                    break;
                case 'footerTemplate':
                    this.updateTemplate();
                    break;
                case 'itemTemplate':
                    this.updateTemplate();
                    this.treeObj.nodeTemplate = newProp.itemTemplate;
                    this.treeObj.dataBind();
                    break;
                case 'noRecordsTemplate':
                    this.updateRecordTemplate();
                    break;
                case 'actionFailureTemplate':
                    this.updateRecordTemplate(true);
                    break;
                case 'htmlAttributes':
                    this.setHTMLAttributes();
                    break;
                case 'wrapText':
                    this.updateOverflowWrapper(this.wrapText);
                    if ((this.allowMultiSelection || this.showCheckBox) && !this.wrapText) {
                        this.updateView();
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overFlowWrapper], HIDEICON);
                        if (this.chipWrapper && this.mode === 'Box') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.chipWrapper], HIDEICON);
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputWrapper], SHOW_CHIP);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.inputEle], CHIP_INPUT);
                        }
                        this.ensurePlaceHolder();
                    }
                    break;
            }
        }
    };
    /**
     * Allows you to clear the selected values from the Dropdown Tree component.
     * @method clear
     * @return {void}.
     */
    DropDownTree.prototype.clear = function () {
        this.clearAll();
        if (this.inputFocus) {
            this.onFocusOut();
        }
        else {
            if (this.changeOnBlur) {
                this.triggerChangeEvent();
            }
            this.removeValue = false;
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. Also, it removes the attributes and classes.
     * @method destroy
     * @return {void}.
     */
    DropDownTree.prototype.destroy = function () {
        this.ddtresetBlazorTemplates(true, true, true, true);
        this.clearTemplate();
        this.unWireEvents();
        this.setCssClass(null, this.cssClass);
        this.resetValue();
        this.treeObj.destroy();
        this.destroyFilter();
        if (this.popupObj) {
            this.popupObj.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.popupObj.element);
        }
        if (this.element.tagName !== this.getDirective()) {
            this.inputWrapper.parentElement.insertBefore(this.element, this.inputWrapper);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.inputWrapper);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.popupDiv);
        this.element.classList.remove('e-input');
        _super.prototype.destroy.call(this);
    };
    DropDownTree.prototype.destroyFilter = function () {
        if (this.filterObj) {
            this.filterObj.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.filterObj.element);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.filterContainer);
            this.filterObj = null;
        }
    };
    /**
     * Ensures visibility of the Dropdown Tree item by using item value or item element.
     * If many Dropdown Tree items are present, and we are in need to find a particular item, then the `ensureVisible` property
     * helps you to bring the item to visibility by expanding the Dropdown Tree and scrolling to the specific item.
     * @param  {string | Element} item - Specifies the value of Dropdown Tree item/ Dropdown Tree item element.
     */
    DropDownTree.prototype.ensureVisible = function (item) {
        this.treeObj.ensureVisible(item);
    };
    /**
     * To get the updated data of source of the Dropdown Tree.
     * @param  {string | Element} item - Specifies the value of Dropdown Tree item/ Dropdown Tree item element.
     * @returns { { [key: string]: Object }[] }.
     */
    DropDownTree.prototype.getData = function (item) {
        return this.treeObj.getTreeData(item);
    };
    /**
     * Close the Dropdown tree pop-up.
     * @returns void.
     */
    DropDownTree.prototype.hidePopup = function () {
        var eventArgs = { popup: this.popupObj };
        this.inputWrapper.classList.remove(ICONANIMATION);
        if (this.popupEle) {
            this.popupEle.style.display = 'none';
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputWrapper, { 'aria-expanded': 'false' });
        if (this.popupObj && this.isPopupOpen) {
            this.popupObj.hide();
            if (this.inputFocus) {
                this.inputWrapper.focus();
                if (this.allowFiltering) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.inputWrapper], [INPUTFOCUS]);
                }
            }
            this.trigger('close', eventArgs);
        }
    };
    /**
     * Based on the state parameter, entire list item will be selected or deselected.
     * parameter
     * `true`   - Selects entire Dropdown Tree items.
     * `false`  - Unselects entire Dropdown Tree items.
     * @returns void
     */
    DropDownTree.prototype.selectAll = function (state) {
        this.selectAllItems(state);
    };
    /**
     * Opens the popup that displays the Dropdown Tree items.
     * @returns void.
     */
    DropDownTree.prototype.showPopup = function () {
        if (!this.enabled || this.readonly || this.isPopupOpen) {
            return;
        }
        this.renderPopup();
        this.focusIn();
    };
    /**
     * Return the module name.
     * @private
     */
    DropDownTree.prototype.getModuleName = function () {
        return 'dropdowntree';
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('The Request Failed')
    ], DropDownTree.prototype, "actionFailureTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "allowMultiSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], DropDownTree.prototype, "changeOnBlur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('')
    ], DropDownTree.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(',')
    ], DropDownTree.prototype, "delimiterChar", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], DropDownTree.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Complex"])({}, Fields)
    ], DropDownTree.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('StartsWith')
    ], DropDownTree.prototype, "filterType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Never')
    ], DropDownTree.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "footerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "ignoreAccent", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], DropDownTree.prototype, "ignoreCase", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])({})
    ], DropDownTree.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "itemTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Default')
    ], DropDownTree.prototype, "mode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('No Records Found')
    ], DropDownTree.prototype, "noRecordsTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('300px')
    ], DropDownTree.prototype, "popupHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('100%')
    ], DropDownTree.prototype, "popupWidth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "showSelectAll", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Select All')
    ], DropDownTree.prototype, "selectAllText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "showCheckBox", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], DropDownTree.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], DropDownTree.prototype, "showDropDownIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('None')
    ], DropDownTree.prototype, "sortOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Complex"])({}, TreeSettings)
    ], DropDownTree.prototype, "treeSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Unselect All')
    ], DropDownTree.prototype, "unSelectAllText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], DropDownTree.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('100%')
    ], DropDownTree.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(1000)
    ], DropDownTree.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], DropDownTree.prototype, "wrapText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "actionFailure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "dataBound", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "keyPress", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], DropDownTree.prototype, "select", void 0);
    DropDownTree = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["NotifyPropertyChanges"]
    ], DropDownTree);
    return DropDownTree;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/index.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/index.js ***!
  \*****************************************************************************/
/*! exports provided: Fields, TreeSettings, DropDownTree */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _drop_down_tree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drop-down-tree */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/drop-down-tree.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fields", function() { return _drop_down_tree__WEBPACK_IMPORTED_MODULE_0__["Fields"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeSettings", function() { return _drop_down_tree__WEBPACK_IMPORTED_MODULE_0__["TreeSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownTree", function() { return _drop_down_tree__WEBPACK_IMPORTED_MODULE_0__["DropDownTree"]; });

/**
 * export all modules from current location
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/index.js":
/*!**************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/index.js ***!
  \**************************************************************/
/*! exports provided: incrementalSearch, Search, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, highlightSearch, revertHighlightSearch, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, SelectionSettings, ToolbarSettings, ListBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "incrementalSearch", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["incrementalSearch"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Search", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["Search"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "highlightSearch", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["highlightSearch"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "revertHighlightSearch", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["revertHighlightSearch"]; });

/* harmony import */ var _drop_down_base_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./drop-down-base/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return _drop_down_base_index__WEBPACK_IMPORTED_MODULE_1__["FieldSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropDownBaseClasses", function() { return _drop_down_base_index__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownBase", function() { return _drop_down_base_index__WEBPACK_IMPORTED_MODULE_1__["DropDownBase"]; });

/* harmony import */ var _drop_down_list_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./drop-down-list/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-list/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropDownListClasses", function() { return _drop_down_list_index__WEBPACK_IMPORTED_MODULE_2__["dropDownListClasses"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownList", function() { return _drop_down_list_index__WEBPACK_IMPORTED_MODULE_2__["DropDownList"]; });

/* harmony import */ var _drop_down_tree_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./drop-down-tree/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-tree/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fields", function() { return _drop_down_tree_index__WEBPACK_IMPORTED_MODULE_3__["Fields"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeSettings", function() { return _drop_down_tree_index__WEBPACK_IMPORTED_MODULE_3__["TreeSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownTree", function() { return _drop_down_tree_index__WEBPACK_IMPORTED_MODULE_3__["DropDownTree"]; });

/* harmony import */ var _combo_box_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./combo-box/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/combo-box/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComboBox", function() { return _combo_box_index__WEBPACK_IMPORTED_MODULE_4__["ComboBox"]; });

/* harmony import */ var _auto_complete_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./auto-complete/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/auto-complete/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoComplete", function() { return _auto_complete_index__WEBPACK_IMPORTED_MODULE_5__["AutoComplete"]; });

/* harmony import */ var _multi_select_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./multi-select/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiSelect", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["MultiSelect"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckBoxSelection", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["CheckBoxSelection"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createFloatLabel", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["createFloatLabel"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateFloatLabelState", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["updateFloatLabelState"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFloating", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["removeFloating"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPlaceHolder", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["setPlaceHolder"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floatLabelFocus", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["floatLabelFocus"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floatLabelBlur", function() { return _multi_select_index__WEBPACK_IMPORTED_MODULE_6__["floatLabelBlur"]; });

/* harmony import */ var _list_box_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./list-box/index */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionSettings", function() { return _list_box_index__WEBPACK_IMPORTED_MODULE_7__["SelectionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSettings", function() { return _list_box_index__WEBPACK_IMPORTED_MODULE_7__["ToolbarSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListBox", function() { return _list_box_index__WEBPACK_IMPORTED_MODULE_7__["ListBox"]; });

/**
 * export all modules from current location
 */










/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/index.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/index.js ***!
  \***********************************************************************/
/*! exports provided: CheckBoxSelection, SelectionSettings, ToolbarSettings, ListBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _list_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list-box */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/list-box.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionSettings", function() { return _list_box__WEBPACK_IMPORTED_MODULE_0__["SelectionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToolbarSettings", function() { return _list_box__WEBPACK_IMPORTED_MODULE_0__["ToolbarSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListBox", function() { return _list_box__WEBPACK_IMPORTED_MODULE_0__["ListBox"]; });

/* harmony import */ var _multi_select_checkbox_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../multi-select/checkbox-selection */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/checkbox-selection.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckBoxSelection", function() { return _multi_select_checkbox_selection__WEBPACK_IMPORTED_MODULE_1__["CheckBoxSelection"]; });

/**
 * export all modules from current location
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/list-box.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/list-box/list-box.js ***!
  \**************************************************************************/
/*! exports provided: SelectionSettings, ToolbarSettings, ListBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionSettings", function() { return SelectionSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToolbarSettings", function() { return ToolbarSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListBox", function() { return ListBox; });
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../drop-down-base/drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>










var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
/**
 * Defines the Selection settings of List Box.
 */
var SelectionSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(SelectionSettings, _super);
    function SelectionSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Multiple')
    ], SelectionSettings.prototype, "mode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], SelectionSettings.prototype, "showCheckbox", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], SelectionSettings.prototype, "showSelectAll", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Left')
    ], SelectionSettings.prototype, "checkboxPosition", void 0);
    return SelectionSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["ChildProperty"]));

/**
 * Defines the toolbar settings of List Box.
 */
var ToolbarSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(ToolbarSettings, _super);
    function ToolbarSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])([])
    ], ToolbarSettings.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Right')
    ], ToolbarSettings.prototype, "position", void 0);
    return ToolbarSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["ChildProperty"]));

/**
 * The ListBox is a graphical user interface component used to display a list of items.
 * Users can select one or more items in the list using a checkbox or by keyboard selection.
 * It supports sorting, grouping, reordering and drag and drop of items.
 * ```html
 * <select id="listbox">
 *      <option value='1'>Badminton</option>
 *      <option value='2'>Basketball</option>
 *      <option value='3'>Cricket</option>
 *      <option value='4'>Football</option>
 *      <option value='5'>Tennis</option>
 * </select>
 * ```
 * ```typescript
 * <script>
 *   var listObj = new ListBox();
 *   listObj.appendTo("#listbox");
 * </script>
 * ```
 */
var ListBox = /** @__PURE__ @class */ (function (_super) {
    __extends(ListBox, _super);
    /**
     * Constructor for creating the ListBox component.
     */
    function ListBox(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isValidKey = false;
        _this.isDataSourceUpdate = false;
        _this.keyDownStatus = false;
        return _this;
    }
    ListBox_1 = ListBox;
    /**
     * Adds a new item to the popup list. By default, new item appends to the list as the last item,
     * but you can insert based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
     * @return {void}.
     * @private
     */
    ListBox.prototype.addItem = function (items, itemIndex) {
        _super.prototype.addItem.call(this, items, itemIndex);
    };
    ;
    /**
     * Build and render the component
     * @private
     */
    ListBox.prototype.render = function () {
        this.inputString = '';
        this.initLoad = true;
        this.isCustomFiltering = false;
        this.initialSelectedOptions = this.value;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) {
            this.list = this.element.parentElement;
            this.liCollections = this.list.querySelectorAll('.' + _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li);
            this.mainList = this.ulElement = this.list.querySelector('ul');
            this.setSelection(this.value);
            if (this.allowFiltering) {
                this.setFiltering();
            }
            this.initToolbarAndStyles();
            this.updateSelectionSettings();
            this.wireEvents();
            this.initDraggable();
            this.initLoad = false;
        }
        else {
            _super.prototype.render.call(this);
        }
        this.renderComplete();
    };
    ListBox.prototype.updateBlazorListData = function (data, isDataSource, select) {
        if (isDataSource) {
            this.liCollections = this.list.querySelectorAll('.' + _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li);
            this.mainList = this.ulElement = this.list.querySelector('ul');
            if (this.allowDragAndDrop && !this.ulElement.classList.contains('e-sortable')) {
                this.initDraggable();
            }
            if (select) {
                this.selectItems(this.listData, false);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(data)) {
            this.sortedData = this.jsonData = this.listData = data;
        }
    };
    ListBox.prototype.initWrapper = function () {
        var hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
        this.list.classList.add('e-listbox-wrapper');
        if (this.itemTemplate) {
            this.list.classList.add('e-list-template');
        }
        this.list.classList.add('e-wrapper');
        this.list.classList.add('e-lib');
        if (this.element.tagName === 'EJS-LISTBOX') {
            this.element.setAttribute('tabindex', '0');
            if (this.initLoad) {
                this.element.appendChild(this.list);
            }
        }
        else {
            if (this.initLoad) {
                this.element.parentElement.insertBefore(this.list, this.element);
            }
            this.list.insertBefore(this.element, this.list.firstChild);
            this.element.style.display = 'none';
        }
        this.list.insertBefore(hiddenSelect, this.list.firstChild);
        if (this.list.getElementsByClassName('e-list-item')[0]) {
            this.list.getElementsByClassName('e-list-item')[0].classList.remove(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"].focus);
        }
        if (this.itemTemplate) {
            this.renderReactTemplates();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.list], [_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"].content, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"].root]);
        this.validationAttribute(this.element, hiddenSelect);
        this.list.setAttribute('role', 'listbox');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
        this.updateSelectionSettings();
    };
    ListBox.prototype.updateSelectionSettings = function () {
        if (this.selectionSettings.showCheckbox && this.selectionSettings.showSelectAll && this.liCollections.length) {
            var l10nSelect = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getModuleName(), { selectAllText: 'Select All', unSelectAllText: 'Unselect All' }, this.locale);
            this.showSelectAll = true;
            this.selectAllText = l10nSelect.getConstant('selectAllText');
            this.unSelectAllText = l10nSelect.getConstant('unSelectAllText');
            this.popupWrapper = this.list;
            this.checkBoxSelectionModule.checkAllParent = null;
            this.notify('selectAll', {});
        }
    };
    ListBox.prototype.initDraggable = function () {
        var _this = this;
        if (this.ulElement) {
            this.ulElement.id = this.element.id + '_parent';
        }
        if (this.allowDragAndDrop) {
            new _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["Sortable"](this.ulElement, {
                scope: this.scope,
                itemClass: 'e-list-item',
                dragStart: this.triggerDragStart.bind(this),
                drag: this.triggerDrag.bind(this),
                beforeDrop: this.beforeDragEnd.bind(this),
                drop: this.dragEnd.bind(this),
                placeHolder: function () { return _this.createElement('span', { className: 'e-placeholder' }); },
                helper: function (e) {
                    var wrapper = _this.list.cloneNode();
                    var ele = e.sender.cloneNode(true);
                    wrapper.appendChild(ele);
                    var refEle = _this.getItems()[0];
                    wrapper.style.width = refEle.offsetWidth + 'px';
                    wrapper.style.height = refEle.offsetHeight + 'px';
                    if ((_this.value && _this.value.length) > 1 && _this.isSelected(ele)) {
                        ele.appendChild(_this.createElement('span', {
                            className: 'e-list-badge', innerHTML: _this.value.length + ''
                        }));
                    }
                    wrapper.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["getZindexPartial"])(_this.element) + '';
                    return wrapper;
                }
            });
        }
    };
    ListBox.prototype.updateActionCompleteData = function (li, item) {
        this.jsonData.push(item);
    };
    ListBox.prototype.initToolbar = function () {
        var scope;
        var pos = this.toolbarSettings.position;
        var prevScope = this.element.getAttribute('data-value');
        if (this.toolbarSettings.items.length) {
            var toolElem = this.createElement('div', { className: 'e-listbox-tool', attrs: { 'role': 'toolbar' } });
            var wrapper = this.createElement('div', {
                className: 'e-listboxtool-wrapper e-lib e-' + pos.toLowerCase()
            });
            this.list.parentElement.insertBefore(wrapper, this.list);
            wrapper.appendChild(pos === 'Right' ? this.list : toolElem);
            wrapper.appendChild(pos === 'Right' ? toolElem : this.list);
            this.createButtons(toolElem);
            if (!this.element.id) {
                this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getUniqueID"])('e-' + this.getModuleName());
            }
            if (this.scope) {
                document.querySelector(this.scope).setAttribute('data-value', this.element.id);
            }
            else {
                this.updateToolBarState();
            }
        }
        scope = this.element.getAttribute('data-value');
        if (prevScope && scope && (prevScope !== scope)) {
            this.tBListBox = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(document.getElementById(prevScope), this.getModuleName());
            this.tBListBox.updateToolBarState();
        }
        else if (scope) {
            this.tBListBox = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(document.getElementById(scope), this.getModuleName());
            this.tBListBox.updateToolBarState();
        }
    };
    ListBox.prototype.createButtons = function (toolElem) {
        var _this = this;
        var btn;
        var ele;
        var title;
        var l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getModuleName(), {
            moveUp: 'Move Up', moveDown: 'Move Down', moveTo: 'Move To',
            moveFrom: 'Move From', moveAllTo: 'Move All To', moveAllFrom: 'Move All From'
        }, this.locale);
        this.toolbarSettings.items.forEach(function (value) {
            title = l10n.getConstant(value);
            ele = _this.createElement('button', {
                attrs: {
                    'type': 'button',
                    'data-value': value,
                    'title': title,
                    'aria-label': title
                }
            });
            toolElem.appendChild(ele);
            btn = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__["Button"]({ iconCss: 'e-icons e-' + value.toLowerCase() }, ele);
            btn.createElement = _this.createElement;
        });
    };
    ListBox.prototype.validationAttribute = function (input, hiddenSelect) {
        _super.prototype.validationAttribute.call(this, input, hiddenSelect);
        hiddenSelect.required = input.required;
        input.required = false;
    };
    ListBox.prototype.setHeight = function () {
        var ele = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
        ele.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.height);
        if (this.allowFiltering && this.height.toString().indexOf('%') < 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.list], 'e-filter-list');
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.list], 'e-filter-list');
        }
    };
    ListBox.prototype.setCssClass = function () {
        var wrap = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([wrap], this.cssClass.split(' '));
        }
        if (this.enableRtl) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([wrap], 'e-rtl');
        }
    };
    ListBox.prototype.setEnable = function () {
        var ele = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
        if (this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([ele], _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([ele], _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered && this.toolbarSettings.items.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.list], _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled);
            }
        }
    };
    ListBox.prototype.showSpinner = function () {
        if (!this.spinner) {
            this.spinner = this.createElement('div', { className: 'e-listbox-wrapper' });
        }
        this.spinner.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.height);
        this.element.parentElement.insertBefore(this.spinner, this.element.nextSibling);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["createSpinner"])({ target: this.spinner }, this.createElement);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["showSpinner"])(this.spinner);
    };
    ListBox.prototype.hideSpinner = function () {
        if (this.spinner.querySelector('.e-spinner-pane')) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["hideSpinner"])(this.spinner);
        }
        if (this.spinner.parentElement) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.spinner);
        }
    };
    ListBox.prototype.onInput = function () {
        if (this.keyDownStatus) {
            this.isValidKey = true;
        }
        else {
            this.isValidKey = false;
        }
        this.keyDownStatus = false;
        this.refreshClearIcon();
    };
    ListBox.prototype.clearText = function () {
        this.filterInput.value = '';
        this.refreshClearIcon();
        var event = document.createEvent('KeyboardEvent');
        this.isValidKey = true;
        this.KeyUp(event);
    };
    ListBox.prototype.refreshClearIcon = function () {
        if (this.filterInput.parentElement.querySelector('.' + listBoxClasses.clearIcon)) {
            var clearElement = this.filterInput.parentElement.querySelector('.' + listBoxClasses.clearIcon);
            clearElement.style.visibility = this.filterInput.value === '' ? 'hidden' : 'visible';
        }
    };
    ListBox.prototype.onActionComplete = function (ulElement, list, e) {
        var searchEle;
        if (this.allowFiltering && this.list.getElementsByClassName('e-filter-parent')[0]) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) {
                searchEle = this.list.getElementsByClassName('e-filter-parent')[0];
            }
            else {
                searchEle = this.list.getElementsByClassName('e-filter-parent')[0].cloneNode(true);
            }
        }
        _super.prototype.onActionComplete.call(this, ulElement, list, e);
        if (this.allowFiltering && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(searchEle)) {
            this.list.insertBefore(searchEle, this.list.firstElementChild);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && !this.isServerRendered) {
                this.filterParent = this.list.getElementsByClassName('e-filter-parent')[0];
                this.filterWireEvents(searchEle);
            }
        }
        this.initWrapper();
        this.setSelection();
        this.initDraggable();
        this.mainList = this.ulElement;
        if (this.initLoad) {
            this.jsonData = [];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(this.jsonData, list, []);
            this.initToolbarAndStyles();
            this.wireEvents();
            if (this.showCheckbox) {
                this.setCheckboxPosition();
            }
            if (this.allowFiltering) {
                this.setFiltering();
            }
        }
        else {
            if (this.isDataSourceUpdate) {
                this.jsonData = [];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(this.jsonData, list, []);
                this.isDataSourceUpdate = false;
            }
            if (this.allowFiltering) {
                var filterElem = this.list.getElementsByClassName('e-input-filter')[0];
                var txtLength = this.filterInput.value.length;
                filterElem.selectionStart = txtLength;
                filterElem.selectionEnd = txtLength;
                filterElem.focus();
            }
        }
        if (this.toolbarSettings.items.length && this.scope && this.scope.indexOf('#') > -1 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e)) {
            var scope = this.scope.replace('#', '');
            var scopedLB = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(document.getElementById(scope), this.getModuleName());
            scopedLB.initToolbar();
        }
        this.initLoad = false;
    };
    ListBox.prototype.initToolbarAndStyles = function () {
        this.initToolbar();
        this.setCssClass();
        this.setEnable();
        this.setHeight();
    };
    ListBox.prototype.triggerDragStart = function (args) {
        var _this = this;
        var badge;
        args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(this.getDragArgs(args), { dragSelected: true });
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIos) {
            this.list.style.overflow = 'hidden';
        }
        this.trigger('dragStart', args, function (dragEventArgs) {
            _this.allowDragAll = dragEventArgs.dragSelected;
            if (!_this.allowDragAll) {
                badge = _this.ulElement.getElementsByClassName('e-list-badge')[0];
                if (badge) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(badge);
                }
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                args.bindEvents(args.dragElement);
            }
        });
    };
    ListBox.prototype.triggerDrag = function (args) {
        this.trigger('drag', this.getDragArgs(args));
        var listObj = this.getComponent(args.target);
        if (listObj && listObj.listData.length === 0) {
            var noRecElem = listObj.ulElement.getElementsByClassName('e-list-nrt')[0];
            if (noRecElem) {
                listObj.ulElement.removeChild(noRecElem);
            }
        }
    };
    ListBox.prototype.beforeDragEnd = function (args) {
        var dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
        if (this.value.indexOf(dragValue) > -1) {
            args.items = this.getDataByValues(this.value);
        }
        else {
            args.items = this.getDataByValues([dragValue]);
        }
        this.trigger('beforeDrop', args);
    };
    // tslint:disable-next-line:max-func-body-length
    ListBox.prototype.dragEnd = function (args) {
        var _this = this;
        var listData;
        var liColl;
        var jsonData;
        var droppedData;
        var selectedOptions;
        var sortedData;
        var dropValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
        var listObj = this.getComponent(args.droppedElement);
        var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
        var sourceArgs = { previousData: this.dataSource };
        var destArgs = { previousData: listObj.dataSource };
        var dragArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])({}, getArgs, { target: args.target, source: { previousData: this.dataSource } });
        if (listObj !== this) {
            var sourceArgs1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(sourceArgs, { currentData: this.listData });
            dragArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(dragArgs, { source: sourceArgs1, destination: destArgs });
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIos) {
            this.list.style.overflow = '';
        }
        if (listObj === this) {
            var ul_1 = this.ulElement;
            listData = [].slice.call(this.listData);
            liColl = [].slice.call(this.liCollections);
            jsonData = [].slice.call(this.jsonData);
            sortedData = [].slice.call(this.sortedData);
            var toSortIdx_1 = args.currentIndex;
            var toIdx_1 = args.currentIndex = this.getCurIdx(this, args.currentIndex);
            var rIdx = listData.indexOf(this.getDataByValue(dropValue));
            var jsonIdx = jsonData.indexOf(this.getDataByValue(dropValue));
            var sIdx = sortedData.indexOf(this.getDataByValue(dropValue));
            listData.splice(toIdx_1, 0, listData.splice(rIdx, 1)[0]);
            sortedData.splice(toSortIdx_1, 0, sortedData.splice(sIdx, 1)[0]);
            jsonData.splice(toIdx_1, 0, jsonData.splice(jsonIdx, 1)[0]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                liColl.splice(toIdx_1, 0, liColl.splice(rIdx, 1)[0]);
            }
            if (this.allowDragAll) {
                selectedOptions = this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 ? this.value : [dropValue];
                selectedOptions.forEach(function (value) {
                    if (value !== dropValue) {
                        var idx = listData.indexOf(_this.getDataByValue(value));
                        var jsonIdx_1 = jsonData.indexOf(_this.getDataByValue(value));
                        var sIdx_1 = sortedData.indexOf(_this.getDataByValue(value));
                        if (idx > toIdx_1) {
                            toIdx_1++;
                        }
                        jsonData.splice(toIdx_1, 0, jsonData.splice(jsonIdx_1, 1)[0]);
                        listData.splice(toIdx_1, 0, listData.splice(idx, 1)[0]);
                        sortedData.splice(toSortIdx_1, 0, sortedData.splice(sIdx_1, 1)[0]);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                            liColl.splice(toIdx_1, 0, liColl.splice(idx, 1)[0]);
                            ul_1.insertBefore(_this.getItems()[_this.getIndexByValue(value)], ul_1.getElementsByClassName('e-placeholder')[0]);
                        }
                    }
                    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                        var lists = [].slice.call(_this.ulElement.getElementsByClassName(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li));
                        var refChild = _this.ulElement.removeChild(lists[args.currentIndex]);
                        lists.splice(args.currentIndex, 1);
                        _this.ulElement.insertBefore(refChild, lists[args.previousIndex]);
                    }
                });
            }
            this.listData = listData;
            this.jsonData = jsonData;
            this.sortedData = sortedData;
            this.liCollections = liColl;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                var value_1 = this.value;
                // tslint:disable-next-line:no-any
                this.interopAdaptor.invokeMethodAsync('UpdateListData', this.listData).then(function () {
                    _this.updateBlazorListData(null, true);
                    _this.selectItems(_this.listData, false);
                    _this.selectItems(value_1);
                });
            }
        }
        else {
            var li_1;
            var fLiColl_1 = [].slice.call(this.liCollections);
            var currIdx_1 = args.currentIndex = this.getCurIdx(listObj, args.currentIndex);
            var ul_2 = listObj.ulElement;
            listData = [].slice.call(listObj.listData);
            liColl = [].slice.call(listObj.liCollections);
            jsonData = [].slice.call(listObj.jsonData);
            sortedData = [].slice.call(listObj.sortedData);
            selectedOptions = (this.value && Array.prototype.indexOf.call(this.value, dropValue) > -1 && this.allowDragAll)
                ? this.value : [dropValue];
            var fListData_1 = [].slice.call(this.listData);
            var fSortData_1 = [].slice.call(this.sortedData);
            selectedOptions.forEach(function (value, index) {
                droppedData = _this.getDataByValue(value);
                var srcIdx = _this.listData.indexOf(droppedData);
                var jsonSrcIdx = _this.jsonData.indexOf(droppedData);
                var sortIdx = _this.sortedData.indexOf(droppedData);
                fListData_1.splice(srcIdx, 1);
                _this.jsonData.splice(jsonSrcIdx, 1);
                fSortData_1.splice(sortIdx, 1);
                _this.listData = fListData_1;
                _this.sortedData = fSortData_1;
                var destIdx = value === dropValue ? args.currentIndex : currIdx_1;
                listData.splice(destIdx, 0, droppedData);
                jsonData.splice(destIdx, 0, droppedData);
                sortedData.splice(destIdx, 0, droppedData);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                    liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
                }
                if (!value) {
                    var liCollElem = _this.getItems();
                    for (var i = 0; i < liCollElem.length; i++) {
                        if (liCollElem[i].getAttribute('data-value') === null && liCollElem[i].classList.contains('e-list-item')) {
                            li_1 = liCollElem[i];
                            break;
                        }
                    }
                }
                else {
                    li_1 = _this.getItems()[_this.getIndexByValue(value)];
                }
                if (!li_1) {
                    li_1 = args.helper;
                }
                _this.removeSelected(_this, value === dropValue ? [args.droppedElement] : [li_1]);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                    if (index === 0) {
                        _this.ulElement.insertBefore(ul_2.getElementsByClassName(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li)[args.currentIndex], _this.ulElement.getElementsByClassName(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li)[args.previousIndex]);
                    }
                }
                else {
                    ul_2.insertBefore(li_1, ul_2.getElementsByClassName('e-placeholder')[0]);
                }
                currIdx_1++;
            });
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                // tslint:disable
                this.interopAdaptor.invokeMethodAsync('UpdateListData', this.listData).then(function () {
                    _this.updateSelectedOptions();
                    if (_this.fields.groupBy) {
                        _this.setSelection();
                    }
                    _this.updateBlazorListData(null, true, _this.value == null || !_this.value.length);
                });
                listObj.interopAdaptor.invokeMethodAsync('UpdateListData', listData).then(function () {
                    if (listObj.sortOrder !== 'None' || _this.selectionSettings.showCheckbox
                        !== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy) {
                        listObj.setSelection();
                    }
                    listObj.updateBlazorListData(null, true, listObj.value == null || !listObj.value.length);
                });
                // tslint:enable
            }
            else {
                if (this.fields.groupBy) {
                    this.ulElement.innerHTML = this.renderItems(this.listData, this.fields).innerHTML;
                    this.setSelection();
                }
                if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
                    !== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
                    var sortable = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(ul_2, 'sortable');
                    ul_2.innerHTML = listObj.renderItems(listData, listObj.fields).innerHTML;
                    if (sortable.placeHolderElement) {
                        ul_2.appendChild(sortable.placeHolderElement);
                    }
                    ul_2.appendChild(args.helper);
                    listObj.setSelection();
                }
                this.liCollections = fLiColl_1;
                listObj.liCollections = liColl;
            }
            listObj.jsonData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])([], [], jsonData, false);
            listObj.listData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])([], [], listData, false);
            listObj.sortedData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])([], [], sortedData, false);
            if (this.listData.length === 0) {
                this.l10nUpdate();
            }
        }
        if (this === listObj) {
            var sourceArgs1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(sourceArgs, { currentData: listData });
            dragArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(dragArgs, { source: sourceArgs1 });
        }
        else {
            var dragArgs1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(destArgs, { currentData: listData });
            dragArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(dragArgs, { destination: dragArgs1 });
        }
        this.trigger('drop', dragArgs);
    };
    ListBox.prototype.removeSelected = function (listObj, elems) {
        if (listObj.selectionSettings.showCheckbox) {
            elems.forEach(function (ele) { ele.getElementsByClassName('e-frame')[0].classList.remove('e-check'); });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(elems, _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
        }
    };
    ListBox.prototype.getCurIdx = function (listObj, idx) {
        if (listObj.fields.groupBy) {
            idx -= [].slice.call(listObj.ulElement.children).slice(0, idx)
                .filter(function (ele) { return ele.classList.contains(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].group); }).length;
        }
        return idx;
    };
    ListBox.prototype.getComponent = function (li) {
        var listObj;
        var ele = (this.element.tagName === 'EJS-LISTBOX' ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(li, '.e-listbox')
            : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(li, '.e-listbox-wrapper') && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(li, '.e-listbox-wrapper').querySelector('.e-listbox'));
        if (ele) {
            listObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(ele, this.getModuleName());
        }
        return listObj;
    };
    ListBox.prototype.listOption = function (dataSource, fields) {
        this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
        this.listCurrentOptions = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
        this.notify('listoption', { module: 'CheckBoxSelection' });
        return this.listCurrentOptions;
    };
    ListBox.prototype.triggerBeforeItemRender = function (e) {
        e.item.setAttribute('tabindex', '-1');
        this.trigger('beforeItemRender', { element: e.item, item: e.curData });
    };
    ListBox.prototype.requiredModules = function () {
        var modules = [];
        if (this.selectionSettings.showCheckbox) {
            modules.push({
                member: 'CheckBoxSelection',
                args: [this]
            });
        }
        return modules;
    };
    /**
     * This method is used to enable or disable the items in the ListBox based on the items and enable argument.
     * @param items Text items that needs to be enabled/disabled.
     * @param enable Set `true`/`false` to enable/disable the list items.
     * @param isValue - Set `true` if `items` parameter is a array of unique values.
     * @returns void
     */
    ListBox.prototype.enableItems = function (items, enable, isValue) {
        var _this = this;
        if (enable === void 0) { enable = true; }
        var li;
        items.forEach(function (item) {
            var text;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && typeof (item) === 'object') {
                text = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(isValue ? _this.fields.value : _this.fields.text, item);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(text)) {
                    return;
                }
            }
            else {
                text = item;
            }
            li = _this.findListElement(_this.list, 'li', 'data-value', isValue ? text : _this.getValueByText(text));
            if (!li) {
                return;
            }
            if (enable) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([li], _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled);
                li.removeAttribute('aria-disabled');
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([li], _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled);
                li.setAttribute('aria-disabled', 'true');
            }
        });
    };
    /**
     * Based on the state parameter, specified list item will be selected/deselected.
     * @param items Array of text value of the item.
     * @param state Set `true`/`false` to select/un select the list items.
     * @param isValue - Set `true` if `items` parameter is a array of unique values.
     * @returns void
     */
    ListBox.prototype.selectItems = function (items, state, isValue) {
        if (state === void 0) { state = true; }
        this.setSelection(items, state, !isValue);
        this.updateSelectedOptions();
    };
    /**
     * Based on the state parameter, entire list item will be selected/deselected.
     * @param state Set `true`/`false` to select/un select the entire list items.
     * @returns void
     */
    ListBox.prototype.selectAll = function (state) {
        if (state === void 0) { state = true; }
        this.selectAllItems(state);
    };
    /**
     * Adds a new item to the list. By default, new item appends to the list as the last item,
     * but you can insert based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to place the newly added item in the list.
     * @returns {void}.
     */
    ListBox.prototype.addItems = function (items, itemIndex) {
        _super.prototype.addItem.call(this, items, itemIndex);
    };
    /**
     * Removes a item from the list. By default, removed the last item in the list,
     * but you can remove based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to remove the item from the list.
     * @returns {void}.
     */
    ListBox.prototype.removeItems = function (items, itemIndex) {
        this.removeItem(items, itemIndex);
    };
    /**
     * Removes a item from the list. By default, removed the last item in the list,
     * but you can remove based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to remove the item from the list.
     * @returns {void}.
     */
    ListBox.prototype.removeItem = function (items, itemIndex) {
        var liCollections = [];
        var liElement = this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"].li);
        if (items) {
            items = (items instanceof Array ? items : [items]);
            var fields = this.fields;
            var dataValue = void 0;
            var objValue = void 0;
            var dupData = [];
            var itemIdx = void 0;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(dupData, [], this.listData);
            var removeIdxes = [];
            var removeLiIdxes = [];
            for (var j = 0; j < items.length; j++) {
                if (items[j] instanceof Object) {
                    dataValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(fields.value, items[j]);
                }
                else {
                    dataValue = items[j].toString();
                }
                for (var i = 0, len = dupData.length; i < len; i++) {
                    if (dupData[i] instanceof Object) {
                        objValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(fields.value, dupData[i]);
                    }
                    else {
                        objValue = dupData[i].toString();
                    }
                    if (objValue === dataValue) {
                        itemIdx = this.getIndexByValue(dataValue);
                        liCollections.push(liElement[itemIdx]);
                        removeIdxes.push(i);
                        removeLiIdxes.push(itemIdx);
                    }
                }
            }
            for (var k = removeIdxes.length - 1; k >= 0; k--) {
                this.listData.splice(removeIdxes[k], 1);
            }
            for (var k = removeLiIdxes.length - 1; k >= 0; k--) {
                this.updateLiCollection(removeLiIdxes[k]);
            }
        }
        else {
            itemIndex = itemIndex ? itemIndex : 0;
            liCollections.push(liElement[itemIndex]);
            this.listData.splice(itemIndex, 1);
            this.updateLiCollection(itemIndex);
        }
        for (var i = 0; i < liCollections.length; i++) {
            this.ulElement.removeChild(liCollections[i]);
        }
        if (this.listData.length === 0) {
            this.l10nUpdate();
        }
    };
    /**
     * Gets the array of data Object that matches the given array of values.
     * @param  { string[] | number[] | boolean[] } value - Specifies the array value of the list item.
     * @returns object[].
     */
    ListBox.prototype.getDataByValues = function (value) {
        var data = [];
        for (var i = 0; i < value.length; i++) {
            data.push(this.getDataByValue(value[i]));
        }
        return data;
    };
    /**
     * Moves the given value(s) / selected value(s) upwards.
     * @param  { string[] | number[] | boolean[] } value - Specifies the value(s).
     * @returns {void}
     */
    ListBox.prototype.moveUp = function (value) {
        var elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
        this.moveUpDown(true, false, elem);
    };
    /**
     * Moves the given value(s) / selected value(s) downwards.
     * @param  { string[] | number[] | boolean[] } value - Specifies the value(s).
     * @returns {void}
     */
    ListBox.prototype.moveDown = function (value) {
        var elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
        this.moveUpDown(false, false, elem);
    };
    /**
     * Moves the given value(s) / selected value(s) to the given / default scoped ListBox.
     * @param  { string[] | number[] | boolean[] } value - Specifies the value or array value of the list item.
     * @returns {void}
     */
    ListBox.prototype.moveTo = function (value, index, targetId) {
        var elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
        var tlistbox = (targetId) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(targetId, ListBox_1) : this.getScopedListBox();
        this.moveData(this, tlistbox, false, elem, index);
    };
    /**
     * Moves all the values from one ListBox to the scoped ListBox.
     * @param  { string } targetId - Specifies the scoped ListBox ID.
     * @param  { string } index - Specifies the index to where the items moved.
     * @returns {void}
     */
    ListBox.prototype.moveAllTo = function (targetId, index) {
        if (this.listData.length > 0) {
            var tlistbox = (targetId) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(targetId, ListBox_1) : this.getScopedListBox();
            this.moveAllData(this, tlistbox, false, index);
        }
    };
    /**
     * Returns the updated dataSource in ListBox
     * @returns {{ [key: string]: Object }[] | string[] | boolean[] | number[]}
     */
    ListBox.prototype.getDataList = function () {
        return this.jsonData;
    };
    /**
     * Returns the sorted Data in ListBox
     * @returns {{ [key: string]: Object }[] | string[] | boolean[] | number[]}
     */
    ListBox.prototype.getSortedList = function () {
        var sortData;
        var tempData;
        sortData = tempData = this.sortedData;
        if (this.fields.groupBy) {
            sortData = [];
            for (var i = 0; i < tempData.length; i++) {
                if (tempData[i].isHeader) {
                    continue;
                }
                sortData.push(tempData[i]);
            }
        }
        return sortData;
    };
    ListBox.prototype.getElemByValue = function (value) {
        var elem = [];
        for (var i = 0; i < value.length; i++) {
            elem.push(this.ulElement.querySelector('[data-value ="' + value[i] + '"]'));
        }
        return elem;
    };
    ListBox.prototype.updateLiCollection = function (index) {
        var tempLi = [].slice.call(this.liCollections);
        tempLi.splice(index, 1);
        this.liCollections = tempLi;
    };
    ListBox.prototype.selectAllItems = function (state, event) {
        var _this = this;
        [].slice.call(this.getItems()).forEach(function (li) {
            if (!li.classList.contains(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].disabled)) {
                if (_this.selectionSettings.showCheckbox) {
                    var ele = li.getElementsByClassName('e-check')[0];
                    if ((!ele && state) || (ele && !state)) {
                        _this.notify('updatelist', { li: li, module: 'listbox' });
                        if (_this.maximumSelectionLength >= _this.list.querySelectorAll('.e-list-item span.e-check').length) {
                            _this.checkMaxSelection();
                        }
                    }
                }
                else {
                    if (state) {
                        li.classList.add(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                    }
                    else {
                        li.classList.remove(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                    }
                }
            }
        });
        this.updateSelectedOptions();
        if (this.allowFiltering && this.selectionSettings.showCheckbox) {
            var liEle = this.list.getElementsByTagName('li');
            var index = 0;
            if (state) {
                var _loop_1 = function () {
                    var dataValue1 = this_1.getFormattedValue(liEle[index].getAttribute('data-value'));
                    if (!this_1.value.some(function (e) { return e === dataValue1; })) {
                        this_1.value.push(this_1.getFormattedValue(liEle[index].getAttribute('data-value')));
                    }
                };
                var this_1 = this;
                for (index = 0; index < liEle.length; index++) {
                    _loop_1();
                }
            }
            else {
                var _loop_2 = function () {
                    var dataValue2 = this_2.getFormattedValue(liEle[index].getAttribute('data-value'));
                    this_2.value = this_2.value.filter(function (e) { return e !== dataValue2; });
                };
                var this_2 = this;
                for (index = 0; index < liEle.length; index++) {
                    _loop_2();
                }
            }
            if (document.querySelectorAll('ul').length < 2) {
                this.updateMainList();
            }
        }
        this.triggerChange(this.getSelectedItems(), event);
    };
    ListBox.prototype.updateMainList = function () {
        var mainList = this.mainList.querySelectorAll('.e-list-item');
        var ulList = this.ulElement.querySelectorAll('.e-list-item');
        var mainCount = mainList.length;
        var ulEleCount = ulList.length;
        if (this.selectionSettings.showCheckbox || (document.querySelectorAll('ul').length > 1 || mainCount !== ulEleCount)) {
            var listindex = 0;
            var valueindex = 0;
            var count = 0;
            for (listindex; listindex < mainCount;) {
                if (this.value) {
                    for (valueindex; valueindex < this.value.length; valueindex++) {
                        if (mainList[listindex].getAttribute('data-value') === this.value[valueindex]) {
                            count++;
                        }
                    }
                }
                if (!count && this.selectionSettings.showCheckbox) {
                    mainList[listindex].getElementsByClassName('e-frame')[0].classList.remove('e-check');
                }
                if (document.querySelectorAll('ul').length > 1 && count && mainCount !== ulEleCount) {
                    this.mainList.removeChild(this.mainList.getElementsByTagName('li')[listindex]);
                    listindex = 0;
                }
                else {
                    listindex++;
                }
                count = 0;
                valueindex = 0;
            }
        }
    };
    ListBox.prototype.wireEvents = function () {
        var form = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.element, 'form');
        var wrapper = this.element.tagName === 'EJS-LISTBOX' ? this.element : this.list;
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(wrapper, 'keydown', this.keyDownHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(wrapper, 'focusout', this.focusOutHandler, this);
        this.wireToolbarEvent();
        if (this.selectionSettings.showCheckbox) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(document, 'mousedown', this.checkBoxSelectionModule.onDocumentClick);
        }
        if (this.fields.groupBy || this.element.querySelector('select>optgroup')) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'scroll', this.setFloatingHeader);
        }
        if (form) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(form, 'reset', this.formResetHandler, this);
        }
    };
    ListBox.prototype.wireToolbarEvent = function () {
        if (this.toolbarSettings.items.length) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.getToolElem(), 'click', this.toolbarClickHandler, this);
        }
    };
    ListBox.prototype.unwireEvents = function () {
        var form = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.element, 'form');
        var wrapper = this.element.tagName === 'EJS-LISTBOX' ? this.element : this.list;
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(wrapper, 'keydown', this.keyDownHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(wrapper, 'focusout', this.focusOutHandler);
        if (this.allowFiltering && this.clearFilterIconElem) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.clearFilterIconElem, 'click', this.clearText);
        }
        if (this.toolbarSettings.items.length) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.getToolElem(), 'click', this.toolbarClickHandler);
        }
        if (form) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(form, 'reset', this.formResetHandler);
        }
    };
    ListBox.prototype.clickHandler = function (e) {
        this.selectHandler(e);
    };
    ;
    ListBox.prototype.checkSelectAll = function () {
        var searchCount = 0;
        var liItems = this.list.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["dropDownBaseClasses"].li);
        for (var i = 0; i < liItems.length; i++) {
            if (!liItems[i].classList.contains('e-disabled')) {
                searchCount++;
            }
        }
        var len = this.getSelectedItems().length;
        if (this.showSelectAll && searchCount) {
            this.notify('checkSelectAll', { module: 'CheckBoxSelection',
                value: (searchCount === len) ? 'check' : (len === 0) ? 'uncheck' : 'indeterminate' });
        }
    };
    ListBox.prototype.getQuery = function (query) {
        var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new _ej2_data__WEBPACK_IMPORTED_MODULE_6__["Query"]();
        if (this.allowFiltering) {
            var filterType = this.inputString === '' ? 'contains' : this.filterType;
            var dataType = this.typeOfData(this.dataSource).typeof;
            if (!(this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_6__["DataManager"]) && dataType === 'string' || dataType === 'number') {
                filterQuery.where('', filterType, this.inputString, this.ignoreCase, this.ignoreAccent);
            }
            else {
                var fields = (this.fields.text) ? this.fields.text : '';
                filterQuery.where(fields, filterType, this.inputString, this.ignoreCase, this.ignoreAccent);
            }
        }
        else {
            filterQuery = query ? query : this.query ? this.query : new _ej2_data__WEBPACK_IMPORTED_MODULE_6__["Query"]();
        }
        return filterQuery;
    };
    ListBox.prototype.setFiltering = function () {
        var filterInputObj;
        if (this.initLoad || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.filterParent)) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) {
                this.filterParent = this.list.querySelector('.e-filter-parent');
                this.filterInput = this.list.querySelector('.e-input-filter');
            }
            else {
                this.filterParent = this.createElement('span', {
                    className: listBoxClasses.filterParent
                });
                this.filterInput = this.createElement('input', {
                    attrs: { type: 'text' },
                    className: listBoxClasses.filterInput
                });
                this.element.parentNode.insertBefore(this.filterInput, this.element);
                var backIcon = false;
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                    backIcon = true;
                }
                filterInputObj = _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].createInput({
                    element: this.filterInput,
                    buttons: [listBoxClasses.filterBarClearIcon],
                    properties: { placeholder: this.filterBarPlaceholder }
                }, this.createElement);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([filterInputObj.container], this.filterParent);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.filterParent], this.list);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.filterInput, {
                    'aria-disabled': 'false',
                    'aria-owns': this.element.id + '_options',
                    'role': 'listbox',
                    'aria-activedescendant': null,
                    'autocomplete': 'off',
                    'autocorrect': 'off',
                    'autocapitalize': 'off',
                    'spellcheck': 'false'
                });
            }
            if (this.height.toString().indexOf('%') < 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.list], 'e-filter-list');
            }
            this.inputString = this.filterInput.value;
            this.filterWireEvents();
            return filterInputObj;
        }
    };
    ListBox.prototype.filterWireEvents = function (filterElem) {
        if (filterElem) {
            this.filterInput = filterElem.querySelector('.e-input-filter');
        }
        this.clearFilterIconElem = this.filterInput.parentElement.querySelector('.' + listBoxClasses.clearIcon);
        if (this.clearFilterIconElem) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.clearFilterIconElem, 'click', this.clearText, this);
            if (!filterElem) {
                this.clearFilterIconElem.style.visibility = 'hidden';
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'input', this.onInput, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'keyup', this.KeyUp, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'keydown', this.onKeyDown, this);
    };
    ListBox.prototype.selectHandler = function (e, isKey) {
        var isSelect = true;
        var currSelIdx;
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, '.' + 'e-list-item');
        var selectedLi = [li];
        if (li && li.parentElement) {
            currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
            if (!this.selectionSettings.showCheckbox) {
                if ((e.ctrlKey || _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) && this.isSelected(li)) {
                    li.classList.remove(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                    li.removeAttribute('aria-selected');
                    isSelect = false;
                }
                else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice))) {
                    this.getSelectedItems().forEach(function (ele) {
                        ele.removeAttribute('aria-selected');
                    });
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(this.getSelectedItems(), _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                }
            }
            else {
                isSelect = !li.getElementsByClassName('e-frame')[0].classList.contains('e-check');
            }
            if (e.shiftKey && !this.selectionSettings.showCheckbox && this.selectionSettings.mode !== 'Single') {
                selectedLi = [].slice.call(li.parentElement.children)
                    .slice(Math.min(currSelIdx, this.prevSelIdx), Math.max(currSelIdx, this.prevSelIdx) + 1)
                    .filter(function (ele) { return ele.classList.contains('e-list-item'); });
            }
            else {
                this.prevSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
            }
            if (isSelect) {
                if (!this.selectionSettings.showCheckbox) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])(selectedLi, _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                }
                selectedLi.forEach(function (ele) {
                    ele.setAttribute('aria-selected', 'true');
                });
                this.list.setAttribute('aria-activedescendant', li.id);
            }
            if (!isKey && (this.maximumSelectionLength > (this.value && this.value.length) || !isSelect) &&
                (this.maximumSelectionLength >= (this.value && this.value.length) || !isSelect) &&
                !(this.maximumSelectionLength < (this.value && this.value.length))) {
                this.notify('updatelist', { li: li, e: e, module: 'listbox' });
            }
            if (this.allowFiltering && !isKey) {
                var liDataValue_1 = this.getFormattedValue(li.getAttribute('data-value'));
                if (!isSelect) {
                    this.value = this.value.filter(function (value1) {
                        return value1 !== liDataValue_1;
                    });
                }
                else {
                    var values = [];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(values, this.value);
                    values.push(liDataValue_1);
                    this.value = values;
                }
                if (document.querySelectorAll('ul').length < 2) {
                    this.updateMainList();
                }
            }
            this.updateSelectedOptions();
            this.triggerChange(this.getSelectedItems(), e);
            this.checkMaxSelection();
        }
    };
    ListBox.prototype.triggerChange = function (selectedLis, event) {
        this.trigger('change', { elements: selectedLis, items: this.getDataByElements(selectedLis), value: this.value, event: event });
    };
    ListBox.prototype.getDataByElems = function (elems) {
        var data = [];
        for (var i = 0, len = elems.length; i < len; i++) {
            data.push(this.getDataByValue(this.getFormattedValue(elems[i].getAttribute('data-value'))));
        }
        return data;
    };
    ListBox.prototype.getDataByElements = function (elems) {
        var data = [];
        var value;
        var sIdx = 0;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.listData)) {
            var type = this.typeOfData(this.listData).typeof;
            if (type === 'string' || type === 'number' || type === 'boolean') {
                for (var _i = 0, _a = this.listData; _i < _a.length; _i++) {
                    var item = _a[_i];
                    for (var i = sIdx, len = elems.length; i < len; i++) {
                        value = this.getFormattedValue(elems[i].getAttribute('data-value'));
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(item) && item === value) {
                            sIdx = i;
                            data.push(item);
                            break;
                        }
                    }
                    if (elems.length === data.length) {
                        break;
                    }
                }
            }
            else {
                for (var _b = 0, _c = this.listData; _b < _c.length; _b++) {
                    var item = _c[_b];
                    for (var i = sIdx, len = elems.length; i < len; i++) {
                        value = this.getFormattedValue(elems[i].getAttribute('data-value'));
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(item) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])((this.fields.value ? this.fields.value : 'value'), item) === value) {
                            sIdx = i;
                            data.push(item);
                            break;
                        }
                    }
                    if (elems.length === data.length) {
                        break;
                    }
                }
            }
            return data;
        }
        return null;
    };
    ListBox.prototype.checkMaxSelection = function () {
        var limit = this.list.querySelectorAll('.e-list-item span.e-check').length;
        if (this.selectionSettings.showCheckbox) {
            var index = 0;
            var liCollElem = void 0;
            liCollElem = this.list.getElementsByClassName('e-list-item');
            for (index; index < liCollElem.length; index++) {
                if (!liCollElem[index].querySelector('.e-frame.e-check')) {
                    if (limit === this.maximumSelectionLength) {
                        liCollElem[index].classList.add('e-disable');
                    }
                    else if (liCollElem[index].classList.contains('e-disable')) {
                        liCollElem[index].classList.remove('e-disable');
                    }
                }
            }
        }
    };
    ListBox.prototype.toolbarClickHandler = function (e) {
        var btn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, 'button');
        if (btn) {
            this.toolbarAction = btn.getAttribute('data-value');
            if (btn.disabled) {
                return;
            }
            switch (this.toolbarAction) {
                case 'moveUp':
                    this.moveUpDown(true);
                    break;
                case 'moveDown':
                    this.moveUpDown();
                    break;
                case 'moveTo':
                    this.moveItemTo();
                    break;
                case 'moveFrom':
                    this.moveItemFrom();
                    break;
                case 'moveAllTo':
                    this.moveAllItemTo();
                    break;
                case 'moveAllFrom':
                    this.moveAllItemFrom();
                    break;
                default:
                    this.trigger('actionBegin', { cancel: false, items: this.getDataByElems(this.getSelectedItems()),
                        eventName: this.toolbarAction });
                    break;
            }
        }
    };
    ListBox.prototype.moveUpDown = function (isUp, isKey, value) {
        var _this = this;
        var elems = this.getSelectedItems();
        var tempItems;
        if (value) {
            elems = value;
        }
        if (((isUp && this.isSelected(this.ulElement.firstElementChild))
            || (!isUp && this.isSelected(this.ulElement.lastElementChild))) && !value) {
            return;
        }
        tempItems = this.getDataByElems(elems);
        var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
        this.trigger('actionBegin', localDataArgs);
        if (localDataArgs.cancel) {
            return;
        }
        (isUp ? elems : elems.reverse()).forEach(function (ele) {
            var jsonToIdx = Array.prototype.indexOf.call(_this.ulElement.querySelectorAll('.e-list-item'), ele);
            var idx = Array.prototype.indexOf.call(_this.ulElement.children, ele);
            Object(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["moveTo"])(_this.ulElement, _this.ulElement, [idx], isUp ? idx - 1 : idx + 2);
            _this.changeData(idx, isUp ? idx - 1 : idx + 1, isUp ? jsonToIdx - 1 : jsonToIdx + 1, ele);
        });
        this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
        elems[0].focus();
        if (!isKey && this.toolbarSettings.items.length) {
            this.getToolElem().querySelector('[data-value=' + (isUp ? 'moveUp' : 'moveDown') + ']').focus();
        }
        this.updateToolBarState();
    };
    ListBox.prototype.moveItemTo = function () {
        this.moveData(this, this.getScopedListBox());
    };
    ListBox.prototype.moveItemFrom = function () {
        this.moveData(this.getScopedListBox(), this);
    };
    /**
     * Called internally if any of the property value changed.
     * @returns void
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    ListBox.prototype.moveData = function (fListBox, tListBox, isKey, value, index) {
        var _this = this;
        var idx = [];
        var dataIdx = [];
        var jsonIdx = [];
        var sortIdx = [];
        var listData = [].slice.call(fListBox.listData);
        var tListData = [].slice.call(tListBox.listData);
        var sortData = [].slice.call(fListBox.sortedData);
        var tSortData = [].slice.call(tListBox.sortedData);
        var fliCollections = [].slice.call(fListBox.liCollections);
        var dataLiIdx = [];
        var tliCollections = [].slice.call(tListBox.liCollections);
        var tempItems = [];
        var data = [];
        var elems = fListBox.getSelectedItems();
        if (value) {
            elems = value;
        }
        var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
            fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
        fListBox.value = [];
        if (elems.length) {
            this.removeSelected(fListBox, elems);
            elems.forEach(function (ele, i) {
                idx.push(Array.prototype.indexOf.call(fListBox.ulElement.children, ele)); // update sortable elem
                // To update lb view data
                dataLiIdx.push(Array.prototype.indexOf.call(fListBox.ulElement.querySelectorAll('.e-list-item'), ele));
                // To update lb listdata data
                dataIdx.push(Array.prototype.indexOf.call(fListBox.listData, fListBox.getDataByElems([ele])[0]));
                // To update lb sorted data
                sortIdx.push(Array.prototype.indexOf.call(fListBox.sortedData, fListBox.getDataByElems([ele])[0]));
                // To update lb original data
                jsonIdx.push(Array.prototype.indexOf.call(fListBox.jsonData, fListBox.getDataByElems([ele])[0]));
            });
            if (this.sortOrder !== 'None') {
                sortIdx.forEach(function (i) {
                    tempItems.push(fListBox.sortedData[i]);
                });
            }
            else {
                jsonIdx.forEach(function (i) {
                    tempItems.push(fListBox.jsonData[i]);
                });
            }
            var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
            fListBox.trigger('actionBegin', localDataArgs);
            if (localDataArgs.cancel) {
                return;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                var rLiCollection_1 = [];
                dataLiIdx.sort(function (n1, n2) { return n1 - n2; }).reverse().forEach(function (i) {
                    rLiCollection_1.push(fliCollections.splice(i, 1)[0]);
                });
                fListBox.liCollections = fliCollections;
                if (index) {
                    var toColl = tliCollections.splice(0, index);
                    tListBox.liCollections = toColl.concat(rLiCollection_1.reverse()).concat(tliCollections);
                }
                else {
                    tListBox.liCollections = tliCollections.concat(rLiCollection_1.reverse());
                }
                if (tListBox.listData.length === 0) {
                    var noRecElem = tListBox.ulElement.getElementsByClassName('e-list-nrt')[0];
                    if (noRecElem) {
                        tListBox.ulElement.removeChild(noRecElem);
                    }
                }
            }
            dataIdx.sort(function (n1, n2) { return n2 - n1; }).forEach(function (i) {
                listData.splice(i, 1)[0];
            });
            sortIdx.sort(function (n1, n2) { return n2 - n1; }).forEach(function (i) {
                sortData.splice(i, 1)[0];
            });
            jsonIdx.slice().reverse().forEach(function (i) {
                data.push(fListBox.jsonData.splice(i, 1)[0]);
            });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                if (isRefresh) {
                    if (fListBox.fields.groupBy) {
                        fListBox.ulElement.innerHTML = fListBox.renderItems(listData, fListBox.fields).innerHTML;
                    }
                    else {
                        elems.forEach(function (ele) { Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(ele); });
                    }
                }
                else {
                    Object(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["moveTo"])(fListBox.ulElement, tListBox.ulElement, idx, index);
                    fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
                }
                if (tListBox.mainList.childElementCount !== tListBox.jsonData.length) {
                    tListBox.mainList = tListBox.ulElement;
                }
                fListBox.updateMainList();
            }
            var tJsonData = [].slice.call(tListBox.jsonData);
            tSortData = [].slice.call(tListBox.sortedData);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                this.selectNextList(elems, dataLiIdx, dataIdx, fListBox);
            }
            if (isKey) {
                this.list.focus();
            }
            fListBox.listData = listData;
            fListBox.sortedData = sortData;
            index = (index) ? index : tListData.length;
            for (var i = tempItems.length - 1; i >= 0; i--) {
                tListData.splice(index, 0, tempItems[i]);
                tJsonData.splice(index, 0, tempItems[i]);
                tSortData.splice(index, 0, tempItems[i]);
            }
            tListBox.listData = tListData;
            tListBox.jsonData = tJsonData;
            tListBox.sortedData = tSortData;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                // tslint:disable
                fListBox.interopAdaptor.invokeMethodAsync('UpdateListData', fListBox.listData).then(function () {
                    fListBox.updateBlazorListData(null, true);
                    _this.selectNextList(elems, dataLiIdx, dataIdx, fListBox);
                    fListBox.updateSelectedOptions();
                });
                tListBox.interopAdaptor.invokeMethodAsync('UpdateListData', tListBox.listData).then(function () {
                    if (isRefresh) {
                        tListBox.setSelection();
                    }
                    tListBox.updateBlazorListData(null, true);
                    fListBox.trigger('actionComplete', { items: tempItems, eventName: _this.toolbarAction });
                });
                // tslint:enable
            }
            else {
                if (isRefresh) {
                    tListBox.ulElement.innerHTML = tListBox.renderItems(tListData, tListBox.fields).innerHTML;
                    tListBox.setSelection();
                }
                fListBox.updateSelectedOptions();
            }
            if (fListBox.listData.length === 0) {
                // tslint:disable-next-line
                fListBox.l10nUpdate();
            }
        }
        if (fListBox.value.length === 1 && fListBox.getSelectedItems().length) {
            fListBox.value[0] = fListBox.getFormattedValue(fListBox.getSelectedItems()[0].getAttribute('data-value'));
        }
    };
    ListBox.prototype.selectNextList = function (elems, dataLiIdx, dataIdx, inst) {
        var childCnt = inst.ulElement.querySelectorAll('.e-list-item').length;
        var ele;
        var liIdx;
        var validIdx = -1;
        if (elems.length === 1 && childCnt && !inst.selectionSettings.showCheckbox) {
            liIdx = childCnt <= dataLiIdx[0] ? childCnt - 1 : dataLiIdx[0];
            ele = inst.ulElement.querySelectorAll('.e-list-item')[liIdx];
            validIdx = inst.getValidIndex(ele, liIdx, childCnt === dataIdx[0] ? 38 : 40);
            if (validIdx > -1) {
                (inst.ulElement.querySelectorAll('.e-list-item')[validIdx].classList.add(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected));
            }
        }
    };
    ListBox.prototype.moveAllItemTo = function () {
        this.moveAllData(this, this.getScopedListBox());
    };
    ListBox.prototype.moveAllItemFrom = function () {
        this.moveAllData(this.getScopedListBox(), this);
    };
    ListBox.prototype.moveAllData = function (fListBox, tListBox, isKey, index) {
        var _this = this;
        var listData = [].slice.call(tListBox.listData);
        var jsonData = [].slice.call(tListBox.jsonData);
        var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
            fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
        this.removeSelected(fListBox, fListBox.getSelectedItems());
        var tempItems = [].slice.call(fListBox.jsonData);
        var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
        fListBox.trigger('actionBegin', localDataArgs);
        if (localDataArgs.cancel) {
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
            if (tListBox.listData.length === 0) {
                var noRecElem = tListBox.ulElement.getElementsByClassName('e-list-nrt')[0];
                if (noRecElem) {
                    tListBox.ulElement.removeChild(noRecElem);
                }
            }
            if (isRefresh) {
                var noRecElem = fListBox.ulElement.getElementsByClassName('e-list-nrt')[0];
                if (noRecElem) {
                    fListBox.ulElement.removeChild(noRecElem);
                }
            }
            Object(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["moveTo"])(fListBox.ulElement, tListBox.ulElement, Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
            this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
        }
        if (isKey) {
            this.list.focus();
        }
        index = (index) ? index : listData.length;
        for (var i = 0; i < fListBox.listData.length; i++) {
            listData.splice(index + i, 0, fListBox.listData[i]);
        }
        for (var i = 0; i < fListBox.jsonData.length; i++) {
            jsonData.splice(index + i, 0, fListBox.jsonData[i]);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
            var fliCollections = [].slice.call(fListBox.liCollections);
            var tliCollections = [].slice.call(tListBox.liCollections);
            fListBox.liCollections = [];
            if (index) {
                var toColl = tliCollections.splice(0, index);
                tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
            }
            else {
                tListBox.liCollections = tliCollections.concat(fliCollections);
            }
        }
        fListBox.value = [];
        listData = listData
            .filter(function (data) { return data.isHeader !== true; });
        tListBox.listData = listData;
        tListBox.jsonData = jsonData;
        fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
            if (!isRefresh) {
                tListBox.sortedData = listData;
            }
            // tslint:disable
            fListBox.interopAdaptor.invokeMethodAsync('UpdateListData', fListBox.listData).then(function () {
                fListBox.updateBlazorListData(null, true);
                fListBox.updateSelectedOptions();
            });
            tListBox.interopAdaptor.invokeMethodAsync('UpdateListData', tListBox.listData).then(function () {
                tListBox.updateBlazorListData(null, true);
                fListBox.updateSelectedOptions();
                fListBox.trigger('actionComplete', { items: tempItems, eventName: _this.toolbarAction });
            });
            // tslint:enable
        }
        else {
            if (isRefresh) {
                tListBox.ulElement.innerHTML = tListBox.renderItems(listData, tListBox.fields).innerHTML;
                this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
            }
            else {
                tListBox.sortedData = listData;
            }
            fListBox.updateSelectedOptions();
        }
        if (fListBox.listData.length === 0) {
            // tslint:disable-next-line
            fListBox.l10nUpdate();
        }
    };
    ListBox.prototype.changeData = function (fromIdx, toIdx, jsonToIdx, ele) {
        var listData = [].slice.call(this.listData);
        var jsonData = [].slice.call(this.jsonData);
        var sortData = [].slice.call(this.sortedData);
        var jsonIdx = Array.prototype.indexOf.call(this.jsonData, this.getDataByElems([ele])[0]);
        var sortIdx = Array.prototype.indexOf.call(this.sortedData, this.getDataByElems([ele])[0]);
        var liColl = [].slice.call(this.liCollections);
        listData.splice(toIdx, 0, listData.splice(fromIdx, 1)[0]);
        jsonData.splice(jsonToIdx, 0, jsonData.splice(jsonIdx, 1)[0]);
        sortData.splice(toIdx, 0, sortData.splice(sortIdx, 1)[0]);
        liColl.splice(toIdx, 0, liColl.splice(fromIdx, 1)[0]);
        this.listData = listData;
        this.jsonData = jsonData;
        this.liCollections = liColl;
        this.sortedData = sortData;
    };
    ListBox.prototype.getSelectedItems = function () {
        var ele = [];
        if (this.selectionSettings.showCheckbox) {
            [].slice.call(this.ulElement.getElementsByClassName('e-check')).forEach(function (cbox) {
                ele.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(cbox, '.' + 'e-list-item'));
            });
        }
        else {
            ele = [].slice.call(this.ulElement.getElementsByClassName(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected));
        }
        return ele;
    };
    ListBox.prototype.getScopedListBox = function () {
        var _this = this;
        var listObj;
        if (this.scope) {
            [].slice.call(document.querySelectorAll(this.scope)).forEach(function (ele) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(ele, _this.getModuleName())) {
                    listObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(ele, _this.getModuleName());
                }
            });
        }
        return listObj;
    };
    ListBox.prototype.getGrabbedItems = function () {
        var elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
        return elems;
    };
    ListBox.prototype.getDragArgs = function (args, isDragEnd) {
        var elems = this.getGrabbedItems();
        if (elems.length) {
            if (isDragEnd) {
                elems.push(args.target);
            }
        }
        else {
            elems = [args.target];
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
            return { elements: elems, items: this.getDataByElems(elems), bindEvents: args.bindEvents,
                dragElement: args.dragElement };
        }
        else {
            return { elements: elems, items: this.getDataByElems(elems) };
        }
    };
    ListBox.prototype.onKeyDown = function (e) {
        this.keyDownHandler(e);
        event.stopPropagation();
    };
    ListBox.prototype.keyDownHandler = function (e) {
        if ([32, 35, 36, 37, 38, 39, 40, 65].indexOf(e.keyCode) > -1 && !this.allowFiltering) {
            if (e.target && e.target.className.indexOf('e-edit-template') > -1) {
                return;
            }
            e.preventDefault();
            if (e.keyCode === 32 && this.ulElement.children.length) {
                this.selectHandler({
                    target: this.ulElement.getElementsByClassName('e-focused')[0],
                    ctrlKey: e.ctrlKey, shiftKey: e.shiftKey
                });
            }
            else if (e.keyCode === 65 && e.ctrlKey) {
                this.selectAll();
            }
            else if ((e.keyCode === 38 || e.keyCode === 40) && e.ctrlKey && e.shiftKey) {
                this.moveUpDown(e.keyCode === 38 ? true : false, true);
            }
            else if ((this.toolbarSettings.items.length || this.tBListBox) && (e.keyCode === 39 || e.keyCode === 37) && e.ctrlKey) {
                var listObj = this.tBListBox || this.getScopedListBox();
                if (e.keyCode === 39) {
                    e.shiftKey ? this.moveAllData(this, listObj, true) : this.moveData(this, listObj, true);
                }
                else {
                    e.shiftKey ? this.moveAllData(listObj, this, true) : this.moveData(listObj, this, true);
                }
            }
            else if (e.keyCode !== 37 && e.keyCode !== 39) {
                this.upDownKeyHandler(e);
            }
        }
        else if (this.allowFiltering) {
            if (e.keyCode === 40 || e.keyCode === 38) {
                this.upDownKeyHandler(e);
            }
        }
    };
    ListBox.prototype.upDownKeyHandler = function (e) {
        var ul = this.ulElement;
        var defaultIdx = (e.keyCode === 40 || e.keyCode === 36) ? 0 : ul.childElementCount - 1;
        var fliIdx = defaultIdx;
        var fli = ul.getElementsByClassName('e-focused')[0] || ul.getElementsByClassName(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected)[0];
        if (fli) {
            if (e.keyCode !== 35 && e.keyCode !== 36) {
                fliIdx = Array.prototype.indexOf.call(ul.children, fli);
                e.keyCode === 40 ? fliIdx++ : fliIdx--;
                if (fliIdx < 0 || fliIdx > ul.childElementCount - 1) {
                    return;
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([fli], 'e-focused');
        }
        var cli = ul.children[fliIdx];
        if (cli) {
            fliIdx = this.getValidIndex(cli, fliIdx, e.keyCode);
            if (fliIdx === -1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([fli], 'e-focused');
                return;
            }
            ul.children[fliIdx].focus();
            ul.children[fliIdx].classList.add('e-focused');
            if (!e.ctrlKey) {
                this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
            }
        }
    };
    ListBox.prototype.KeyUp = function (e) {
        var _this = this;
        var char = String.fromCharCode(e.keyCode);
        var isWordCharacter = char.match(/\w/);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(isWordCharacter)) {
            this.isValidKey = true;
        }
        this.isValidKey = (e.keyCode === 8) || this.isValidKey;
        if (this.isValidKey) {
            this.isValidKey = false;
            switch (e.keyCode) {
                default:
                    var text = this.targetElement();
                    var keyCode = e.keyCode;
                    if (this.allowFiltering) {
                        var eventArgsData_1 = {
                            preventDefaultAction: false,
                            text: this.targetElement(),
                            updateData: function (dataSource, query, fields) {
                                if (eventArgsData_1.cancel) {
                                    return;
                                }
                                _this.isFiltered = true;
                                _this.remoteFilterAction = true;
                                _this.dataUpdater(dataSource, query, fields);
                            },
                            event: e,
                            cancel: false
                        };
                        this.trigger('filtering', eventArgsData_1, function (args) {
                            _this.isDataFetched = false;
                            if (eventArgsData_1.cancel || (_this.filterInput.value !== '' && _this.isFiltered)) {
                                return;
                            }
                            if (!eventArgsData_1.cancel && !_this.isCustomFiltering && !eventArgsData_1.preventDefaultAction) {
                                _this.inputString = _this.filterInput.value;
                                _this.filteringAction(_this.jsonData, new _ej2_data__WEBPACK_IMPORTED_MODULE_6__["Query"](), _this.fields);
                            }
                            if (!_this.isFiltered && !_this.isCustomFiltering && !eventArgsData_1.preventDefaultAction) {
                                _this.dataUpdater(_this.jsonData, new _ej2_data__WEBPACK_IMPORTED_MODULE_6__["Query"](), _this.fields);
                            }
                        });
                    }
            }
        }
    };
    /**
     * To filter the data from given data source by using query
     * @param  {Object[] | DataManager } dataSource - Set the data source to filter.
     * @param  {Query} query - Specify the query to filter the data.
     * @param  {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
     * @return {void}.
     */
    ListBox.prototype.filter = function (dataSource, query, fields) {
        this.isCustomFiltering = true;
        this.filteringAction(dataSource, query, fields);
    };
    ListBox.prototype.filteringAction = function (dataSource, query, fields) {
        this.resetList(dataSource, fields, query);
    };
    ListBox.prototype.targetElement = function () {
        this.targetInputElement = this.list.getElementsByClassName('e-input-filter')[0];
        return this.targetInputElement.value;
    };
    ListBox.prototype.dataUpdater = function (dataSource, query, fields) {
        this.isDataFetched = false;
        var backCommand = true;
        if (this.targetElement().trim() === '') {
            var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
            if (backCommand) {
                this.remoteCustomValue = false;
                this.onActionComplete(list, this.jsonData);
                this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.selectionSettings.showCheckbox, e: this });
            }
        }
        else {
            this.resetList(dataSource, fields, query);
        }
    };
    ListBox.prototype.focusOutHandler = function () {
        var ele = this.list.getElementsByClassName('e-focused')[0];
        if (ele) {
            ele.classList.remove('e-focused');
        }
        if (this.allowFiltering) {
            this.refreshClearIcon();
        }
    };
    ListBox.prototype.getValidIndex = function (cli, index, keyCode) {
        var cul = this.ulElement;
        if (cli.classList.contains('e-disabled') || cli.classList.contains(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].group)) {
            (keyCode === 40 || keyCode === 36) ? index++ : index--;
        }
        if (index < 0 || index === cul.childElementCount) {
            return -1;
        }
        cli = cul.querySelectorAll('.e-list-item')[index];
        if (cli.classList.contains('e-disabled') || cli.classList.contains(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].group)) {
            index = this.getValidIndex(cli, index, keyCode);
        }
        return index;
    };
    ListBox.prototype.updateSelectedOptions = function () {
        var _this = this;
        var selectedOptions = [];
        var values = [];
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(values, this.value);
        this.getSelectedItems().forEach(function (ele) {
            if (!ele.classList.contains('e-grabbed')) {
                selectedOptions.push(_this.getFormattedValue(ele.getAttribute('data-value')));
            }
        });
        if (this.mainList.childElementCount === this.ulElement.childElementCount) {
            if (this.allowFiltering && this.selectionSettings.showCheckbox) {
                for (var i = 0; i < selectedOptions.length; i++) {
                    if (values.indexOf(selectedOptions[i]) > -1) {
                        continue;
                    }
                    else {
                        values.push(selectedOptions[i]);
                    }
                }
                this.setProperties({ value: values }, true);
            }
            else {
                this.setProperties({ value: selectedOptions }, true);
            }
        }
        this.updateSelectTag();
        this.updateToolBarState();
        if (this.tBListBox) {
            this.tBListBox.updateToolBarState();
        }
    };
    ListBox.prototype.clearSelection = function (values) {
        var _this = this;
        if (values === void 0) { values = this.value; }
        if (this.selectionSettings.showCheckbox) {
            var dvalue_1;
            this.getSelectedItems().forEach(function (li) {
                dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
                if (values.indexOf(dvalue_1) < 0) {
                    li.getElementsByClassName('e-check')[0].classList.remove('e-check');
                    li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
                    li.removeAttribute('aria-selected');
                }
            });
        }
    };
    ;
    ListBox.prototype.setSelection = function (values, isSelect, isText) {
        var _this = this;
        if (values === void 0) { values = this.value; }
        if (isSelect === void 0) { isSelect = true; }
        if (isText === void 0) { isText = false; }
        var li;
        var liselect;
        if (values) {
            values.forEach(function (value) {
                var text;
                if (isText) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && typeof (value) === 'object') {
                        text = value[_this.fields.text || 'text'];
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(text)) {
                            return;
                        }
                        text = _this.getValueByText(text);
                    }
                    else {
                        text = _this.getValueByText(value);
                    }
                }
                else {
                    text = value;
                }
                li = _this.list.querySelector('[data-value="' + text + '"]');
                if (li) {
                    if (_this.selectionSettings.showCheckbox) {
                        liselect = li.getElementsByClassName('e-frame')[0].classList.contains('e-check');
                    }
                    else {
                        liselect = li.classList.contains('e-selected');
                    }
                    if (!isSelect && liselect || isSelect && !liselect && li) {
                        if (_this.selectionSettings.showCheckbox) {
                            _this.notify('updatelist', { li: li, module: 'listbox' });
                        }
                        else {
                            if (isSelect) {
                                li.classList.add(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                                li.setAttribute('aria-selected', 'true');
                            }
                            else {
                                li.classList.remove(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                                li.removeAttribute('aria-selected');
                            }
                        }
                    }
                }
            });
        }
        this.updateSelectTag();
    };
    ListBox.prototype.updateSelectTag = function () {
        var ele = this.getSelectTag();
        var innerHTML = '';
        ele.innerHTML = '';
        if (this.value) {
            for (var i = 0, len = this.value.length; i < len; i++) {
                innerHTML += '<option selected value="' + this.value[i] + '"></option>';
            }
            ele.innerHTML += innerHTML;
        }
        this.checkSelectAll();
    };
    ListBox.prototype.checkDisabledState = function (inst) {
        return inst.ulElement.querySelectorAll('.' + _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].li).length === 0;
    };
    ListBox.prototype.updateToolBarState = function () {
        var _this = this;
        if (this.toolbarSettings.items.length) {
            var listObj_1 = this.getScopedListBox();
            var wrap_1 = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
            this.toolbarSettings.items.forEach(function (value) {
                var btn = wrap_1.querySelector('[data-value="' + value + '"]');
                switch (value) {
                    case 'moveAllTo':
                        btn.disabled = _this.checkDisabledState(_this);
                        break;
                    case 'moveAllFrom':
                        btn.disabled = _this.checkDisabledState(listObj_1);
                        break;
                    case 'moveFrom':
                        btn.disabled = listObj_1.value && listObj_1.value.length ? false : true;
                        break;
                    case 'moveUp':
                        btn.disabled = _this.value && _this.value.length
                            && !_this.isSelected(_this.ulElement.children[0]) ? false : true;
                        break;
                    case 'moveDown':
                        btn.disabled = _this.value && _this.value.length
                            && !_this.isSelected(_this.ulElement.children[_this.ulElement.childElementCount - 1]) ? false : true;
                        break;
                    default:
                        btn.disabled = _this.value && _this.value.length ? false : true;
                        break;
                }
            });
        }
    };
    ListBox.prototype.setCheckboxPosition = function () {
        var listWrap = this.list;
        if (!this.initLoad && this.selectionSettings.checkboxPosition === 'Left') {
            listWrap.classList.remove('e-right');
        }
        if (this.selectionSettings.checkboxPosition === 'Right') {
            listWrap.classList.add('e-right');
        }
    };
    ListBox.prototype.showCheckbox = function (showCheckbox) {
        var index = 0;
        var liColl = this.list.lastElementChild.querySelectorAll('li');
        var liCollLen = this.list.lastElementChild.getElementsByClassName('e-list-item').length;
        if (showCheckbox) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                this.ulElement = this.renderItems(this.listData, this.fields);
                this.mainList = this.ulElement;
                this.list.removeChild(this.list.getElementsByTagName('ul')[0]);
                this.list.appendChild(this.ulElement);
            }
            if (this.selectionSettings.showSelectAll && !this.list.getElementsByClassName('e-selectall-parent')[0]) {
                var l10nShow = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getModuleName(), { selectAllText: 'Select All', unSelectAllText: 'Unselect All' }, this.locale);
                this.showSelectAll = true;
                this.selectAllText = l10nShow.getConstant('selectAllText');
                this.unSelectAllText = l10nShow.getConstant('unSelectAllText');
                this.popupWrapper = this.list;
                this.checkBoxSelectionModule.checkAllParent = null;
                this.notify('selectAll', {});
                this.checkSelectAll();
            }
        }
        else {
            if (this.list.getElementsByClassName('e-selectall-parent')[0]) {
                this.list.removeChild(this.list.getElementsByClassName('e-selectall-parent')[0]);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])()) {
                for (index; index < liCollLen; index++) {
                    if (liColl[index].classList.contains('e-list-item')) {
                        liColl[index].removeChild(liColl[index].getElementsByClassName('e-checkbox-wrapper')[0]);
                    }
                    if (liColl[index].hasAttribute('aria-selected')) {
                        liColl[index].removeAttribute('aria-selected');
                    }
                }
                this.mainList = this.ulElement;
            }
        }
        this.value = [];
    };
    ListBox.prototype.isSelected = function (ele) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ele)) {
            return ele.classList.contains(_ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected) || ele.querySelector('.e-check') !== null;
        }
        else {
            return false;
        }
    };
    ListBox.prototype.getSelectTag = function () {
        return this.list.getElementsByClassName('e-hidden-select')[0];
    };
    ListBox.prototype.getToolElem = function () {
        return this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
    };
    ListBox.prototype.formResetHandler = function () {
        this.value = this.initialSelectedOptions;
    };
    /**
     * Return the module name.
     * @private
     */
    ListBox.prototype.getModuleName = function () {
        return 'listbox';
    };
    /**
     * Get the properties to be maintained in the persisted state.
     */
    ListBox.prototype.getPersistData = function () {
        return this.addOnPersist(['value']);
    };
    ListBox.prototype.getLocaleName = function () {
        return 'listbox';
    };
    ;
    ListBox.prototype.destroy = function () {
        if (this.itemTemplate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["resetBlazorTemplate"])("" + this.element.id + ITEMTEMPLATE_PROPERTY, ITEMTEMPLATE_PROPERTY);
        }
        this.unwireEvents();
        if (this.element.tagName === 'EJS-LISTBOX') {
            this.element.innerHTML = '';
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && !this.isServerRendered)) {
                this.element.style.display = 'inline-block';
                if (this.toolbarSettings.items.length) {
                    this.list.parentElement.parentElement.insertBefore(this.list, this.list.parentElement);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.list.nextElementSibling);
                }
                this.list.parentElement.insertBefore(this.element, this.list);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && !this.isServerRendered)) {
            _super.prototype.destroy.call(this);
        }
        if (this.itemTemplate) {
            this.clearTemplate();
        }
    };
    /**
     * Called internally if any of the property value changed.
     * @returns void
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    ListBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        var wrap = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
        this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([wrap], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([wrap], newProp.cssClass.split(' '));
                    }
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        wrap.classList.add('e-rtl');
                    }
                    else {
                        wrap.classList.remove('e-rtl');
                    }
                    break;
                case 'value':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(this.list.querySelectorAll('.' + _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected), _ej2_lists__WEBPACK_IMPORTED_MODULE_3__["cssClass"].selected);
                    this.clearSelection(this.value);
                    this.setSelection();
                    break;
                case 'height':
                    this.setHeight();
                    break;
                case 'enabled':
                    this.setEnable();
                    break;
                case 'allowDragAndDrop':
                    if (newProp.allowDragAndDrop) {
                        this.initDraggable();
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(this.ulElement, 'sortable').destroy();
                    }
                    break;
                case 'allowFiltering':
                    if (this.allowFiltering) {
                        this.setFiltering();
                    }
                    else {
                        this.list.removeChild(this.list.getElementsByClassName('e-filter-parent')[0]);
                        this.filterParent = null;
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.list], 'e-filter-list');
                    }
                    break;
                case 'filterBarPlaceholder':
                    if (this.allowFiltering) {
                        if (this.filterInput) {
                            _ej2_inputs__WEBPACK_IMPORTED_MODULE_0__["Input"].setPlaceholder(newProp.filterBarPlaceholder, this.filterInput);
                        }
                    }
                    break;
                case 'scope':
                    if (this.allowDragAndDrop) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(this.ulElement, 'sortable').scope = newProp.scope;
                    }
                    if (this.toolbarSettings.items.length) {
                        if (oldProp.scope) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(document.querySelector(oldProp.scope), this.getModuleName())
                                .tBListBox = null;
                        }
                        if (newProp.scope) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getComponent"])(document.querySelector(newProp.scope), this.getModuleName())
                                .tBListBox = this;
                        }
                    }
                    break;
                case 'toolbarSettings':
                    var ele = void 0;
                    var pos = newProp.toolbarSettings.position;
                    var toolElem = this.getToolElem();
                    if (pos) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([wrap], ['e-right', 'e-left']);
                        wrap.classList.add('e-' + pos.toLowerCase());
                        if (pos === 'Left') {
                            wrap.insertBefore(toolElem, this.list);
                        }
                        else {
                            wrap.appendChild(toolElem);
                        }
                    }
                    if (newProp.toolbarSettings.items) {
                        if (oldProp.toolbarSettings.items.length) {
                            ele = this.list.parentElement;
                            ele.parentElement.insertBefore(this.list, ele);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(ele);
                        }
                        this.initToolbarAndStyles();
                        this.wireToolbarEvent();
                    }
                    break;
                case 'selectionSettings':
                    var showSelectAll = newProp.selectionSettings.showSelectAll;
                    var showCheckbox = newProp.selectionSettings.showCheckbox;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(showSelectAll)) {
                        this.showSelectAll = showSelectAll;
                        if (this.showSelectAll) {
                            var l10nSel = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getModuleName(), { selectAllText: 'Select All', unSelectAllText: 'Unselect All' }, this.locale);
                            this.checkBoxSelectionModule.checkAllParent = null;
                            this.showSelectAll = true;
                            this.selectAllText = l10nSel.getConstant('selectAllText');
                            this.unSelectAllText = l10nSel.getConstant('selectAllText');
                            this.popupWrapper = this.list;
                        }
                        this.notify('selectAll', {});
                        this.checkSelectAll();
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(showCheckbox)) {
                        this.showCheckbox(showCheckbox);
                    }
                    if (this.selectionSettings.showCheckbox) {
                        this.setCheckboxPosition();
                    }
                    break;
                case 'dataSource':
                    this.isDataSourceUpdate = true;
                    this.jsonData = [].slice.call(this.dataSource);
                    break;
            }
        }
    };
    var ListBox_1;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('')
    ], ListBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])([])
    ], ListBox.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('')
    ], ListBox.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], ListBox.prototype, "allowDragAndDrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(1000)
    ], ListBox.prototype, "maximumSelectionLength", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], ListBox.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('')
    ], ListBox.prototype, "scope", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], ListBox.prototype, "ignoreCase", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], ListBox.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "beforeItemRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "beforeDrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "dragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "drag", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "drop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], ListBox.prototype, "dataBound", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], ListBox.prototype, "groupTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('No records found')
    ], ListBox.prototype, "noRecordsTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Request failed')
    ], ListBox.prototype, "actionFailureTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(1000)
    ], ListBox.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], ListBox.prototype, "ignoreAccent", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Complex"])({}, ToolbarSettings)
    ], ListBox.prototype, "toolbarSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Complex"])({}, SelectionSettings)
    ], ListBox.prototype, "selectionSettings", void 0);
    ListBox = ListBox_1 = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["NotifyPropertyChanges"]
    ], ListBox);
    return ListBox;
}(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_1__["DropDownBase"]));

var listBoxClasses = {
    backIcon: 'e-input-group-icon e-back-icon e-icons',
    filterBarClearIcon: 'e-input-group-icon e-clear-icon e-icons',
    filterInput: 'e-input-filter',
    filterParent: 'e-filter-parent',
    clearIcon: 'e-clear-icon',
};


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/checkbox-selection.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/checkbox-selection.js ***!
  \****************************************************************************************/
/*! exports provided: CheckBoxSelection */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckBoxSelection", function() { return CheckBoxSelection; });
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../drop-down-base/drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");





var ICON = 'e-icons';
var CHECKBOXFRAME = 'e-frame';
var CHECK = 'e-check';
var CHECKBOXWRAP = 'e-checkbox-wrapper';
var CHECKBOXRIPPLE = 'e-ripple-container';
var INDETERMINATE = 'e-stop';
var checkAllParent = 'e-selectall-parent';
var searchBackIcon = 'e-input-group-icon e-back-icon e-icons';
var filterBarClearIcon = 'e-input-group-icon e-clear-icon e-icons';
var filterInput = 'e-input-filter';
var filterParent = 'e-filter-parent';
var mobileFilter = 'e-ddl-device-filter';
var clearIcon = 'e-clear-icon';
var popupFullScreen = 'e-popup-full-page';
var device = 'e-ddl-device';
var FOCUS = 'e-input-focus';
/**
 * The Multiselect enable CheckBoxSelection call this inject module.
 */
var CheckBoxSelection = /** @__PURE__ @class */ (function () {
    function CheckBoxSelection(parent) {
        this.activeLi = [];
        this.activeEle = [];
        this.parent = parent;
        this.removeEventListener();
        this.addEventListener();
    }
    CheckBoxSelection.prototype.getModuleName = function () {
        return 'CheckBoxSelection';
    };
    CheckBoxSelection.prototype.addEventListener = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.on('updatelist', this.listSelection, this);
        this.parent.on('listoption', this.listOption, this);
        this.parent.on('selectAll', this.setSelectAll, this);
        this.parent.on('checkSelectAll', this.checkSelectAll, this);
        this.parent.on('searchBox', this.setSearchBox, this);
        this.parent.on('blur', this.onBlur, this);
        this.parent.on('targetElement', this.targetElement, this);
        this.parent.on('deviceSearchBox', this.setDeviceSearchBox, this);
        this.parent.on('inputFocus', this.getFocus, this);
        this.parent.on('reOrder', this.setReorder, this);
        this.parent.on('activeList', this.getActiveList, this);
        this.parent.on('selectAllText', this.setLocale, this);
        this.parent.on('filterBarPlaceholder', this.setPlaceholder, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(document, 'mousedown', this.onDocumentClick, this);
        this.parent.on('addItem', this.checboxCreate, this);
        this.parent.on('popupFullScreen', this.setPopupFullScreen, this);
    };
    CheckBoxSelection.prototype.removeEventListener = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.off('updatelist', this.listSelection);
        this.parent.off('listoption', this.listOption);
        this.parent.off('selectAll', this.setSelectAll);
        this.parent.off('checkSelectAll', this.checkSelectAll);
        this.parent.off('searchBox', this.setSearchBox);
        this.parent.off('blur', this.onBlur);
        this.parent.off('targetElement', this.targetElement);
        this.parent.off('deviceSearchBox', this.setDeviceSearchBox);
        this.parent.off('inputFocus', this.getFocus);
        this.parent.off('reOrder', this.setReorder);
        this.parent.off('activeList', this.getActiveList);
        this.parent.off('selectAllText', this.setLocale);
        this.parent.off('filterBarPlaceholder', this.setPlaceholder);
        this.parent.off('addItem', this.checboxCreate);
        this.parent.off('popupFullScreen', this.setPopupFullScreen);
    };
    CheckBoxSelection.prototype.listOption = function (args) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.listCurrentOptions.itemCreated)) {
            this.parent.listCurrentOptions.itemCreated = function (e) {
                _this.checboxCreate(e);
            };
        }
        else {
            var itemCreated_1 = this.parent.listCurrentOptions.itemCreated;
            this.parent.listCurrentOptions.itemCreated = function (e) {
                _this.checboxCreate(e);
                itemCreated_1.apply(_this, [e]);
            };
        }
    };
    ;
    CheckBoxSelection.prototype.setPlaceholder = function (props) {
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(props.filterBarPlaceholder, this.filterInput);
    };
    CheckBoxSelection.prototype.checboxCreate = function (e) {
        var item;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e.item)) {
            item = e.item;
        }
        else {
            item = e;
        }
        if (this.parent.enableGroupCheckBox || (item.className !== 'e-list-group-item '
            && item.className !== 'e-list-group-item')) {
            var checkboxEle = Object(_ej2_buttons__WEBPACK_IMPORTED_MODULE_0__["createCheckBox"])(this.parent.createElement, true);
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('div.' + ICON, item);
            var id = item.getAttribute('data-uid');
            item.insertBefore(checkboxEle, item.childNodes[Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(icon) ? 0 : 1]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + CHECKBOXFRAME, checkboxEle);
            var frame = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + CHECKBOXFRAME, checkboxEle);
            if (this.parent.enableGroupCheckBox) {
                this.parent.popupWrapper.classList.add('e-multiselect-group');
            }
            return item;
        }
        else {
            return item;
        }
    };
    CheckBoxSelection.prototype.setSelectAll = function () {
        if (this.parent.showSelectAll) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.checkAllParent)) {
                this.checkAllParent = this.parent.createElement('div', {
                    className: checkAllParent
                });
                this.selectAllSpan = this.parent.createElement('span', {
                    className: 'e-all-text'
                });
                this.selectAllSpan.textContent = '';
                this.checkAllParent.appendChild(this.selectAllSpan);
                this.setLocale();
                this.checboxCreate(this.checkAllParent);
                if (this.parent.headerTemplate) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.filterParent)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.checkAllParent], this.parent.filterParent);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.checkAllParent], this.parent.popupWrapper);
                    }
                }
                if (!this.parent.headerTemplate) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.filterParent)) {
                        this.parent.filterParent.parentNode.insertBefore(this.checkAllParent, this.parent.filterParent.nextSibling);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.checkAllParent], this.parent.popupWrapper);
                    }
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.checkAllParent, 'mousedown', this.clickHandler, this);
            }
            if (this.parent.list.classList.contains('e-nodata') || (this.parent.listData && this.parent.listData.length <= 1 &&
                !(this.parent.isDynamicDataChange && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])())) || (this.parent.isDynamicDataChange &&
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.value) && this.parent.value.length <= 1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])())) {
                this.checkAllParent.style.display = 'none';
            }
            else {
                this.checkAllParent.style.display = 'block';
            }
            this.parent.selectAllHeight = this.checkAllParent.getBoundingClientRect().height;
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.checkAllParent)) {
            this.checkAllParent.parentElement.removeChild(this.checkAllParent);
            this.checkAllParent = null;
        }
    };
    CheckBoxSelection.prototype.destroy = function () {
        this.removeEventListener();
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(document, 'mousedown', this.onDocumentClick);
    };
    CheckBoxSelection.prototype.listSelection = function (args) {
        var target;
        var isBlazorListbox = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && (args.module && args.module === 'listbox');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(args.e)) {
            var frameElm = args.li.querySelector('.e-checkbox-wrapper .e-frame');
            target = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(args.e.target) ?
                (args.e.target.classList.contains('e-frame')
                    && (!this.parent.showSelectAll
                        || (this.checkAllParent && !this.checkAllParent.contains(args.e.target)))) ?
                    args.e.target : (isBlazorListbox ? frameElm : args.li.querySelector('.e-checkbox-wrapper').childNodes[1])
                : (isBlazorListbox ? frameElm : args.li.querySelector('.e-checkbox-wrapper').childNodes[1]);
        }
        else {
            var checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');
            target = checkboxWrapper ? (isBlazorListbox ?
                checkboxWrapper.querySelector('.e-frame') : checkboxWrapper.childNodes[1]) : args.li.lastElementChild.childNodes[1];
        }
        if (this.parent.itemTemplate || this.parent.enableGroupCheckBox) {
            target = args.li.firstElementChild.childNodes[1];
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(target)) {
            this.checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + CHECKBOXWRAP);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.checkWrapper)) {
            var checkElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + CHECKBOXFRAME, this.checkWrapper);
            var selectAll = false;
            this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK), args.li, args.e, selectAll);
        }
    };
    CheckBoxSelection.prototype.validateCheckNode = function (checkWrap, isCheck, li, e, selectAll) {
        this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true, selectAll);
    };
    CheckBoxSelection.prototype.clickHandler = function (e) {
        var target;
        if (e.currentTarget.classList.contains(this.checkAllParent.className)) {
            target = e.currentTarget.firstElementChild.lastElementChild;
        }
        else {
            target = e.currentTarget;
        }
        this.checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + CHECKBOXWRAP);
        var selectAll = true;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.checkWrapper)) {
            var checkElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])('.' + CHECKBOXFRAME, this.checkWrapper);
            this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK), null, e, selectAll);
        }
        e.preventDefault();
    };
    CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll) {
        var ariaState;
        var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME)[0];
        if (state === 'check' && !frameSpan.classList.contains(CHECK)) {
            frameSpan.classList.remove(INDETERMINATE);
            frameSpan.classList.add(CHECK);
            ariaState = 'true';
            if (selectAll) {
                this.parent.selectAllItems(true, e);
                this.setLocale(true);
            }
        }
        else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK) || frameSpan.classList.contains(INDETERMINATE))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([frameSpan], [CHECK, INDETERMINATE]);
            ariaState = 'false';
            if (selectAll) {
                this.parent.selectAllItems(false, e);
                this.setLocale();
            }
        }
        else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([frameSpan], [CHECK]);
            frameSpan.classList.add(INDETERMINATE);
            ariaState = 'false';
            if (selectAll) {
                this.parent.selectAllItems(false, e);
                this.setLocale();
            }
        }
        ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ariaState)) {
            wrapper.setAttribute('aria-checked', ariaState);
        }
    };
    CheckBoxSelection.prototype.setSearchBox = function (args) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.filterParent)) {
            this.parent.filterParent = this.parent.createElement('span', {
                className: filterParent
            });
            this.filterInput = this.parent.createElement('input', {
                attrs: { type: 'text' },
                className: filterInput
            });
            this.parent.element.parentNode.insertBefore(this.filterInput, this.parent.element);
            var backIcon = false;
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                backIcon = true;
                this.parent.mobFilter = false;
            }
            this.filterInputObj = _ej2_inputs__WEBPACK_IMPORTED_MODULE_1__["Input"].createInput({
                element: this.filterInput,
                buttons: backIcon ? [searchBackIcon, filterBarClearIcon] : [filterBarClearIcon],
                properties: { placeholder: this.parent.filterBarPlaceholder }
            }, this.parent.createElement);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.cssClass)) {
                if (this.parent.cssClass.split(' ').indexOf('e-outline') !== -1) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.filterInputObj.container], 'e-outline');
                }
                else if (this.parent.cssClass.split(' ').indexOf('e-filled') !== -1) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.filterInputObj.container], 'e-filled');
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.filterInputObj.container], this.parent.filterParent);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.parent.filterParent], args.popupElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.filterInput, {
                'aria-disabled': 'false',
                'aria-owns': this.parent.element.id + '_options',
                'role': 'listbox',
                'aria-activedescendant': null,
                'autocomplete': 'off',
                'autocorrect': 'off',
                'autocapitalize': 'off',
                'spellcheck': 'false'
            });
            this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && this.clearIconElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.clearIconElement, 'mousedown', this.clearText, this);
                this.clearIconElement.style.visibility = 'hidden';
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'input', this.parent.onInput, this.parent);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'keyup', this.parent.KeyUp, this.parent);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'keydown', this.parent.onKeyDown, this.parent);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'blur', this.onBlur, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.filterInput, 'paste', this.parent.pasteHandler, this.parent);
            this.parent.searchBoxHeight = (this.filterInputObj.container.parentElement).getBoundingClientRect().height;
            return this.filterInputObj;
        }
    };
    ;
    CheckBoxSelection.prototype.clickOnBackIcon = function (e) {
        this.parent.hidePopup();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([document.body, this.parent.popupObj.element], popupFullScreen);
        this.parent.inputElement.focus();
    };
    CheckBoxSelection.prototype.clearText = function (e) {
        this.parent.targetInputElement.value = '';
        if (this.parent.allowFiltering && this.parent.targetInputElement.value === '') {
            this.parent.search(null);
        }
        this.parent.refreshPopup();
        this.parent.refreshListItems(null);
        this.clearIconElement.style.visibility = 'hidden';
        this.filterInput.focus();
        this.setReorder(e);
        e.preventDefault();
    };
    CheckBoxSelection.prototype.setDeviceSearchBox = function () {
        this.parent.popupObj.element.classList.add(device);
        this.parent.popupObj.element.classList.add(mobileFilter);
        this.parent.popupObj.position = { X: 0, Y: 0 };
        this.parent.popupObj.dataBind();
        this.setSearchBoxPosition();
        this.backIconElement = this.filterInputObj.container.querySelector('.e-back-icon');
        this.clearIconElement = this.filterInputObj.container.querySelector('.' + clearIcon);
        this.clearIconElement.style.visibility = 'hidden';
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.backIconElement, 'click', this.clickOnBackIcon, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.clearIconElement, 'click', this.clearText, this);
    };
    CheckBoxSelection.prototype.setSearchBoxPosition = function () {
        var searchBoxHeight = this.filterInput.parentElement.getBoundingClientRect().height;
        var selectAllHeight = 0;
        if (this.checkAllParent) {
            selectAllHeight = this.checkAllParent.getBoundingClientRect().height;
        }
        this.parent.popupObj.element.style.maxHeight = '100%';
        this.parent.popupObj.element.style.width = '100%';
        this.parent.list.style.maxHeight = (window.innerHeight - searchBoxHeight - selectAllHeight) + 'px';
        this.parent.list.style.height = (window.innerHeight - searchBoxHeight - selectAllHeight) + 'px';
        var clearElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.filterInput);
        clearElement.parentElement.insertBefore(this.filterInput, clearElement);
    };
    CheckBoxSelection.prototype.setPopupFullScreen = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.parent.popupObj.element, { style: 'left:0px;right:0px;top:0px;bottom:0px;' });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([document.body, this.parent.popupObj.element], popupFullScreen);
        this.parent.popupObj.element.style.maxHeight = '100%';
        this.parent.popupObj.element.style.width = '100%';
    };
    CheckBoxSelection.prototype.targetElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.clearIconElement)) {
            this.parent.targetInputElement = this.filterInput;
            this.clearIconElement.style.visibility = this.parent.targetInputElement.value === '' ? 'hidden' : 'visible';
        }
        return this.parent.targetInputElement.value;
    };
    CheckBoxSelection.prototype.onBlur = function (e) {
        if (!this.parent.element.classList.contains('e-listbox')) {
            var target = void 0;
            if (this.parent.keyAction) {
                return;
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE) {
                target = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e) && e.target;
            }
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE) {
                target = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e) && e.relatedTarget;
            }
            if (this.parent.popupObj && document.body.contains(this.parent.popupObj.element) && this.parent.popupObj.element.contains(target)
                && !_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE && this.filterInput) {
                this.filterInput.focus();
                return;
            }
            if (this.parent.scrollFocusStatus && this.filterInput) {
                e.preventDefault();
                this.filterInput.focus();
                this.parent.scrollFocusStatus = false;
                return;
            }
            if (this.parent.popupObj && document.body.contains(this.parent.popupObj.element)
                && !this.parent.popupObj.element.classList.contains('e-popup-close')) {
                this.parent.inputFocus = false;
                this.parent.updateValueState(e, this.parent.value, this.parent.tempValues);
                this.parent.dispatchEvent(this.parent.hiddenElement, 'change');
            }
            if (this.parent.popupObj && document.body.contains(this.parent.popupObj.element) &&
                !this.parent.popupObj.element.classList.contains('e-popup-close')) {
                this.parent.inputFocus = false;
                this.parent.overAllWrapper.classList.remove(FOCUS);
                this.parent.trigger('blur');
                this.parent.focused = true;
            }
            if (this.parent.popupObj && document.body.contains(this.parent.popupObj.element) &&
                !this.parent.popupObj.element.classList.contains('e-popup-close') && !_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                this.parent.hidePopup();
            }
        }
    };
    CheckBoxSelection.prototype.onDocumentClick = function (e) {
        if (this.parent.getLocaleName() !== 'listbox') {
            var target = e.target;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.popupObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '[id="' + this.parent.popupObj.element.id + '"]')) {
                if (!(this.filterInput && this.filterInput.value !== '')) {
                    e.preventDefault();
                }
            }
            if (!(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.popupObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '[id="' + this.parent.popupObj.element.id + '"]')) &&
                !this.parent.overAllWrapper.contains(e.target)) {
                if (this.parent.overAllWrapper.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_3__["dropDownBaseClasses"].focus) || this.parent.isPopupOpen()) {
                    this.parent.inputFocus = false;
                    this.parent.scrollFocusStatus = false;
                    this.parent.hidePopup();
                    this.parent.onBlur(e, true);
                    this.parent.focused = true;
                }
            }
            else {
                this.parent.scrollFocusStatus = (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].info.name === 'edge') && (document.activeElement === this.filterInput);
            }
            if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
                !this.parent.isPopupOpen()) {
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE) {
                    this.parent.onBlur();
                }
                else {
                    this.parent.onBlur(e);
                }
            }
            if (this.filterInput === target) {
                this.filterInput.focus();
            }
        }
    };
    CheckBoxSelection.prototype.getFocus = function (e) {
        this.parent.overAllWrapper.classList.remove(FOCUS);
        if (this.parent.keyAction && e.value !== 'clear' && e.value !== 'focus') {
            this.parent.keyAction = false;
            return;
        }
        if (e.value === 'focus') {
            this.filterInput.focus();
            this.parent.removeFocus();
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.parent.list, 'keydown', this.parent.onKeyDown);
        }
        if (e.value === 'clear') {
            this.filterInput.value = '';
            this.clearIconElement.style.visibility = 'hidden';
        }
    };
    CheckBoxSelection.prototype.checkSelectAll = function (e) {
        if (e.value === 'check' && this.checkAllParent.getAttribute('aria-checked') !== 'true') {
            this.changeState(this.checkAllParent, e.value, null, null, false);
            this.setLocale(true);
        }
        if (e.value === 'uncheck') {
            this.changeState(this.checkAllParent, e.value, null, null, false);
            this.setLocale();
        }
        if (e.value === 'indeterminate') {
            this.changeState(this.checkAllParent, e.value, null, null, false);
            this.setLocale();
        }
    };
    CheckBoxSelection.prototype.setLocale = function (unSelect) {
        if (this.parent.selectAllText !== 'Select All' || this.parent.unSelectAllText !== 'Unselect All') {
            var template = unSelect ? this.parent.unSelectAllText : this.parent.selectAllText;
            var compiledString = void 0;
            this.selectAllSpan.textContent = '';
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(template);
            var templateName = unSelect ? 'unSelectAllText' : 'selectAllText';
            for (var _i = 0, _a = compiledString({}, this.parent, templateName, null, !this.parent.isStringTemplate); _i < _a.length; _i++) {
                var item = _a[_i];
                this.selectAllSpan.textContent = item.textContent;
            }
        }
        else {
            var l10nLocale = { selectAllText: 'Select All', unSelectAllText: 'Unselect All' };
            var l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.parent.getLocaleName(), {}, this.parent.locale);
            if (l10n.getConstant('selectAllText') === '') {
                l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"]('dropdowns', l10nLocale, this.parent.locale);
            }
            this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
        }
    };
    CheckBoxSelection.prototype.getActiveList = function (args) {
        if (args.li.classList.contains('e-active')) {
            this.activeLi.push(args.li.cloneNode(true));
        }
        else {
            this.activeLi.splice(args.index, 1);
        }
    };
    CheckBoxSelection.prototype.setReorder = function (args) {
        if (this.parent.enableSelectionOrder && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.parent.value)) {
            var activeLiCount = this.parent.ulElement.querySelectorAll('li.e-active').length;
            var remLi = void 0;
            var ulEle = this.parent.createElement('ul', {
                className: 'e-list-parent e-ul e-reorder'
            });
            var removeEle = this.parent.createElement('div');
            if (activeLiCount > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])(this.parent.ulElement.querySelectorAll('li.e-active'), ulEle);
                remLi = this.parent.ulElement.querySelectorAll('li.e-active');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])(remLi, 'e-reorder-hide');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([ulEle], this.parent.list);
            }
            this.parent.focusAtFirstListItem();
        }
    };
    return CheckBoxSelection;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/float-label.js":
/*!*********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/float-label.js ***!
  \*********************************************************************************/
/*! exports provided: createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatLabel", function() { return createFloatLabel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateFloatLabelState", function() { return updateFloatLabelState; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFloating", function() { return removeFloating; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPlaceHolder", function() { return setPlaceHolder; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floatLabelFocus", function() { return floatLabelFocus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floatLabelBlur", function() { return floatLabelBlur; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/**
 * FloatLable Moduel
 * Specifies whether to display the floating label above the input element.
 */


var FLOATLINE = 'e-float-line';
var FLOATTEXT = 'e-float-text';
var LABELTOP = 'e-label-top';
var LABELBOTTOM = 'e-label-bottom';
/**
 * Function to create Float Label element.
 * @param overAllWrapper - overall wrapper of multiselect.
 * @param element - the given html element.
 * @param inputElement - specify the input wrapper.
 * @param value - Value of the MultiSelect.
 * @param floatLabelType - Specify the FloatLabel Type.
 * @param placeholder - Specify the PlaceHolder text.
 */
function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
    var floatLinelement;
    var floatLabelElement;
    floatLinelement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', { className: FLOATLINE });
    floatLabelElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('label', { className: FLOATTEXT });
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.id) && element.id !== '') {
        floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-labelledby': floatLabelElement.id });
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputElement.placeholder) && inputElement.placeholder !== '') {
        floatLabelElement.innerText = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(inputElement.placeholder);
        inputElement.removeAttribute('placeholder');
    }
    floatLabelElement.innerText = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(placeholder);
    searchWrapper.appendChild(floatLinelement);
    searchWrapper.appendChild(floatLabelElement);
    overAllWrapper.classList.add('e-float-input');
    updateFloatLabelState(value, floatLabelElement);
    if (floatLabelType === 'Always') {
        if (floatLabelElement.classList.contains(LABELBOTTOM)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([floatLabelElement], LABELBOTTOM);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([floatLabelElement], LABELTOP);
    }
}
/**
 * Function to update status of the Float Label element.
 * @param value - Value of the MultiSelect.
 * @param label - float label element.
 */
function updateFloatLabelState(value, label) {
    if (value && value.length > 0) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], LABELTOP);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], LABELBOTTOM);
    }
    else {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], LABELTOP);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], LABELBOTTOM);
    }
}
/**
 * Function to remove Float Label element.
 * @param overAllWrapper - overall wrapper of multiselect.
 * @param componentWrapper - wrapper element of multiselect.
 * @param searchWrapper - search wrapper of multiselect.
 * @param inputElement - specify the input wrapper.
 * @param value - Value of the MultiSelect.
 * @param floatLabelType - Specify the FloatLabel Type.
 * @param placeholder - Specify the PlaceHolder text.
 */
function removeFloating(overAllWrapper, componentWrapper, searchWrapper, inputElement, value, floatLabelType, placeholder) {
    var placeholderElement = componentWrapper.querySelector('.' + FLOATTEXT);
    var floatLine = componentWrapper.querySelector('.' + FLOATLINE);
    var placeholderText;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(placeholderElement)) {
        placeholderText = placeholderElement.innerText;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(searchWrapper.querySelector('.' + FLOATTEXT));
        setPlaceHolder(value, inputElement, placeholderText);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(floatLine)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(searchWrapper.querySelector('.' + FLOATLINE));
        }
    }
    else {
        placeholderText = (placeholder !== null) ? placeholder : '';
        setPlaceHolder(value, inputElement, placeholderText);
    }
    overAllWrapper.classList.remove('e-float-input');
}
/**
 * Function to set the placeholder to the element.
 * @param value - Value of the MultiSelect.
 * @param inputElement - specify the input wrapper.
 * @param placeholder - Specify the PlaceHolder text.
 */
function setPlaceHolder(value, inputElement, placeholder) {
    if (value && value.length) {
        inputElement.placeholder = '';
    }
    else {
        inputElement.placeholder = placeholder;
    }
}
/**
 * Function for focusing the Float Element.
 * @param overAllWrapper - overall wrapper of multiselect.
 * @param componentWrapper - wrapper element of multiselect.
 */
function floatLabelFocus(overAllWrapper, componentWrapper) {
    overAllWrapper.classList.add('e-input-focus');
    var label = componentWrapper.querySelector('.' + FLOATTEXT);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], LABELTOP);
        if (label.classList.contains(LABELBOTTOM)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], LABELBOTTOM);
        }
    }
}
/**
 * Function to focus the Float Label element.
 * @param overAllWrapper - overall wrapper of multiselect.
 * @param componentWrapper - wrapper element of multiselect.
 * @param value - Value of the MultiSelect.
 * @param floatLabelType - Specify the FloatLabel Type.
 * @param placeholder - Specify the PlaceHolder text.
 */
function floatLabelBlur(overAllWrapper, componentWrapper, value, floatLabelType, placeholder) {
    overAllWrapper.classList.remove('e-input-focus');
    var label = componentWrapper.querySelector('.' + FLOATTEXT);
    if (value && value.length <= 0 && floatLabelType === 'Auto' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
        if (label.classList.contains(LABELTOP)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], LABELTOP);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], LABELBOTTOM);
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/index.js":
/*!***************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/index.js ***!
  \***************************************************************************/
/*! exports provided: MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _multi_select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./multi-select */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/multi-select.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiSelect", function() { return _multi_select__WEBPACK_IMPORTED_MODULE_0__["MultiSelect"]; });

/* harmony import */ var _checkbox_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./checkbox-selection */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/checkbox-selection.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckBoxSelection", function() { return _checkbox_selection__WEBPACK_IMPORTED_MODULE_1__["CheckBoxSelection"]; });

/* harmony import */ var _float_label__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./float-label */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/float-label.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createFloatLabel", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["createFloatLabel"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateFloatLabelState", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["updateFloatLabelState"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFloating", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["removeFloating"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setPlaceHolder", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["setPlaceHolder"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floatLabelFocus", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["floatLabelFocus"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floatLabelBlur", function() { return _float_label__WEBPACK_IMPORTED_MODULE_2__["floatLabelBlur"]; });

/**
 * export all modules from current location
 */





/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/multi-select.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/multi-select.js ***!
  \**********************************************************************************/
/*! exports provided: MultiSelect */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiSelect", function() { return MultiSelect; });
/* harmony import */ var _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../drop-down-base/drop-down-base */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/drop-down-base/drop-down-base.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_incremental_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/incremental-search */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/common/incremental-search.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _float_label__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./float-label */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/multi-select/float-label.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>










/* tslint:disable */


/* tslint:enable */
var FOCUS = 'e-input-focus';
var DISABLED = 'e-disabled';
var OVER_ALL_WRAPPER = 'e-multiselect e-input-group e-control-wrapper';
var ELEMENT_WRAPPER = 'e-multi-select-wrapper';
var ELEMENT_MOBILE_WRAPPER = 'e-mob-wrapper';
var HIDE_LIST = 'e-hide-listitem';
var DELIMITER_VIEW = 'e-delim-view';
var CHIP_WRAPPER = 'e-chips-collection';
var CHIP = 'e-chips';
var CHIP_CONTENT = 'e-chipcontent';
var CHIP_CLOSE = 'e-chips-close';
var CHIP_SELECTED = 'e-chip-selected';
var SEARCHBOX_WRAPPER = 'e-searcher';
var DELIMITER_VIEW_WRAPPER = 'e-delimiter';
var ZERO_SIZE = 'e-zero-size';
var REMAIN_WRAPPER = 'e-remain';
var CLOSEICON_CLASS = 'e-chips-close e-close-hooker';
var DELIMITER_WRAPPER = 'e-delim-values';
var POPUP_WRAPPER = 'e-ddl e-popup e-multi-select-list-wrapper';
var INPUT_ELEMENT = 'e-dropdownbase';
var RTL_CLASS = 'e-rtl';
var CLOSE_ICON_HIDE = 'e-close-icon-hide';
var MOBILE_CHIP = 'e-mob-chip';
var FOOTER = 'e-ddl-footer';
var HEADER = 'e-ddl-header';
var DISABLE_ICON = 'e-ddl-disable-icon';
var SPINNER_CLASS = 'e-ms-spinner-icon';
var HIDDEN_ELEMENT = 'e-multi-hidden';
var destroy = 'destroy';
var dropdownIcon = 'e-input-group-icon e-ddl-icon';
var iconAnimation = 'e-icon-anim';
var TOTAL_COUNT_WRAPPER = 'e-delim-total';
var BOX_ELEMENT = 'e-multiselect-box';
var FILTERPARENT = 'e-filter-parent';
var CUSTOM_WIDTH = 'e-search-custom-width';
/**
 * The Multiselect allows the user to pick a more than one value from list of predefined values.
 * ```html
 * <select id="list">
 *      <option value='1'>Badminton</option>
 *      <option value='2'>Basketball</option>
 *      <option value='3'>Cricket</option>
 *      <option value='4'>Football</option>
 *      <option value='5'>Tennis</option>
 * </select>
 * ```
 * ```typescript
 * <script>
 *   var multiselectObj = new Multiselect();
 *   multiselectObj.appendTo("#list");
 * </script>
 * ```
 */
var MultiSelect = /** @__PURE__ @class */ (function (_super) {
    __extends(MultiSelect, _super);
    /**
     * Constructor for creating the DropDownList widget.
     */
    function MultiSelect(option, element) {
        var _this = _super.call(this, option, element) || this;
        _this.clearIconWidth = 0;
        _this.isValidKey = false;
        _this.selectAllEventData = [];
        _this.selectAllEventEle = [];
        _this.isDynamicDataChange = false;
        _this.scrollFocusStatus = false;
        _this.keyDownStatus = false;
        return _this;
    }
    ;
    MultiSelect.prototype.enableRTL = function (state) {
        if (state) {
            this.overAllWrapper.classList.add(RTL_CLASS);
        }
        else {
            this.overAllWrapper.classList.remove(RTL_CLASS);
        }
        if (this.popupObj) {
            this.popupObj.enableRtl = state;
            this.popupObj.dataBind();
        }
    };
    MultiSelect.prototype.requiredModules = function () {
        var modules = [];
        if (this.mode === 'CheckBox') {
            this.isGroupChecking = this.enableGroupCheckBox;
            if (this.enableGroupCheckBox) {
                var prevOnChange = this.isProtectedOnChange;
                this.isProtectedOnChange = true;
                this.enableSelectionOrder = false;
                this.isProtectedOnChange = prevOnChange;
            }
            this.allowCustomValue = false;
            this.hideSelectedItem = false;
            this.closePopupOnSelect = false;
            modules.push({
                member: 'CheckBoxSelection',
                args: [this]
            });
        }
        return modules;
    };
    MultiSelect.prototype.updateHTMLAttribute = function () {
        if (Object.keys(this.htmlAttributes).length) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var htmlAttr = _a[_i];
                switch (htmlAttr) {
                    case 'class':
                        var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
                        if (updatedClassValue !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllWrapper], updatedClassValue.split(' '));
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.popupWrapper], updatedClassValue.split(' '));
                        }
                        break;
                    case 'disabled':
                        this.enable(false);
                        break;
                    case 'placeholder':
                        if (!this.placeholder) {
                            this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                            this.setProperties({ placeholder: this.inputElement.placeholder }, true);
                            this.refreshPlaceHolder();
                        }
                        break;
                    default:
                        var defaultAttr = ['id'];
                        var validateAttr = ['name', 'required', 'aria-required', 'form'];
                        var containerAttr = ['title', 'role', 'style', 'class'];
                        if (defaultAttr.indexOf(htmlAttr) > -1) {
                            this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                        }
                        else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
                            this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                        }
                        else if (containerAttr.indexOf(htmlAttr) > -1) {
                            this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                        }
                        else {
                            this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
                        }
                        break;
                }
            }
        }
    };
    MultiSelect.prototype.updateReadonly = function (state) {
        if (state || this.mode === 'CheckBox') {
            this.inputElement.setAttribute('readonly', 'true');
        }
        else {
            this.inputElement.removeAttribute('readonly');
        }
    };
    MultiSelect.prototype.updateClearButton = function (state) {
        if (state) {
            if (this.overAllClear.parentNode) {
                this.overAllClear.style.display = '';
            }
            else {
                this.componentWrapper.appendChild(this.overAllClear);
            }
            this.componentWrapper.classList.remove(CLOSE_ICON_HIDE);
        }
        else {
            this.overAllClear.style.display = 'none';
            this.componentWrapper.classList.add(CLOSE_ICON_HIDE);
        }
    };
    MultiSelect.prototype.updateCssClass = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            var updatedCssClassValues = this.cssClass;
            updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
            if (updatedCssClassValues !== '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllWrapper], updatedCssClassValues.split(' '));
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.popupWrapper], updatedCssClassValues.split(' '));
            }
        }
    };
    MultiSelect.prototype.updateOldPropCssClass = function (oldClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(oldClass) && oldClass !== '') {
            oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
            if (oldClass !== '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overAllWrapper], oldClass.split(' '));
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.popupWrapper], oldClass.split(' '));
            }
        }
    };
    MultiSelect.prototype.onPopupShown = function () {
        var _this = this;
        var listItems;
        var mainListItems;
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
            var proxy_1 = this;
            window.onpopstate = function () {
                proxy_1.hidePopup();
                proxy_1.inputElement.focus();
            };
            history.pushState({}, '');
        }
        var animModel = { name: 'FadeIn', duration: 100 };
        var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
        this.trigger('open', eventArgs, function (eventArgs) {
            if (!eventArgs.cancel) {
                _this.focusAtFirstListItem();
                document.body.appendChild(_this.popupObj.element);
                if (_this.mode === 'CheckBox' && _this.enableGroupCheckBox && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(_this.fields.groupBy)) {
                    _this.updateListItems(_this.list.querySelectorAll('li.e-list-item'), _this.mainList.querySelectorAll('li.e-list-item'));
                }
                if (_this.mode === 'CheckBox' || _this.showDropDownIcon) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([_this.overAllWrapper], [iconAnimation]);
                }
                _this.refreshPopup();
                _this.renderReactTemplates();
                _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(_this.inputElement, { 'aria-expanded': 'true' });
                if (_this.isFirstClick) {
                    _this.loadTemplate();
                }
            }
        });
    };
    MultiSelect.prototype.updateListItems = function (listItems, mainListItems) {
        for (var i = 0; i < listItems.length; i++) {
            this.findGroupStart(listItems[i]);
            this.findGroupStart(mainListItems[i]);
        }
        this.deselectHeader();
    };
    MultiSelect.prototype.loadTemplate = function () {
        var _this = this;
        if (this.mode === 'CheckBox' && this.itemTemplate && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) &&
            this.mainData && this.mainData.length > 0) {
            setTimeout(function () {
                _this.refreshListItems(null);
                if (_this.mode === 'CheckBox') {
                    _this.removeFocus();
                }
                _this.notify('reOrder', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', e: _this });
            }, this.mainData.length < 100 ? 100 : this.mainData.length);
        }
        else {
            this.refreshListItems(null);
            if (this.mode === 'CheckBox') {
                this.removeFocus();
            }
            this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });
        }
    };
    MultiSelect.prototype.setScrollPosition = function () {
        if (((!this.hideSelectedItem && this.mode !== 'CheckBox') || (this.mode === 'CheckBox' && !this.enableSelectionOrder)) &&
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) && (this.value.length > 0))) {
            var valueEle = this.findListElement((this.hideSelectedItem ? this.ulElement : this.list), 'li', 'data-value', this.value[this.value.length - 1]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(valueEle)) {
                this.scrollBottom(valueEle);
            }
        }
    };
    MultiSelect.prototype.focusAtFirstListItem = function () {
        if (this.ulElement && this.ulElement.querySelector('li.'
            + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li)) {
            var element = void 0;
            if (this.mode === 'CheckBox') {
                this.removeFocus();
                return;
            }
            else {
                element = this.ulElement.querySelector('li.'
                    + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.'
                    + HIDE_LIST + ')');
            }
            if (element !== null) {
                this.removeFocus();
                this.addListFocus(element);
            }
        }
    };
    MultiSelect.prototype.focusAtLastListItem = function (data) {
        var activeElement;
        if (data) {
            activeElement = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_3__["Search"])(data, this.liCollections, 'StartsWith', this.ignoreCase);
        }
        else {
            if (this.value && this.value.length) {
                Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_3__["Search"])(this.value[this.value.length - 1], this.liCollections, 'StartsWith', this.ignoreCase);
            }
            else {
                activeElement = null;
            }
        }
        if (activeElement && activeElement.item !== null) {
            this.addListFocus(activeElement.item);
            this.scrollBottom(activeElement.item, activeElement.index);
        }
    };
    MultiSelect.prototype.getAriaAttributes = function () {
        var ariaAttributes = {
            'aria-disabled': 'false',
            'aria-owns': this.element.id + '_options',
            'role': 'listbox',
            'aria-multiselectable': 'true',
            'aria-activedescendant': 'null',
            'aria-haspopup': 'true',
            'aria-expanded': 'false'
        };
        return ariaAttributes;
    };
    MultiSelect.prototype.updateListARIA = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
        var disableStatus = (this.inputElement.disabled) ? true : false;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputElement, this.getAriaAttributes());
        if (disableStatus) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputElement, { 'aria-disabled': 'true' });
        }
        this.ensureAriaDisabled((disableStatus) ? 'true' : 'false');
    };
    MultiSelect.prototype.ensureAriaDisabled = function (status) {
        if (this.htmlAttributes && this.htmlAttributes['aria-disabled']) {
            var attr = this.htmlAttributes;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(attr, { 'aria-disabled': status }, attr);
            this.setProperties({ htmlAttributes: attr }, true);
        }
    };
    MultiSelect.prototype.removelastSelection = function (e) {
        var elements;
        elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
        var value = elements[elements.length - 1].getAttribute('data-value');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
            this.tempValues = this.value.slice();
        }
        this.removeValue(value, e);
        this.removeChipSelection();
        this.updateDelimeter(this.delimiterChar, e);
        this.makeTextBoxEmpty();
        if (this.mainList && this.listData) {
            this.refreshSelection();
        }
        this.checkPlaceholderSize();
    };
    MultiSelect.prototype.onActionFailure = function (e) {
        _super.prototype.onActionFailure.call(this, e);
        this.renderPopup();
        this.onPopupShown();
    };
    MultiSelect.prototype.targetElement = function () {
        this.targetInputElement = this.inputElement;
        if (this.mode === 'CheckBox' && this.allowFiltering) {
            this.notify('targetElement', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
        }
        return this.targetInputElement.value;
    };
    MultiSelect.prototype.getForQuery = function (valuecheck) {
        var predicate;
        var field = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.value) ? this.fields.text : this.fields.value;
        for (var i = 0; i < valuecheck.length; i++) {
            if (i === 0) {
                predicate = new _ej2_data__WEBPACK_IMPORTED_MODULE_4__["Predicate"](field, 'equal', valuecheck[i]);
            }
            else {
                predicate = predicate.or(field, 'equal', valuecheck[i]);
            }
        }
        return this.getQuery(this.query).where(predicate);
    };
    MultiSelect.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
        _super.prototype.onActionComplete.call(this, ulElement, list, e);
        this.updateSelectElementData(this.allowFiltering);
        var proxy = this;
        var valuecheck = [];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered && this.isDynamicDataChange && this.value !== null && this.value.length > 0) {
            var items = [];
            for (var k = 0; k < this.value.length; k++) {
                var itemsData = this.getDataByValue(this.value[k]);
                if (itemsData) {
                    // tslint:disable-next-line
                    items.push(itemsData[this.fields.value]); // remove the condition for hybrid
                }
            }
            if (items.length === 0) {
                this.setProperties({ 'value': null });
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) && !this.allowCustomValue) {
            for (var i = 0; i < this.value.length; i++) {
                var checkEle = this.findListElement(((this.allowFiltering && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
                if (!checkEle) {
                    this.value.splice(i, 1);
                    i -= 1;
                }
            }
        }
        this.updateActionList(ulElement, list, e);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered && this.allowFiltering && this.mode === 'CheckBox') {
            this.removeFocus();
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered && this.isDynamicDataChange && this.value && this.value.length > 0) {
            this.updateVal(this.value, null, 'value');
            this.addValidInputClass();
            this.isDynamicDataChange = false;
        }
        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_4__["DataManager"] && this.mode === 'CheckBox' && this.allowFiltering &&
            !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered)) {
            this.removeFocus();
        }
    };
    MultiSelect.prototype.updateActionList = function (ulElement, list, e, isUpdated) {
        if (this.mode === 'CheckBox' && this.showSelectAll) {
            this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
        }
        if (!this.mainList && !this.mainData) {
            this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
            this.mainData = list;
            this.mainListCollection = this.liCollections;
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainData) && this.mainData.length === 0) {
            this.mainData = list;
        }
        if ((this.remoteCustomValue || list.length <= 0) && this.allowCustomValue && this.inputFocus && this.allowFiltering &&
            this.inputElement.value && this.inputElement.value !== '') {
            this.checkForCustomValue(this.tempQuery, this.fields);
            return;
        }
        if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value !== '') ||
            this.mode === 'CheckBox')) {
            this.refreshSelection();
        }
        this.updateListARIA();
        this.unwireListEvents();
        this.wireListEvents();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.setInitialValue)) {
            this.setInitialValue();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.selectAllAction)) {
            this.selectAllAction();
        }
        if (this.setDynValue) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0)) {
                this.initialTextUpdate();
            }
            this.initialValueUpdate();
            this.initialUpdate();
            this.refreshPlaceHolder();
            if (this.mode !== 'CheckBox' && this.changeOnBlur) {
                this.updateValueState(null, this.value, null);
            }
        }
        this.renderPopup();
        if (this.beforePopupOpen) {
            this.beforePopupOpen = false;
            this.onPopupShown();
        }
    };
    MultiSelect.prototype.refreshSelection = function () {
        var value;
        var element;
        var className = this.hideSelectedItem ?
            HIDE_LIST :
            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
            for (var index = 0; !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value[index]); index++) {
                value = this.value[index];
                element = this.findListElement(this.list, 'li', 'data-value', value);
                if (element) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element], className);
                    if (this.hideSelectedItem && element.previousSibling
                        && element.previousElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group)
                        && (!element.nextElementSibling ||
                            element.nextElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group))) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element.previousElementSibling], className);
                    }
                    if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
                        this.hideGroupItem(value);
                    }
                    if (this.hideSelectedItem && element.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
                        var listEle = element.parentElement.querySelectorAll('.' +
                            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.' + HIDE_LIST + ')');
                        if (listEle.length > 0) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([listEle[0]], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
                        }
                        else {
                            this.ulElement = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
                            this.l10nUpdate();
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.list], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].noData);
                        }
                    }
                    element.setAttribute('aria-selected', 'true');
                    if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
                        var ariaValue = element.firstElementChild.getAttribute('aria-checked');
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ariaValue) || ariaValue === 'false') {
                            var args = {
                                module: 'CheckBoxSelection',
                                enable: this.mode === 'CheckBox',
                                li: element,
                                e: null
                            };
                            this.notify('updatelist', args);
                        }
                    }
                }
            }
        }
        this.checkSelectAll();
        this.checkMaxSelection();
    };
    MultiSelect.prototype.hideGroupItem = function (value) {
        var element;
        var element1;
        var className = this.hideSelectedItem ?
            HIDE_LIST :
            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected;
        element1 = element = this.findListElement(this.ulElement, 'li', 'data-value', value);
        var i = 0;
        var j = 0;
        var temp = true;
        var temp1 = true;
        do {
            if (element && element.previousElementSibling
                && (!element.previousElementSibling.classList.contains(HIDE_LIST) &&
                    element.previousElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li))) {
                temp = false;
            }
            if (!temp || !element || (element.previousElementSibling
                && element.previousElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group))) {
                i = 10;
            }
            else {
                element = element.previousElementSibling;
            }
            if (element1 && element1.nextElementSibling
                && (!element1.nextElementSibling.classList.contains(HIDE_LIST) &&
                    element1.nextElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li))) {
                temp1 = false;
            }
            if (!temp1 || !element1 || (element1.nextElementSibling
                && element1.nextElementSibling.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group))) {
                j = 10;
            }
            else {
                element1 = element1.nextElementSibling;
            }
        } while (i < 10 || j < 10);
        if (temp && temp1 && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element.previousElementSibling], className);
        }
        else if (temp && temp1 && element.previousElementSibling.classList.contains(HIDE_LIST)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element.previousElementSibling], className);
        }
    };
    MultiSelect.prototype.checkSelectAll = function () {
        var groupItemLength = this.list.querySelectorAll('li.e-list-group-item.e-active').length;
        var listItem = this.list.querySelectorAll('li.e-list-item');
        var searchCount = this.list.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li).length;
        var searchActiveCount = this.list.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected).length;
        if (this.enableGroupCheckBox && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            searchActiveCount = searchActiveCount - groupItemLength;
        }
        if ((searchCount === searchActiveCount || searchActiveCount === this.maximumSelectionLength)
            && (this.mode === 'CheckBox' && this.showSelectAll)) {
            this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });
        }
        else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {
            this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
        }
        if (this.enableGroupCheckBox && this.fields.groupBy && !this.enableSelectionOrder) {
            for (var i = 0; i < listItem.length; i++) {
                this.findGroupStart(listItem[i]);
            }
            this.deselectHeader();
        }
    };
    MultiSelect.prototype.openClick = function (e) {
        if (!this.openOnClick && this.mode !== 'CheckBox') {
            if (this.targetElement() !== '') {
                this.showPopup();
            }
            else {
                this.hidePopup();
            }
        }
        else if (!this.openOnClick && this.mode === 'CheckBox' && !this.isPopupOpen()) {
            this.showPopup();
        }
    };
    MultiSelect.prototype.KeyUp = function (e) {
        if (this.mode === 'CheckBox' && !this.openOnClick) {
            var char = String.fromCharCode(e.keyCode);
            var isWordCharacter = char.match(/\w/);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(isWordCharacter)) {
                this.isValidKey = true;
            }
        }
        this.isValidKey = (this.isPopupOpen() && e.keyCode === 8) || this.isValidKey;
        this.isValidKey = e.ctrlKey && e.keyCode === 86 ? false : this.isValidKey;
        if (this.isValidKey) {
            this.isValidKey = false;
            this.expandTextbox();
            this.showOverAllClear();
            switch (e.keyCode) {
                default:
                    // For filtering works in mobile firefox
                    this.search(e);
            }
        }
    };
    /**
     * To filter the multiselect data from given data source by using query
     * @param  {Object[] | DataManager } dataSource - Set the data source to filter.
     * @param  {Query} query - Specify the query to filter the data.
     * @param  {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
     * @return {void}.
     */
    MultiSelect.prototype.filter = function (dataSource, query, fields) {
        this.isFiltered = true;
        this.remoteFilterAction = true;
        this.dataUpdater(dataSource, query, fields);
    };
    MultiSelect.prototype.getQuery = function (query) {
        var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new _ej2_data__WEBPACK_IMPORTED_MODULE_4__["Query"]();
        if (this.filterAction) {
            if (this.targetElement() !== null) {
                var dataType = this.typeOfData(this.dataSource).typeof;
                if (!(this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_4__["DataManager"]) && dataType === 'string' || dataType === 'number') {
                    filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
                }
                else {
                    var fields = this.fields;
                    filterQuery.where(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
                }
            }
            return filterQuery;
        }
        else {
            return query ? query : this.query ? this.query : new _ej2_data__WEBPACK_IMPORTED_MODULE_4__["Query"]();
        }
    };
    MultiSelect.prototype.dataUpdater = function (dataSource, query, fields) {
        this.isDataFetched = false;
        if (this.targetElement().trim() === '') {
            var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
            if (this.backCommand) {
                this.remoteCustomValue = false;
                this.onActionComplete(list, this.mainData);
                if (this.value && this.value.length) {
                    this.refreshSelection();
                }
                if (this.keyCode !== 8) {
                    this.focusAtFirstListItem();
                }
                this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });
            }
        }
        else {
            this.resetList(dataSource, fields, query);
            if (this.allowCustomValue) {
                if (!(dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_4__["DataManager"])) {
                    this.checkForCustomValue(query, fields);
                }
                else {
                    this.remoteCustomValue = true;
                    this.tempQuery = query;
                }
            }
        }
        this.refreshPopup();
        if (this.mode === 'CheckBox') {
            this.removeFocus();
        }
    };
    MultiSelect.prototype.checkForCustomValue = function (query, fields) {
        var dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);
        if (this.allowCustomValue && dataChecks) {
            var value = this.inputElement.value;
            var field = fields ? fields : this.fields;
            var customData = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainData) && this.mainData.length > 0) ?
                this.mainData[0] : this.mainData;
            if (typeof (customData) !== 'string') {
                var dataItem = {};
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])(field.text, value, dataItem);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])(field.value, value, dataItem);
                var tempData = JSON.parse(JSON.stringify(this.listData));
                tempData.splice(0, 0, dataItem);
                this.resetList(tempData, field, query);
            }
            else {
                var tempData = [this.inputElement.value];
                this.resetList(tempData, field);
            }
        }
        if (this.value && this.value.length) {
            this.refreshSelection();
        }
    };
    MultiSelect.prototype.getNgDirective = function () {
        return 'EJS-MULTISELECT';
    };
    MultiSelect.prototype.wrapperClick = function (e) {
        this.setDynValue = false;
        if (!this.enabled) {
            return;
        }
        if (e.target === this.overAllClear) {
            e.preventDefault();
            return;
        }
        if (!this.inputFocus) {
            this.inputElement.focus();
        }
        if (!this.readonly) {
            if (e.target && e.target.classList.toString().indexOf(CHIP_CLOSE) !== -1) {
                if (this.isPopupOpen()) {
                    this.refreshPopup();
                }
                return;
            }
            if (!this.isPopupOpen() &&
                (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
                this.showPopup();
            }
            else {
                this.hidePopup();
                if (this.mode === 'CheckBox') {
                    this.showOverAllClear();
                    this.inputFocus = true;
                    if (!this.overAllWrapper.classList.contains(FOCUS)) {
                        this.overAllWrapper.classList.add(FOCUS);
                    }
                }
            }
        }
        if (!(this.targetElement() && this.targetElement() !== '')) {
            e.preventDefault();
        }
    };
    MultiSelect.prototype.enable = function (state) {
        if (state) {
            this.overAllWrapper.classList.remove(DISABLED);
            this.inputElement.removeAttribute('disabled');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputElement, { 'aria-disabled': 'false' });
            this.ensureAriaDisabled('false');
        }
        else {
            this.overAllWrapper.classList.add(DISABLED);
            this.inputElement.setAttribute('disabled', 'true');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputElement, { 'aria-disabled': 'true' });
            this.ensureAriaDisabled('true');
        }
        if (this.enabled !== state) {
            this.enabled = state;
        }
        this.hidePopup();
    };
    MultiSelect.prototype.onBlur = function (eve, isDocClickFromCheck) {
        var target;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(eve)) {
            target = eve.relatedTarget;
        }
        if (this.popupObj && document.body.contains(this.popupObj.element) && this.popupObj.element.contains(target)) {
            if (this.mode !== 'CheckBox') {
                this.inputElement.focus();
            }
            else if ((this.floatLabelType === 'Auto' &&
                ((this.overAllWrapper.classList.contains('e-outline')) || (this.overAllWrapper.classList.contains('e-filled'))))) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllWrapper], 'e-valid-input');
            }
            return;
        }
        if (this.floatLabelType === 'Auto' && (this.overAllWrapper.classList.contains('e-outline')) && this.mode === 'CheckBox' &&
            ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) || this.value.length === 0)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overAllWrapper], 'e-valid-input');
        }
        if (this.mode === 'CheckBox' && _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(eve) && !isDocClickFromCheck) {
            this.inputFocus = false;
            this.overAllWrapper.classList.remove(FOCUS);
            return;
        }
        if (this.scrollFocusStatus) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(eve)) {
                eve.preventDefault();
            }
            this.inputElement.focus();
            this.scrollFocusStatus = false;
            return;
        }
        this.inputFocus = false;
        this.overAllWrapper.classList.remove(FOCUS);
        this.refreshListItems(null);
        if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
            this.updateDelimView();
        }
        if (this.changeOnBlur) {
            this.updateValueState(eve, this.value, this.tempValues);
            this.dispatchEvent(this.hiddenElement, 'change');
        }
        this.overAllClear.style.display = 'none';
        if (this.isPopupOpen()) {
            this.DropDownBaseresetBlazorTemplates(false, false, true, true, false, true, true);
            this.hidePopup();
        }
        this.makeTextBoxEmpty();
        this.trigger('blur');
        this.focused = true;
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
            this.removeChipFocus();
        }
        this.removeChipSelection();
        this.refreshInputHight();
        Object(_float_label__WEBPACK_IMPORTED_MODULE_5__["floatLabelBlur"])(this.overAllWrapper, this.componentWrapper, this.value, this.floatLabelType, this.placeholder);
        this.refreshPlaceHolder();
        if ((this.allowFiltering || (this.enableSelectionOrder === true && this.mode === 'CheckBox'))
            && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainList)) {
            this.ulElement = this.mainList;
        }
        this.checkPlaceholderSize();
    };
    MultiSelect.prototype.checkPlaceholderSize = function () {
        if (this.showDropDownIcon) {
            var downIconWidth = this.dropIcon.offsetWidth +
                parseInt(window.getComputedStyle(this.dropIcon).marginRight, 10);
            this.setPlaceholderSize(downIconWidth);
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.dropIcon)) {
                this.setPlaceholderSize(this.showDropDownIcon ? this.dropIcon.offsetWidth : 0);
            }
        }
    };
    MultiSelect.prototype.setPlaceholderSize = function (downIconWidth) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0) {
            if (this.dropIcon.offsetWidth !== 0) {
                this.searchWrapper.style.width = ('calc(100% - ' + (downIconWidth + 10)) + 'px';
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.searchWrapper], CUSTOM_WIDTH);
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
            this.searchWrapper.removeAttribute('style');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.searchWrapper], CUSTOM_WIDTH);
        }
    };
    MultiSelect.prototype.refreshInputHight = function () {
        if ((!this.value || !this.value.length) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text) || this.text === '')) {
            this.searchWrapper.classList.remove(ZERO_SIZE);
        }
        else {
            this.searchWrapper.classList.add(ZERO_SIZE);
        }
    };
    MultiSelect.prototype.validateValues = function (newValue, oldValue) {
        return JSON.stringify(newValue.slice().sort()) !== JSON.stringify(oldValue.slice().sort());
    };
    MultiSelect.prototype.updateValueState = function (event, newVal, oldVal) {
        var newValue = newVal ? newVal : [];
        var oldValue = oldVal ? oldVal : [];
        if (this.initStatus && this.validateValues(newValue, oldValue)) {
            var eventArgs = {
                e: event,
                oldValue: oldVal,
                value: newVal,
                isInteracted: event ? true : false,
                element: this.element
            };
            if (this.isAngular && this.preventChange) {
                this.preventChange = false;
            }
            else {
                this.trigger('change', eventArgs);
            }
            this.updateTempValue();
            if (!this.changeOnBlur) {
                this.dispatchEvent(this.hiddenElement, 'change');
            }
        }
    };
    MultiSelect.prototype.updateTempValue = function () {
        if (!this.value) {
            this.tempValues = this.value;
        }
        else {
            this.tempValues = this.value.slice();
        }
    };
    MultiSelect.prototype.getPagingCount = function () {
        var height = this.list.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].noData) ? null :
            getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
        return Math.round(this.list.offsetHeight / parseInt(height, 10));
    };
    MultiSelect.prototype.pageUpSelection = function (steps) {
        var collection = this.list.querySelectorAll('li.'
            + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
        var previousItem;
        previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
        this.addListFocus(previousItem);
        this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));
    };
    ;
    MultiSelect.prototype.pageDownSelection = function (steps) {
        var list = this.getItems();
        var collection = this.list.querySelectorAll('li.'
            + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
        var previousItem;
        previousItem = steps <= collection.length ? collection[steps - 1] : collection[collection.length - 1];
        this.addListFocus(previousItem);
        this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));
    };
    MultiSelect.prototype.getItems = function () {
        if (!this.list) {
            _super.prototype.render.call(this);
        }
        return this.ulElement && this.ulElement.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li).length > 0 ?
            this.ulElement.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li
                + ':not(.' + HIDE_LIST + ')') : [];
    };
    MultiSelect.prototype.focusInHandler = function (e) {
        if (this.enabled) {
            this.showOverAllClear();
            this.inputFocus = true;
            if (this.value && this.value.length) {
                if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
                    this.chipCollectionWrapper.style.display = '';
                }
                else {
                    this.showDelimWrapper();
                }
                if (this.mode !== 'CheckBox') {
                    this.viewWrapper.style.display = 'none';
                }
            }
            if (this.mode !== 'CheckBox') {
                this.searchWrapper.classList.remove(ZERO_SIZE);
            }
            this.checkPlaceholderSize();
            if (this.focused) {
                var args = { isInteracted: e ? true : false, event: e };
                this.trigger('focus', args);
                this.focused = false;
            }
            if (!this.overAllWrapper.classList.contains(FOCUS)) {
                this.overAllWrapper.classList.add(FOCUS);
            }
            Object(_float_label__WEBPACK_IMPORTED_MODULE_5__["floatLabelFocus"])(this.overAllWrapper, this.componentWrapper);
            if (this.isPopupOpen()) {
                this.refreshPopup();
            }
            return true;
        }
        else {
            return false;
        }
    };
    MultiSelect.prototype.showDelimWrapper = function () {
        if (this.mode === 'CheckBox') {
            this.viewWrapper.style.display = '';
        }
        else {
            this.delimiterWrapper.style.display = '';
        }
        this.componentWrapper.classList.add(DELIMITER_VIEW_WRAPPER);
    };
    MultiSelect.prototype.hideDelimWrapper = function () {
        this.delimiterWrapper.style.display = 'none';
        this.componentWrapper.classList.remove(DELIMITER_VIEW_WRAPPER);
    };
    MultiSelect.prototype.expandTextbox = function () {
        var size = 5;
        if (this.placeholder) {
            size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length;
        }
        if (this.inputElement.value.length > size) {
            this.inputElement.size = this.inputElement.value.length;
        }
        else {
            this.inputElement.size = size;
        }
    };
    MultiSelect.prototype.isPopupOpen = function () {
        return ((this.popupWrapper !== null) && (this.popupWrapper.parentElement !== null));
    };
    MultiSelect.prototype.refreshPopup = function () {
        if (this.popupObj && this.mobFilter) {
            this.popupObj.setProperties({ width: this.calcPopupWidth() });
            this.popupObj.refreshPosition(this.overAllWrapper);
            this.popupObj.resolveCollision();
        }
    };
    MultiSelect.prototype.checkTextLength = function () {
        return this.targetElement().length < 1;
    };
    MultiSelect.prototype.popupKeyActions = function (e) {
        switch (e.keyCode) {
            case 38:
                this.hidePopup();
                if (this.mode === 'CheckBox') {
                    this.inputElement.focus();
                }
                e.preventDefault();
                break;
            case 40:
                if (!this.isPopupOpen()) {
                    this.showPopup();
                    e.preventDefault();
                }
                break;
        }
    };
    MultiSelect.prototype.updateAriaAttribute = function () {
        var focusedItem = this.list.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(focusedItem)) {
            this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);
        }
    };
    MultiSelect.prototype.homeNavigation = function (isHome) {
        this.removeFocus();
        var scrollEle = this.ulElement.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li
            + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
        if (scrollEle.length > 0) {
            var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
            element.classList.add(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            this.scrollBottom(element);
        }
    };
    MultiSelect.prototype.onKeyDown = function (e) {
        if (this.readonly || !this.enabled && this.mode !== 'CheckBox') {
            return;
        }
        this.keyDownStatus = true;
        if (e.keyCode > 111 && e.keyCode < 124) {
            return;
        }
        if (e.altKey) {
            this.popupKeyActions(e);
            return;
        }
        else if (this.isPopupOpen()) {
            var focusedItem = this.list.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            var activeIndex = void 0;
            switch (e.keyCode) {
                case 36:
                case 35:
                    this.homeNavigation((e.keyCode === 36) ? true : false);
                    break;
                case 33:
                    e.preventDefault();
                    if (focusedItem) {
                        this.getIndexByValue(focusedItem.getAttribute('data-value'));
                        this.pageUpSelection(activeIndex - this.getPagingCount());
                        this.updateAriaAttribute();
                    }
                    return;
                case 34:
                    e.preventDefault();
                    if (focusedItem) {
                        this.getIndexByValue(focusedItem.getAttribute('data-value'));
                        this.pageDownSelection(activeIndex + this.getPagingCount());
                        this.updateAriaAttribute();
                    }
                    return;
                case 38:
                    this.arrowUp(e);
                    break;
                case 40:
                    this.arrowDown(e);
                    break;
                case 27:
                    e.preventDefault();
                    this.hidePopup();
                    if (this.mode === 'CheckBox') {
                        this.inputElement.focus();
                    }
                    return;
                case 13:
                    e.preventDefault();
                    if (this.mode !== 'CheckBox') {
                        this.selectByKey(e);
                    }
                    this.checkPlaceholderSize();
                    return;
                case 32:
                    this.spaceKeySelection(e);
                    return;
                case 9:
                    e.preventDefault();
                    this.hidePopup();
                    this.inputElement.focus();
                    this.overAllWrapper.classList.add(FOCUS);
            }
        }
        else {
            switch (e.keyCode) {
                case 13:
                case 9:
                case 16:
                case 17:
                case 20:
                    return;
                case 40:
                    if (this.openOnClick) {
                        this.showPopup();
                    }
                    break;
                case 27:
                    e.preventDefault();
                    this.escapeAction();
                    return;
            }
        }
        if (this.checkTextLength()) {
            this.keyNavigation(e);
        }
        if (this.mode === 'CheckBox' && this.enableSelectionOrder) {
            this.checkBackCommand(e);
        }
        this.expandTextbox();
        this.refreshPopup();
    };
    MultiSelect.prototype.arrowDown = function (e) {
        e.preventDefault();
        this.moveByList(1);
        this.keyAction = true;
        if (document.activeElement.classList.contains('e-input-filter')
            || (this.mode === 'CheckBox' && !this.allowFiltering && document.activeElement !== this.list)) {
            this.list.focus();
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'keydown', this.onKeyDown, this);
        }
        this.updateAriaAttribute();
    };
    MultiSelect.prototype.arrowUp = function (e) {
        e.preventDefault();
        this.keyAction = true;
        var list = this.list.querySelectorAll('li.'
            + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li
            + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
        if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            list = this.list.querySelectorAll('li.'
                + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ',li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group
                + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
        }
        var focuseElem = this.list.querySelector('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
        var index = Array.prototype.slice.call(list).indexOf(focuseElem);
        if (index <= 0 && (this.mode === 'CheckBox' && this.allowFiltering)) {
            this.keyAction = false;
            this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus' });
        }
        this.moveByList(-1);
        this.updateAriaAttribute();
    };
    MultiSelect.prototype.spaceKeySelection = function (e) {
        if (this.mode === 'CheckBox') {
            if (!document.activeElement.classList.contains('e-input-filter')) {
                e.preventDefault();
                this.keyAction = true;
                this.list.focus();
            }
            this.selectByKey(e);
        }
        this.checkPlaceholderSize();
    };
    MultiSelect.prototype.checkBackCommand = function (e) {
        if (e.keyCode === 8 && this.targetElement() === '') {
            this.backCommand = false;
        }
        else {
            this.backCommand = true;
        }
    };
    MultiSelect.prototype.keyNavigation = function (e) {
        if ((this.mode !== 'Delimiter' && this.mode !== 'CheckBox') && this.value && this.value.length) {
            switch (e.keyCode) {
                case 37: //left arrow   
                    e.preventDefault();
                    this.moveBy(-1, e);
                    break;
                case 39: //right arrow  
                    e.preventDefault();
                    this.moveBy(1, e);
                    break;
                case 8:
                    this.removelastSelection(e);
                    break;
                case 46: //del
                    this.removeSelectedChip(e);
                    break;
            }
        }
        else if (e.keyCode === 8 && this.mode === 'Delimiter') {
            if (this.value && this.value.length) {
                e.preventDefault();
                var temp = this.value[this.value.length - 1];
                this.removeValue(temp, e);
                this.updateDelimeter(this.delimiterChar, e);
                this.focusAtLastListItem(temp);
            }
        }
    };
    MultiSelect.prototype.selectByKey = function (e) {
        this.removeChipSelection();
        this.selectListByKey(e);
        if (this.hideSelectedItem) {
            this.focusAtFirstListItem();
        }
    };
    MultiSelect.prototype.escapeAction = function () {
        var temp = this.tempValues ? this.tempValues.slice() : [];
        if (this.value && this.validateValues(this.value, temp)) {
            if (this.mode !== 'CheckBox') {
                this.value = temp;
                this.initialValueUpdate();
            }
            if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
                this.chipCollectionWrapper.style.display = '';
            }
            else {
                this.showDelimWrapper();
            }
            this.refreshPlaceHolder();
            if (this.value.length) {
                this.showOverAllClear();
            }
            else {
                this.hideOverAllClear();
            }
        }
        this.makeTextBoxEmpty();
    };
    MultiSelect.prototype.scrollBottom = function (selectedLI, activeIndex) {
        var currentOffset = this.list.offsetHeight;
        var nextBottom = selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop;
        var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
        var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);
        boxRange = this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fixedHeaderElement) ?
            boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
        if (activeIndex === 0) {
            this.list.scrollTop = 0;
        }
        else if (nextBottom > currentOffset) {
            this.list.scrollTop = nextOffset;
        }
        else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
            this.list.scrollTop = nextOffset;
        }
    };
    MultiSelect.prototype.scrollTop = function (selectedLI, activeIndex) {
        var nextOffset = selectedLI.offsetTop - this.list.scrollTop;
        var nextBottom = selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop;
        nextOffset = this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(this.fixedHeaderElement) ?
            nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
        var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);
        if (activeIndex === 0) {
            this.list.scrollTop = 0;
        }
        else if (nextOffset < 0) {
            this.list.scrollTop = this.list.scrollTop + nextOffset;
        }
        else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
            this.list.scrollTop = selectedLI.offsetTop - (this.fields.groupBy && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isUndefined"])(this.fixedHeaderElement) ?
                this.fixedHeaderElement.offsetHeight : 0);
        }
    };
    MultiSelect.prototype.selectListByKey = function (e) {
        var li = this.list.querySelector('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
        var limit = this.value && this.value.length ? this.value.length : 0;
        var target;
        if (li !== null) {
            if (li.classList.contains('e-active')) {
                limit = limit - 1;
            }
            if (this.isValidLI(li) && limit < this.maximumSelectionLength) {
                this.updateListSelection(li, e);
                this.addListFocus(li);
                if (this.mode === 'CheckBox') {
                    this.updateDelimView();
                    this.updateDelimeter(this.delimiterChar, e);
                    this.refreshInputHight();
                    this.checkPlaceholderSize();
                    if (this.enableGroupCheckBox && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
                        target = li.firstElementChild.lastElementChild;
                        this.findGroupStart(target);
                        this.deselectHeader();
                    }
                }
                else {
                    this.updateDelimeter(this.delimiterChar, e);
                }
                this.makeTextBoxEmpty();
                if (this.mode !== 'CheckBox') {
                    this.refreshListItems(li.textContent);
                }
                if (!this.changeOnBlur) {
                    this.updateValueState(e, this.value, this.tempValues);
                }
                this.refreshPopup();
            }
            else {
                if (!this.isValidLI(li) && limit < this.maximumSelectionLength) {
                    target = li.firstElementChild.lastElementChild;
                    target.classList.contains('e-check') ? this.selectAllItem(false, e, li) : this.selectAllItem(true, e, li);
                }
            }
            this.refreshSelection();
            if (this.closePopupOnSelect) {
                this.hidePopup();
            }
        }
        this.refreshPlaceHolder();
    };
    MultiSelect.prototype.refreshListItems = function (data) {
        if ((this.allowFiltering || (this.mode === 'CheckBox' && this.enableSelectionOrder === true)
            || this.allowCustomValue) && this.mainList && this.listData) {
            var list = void 0;
            list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
            this.onActionComplete(list, this.mainData);
            this.focusAtLastListItem(data);
            if (this.value && this.value.length) {
                this.refreshSelection();
            }
        }
    };
    MultiSelect.prototype.removeSelectedChip = function (e) {
        var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);
        var temp;
        if (selectedElem !== null) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
                this.tempValues = this.value.slice();
            }
            temp = selectedElem.nextElementSibling;
            if (temp !== null) {
                this.removeChipSelection();
                this.addChipSelection(temp, e);
            }
            this.removeValue(selectedElem.getAttribute('data-value'), e);
            this.makeTextBoxEmpty();
        }
        if (this.closePopupOnSelect) {
            this.hidePopup();
        }
        this.checkPlaceholderSize();
    };
    MultiSelect.prototype.moveByTop = function (state) {
        var elements = this.list.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li);
        var index;
        if (elements.length > 1) {
            this.removeFocus();
            index = state ? 0 : (elements.length - 1);
            this.addListFocus(elements[index]);
            this.scrollBottom(elements[index], index);
        }
        this.updateAriaAttribute();
    };
    MultiSelect.prototype.moveByList = function (position) {
        if (this.list) {
            var elements = this.list.querySelectorAll('li.'
                + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li
                + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
            if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
                elements = this.list.querySelectorAll('li.'
                    + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ',li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group
                    + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
            }
            var selectedElem = this.list.querySelector('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            var temp = -1;
            if (elements.length) {
                for (var index = 0; index < elements.length; index++) {
                    if (elements[index] === selectedElem) {
                        temp = index;
                        break;
                    }
                }
                if (position > 0) {
                    if (temp < (elements.length - 1)) {
                        this.removeFocus();
                        this.addListFocus(elements[++temp]);
                        this.updateCheck(elements[temp]);
                        this.scrollBottom(elements[temp], temp);
                    }
                }
                else {
                    if (temp > 0) {
                        this.removeFocus();
                        this.addListFocus(elements[--temp]);
                        this.updateCheck(elements[temp]);
                        this.scrollTop(elements[temp], temp);
                    }
                }
            }
        }
    };
    MultiSelect.prototype.updateCheck = function (element) {
        if (this.mode === 'CheckBox' && this.enableGroupCheckBox &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            var checkElement = element.firstElementChild.lastElementChild;
            if (checkElement.classList.contains('e-check')) {
                element.classList.add('e-active');
            }
            else {
                element.classList.remove('e-active');
            }
        }
    };
    MultiSelect.prototype.moveBy = function (position, e) {
        var elements;
        var selectedElem;
        var temp;
        elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
        selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);
        if (selectedElem === null) {
            if (position < 0) {
                this.addChipSelection(elements[elements.length - 1], e);
            }
        }
        else {
            if (position < 0) {
                temp = selectedElem.previousElementSibling;
                if (temp !== null) {
                    this.removeChipSelection();
                    this.addChipSelection(temp, e);
                }
            }
            else {
                temp = selectedElem.nextElementSibling;
                this.removeChipSelection();
                if (temp !== null) {
                    this.addChipSelection(temp, e);
                }
            }
        }
    };
    MultiSelect.prototype.chipClick = function (e) {
        if (this.enabled) {
            var elem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, '.' + CHIP);
            this.removeChipSelection();
            this.addChipSelection(elem, e);
        }
    };
    MultiSelect.prototype.removeChipSelection = function () {
        if (this.chipCollectionWrapper) {
            this.removeChipFocus();
        }
    };
    MultiSelect.prototype.addChipSelection = function (element, e) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element], CHIP_SELECTED);
        this.trigger('chipSelection', e);
    };
    MultiSelect.prototype.onChipRemove = function (e) {
        if (e.which === 3 || e.button === 2) {
            return;
        }
        if (this.enabled && !this.readonly) {
            var element = e.target.parentElement;
            var customVal = element.getAttribute('data-value');
            var value = this.getFormattedValue(customVal);
            if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(value) && value.toString() === 'NaN'))) {
                value = customVal;
            }
            if (this.isPopupOpen() && this.mode !== 'CheckBox') {
                this.hidePopup();
            }
            if (!this.inputFocus) {
                this.inputElement.focus();
            }
            this.removeValue(value, e);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.findListElement(this.list, 'li', 'data-value', value)) && this.mainList && this.listData) {
                var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
                this.onActionComplete(list, this.mainData);
            }
            this.updateDelimeter(this.delimiterChar, e);
            if (this.placeholder && this.floatLabelType === 'Never') {
                this.makeTextBoxEmpty();
                this.checkPlaceholderSize();
            }
            else {
                this.inputElement.value = '';
            }
            e.preventDefault();
        }
    };
    MultiSelect.prototype.makeTextBoxEmpty = function () {
        this.inputElement.value = '';
        this.refreshPlaceHolder();
    };
    MultiSelect.prototype.refreshPlaceHolder = function () {
        if (this.placeholder && this.floatLabelType === 'Never') {
            if ((this.value && this.value.length) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text) && this.text !== '')) {
                this.inputElement.placeholder = '';
            }
            else {
                this.inputElement.placeholder = this.placeholder;
            }
        }
        else {
            this.setFloatLabelType();
        }
        this.expandTextbox();
    };
    MultiSelect.prototype.removeValue = function (value, eve, length, isClearAll) {
        var _this = this;
        var index = this.value.indexOf(this.getFormattedValue(value));
        if (index === -1 && this.allowCustomValue && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(value)) {
            index = this.value.indexOf(value.toString());
        }
        var targetEle = eve && eve.target;
        isClearAll = (isClearAll || targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;
        var className = this.hideSelectedItem ?
            HIDE_LIST :
            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected;
        if (index !== -1) {
            var element_1 = this.findListElement(this.list, 'li', 'data-value', value);
            var val_1 = this.getDataByValue(value);
            var eventArgs = {
                e: eve,
                item: element_1,
                itemData: val_1,
                isInteracted: eve ? true : false,
                cancel: false
            };
            this.trigger('removing', eventArgs, function (eventArgs) {
                if (eventArgs.cancel) {
                    _this.removeIndex++;
                }
                else {
                    var removeVal = _this.value.slice(0);
                    removeVal.splice(index, 1);
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered) {
                        var removedValues = [].concat([], removeVal);
                        _this.setProperties({ value: removedValues.length === 0 ? null : removedValues }, true);
                    }
                    else {
                        _this.setProperties({ value: [].concat([], removeVal) }, true);
                    }
                    if (element_1 !== null) {
                        var hideElement = _this.findListElement(_this.mainList, 'li', 'data-value', value);
                        element_1.setAttribute('aria-selected', 'false');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element_1], className);
                        if (hideElement) {
                            hideElement.setAttribute('aria-selected', 'false');
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element_1, hideElement], className);
                        }
                        _this.notify('activeList', {
                            module: 'CheckBoxSelection',
                            enable: _this.mode === 'CheckBox', li: element_1,
                            e: _this, index: index
                        });
                        _this.notify('updatelist', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', li: element_1, e: eve });
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(_this.inputElement, { 'aria-activedescendant': element_1.id });
                        if ((_this.value && _this.value.length !== _this.mainData.length)
                            && (_this.mode === 'CheckBox' && _this.showSelectAll && !(_this.isSelectAll || isClearAll))) {
                            _this.notify('checkSelectAll', { module: 'CheckBoxSelection',
                                enable: _this.mode === 'CheckBox',
                                value: 'uncheck' });
                        }
                    }
                    if (_this.hideSelectedItem && _this.fields.groupBy) {
                        _this.hideGroupItem(value);
                    }
                    _this.updateMainList(true, value);
                    _this.removeChip(value);
                    _this.updateChipStatus();
                    var limit = _this.value && _this.value.length ? _this.value.length : 0;
                    if (limit < _this.maximumSelectionLength) {
                        var collection = _this.list.querySelectorAll('li.'
                            + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.e-active)');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(collection, 'e-disable');
                    }
                    _this.trigger('removed', eventArgs);
                    var targetEle_1 = eve && eve.currentTarget;
                    var isSelectAll = (targetEle_1 && targetEle_1.classList.contains('e-selectall-parent')) ? true : null;
                    if (!_this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll)) {
                        _this.updateValueState(eve, _this.value, _this.tempValues);
                    }
                    if (length) {
                        _this.selectAllEventData.push(val_1);
                        _this.selectAllEventEle.push(element_1);
                    }
                    if (length === 1) {
                        if (!_this.changeOnBlur) {
                            _this.updateValueState(eve, _this.value, _this.tempValues);
                        }
                        var args = {
                            event: eve,
                            items: _this.selectAllEventEle,
                            itemData: _this.selectAllEventData,
                            isInteracted: eve ? true : false,
                            isChecked: false
                        };
                        _this.trigger('selectedAll', args);
                        _this.selectAllEventData = [];
                        _this.selectAllEventEle = [];
                    }
                    if (isClearAll && (length === 1 || length === null)) {
                        _this.clearAllCallback(eve, isClearAll);
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(_this.value) || _this.value.length === 0)) {
                        _this.updatedataValueItems(eve);
                    }
                }
            });
        }
    };
    MultiSelect.prototype.updateMainList = function (state, value) {
        if (this.allowFiltering || this.mode === 'CheckBox') {
            var element2 = this.findListElement(this.mainList, 'li', 'data-value', value);
            if (element2) {
                if (state) {
                    element2.setAttribute('aria-selected', 'false');
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element2], this.hideSelectedItem ?
                        HIDE_LIST :
                        _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected);
                    if (this.mode === 'CheckBox') {
                        element2.firstElementChild.setAttribute('aria-checked', 'false');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([element2.firstElementChild.lastElementChild], 'e-check');
                    }
                }
                else {
                    element2.setAttribute('aria-selected', 'true');
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element2], this.hideSelectedItem ?
                        HIDE_LIST :
                        _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected);
                    if (this.mode === 'CheckBox') {
                        element2.firstElementChild.setAttribute('aria-checked', 'true');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element2.firstElementChild.lastElementChild], 'e-check');
                    }
                }
            }
        }
    };
    MultiSelect.prototype.removeChip = function (value) {
        if (this.chipCollectionWrapper) {
            var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
            if (element) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(element);
            }
        }
    };
    MultiSelect.prototype.setWidth = function (width) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(width)) {
            if (typeof width === 'number') {
                this.overAllWrapper.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(width);
            }
            else if (typeof width === 'string') {
                this.overAllWrapper.style.width = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(width));
            }
        }
    };
    MultiSelect.prototype.updateChipStatus = function () {
        if (this.value && this.value.length) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.chipCollectionWrapper)) {
                (this.chipCollectionWrapper.style.display = '');
            }
            if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
                this.showDelimWrapper();
            }
            this.showOverAllClear();
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.chipCollectionWrapper)) {
                this.chipCollectionWrapper.style.display = 'none';
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.delimiterWrapper)) {
                (this.delimiterWrapper.style.display = 'none');
            }
            this.hideOverAllClear();
        }
    };
    MultiSelect.prototype.addValue = function (value, text, eve) {
        if (!this.value) {
            this.value = [];
        }
        if (this.value.indexOf(value) < 0) {
            this.setProperties({ value: [].concat([], this.value, [value]) }, true);
        }
        var element = this.findListElement(this.list, 'li', 'data-value', value);
        this.removeFocus();
        if (element) {
            this.addListFocus(element);
            this.addListSelection(element);
        }
        if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
            this.addChip(text, value, eve);
        }
        if (this.hideSelectedItem && this.fields.groupBy) {
            this.hideGroupItem(value);
        }
        this.updateChipStatus();
        this.checkMaxSelection();
    };
    MultiSelect.prototype.checkMaxSelection = function () {
        var limit = this.value && this.value.length ? this.value.length : 0;
        if (limit === this.maximumSelectionLength) {
            var collection = this.list.querySelectorAll('li.'
                + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.e-active)');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])(collection, 'e-disable');
        }
    };
    MultiSelect.prototype.dispatchSelect = function (value, eve, element, isNotTrigger, length) {
        var _this = this;
        var list = this.listData;
        if (this.initStatus && !isNotTrigger) {
            var val_2 = this.getDataByValue(value);
            var eventArgs = {
                e: eve,
                item: element,
                itemData: val_2,
                isInteracted: eve ? true : false,
                cancel: false
            };
            this.trigger('select', eventArgs, function (eventArgs) {
                if (!eventArgs.cancel) {
                    if (length) {
                        _this.selectAllEventData.push(val_2);
                        _this.selectAllEventEle.push(element);
                    }
                    if (length === 1) {
                        var args = {
                            event: eve,
                            items: _this.selectAllEventEle,
                            itemData: _this.selectAllEventData,
                            isInteracted: eve ? true : false,
                            isChecked: true
                        };
                        _this.trigger('selectedAll', args);
                        _this.selectAllEventData = [];
                    }
                    if (_this.allowCustomValue && _this.isServerRendered && _this.listData !== list) {
                        _this.listData = list;
                    }
                    _this.updateListSelectEventCallback(value, element, eve);
                }
            });
        }
    };
    MultiSelect.prototype.addChip = function (text, value, e) {
        if (this.chipCollectionWrapper) {
            this.getChip(text, value, e);
        }
    };
    MultiSelect.prototype.removeChipFocus = function () {
        var elements;
        var closeElements;
        elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
        closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE.split(' ')[0]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(elements, CHIP_SELECTED);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
            for (var index = 0; index < closeElements.length; index++) {
                closeElements[index].style.display = 'none';
            }
        }
    };
    MultiSelect.prototype.onMobileChipInteraction = function (e) {
        var chipElem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, '.' + CHIP);
        var chipClose = chipElem.querySelector('span.' + CHIP_CLOSE.split(' ')[0]);
        if (this.enabled && !this.readonly) {
            if (!chipElem.classList.contains(CHIP_SELECTED)) {
                this.removeChipFocus();
                chipClose.style.display = '';
                chipElem.classList.add(CHIP_SELECTED);
            }
            this.refreshPopup();
            e.preventDefault();
        }
    };
    MultiSelect.prototype.multiCompiler = function (multiselectTemplate) {
        var checkTemplate = false;
        if (multiselectTemplate) {
            var exception = void 0;
            try {
                checkTemplate = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])(multiselectTemplate, document).length) ? true : false;
            }
            catch (exception) {
                checkTemplate = false;
            }
        }
        return checkTemplate;
    };
    MultiSelect.prototype.getChip = function (data, value, e) {
        var _this = this;
        var itemData = { text: value, value: value };
        var chip = this.createElement('span', {
            className: CHIP,
            attrs: { 'data-value': value, 'title': data }
        });
        var compiledString;
        var chipContent = this.createElement('span', { className: CHIP_CONTENT });
        var chipClose = this.createElement('span', { className: CHIP_CLOSE });
        if (this.mainData) {
            itemData = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) ? JSON.parse(JSON.stringify(this.getDataByValue(value)))
                : this.getDataByValue(value);
        }
        if (this.valueTemplate && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(itemData)) {
            var valuecheck = this.multiCompiler(this.valueTemplate);
            if (valuecheck) {
                compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])(this.valueTemplate, document).innerHTML.trim());
            }
            else {
                compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(this.valueTemplate);
            }
            // tslint:disable-next-line
            var valueCompTemp = compiledString(itemData, this, 'valueTemplate', this.valueTemplateId, this.isStringTemplate, null, chipContent);
            if (valueCompTemp && valueCompTemp.length > 0) {
                for (var i = 0; i < valueCompTemp.length; i++) {
                    chipContent.appendChild(valueCompTemp[i]);
                }
            }
            this.renderReactTemplates();
            this.DropDownBaseupdateBlazorTemplates(false, false, false, false, true, false, false, false);
        }
        else if (this.enableHtmlSanitizer) {
            chipContent.innerText = data;
        }
        else {
            chipContent.innerHTML = data;
        }
        chip.appendChild(chipContent);
        var eventArgs = {
            isInteracted: e ? true : false,
            itemData: itemData,
            e: e,
            setClass: function (classes) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([chip], classes);
            },
            cancel: false
        };
        this.isPreventChange = this.isAngular && this.preventChange;
        this.trigger('tagging', eventArgs, function (eventArgs) {
            if (!eventArgs.cancel) {
                if (eventArgs.setClass && typeof eventArgs.setClass === 'string' && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([chip], eventArgs.setClass);
                }
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                    chip.classList.add(MOBILE_CHIP);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([chipClose], chip);
                    chipClose.style.display = 'none';
                    _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(chip, 'click', _this.onMobileChipInteraction, _this);
                }
                else {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(chip, 'mousedown', _this.chipClick, _this);
                    if (_this.showClearButton) {
                        chip.appendChild(chipClose);
                    }
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(chipClose, 'mousedown', _this.onChipRemove, _this);
                _this.chipCollectionWrapper.appendChild(chip);
                if (!_this.changeOnBlur && e) {
                    _this.updateValueState(e, _this.value, _this.tempValues);
                }
            }
        });
    };
    MultiSelect.prototype.calcPopupWidth = function () {
        var width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.popupWidth);
        if (width.indexOf('%') > -1) {
            var inputWidth = (this.componentWrapper.offsetWidth) * parseFloat(width) / 100;
            width = inputWidth.toString() + 'px';
        }
        return width;
    };
    MultiSelect.prototype.mouseIn = function () {
        if (this.enabled && !this.readonly) {
            this.showOverAllClear();
        }
    };
    MultiSelect.prototype.mouseOut = function () {
        if (!this.inputFocus) {
            this.overAllClear.style.display = 'none';
        }
    };
    MultiSelect.prototype.listOption = function (dataSource, fields) {
        var iconCss = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(fields.iconCss) ? false : true;
        var fieldProperty = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(fields.properties) ? fields :
            fields.properties;
        this.listCurrentOptions = (fields.text !== null || fields.value !== null) ? {
            fields: fieldProperty, showIcon: iconCss, ariaAttributes: { groupItemRole: 'presentation' }
        } : { fields: { value: 'text' } };
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["extend"])(this.listCurrentOptions, this.listCurrentOptions, fields, true);
        if (this.mode === 'CheckBox') {
            this.notify('listoption', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', dataSource: dataSource, fieldProperty: fieldProperty });
        }
        return this.listCurrentOptions;
    };
    MultiSelect.prototype.renderPopup = function () {
        var _this = this;
        if (!this.list) {
            _super.prototype.render.call(this);
        }
        if (!this.popupObj) {
            document.body.appendChild(this.popupWrapper);
            var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
            if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
                checkboxFilter.remove();
                this.filterParent = null;
            }
            var overAllHeight = parseInt(this.popupHeight, 10);
            this.popupWrapper.style.visibility = 'hidden';
            if (this.headerTemplate) {
                this.setHeaderTemplate();
                overAllHeight -= this.header.offsetHeight;
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.list], this.popupWrapper);
            if (this.footerTemplate) {
                this.setFooterTemplate();
                overAllHeight -= this.footer.offsetHeight;
            }
            if (this.mode === 'CheckBox' && this.showSelectAll) {
                this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
                overAllHeight -= this.selectAllHeight;
            }
            else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
                this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
                overAllHeight = parseInt(this.popupHeight, 10);
            }
            else if (this.mode === 'CheckBox' && !this.showSelectAll) {
                this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
                overAllHeight = parseInt(this.popupHeight, 10);
                if (this.headerTemplate && this.header) {
                    overAllHeight -= this.header.offsetHeight;
                }
                if (this.footerTemplate && this.footer) {
                    overAllHeight -= this.footer.offsetHeight;
                }
            }
            if (this.mode === 'CheckBox') {
                var args = {
                    module: 'CheckBoxSelection',
                    enable: this.mode === 'CheckBox',
                    popupElement: this.popupWrapper
                };
                if (this.allowFiltering) {
                    this.notify('searchBox', args);
                    overAllHeight -= this.searchBoxHeight;
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.popupWrapper], 'e-checkbox');
            }
            if (this.popupHeight !== 'auto') {
                this.list.style.maxHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(overAllHeight);
                this.popupWrapper.style.maxHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.popupHeight);
            }
            else {
                this.list.style.maxHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["formatUnit"])(this.popupHeight);
            }
            this.popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](this.popupWrapper, {
                width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
                relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
                enableRtl: this.enableRtl, zIndex: this.zIndex,
                close: function () {
                    if (_this.popupObj.element.parentElement) {
                        _this.popupObj.unwireScrollEvents();
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(_this.popupObj.element);
                    }
                },
                open: function () {
                    _this.popupObj.resolveCollision();
                    if (!_this.isFirstClick) {
                        var ulElement = _this.list.querySelector('ul');
                        if (ulElement) {
                            if (_this.itemTemplate && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered)) {
                                setTimeout(function () { _this.mainList = _this.ulElement; }, 0);
                            }
                            else if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
                                _this.targetElement().trim() !== '')) {
                                _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
                            }
                        }
                        _this.isFirstClick = true;
                    }
                    _this.popupObj.wireScrollEvents();
                    if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
                        _this.targetElement().trim() !== '')) {
                        _this.loadTemplate();
                    }
                    _this.setScrollPosition();
                    if (_this.allowFiltering) {
                        _this.notify('inputFocus', {
                            module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
                        });
                    }
                }, targetExitViewport: function () {
                    if (!_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
                        _this.hidePopup();
                    }
                }
            });
            if (this.mode === 'CheckBox' && _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && this.allowFiltering) {
                this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
            }
            this.popupObj.close();
            this.popupWrapper.style.visibility = '';
        }
    };
    MultiSelect.prototype.setHeaderTemplate = function () {
        var compiledString;
        if (this.header) {
            this.header.remove();
        }
        this.header = this.createElement('div');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.header], HEADER);
        var headercheck = this.multiCompiler(this.headerTemplate);
        if (headercheck) {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])(this.headerTemplate, document).innerHTML.trim());
        }
        else {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(this.headerTemplate);
        }
        // tslint:disable-next-line
        var elements = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, null, this.header);
        if (elements && elements.length > 0) {
            for (var temp = 0; temp < elements.length; temp++) {
                this.header.appendChild(elements[temp]);
            }
        }
        this.DropDownBaseupdateBlazorTemplates(false, false, false, false, false, true, false);
        if (this.mode === 'CheckBox' && this.showSelectAll) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["prepend"])([this.header], this.popupWrapper);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.header], this.popupWrapper);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.header, 'mousedown', this.onListMouseDown, this);
    };
    MultiSelect.prototype.setFooterTemplate = function () {
        var compiledString;
        if (this.footer) {
            this.footer.remove();
        }
        this.footer = this.createElement('div');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.footer], FOOTER);
        var footercheck = this.multiCompiler(this.footerTemplate);
        if (footercheck) {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["select"])(this.footerTemplate, document).innerHTML.trim());
        }
        else {
            compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(this.footerTemplate);
        }
        // tslint:disable-next-line
        var elements = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, null, this.footer);
        if (elements && elements.length > 0) {
            for (var temp = 0; temp < elements.length; temp++) {
                this.footer.appendChild(elements[temp]);
            }
        }
        this.DropDownBaseupdateBlazorTemplates(false, false, false, false, false, false, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([this.footer], this.popupWrapper);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.footer, 'mousedown', this.onListMouseDown, this);
    };
    MultiSelect.prototype.ClearAll = function (e) {
        if (this.enabled && !this.readonly) {
            var temp = void 0;
            if (this.value && this.value.length > 0) {
                var liElement = this.list && this.list.querySelectorAll('li.e-list-item');
                if (liElement && liElement.length > 0) {
                    this.selectAllItems(false, e);
                }
                else {
                    this.removeIndex = 0;
                    for (temp = this.value[this.removeIndex]; this.removeIndex < this.value.length; temp = this.value[this.removeIndex]) {
                        this.removeValue(temp, e, null, true);
                        if (this.value === null && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) {
                            break;
                        }
                    }
                }
            }
            else {
                this.clearAllCallback(e);
            }
        }
    };
    MultiSelect.prototype.clearAllCallback = function (e, isClearAll) {
        var tempValues = this.value ? this.value.slice() : [];
        if (this.mainList && this.listData && ((this.allowFiltering && this.mode !== 'CheckBox') || this.allowCustomValue)) {
            var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
            this.onActionComplete(list, this.mainData);
        }
        this.focusAtFirstListItem();
        this.updateDelimeter(this.delimiterChar, e);
        if (this.mode !== 'Box' && (!this.inputFocus || this.mode === 'CheckBox')) {
            this.updateDelimView();
        }
        if (this.inputElement.value !== '') {
            this.makeTextBoxEmpty();
            this.search(null);
        }
        this.checkPlaceholderSize();
        if (this.isPopupOpen()) {
            this.refreshPopup();
        }
        if (!this.inputFocus) {
            if (this.changeOnBlur) {
                this.updateValueState(e, this.value, tempValues);
            }
            if (this.mode !== 'CheckBox') {
                this.inputElement.focus();
            }
        }
        if (this.mode === 'CheckBox') {
            this.refreshPlaceHolder();
            this.refreshInputHight();
            if (this.changeOnBlur && isClearAll && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0)) {
                this.updateValueState(e, this.value, this.tempValues);
            }
        }
        if (!this.changeOnBlur && isClearAll && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0)) {
            this.updateValueState(e, this.value, this.tempValues);
        }
        if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            this.updateListItems(this.list.querySelectorAll('li.e-list-item'), this.mainList.querySelectorAll('li.e-list-item'));
        }
        e.preventDefault();
    };
    MultiSelect.prototype.windowResize = function () {
        this.refreshPopup();
        if ((!this.inputFocus || this.mode === 'CheckBox') && this.viewWrapper && this.viewWrapper.parentElement) {
            this.updateDelimView();
        }
    };
    MultiSelect.prototype.resetValueHandler = function (e) {
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputElement, 'form');
        if (formElement && e.target === formElement) {
            var textVal = (this.element.tagName === this.getNgDirective()) ? null : this.element.getAttribute('data-initial-value');
            this.text = textVal;
        }
    };
    MultiSelect.prototype.wireEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.componentWrapper, 'mousedown', this.wrapperClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(window, 'resize', this.windowResize, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'focus', this.focusInHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'keydown', this.onKeyDown, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'keyup', this.KeyUp, this);
        if (this.mode !== 'CheckBox') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'input', this.onInput, this);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'blur', this.onBlur, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.componentWrapper, 'mousemove', this.mouseIn, this);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputElement, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(formElement, 'reset', this.resetValueHandler, this);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.componentWrapper, 'mouseout', this.mouseOut, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.overAllClear, 'mouseup', this.ClearAll, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.inputElement, 'paste', this.pasteHandler, this);
    };
    MultiSelect.prototype.onInput = function (e) {
        if (this.keyDownStatus) {
            this.isValidKey = true;
        }
        else {
            this.isValidKey = false;
        }
        this.keyDownStatus = false;
        // For Filtering works in mobile firefox
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].info.name === 'mozilla') {
            this.search(e);
        }
    };
    MultiSelect.prototype.pasteHandler = function (event) {
        var _this = this;
        setTimeout(function () {
            _this.search(event);
        });
    };
    MultiSelect.prototype.search = function (e) {
        var _this = this;
        if (!this.isPopupOpen() && this.openOnClick) {
            this.showPopup();
        }
        this.openClick(e);
        if (this.checkTextLength() && !this.allowFiltering && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e) && (e.keyCode !== 8)) {
            this.focusAtFirstListItem();
        }
        else {
            var text = this.targetElement();
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(e)) {
                this.keyCode = e.keyCode;
            }
            if (this.allowFiltering) {
                var eventArgs_1 = {
                    preventDefaultAction: false,
                    text: this.targetElement(),
                    updateData: function (dataSource, query, fields) {
                        if (eventArgs_1.cancel) {
                            return;
                        }
                        _this.isFiltered = true;
                        _this.remoteFilterAction = true;
                        _this.dataUpdater(dataSource, query, fields);
                    },
                    event: e,
                    cancel: false
                };
                this.trigger('filtering', eventArgs_1, function (eventArgs) {
                    if (!eventArgs.cancel) {
                        if (!_this.isFiltered && !eventArgs.preventDefaultAction) {
                            _this.filterAction = true;
                            _this.dataUpdater(_this.dataSource, null, _this.fields);
                        }
                    }
                });
            }
            else if (this.allowCustomValue) {
                var query = new _ej2_data__WEBPACK_IMPORTED_MODULE_4__["Query"]();
                query = (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
                this.dataUpdater(this.mainData, query, this.fields);
            }
            else {
                var liCollections = void 0;
                liCollections = this.list.querySelectorAll('li.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + ':not(.e-hide-listitem)');
                var activeElement = Object(_common_incremental_search__WEBPACK_IMPORTED_MODULE_3__["Search"])(this.targetElement(), liCollections, 'StartsWith', this.ignoreCase);
                if (activeElement && activeElement.item !== null) {
                    this.addListFocus(activeElement.item);
                    this.list.scrollTop =
                        activeElement.item.offsetHeight * activeElement.index;
                }
                else if (this.targetElement() !== '') {
                    this.removeFocus();
                }
                else {
                    this.focusAtFirstListItem();
                }
            }
        }
    };
    MultiSelect.prototype.preRender = function () {
        if (this.allowFiltering === null) {
            this.allowFiltering = (this.mode === 'CheckBox') ? true : false;
        }
        this.initializeData();
        this.updateDataAttribute(this.htmlAttributes);
        _super.prototype.preRender.call(this);
    };
    MultiSelect.prototype.getLocaleName = function () {
        return 'multi-select';
    };
    ;
    MultiSelect.prototype.initializeData = function () {
        this.mainListCollection = [];
        this.beforePopupOpen = false;
        this.filterAction = false;
        this.remoteFilterAction = false;
        this.isFirstClick = false;
        this.mobFilter = true;
        this.isFiltered = false;
        this.focused = true;
        this.initial = true;
        this.backCommand = true;
    };
    MultiSelect.prototype.updateData = function (delimiterChar, e) {
        var data = '';
        var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
        var text = [];
        var temp;
        var tempData = this.listData;
        this.listData = this.mainData;
        this.hiddenElement.innerHTML = '';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
            for (var index = 0; !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value[index]); index++) {
                var listValue = this.findListElement(((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
                if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(listValue) && !this.allowCustomValue) {
                    this.value.splice(index, 1);
                    index -= 1;
                }
                else {
                    if (this.listData) {
                        temp = this.getTextByValue(this.value[index]);
                    }
                    else {
                        temp = this.value[index];
                    }
                    data += temp + delimiterChar + ' ';
                    text.push(temp);
                }
                this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
            }
        }
        this.setProperties({ text: text.toString() }, true);
        if (delim) {
            this.updateWrapperText(this.delimiterWrapper, data);
            this.delimiterWrapper.setAttribute('id', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getUniqueID"])('delim_val'));
            this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
        }
        var targetEle = e && e.target;
        var isClearAll = (targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;
        if (!this.changeOnBlur && ((e && !isClearAll)) || this.isSelectAll) {
            this.isSelectAll = false;
            this.updateValueState(e, this.value, this.tempValues);
        }
        this.listData = tempData;
        this.addValidInputClass();
    };
    MultiSelect.prototype.initialTextUpdate = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text)) {
            var textArr = this.text.split(this.delimiterChar);
            var textVal = [];
            for (var index = 0; textArr.length > index; index++) {
                var val = this.getValueByText(textArr[index]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(val)) {
                    textVal.push(val);
                }
                else if (this.allowCustomValue) {
                    textVal.push(textArr[index]);
                }
            }
            if (textVal && textVal.length) {
                this.setProperties({ value: textVal }, true);
            }
        }
        else {
            this.setProperties({ value: null }, true);
        }
    };
    MultiSelect.prototype.renderList = function (isEmptyData) {
        if (!isEmptyData && this.allowCustomValue && this.list && (this.list.textContent === this.noRecordsTemplate
            || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
            isEmptyData = true;
        }
        _super.prototype.render.call(this, isEmptyData);
        this.unwireListEvents();
        this.wireListEvents();
    };
    MultiSelect.prototype.initialValueUpdate = function () {
        if (this.list) {
            var text = void 0;
            var textField = void 0;
            var valueField = void 0;
            var element = void 0;
            var value = void 0;
            if (this.chipCollectionWrapper) {
                this.chipCollectionWrapper.innerHTML = '';
            }
            this.removeListSelection();
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
                for (var index = 0; !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value[index]); index++) {
                    value = this.value[index];
                    element = this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
                    text = this.getTextByValue(value);
                    if ((element && (element.getAttribute('aria-selected') !== 'true')) ||
                        (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
                            (this.mode === 'Box' || this.mode === 'Default'))) {
                        this.addChip(text, value);
                        this.addListSelection(element);
                    }
                    else if (value && this.allowCustomValue) {
                        var indexItem = this.listData.length;
                        var newValue = {};
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])(this.fields.text, value, newValue);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["setValue"])(this.fields.value, value, newValue);
                        var noDataEle = this.popupWrapper.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].noData);
                        this.addItem(newValue, indexItem);
                        if (this.popupWrapper.contains(noDataEle)) {
                            this.list.setAttribute('style', noDataEle.getAttribute('style'));
                            this.popupWrapper.replaceChild(this.list, noDataEle);
                            this.wireListEvents();
                        }
                        this.addChip(text, value);
                        this.addListSelection(element);
                    }
                }
            }
            if (this.mode === 'CheckBox') {
                this.updateDelimView();
                if (this.changeOnBlur) {
                    this.updateValueState(null, this.value, this.tempValues);
                }
                this.updateDelimeter(this.delimiterChar);
                this.refreshInputHight();
            }
            else {
                this.updateDelimeter(this.delimiterChar);
            }
            if (this.mode === 'CheckBox' && this.showSelectAll && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || !this.value.length)) {
                this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
            }
            if (this.mode === 'Box' || (this.mode === 'Default' && this.inputFocus)) {
                this.chipCollectionWrapper.style.display = '';
            }
            else if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
                this.showDelimWrapper();
            }
        }
    };
    MultiSelect.prototype.updateActionCompleteData = function (li, item) {
        if (this.value && this.value.indexOf(li.getAttribute('data-value')) > -1) {
            this.mainList = this.ulElement;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([li], HIDE_LIST);
        }
    };
    MultiSelect.prototype.updateAddItemList = function (list, itemCount) {
        if (this.popupObj && this.popupObj.element && this.popupObj.element.querySelector('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].noData) && list) {
            this.list = list;
            this.mainList = this.ulElement = list.querySelector('ul');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(this.popupWrapper.querySelector('.e-content'));
            this.popupObj = null;
            this.renderPopup();
        }
    };
    MultiSelect.prototype.updateDataList = function () {
        if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
            this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
        }
    };
    MultiSelect.prototype.isValidLI = function (li) {
        return (li && !li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].disabled) && !li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group) &&
            li.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li));
    };
    ;
    MultiSelect.prototype.updateListSelection = function (li, e, length) {
        var customVal = li.getAttribute('data-value');
        var value = this.getFormattedValue(customVal);
        if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(value) && value.toString() === 'NaN'))) {
            value = customVal;
        }
        this.removeHover();
        if (!this.value || this.value.indexOf(value) === -1) {
            this.dispatchSelect(value, e, li, (li.getAttribute('aria-selected') === 'true'), length);
        }
        else {
            this.removeValue(value, e, length);
        }
    };
    MultiSelect.prototype.updateListSelectEventCallback = function (value, li, e) {
        var _this = this;
        var text = this.getTextByValue(value);
        if ((this.allowCustomValue || this.allowFiltering) && !this.findListElement(this.mainList, 'li', 'data-value', value)) {
            var temp_1 = li.cloneNode(true);
            var fieldValue = this.fields.value ? this.fields.value : 'value';
            if (this.allowCustomValue && this.mainData.length && typeof Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getValue"])(fieldValue, this.mainData[0]) === 'number') {
                value = !isNaN(parseFloat(value.toString())) ? parseFloat(value.toString()) : value;
            }
            var data_1 = this.getDataByValue(value);
            var eventArgs = {
                newData: data_1,
                cancel: false
            };
            this.trigger('customValueSelection', eventArgs, function (eventArgs) {
                if (!eventArgs.cancel) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["append"])([temp_1], _this.mainList);
                    _this.mainData.push(data_1);
                    _this.remoteCustomValue = false;
                    _this.addValue(value, text, e);
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered) {
                        _this.checkPlaceholderSize();
                        _this.makeTextBoxEmpty();
                    }
                }
            });
        }
        else {
            this.remoteCustomValue = false;
            this.addValue(value, text, e);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered && this.value && this.list &&
            (this.value.length === this.list.querySelectorAll('li.e-list-item').length ||
                this.value.length === this.maximumSelectionLength)) {
            this.updatedataValueItems(e);
            this.checkPlaceholderSize();
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered) {
            this.checkPlaceholderSize();
            this.makeTextBoxEmpty();
        }
    };
    MultiSelect.prototype.removeListSelection = function () {
        var className = this.hideSelectedItem ?
            HIDE_LIST :
            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected;
        var selectedItems = this.list.querySelectorAll('.' + className);
        var temp = selectedItems.length;
        if (selectedItems && selectedItems.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(selectedItems, className);
            while (temp > 0) {
                selectedItems[temp - 1].setAttribute('aria-selected', 'false');
                temp--;
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.mainList)) {
            var selectItems = this.mainList.querySelectorAll('.' + className);
            var temp1 = selectItems.length;
            if (selectItems && selectItems.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(selectItems, className);
                while (temp1 > 0) {
                    selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
                    if (this.mode === 'CheckBox') {
                        if (selectedItems && (selectedItems.length > (temp1 - 1))) {
                            selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
                        }
                        selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
                    }
                    temp1--;
                }
            }
        }
    };
    ;
    MultiSelect.prototype.removeHover = function () {
        var hoveredItem = this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].hover);
        if (hoveredItem && hoveredItem.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(hoveredItem, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].hover);
        }
    };
    ;
    MultiSelect.prototype.removeFocus = function () {
        if (this.list && this.mainList) {
            var hoveredItem = this.list.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            var mainlist = this.mainList.querySelectorAll('.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            if (hoveredItem && hoveredItem.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(hoveredItem, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(mainlist, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            }
        }
    };
    ;
    MultiSelect.prototype.addListHover = function (li) {
        if (this.enabled && this.isValidLI(li)) {
            this.removeHover();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([li], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].hover);
        }
        else {
            if ((li !== null && li.classList.contains('e-list-group-item')) && this.enableGroupCheckBox && this.mode === 'CheckBox'
                && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
                this.removeHover();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([li], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].hover);
            }
        }
    };
    ;
    MultiSelect.prototype.addListFocus = function (element) {
        if (this.enabled && this.isValidLI(element)) {
            this.removeFocus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
        }
        else {
            if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element], _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].focus);
            }
        }
    };
    MultiSelect.prototype.addListSelection = function (element) {
        var className = this.hideSelectedItem ?
            HIDE_LIST :
            _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].selected;
        if (this.isValidLI(element) && !element.classList.contains(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].hover)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([element], className);
            this.updateMainList(false, element.getAttribute('data-value'));
            element.setAttribute('aria-selected', 'true');
            if (this.mode === 'CheckBox') {
                var ariaCheck = element.firstElementChild.getAttribute('aria-checked');
                if (ariaCheck === 'false' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(ariaCheck)) {
                    this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
                }
            }
            this.notify('activeList', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
            if (this.chipCollectionWrapper) {
                this.removeChipSelection();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(this.inputElement, { 'aria-activedescendant': element.id });
        }
    };
    MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
        this.updateData(delimChar, e);
    };
    MultiSelect.prototype.onMouseClick = function (e) {
        var _this = this;
        this.scrollFocusStatus = false;
        var target = e.target;
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li);
        var headerLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group);
        if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
            target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
                : e.target;
            if (target.classList.contains('e-check')) {
                this.selectAllItem(false, e);
                target.classList.remove('e-check');
                target.classList.remove('e-stop');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + 'e-list-group-item').classList.remove('e-active');
                target.setAttribute('aria-selected', 'false');
            }
            else {
                this.selectAllItem(true, e);
                target.classList.remove('e-stop');
                target.classList.add('e-check');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '.' + 'e-list-group-item').classList.add('e-active');
                target.setAttribute('aria-selected', 'true');
            }
            this.refreshSelection();
            this.checkSelectAll();
        }
        else {
            if (this.isValidLI(li)) {
                var limit = this.value && this.value.length ? this.value.length : 0;
                if (li.classList.contains('e-active')) {
                    limit = limit - 1;
                }
                if (limit < this.maximumSelectionLength) {
                    this.updateListSelection(li, e);
                    this.checkPlaceholderSize();
                    this.addListFocus(li);
                    if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
                        if (this.mode !== 'CheckBox') {
                            this.focusAtLastListItem(li.getAttribute('data-value'));
                            this.refreshSelection();
                        }
                    }
                    else {
                        this.makeTextBoxEmpty();
                    }
                }
                if (this.mode === 'CheckBox') {
                    this.updateDelimView();
                    if (this.value && this.value.length > 50) {
                        setTimeout(function () {
                            _this.updateDelimeter(_this.delimiterChar, e);
                        }, 0);
                    }
                    else {
                        this.updateDelimeter(this.delimiterChar, e);
                    }
                    this.refreshInputHight();
                }
                else {
                    this.updateDelimeter(this.delimiterChar, e);
                }
                this.checkSelectAll();
                this.refreshPopup();
                if (this.hideSelectedItem) {
                    this.focusAtFirstListItem();
                }
                if (this.closePopupOnSelect) {
                    this.hidePopup();
                }
                else {
                    e.preventDefault();
                }
                this.makeTextBoxEmpty();
                this.findGroupStart(target);
            }
            else {
                e.preventDefault();
            }
            if (this.mode !== 'CheckBox') {
                this.refreshListItems(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(li) ? null : li.textContent);
            }
            this.refreshPlaceHolder();
            this.deselectHeader();
        }
    };
    MultiSelect.prototype.findGroupStart = function (target) {
        if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            var count = 0;
            var liChecked = 0;
            var liUnchecked = 0;
            var groupValues = void 0;
            if (this.itemTemplate && !target.getElementsByClassName('e-frame').length) {
                while (!target.getElementsByClassName('e-frame').length) {
                    target = target.parentElement;
                }
            }
            if (target.classList.contains('e-frame')) {
                target = target.parentElement.parentElement;
            }
            groupValues = this.findGroupAttrtibutes(target, liChecked, liUnchecked, count, 0);
            groupValues = this.findGroupAttrtibutes(target, groupValues[0], groupValues[1], groupValues[2], 1);
            while (!target.classList.contains('e-list-group-item')) {
                if (target.classList.contains('e-list-icon')) {
                    target = target.parentElement;
                }
                target = target.previousElementSibling;
                if (target == null) {
                    break;
                }
            }
            this.updateCheckBox(target, groupValues[0], groupValues[1], groupValues[2]);
        }
    };
    MultiSelect.prototype.findGroupAttrtibutes = function (listElement, checked, unChecked, count, position) {
        while (!listElement.classList.contains('e-list-group-item')) {
            if (listElement.classList.contains('e-list-icon')) {
                listElement = listElement.parentElement;
            }
            if (listElement.getElementsByClassName('e-frame')[0].classList.contains('e-check') &&
                listElement.classList.contains('e-list-item')) {
                checked++;
            }
            else if (listElement.classList.contains('e-list-item')) {
                unChecked++;
            }
            count++;
            listElement = position ? listElement.nextElementSibling : listElement.previousElementSibling;
            if (listElement == null) {
                break;
            }
        }
        return [checked, unChecked, count];
    };
    MultiSelect.prototype.updateCheckBox = function (groupHeader, checked, unChecked, count) {
        if (groupHeader === null) {
            return;
        }
        var checkBoxElement = groupHeader.getElementsByClassName('e-frame')[0];
        if (count === checked) {
            checkBoxElement.classList.remove('e-stop');
            checkBoxElement.classList.add('e-check');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');
            groupHeader.setAttribute('aria-selected', 'true');
        }
        else if (count === unChecked) {
            checkBoxElement.classList.remove('e-check');
            checkBoxElement.classList.remove('e-stop');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(checkBoxElement, '.' + 'e-list-group-item').classList.remove('e-active');
            groupHeader.setAttribute('aria-selected', 'false');
        }
        else if (this.maximumSelectionLength === checked - 1) {
            checkBoxElement.classList.remove('e-stop');
            groupHeader.setAttribute('aria-selected', 'true');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');
            checkBoxElement.classList.add('e-check');
        }
        else {
            checkBoxElement.classList.remove('e-check');
            checkBoxElement.classList.add('e-stop');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(checkBoxElement, '.' + 'e-list-group-item').classList.add('e-active');
            groupHeader.setAttribute('aria-selected', 'false');
        }
    };
    MultiSelect.prototype.deselectHeader = function () {
        var limit = this.value && this.value.length ? this.value.length : 0;
        var collection = this.list.querySelectorAll('li.e-list-group-item:not(.e-active)');
        if (limit < this.maximumSelectionLength) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])(collection, 'e-disable');
        }
        if (limit === this.maximumSelectionLength) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])(collection, 'e-disable');
        }
    };
    MultiSelect.prototype.onMouseOver = function (e) {
        var currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li);
        if (currentLi === null && this.mode === 'CheckBox' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)
            && this.enableGroupCheckBox) {
            currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(e.target, '.' + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].group);
        }
        this.addListHover(currentLi);
    };
    MultiSelect.prototype.onMouseLeave = function (e) {
        this.removeHover();
    };
    MultiSelect.prototype.onListMouseDown = function (e) {
        e.preventDefault();
        this.scrollFocusStatus = true;
    };
    MultiSelect.prototype.onDocumentClick = function (e) {
        if (this.mode !== 'CheckBox') {
            var target = e.target;
            if (!(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.popupObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(target, '[id="' + this.popupObj.element.id + '"]')) &&
                !this.overAllWrapper.contains(e.target)) {
                this.scrollFocusStatus = false;
            }
            else {
                this.scrollFocusStatus = (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isIE || _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].info.name === 'edge') && (document.activeElement === this.inputElement);
            }
        }
    };
    MultiSelect.prototype.wireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(document, 'mousedown', this.onDocumentClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'mousedown', this.onListMouseDown, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'mouseup', this.onMouseClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'mouseover', this.onMouseOver, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].add(this.list, 'mouseout', this.onMouseLeave, this);
    };
    ;
    MultiSelect.prototype.unwireListEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(document, 'mousedown', this.onDocumentClick);
        if (this.list) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'mousedown', this.onListMouseDown);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'mouseup', this.onMouseClick);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'mouseover', this.onMouseOver);
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.list, 'mouseout', this.onMouseLeave);
        }
    };
    ;
    MultiSelect.prototype.hideOverAllClear = function () {
        if (!this.value || !this.value.length || this.inputElement.value === '') {
            this.overAllClear.style.display = 'none';
        }
    };
    MultiSelect.prototype.showOverAllClear = function () {
        if (((this.value && this.value.length) || this.inputElement.value !== '') && this.showClearButton && this.readonly !== true) {
            this.overAllClear.style.display = '';
        }
        else {
            this.overAllClear.style.display = 'none';
        }
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    MultiSelect.prototype.focusIn = function () {
        if (document.activeElement !== this.inputElement && this.enabled) {
            this.inputElement.focus();
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    MultiSelect.prototype.focusOut = function () {
        if (document.activeElement === this.inputElement && this.enabled) {
            this.inputElement.blur();
        }
    };
    /**
     * Shows the spinner loader.
     * @returns void.
     */
    MultiSelect.prototype.showSpinner = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.spinnerElement)) {
            if (this.overAllClear.style.display !== 'none') {
                this.spinnerElement = this.overAllClear;
            }
            else {
                this.spinnerElement = this.createElement('span', { className: CLOSEICON_CLASS + ' ' + SPINNER_CLASS });
                this.componentWrapper.appendChild(this.spinnerElement);
            }
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({ target: this.spinnerElement, width: _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice ? '16px' : '14px' }, this.createElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.spinnerElement], DISABLE_ICON);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(this.spinnerElement);
        }
    };
    /**
     * Hides the spinner loader.
     * @returns void.
     */
    MultiSelect.prototype.hideSpinner = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.spinnerElement)) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(this.spinnerElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.spinnerElement], DISABLE_ICON);
            if (this.spinnerElement.classList.contains(SPINNER_CLASS)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["detach"])(this.spinnerElement);
            }
            else {
                this.spinnerElement.innerHTML = '';
            }
            this.spinnerElement = null;
        }
    };
    MultiSelect.prototype.updateWrapperText = function (wrapperType, wrapperData) {
        if (this.valueTemplate || !this.enableHtmlSanitizer) {
            wrapperType.innerHTML = wrapperData;
        }
        else {
            wrapperType.innerText = _ej2_base__WEBPACK_IMPORTED_MODULE_2__["SanitizeHtmlHelper"].sanitize(wrapperData);
        }
    };
    MultiSelect.prototype.updateDelimView = function () {
        if (this.delimiterWrapper) {
            this.hideDelimWrapper();
        }
        if (this.chipCollectionWrapper) {
            this.chipCollectionWrapper.style.display = 'none';
        }
        this.viewWrapper.style.display = '';
        this.viewWrapper.style.width = '';
        this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
        if (this.value && this.value.length) {
            var data = '';
            var temp = void 0;
            var tempData = void 0;
            var tempIndex = 1;
            var wrapperleng = void 0;
            var remaining = void 0;
            var downIconWidth = 0;
            var overAllContainer = void 0;
            this.updateWrapperText(this.viewWrapper, data);
            var l10nLocale = {
                noRecordsTemplate: 'No records found',
                actionFailureTemplate: 'Request failed',
                overflowCountTemplate: '+${count} more..',
                totalCountTemplate: '${count} selected'
            };
            var l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"](this.getLocaleName(), l10nLocale, this.locale);
            if (l10n.getConstant('actionFailureTemplate') === '') {
                l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"]('dropdowns', l10nLocale, this.locale);
            }
            if (l10n.getConstant('noRecordsTemplate') === '') {
                l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["L10n"]('dropdowns', l10nLocale, this.locale);
            }
            var remainContent = l10n.getConstant('overflowCountTemplate');
            var raminElement = this.createElement('span', {
                className: REMAIN_WRAPPER
            });
            var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(remainContent);
            var totalCompiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["compile"])(l10n.getConstant('totalCountTemplate'));
            // tslint:disable-next-line
            var remainCompildTemp = compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
            if (remainCompildTemp && remainCompildTemp.length > 0) {
                raminElement.appendChild(remainCompildTemp[0]);
            }
            this.viewWrapper.appendChild(raminElement);
            this.renderReactTemplates();
            var remainSize = raminElement.offsetWidth;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(raminElement);
            if (this.showDropDownIcon) {
                downIconWidth = this.dropIcon.offsetWidth + parseInt(window.getComputedStyle(this.dropIcon).marginRight, 10);
            }
            this.checkClearIconWidth();
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value)) {
                for (var index = 0; !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value[index]); index++) {
                    data += (index === 0) ? '' : this.delimiterChar + ' ';
                    temp = this.getOverflowVal(index);
                    data += temp;
                    temp = this.viewWrapper.innerHTML;
                    this.updateWrapperText(this.viewWrapper, data);
                    wrapperleng = this.viewWrapper.offsetWidth +
                        parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
                    overAllContainer = this.componentWrapper.offsetWidth -
                        parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
                        parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
                    if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
                        if (tempData !== undefined && tempData !== '') {
                            temp = tempData;
                            index = tempIndex + 1;
                        }
                        this.updateWrapperText(this.viewWrapper, temp);
                        remaining = this.value.length - index;
                        wrapperleng = this.viewWrapper.offsetWidth +
                            parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
                        while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
                            && this.viewWrapper.innerHTML !== '') {
                            var textArr = this.viewWrapper.innerHTML.split(this.delimiterChar);
                            textArr.pop();
                            this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
                            remaining++;
                            wrapperleng = this.viewWrapper.offsetWidth +
                                parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
                        }
                        break;
                    }
                    else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
                        tempData = data;
                        tempIndex = index;
                    }
                    else if (index === 0) {
                        tempData = '';
                        tempIndex = -1;
                    }
                }
            }
            if (remaining > 0) {
                var totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;
                this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth));
                this.updateRemainWidth(this.viewWrapper, totalWidth);
                this.updateRemainingText(raminElement, downIconWidth, remaining, compiledString, totalCompiledString);
            }
        }
        else {
            this.viewWrapper.innerHTML = '';
            this.viewWrapper.style.display = 'none';
        }
    };
    MultiSelect.prototype.checkClearIconWidth = function () {
        if (this.showClearButton) {
            this.clearIconWidth = this.overAllClear.offsetWidth;
        }
    };
    MultiSelect.prototype.updateRemainWidth = function (viewWrapper, totalWidth) {
        if (viewWrapper.classList.contains(TOTAL_COUNT_WRAPPER) && totalWidth < (viewWrapper.offsetWidth +
            parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10)
            + parseInt(window.getComputedStyle(viewWrapper).paddingLeft, 10))) {
            viewWrapper.style.width = totalWidth + 'px';
        }
    };
    MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining, compiledString, totalCompiledString, totalWidth) {
        if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {
            viewWrapper.removeChild(viewWrapper.firstChild);
        }
        raminElement.innerHTML = '';
        // tslint:disable-next-line
        var remainTemp = compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
        // tslint:disable-next-line
        var totalTemp = totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate, null, raminElement);
        raminElement.appendChild((viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ?
            remainTemp && remainTemp[0] : totalTemp && totalTemp[0]);
        if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
            viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
        }
        else {
            viewWrapper.classList.add(TOTAL_COUNT_WRAPPER);
            this.updateRemainWidth(viewWrapper, totalWidth);
        }
        return raminElement;
    };
    MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining, compiledString, totalCompiledString) {
        var overAllContainer = this.componentWrapper.offsetWidth -
            parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
            parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
        var wrapperleng = this.viewWrapper.offsetWidth + parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
        if (((wrapperleng + downIconWidth) >= overAllContainer) && wrapperleng !== 0 && this.viewWrapper.firstChild &&
            this.viewWrapper.firstChild.nodeType === 3) {
            while (((wrapperleng + downIconWidth) > overAllContainer) && wrapperleng !== 0 && this.viewWrapper.firstChild &&
                this.viewWrapper.firstChild.nodeType === 3) {
                var textArr = this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);
                textArr.pop();
                this.viewWrapper.firstChild.nodeValue = textArr.join(this.delimiterChar);
                if (this.viewWrapper.firstChild.nodeValue === '') {
                    this.viewWrapper.removeChild(this.viewWrapper.firstChild);
                }
                remaining++;
                wrapperleng = this.viewWrapper.offsetWidth;
            }
            var totalWidth = overAllContainer - downIconWidth;
            this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, compiledString, totalCompiledString, totalWidth);
        }
    };
    MultiSelect.prototype.getOverflowVal = function (index) {
        var temp;
        if (this.mainData && this.mainData.length) {
            if (this.mode === 'CheckBox') {
                var newTemp = this.listData;
                this.listData = this.mainData;
                temp = this.getTextByValue(this.value[index]);
                this.listData = newTemp;
            }
            else {
                temp = this.getTextByValue(this.value[index]);
            }
        }
        else {
            temp = this.value[index];
        }
        return temp;
    };
    MultiSelect.prototype.unWireEvent = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.componentWrapper, 'mousedown', this.wrapperClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(window, 'resize', this.windowResize);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'focus', this.focusInHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'keydown', this.onKeyDown);
        if (this.mode !== 'CheckBox') {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'input', this.onInput);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'keyup', this.KeyUp);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(this.inputElement, 'form');
        if (formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(formElement, 'reset', this.resetValueHandler);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'blur', this.onBlur);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.componentWrapper, 'mousemove', this.mouseIn);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.componentWrapper, 'mouseout', this.mouseOut);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.overAllClear, 'mousedown', this.ClearAll);
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(this.inputElement, 'paste', this.pasteHandler);
    };
    MultiSelect.prototype.selectAllItem = function (state, event, list) {
        var li;
        li = this.list.querySelectorAll(state ?
            'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
            'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
        if (this.value && this.value.length && this.isPopupOpen() && event && event.target
            && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(event.target, '.e-close-hooker') && this.allowFiltering) {
            li = this.mainList.querySelectorAll(state ?
                'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
                'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
        }
        if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.fields.groupBy)) {
            var target = (event ? event.target : null);
            target = (event && event.keyCode === 32) ? list : target;
            target = (target && target.classList.contains('e-frame')) ? target.parentElement.parentElement : target;
            if (target && target.classList.contains('e-list-group-item')) {
                var listElement = target.nextElementSibling;
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(listElement)) {
                    return;
                }
                while (listElement.classList.contains('e-list-item')) {
                    if (state) {
                        if (!listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
                            var selectionLimit = this.value && this.value.length ? this.value.length : 0;
                            if (listElement.classList.contains('e-active')) {
                                selectionLimit -= 1;
                            }
                            if (selectionLimit < this.maximumSelectionLength) {
                                this.updateListSelection(listElement, event);
                            }
                        }
                    }
                    else {
                        if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
                            this.updateListSelection(listElement, event);
                        }
                    }
                    listElement = listElement.nextElementSibling;
                    if (listElement == null) {
                        break;
                    }
                }
                if (target.classList.contains('e-list-group-item')) {
                    var focusedElement = this.list.getElementsByClassName('e-item-focus')[0];
                    if (focusedElement) {
                        focusedElement.classList.remove('e-item-focus');
                    }
                    state ? target.classList.add('e-active') : target.classList.remove('e-active');
                    target.classList.add('e-item-focus');
                }
                this.textboxValueUpdate();
                this.checkPlaceholderSize();
                if (!this.changeOnBlur && event) {
                    this.updateValueState(event, this.value, this.tempValues);
                }
            }
            else {
                this.updateValue(event, li, state);
            }
        }
        else {
            this.updateValue(event, li, state);
        }
    };
    MultiSelect.prototype.updateValue = function (event, li, state) {
        var _this = this;
        var length = li.length;
        var hiddenValue = '';
        if (li && li.length) {
            var index_1 = 0;
            var count_1 = 0;
            if (this.enableGroupCheckBox) {
                count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : li.length;
            }
            else {
                count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : this.maximumSelectionLength;
            }
            while (index_1 < length && index_1 <= 50 && index_1 < count_1) {
                this.updateListSelection(li[index_1], event, length - index_1);
                if (this.enableGroupCheckBox) {
                    this.findGroupStart(li[index_1]);
                }
                if (state) {
                    hiddenValue += '<option selected value ="' + this.value[index_1] + '">' + index_1 + '</option>';
                }
                index_1++;
            }
            this.hiddenElement.innerHTML = hiddenValue;
            if (length > 50) {
                setTimeout(function () {
                    hiddenValue = '';
                    while (index_1 < length && index_1 < count_1) {
                        _this.updateListSelection(li[index_1], event, length - index_1);
                        if (_this.enableGroupCheckBox) {
                            _this.findGroupStart(li[index_1]);
                        }
                        if (state) {
                            hiddenValue += '<option selected value ="' + _this.value[index_1] + '">' + index_1 + '</option>';
                        }
                        index_1++;
                    }
                    if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered)) {
                        _this.hiddenElement.innerHTML += hiddenValue;
                        _this.updatedataValueItems(event);
                        if (!_this.changeOnBlur) {
                            _this.updateValueState(event, _this.value, _this.tempValues);
                            _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
                        }
                    }
                }, 0);
            }
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered)) {
            this.updatedataValueItems(event);
            this.checkPlaceholderSize();
            if (length <= 50) {
                if (!this.changeOnBlur) {
                    this.updateValueState(event, this.value, this.tempValues);
                    this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
                }
            }
        }
    };
    MultiSelect.prototype.updatedataValueItems = function (event) {
        this.deselectHeader();
        this.textboxValueUpdate(event);
    };
    MultiSelect.prototype.textboxValueUpdate = function (event) {
        var isRemoveAll = event && event.target && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(event.target, '.e-selectall-parent')
            || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["closest"])(event.target, '.e-close-hooker'));
        if (this.mode !== 'Box' && !this.isPopupOpen() && !(this.mode === 'CheckBox' && (this.isSelectAll || isRemoveAll))) {
            this.updateDelimView();
        }
        else {
            this.searchWrapper.classList.remove(ZERO_SIZE);
        }
        if (this.mode === 'CheckBox') {
            this.updateDelimView();
            if (!(isRemoveAll || this.isSelectAll)) {
                this.updateDelimeter(this.delimiterChar, event);
            }
            this.refreshInputHight();
        }
        else {
            this.updateDelimeter(this.delimiterChar, event);
        }
        this.refreshPlaceHolder();
    };
    MultiSelect.prototype.setZIndex = function () {
        if (this.popupObj) {
            this.popupObj.setProperties({ 'zIndex': this.zIndex });
        }
    };
    MultiSelect.prototype.updateDataSource = function (prop) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.list)) {
            this.renderPopup();
        }
        else {
            this.resetList(this.dataSource);
        }
        if (this.value && this.value.length && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && this.isServerRendered)) {
            this.setProperties({ 'value': this.value });
            this.refreshSelection();
        }
    };
    MultiSelect.prototype.onLoadSelect = function () {
        this.setDynValue = true;
        this.renderPopup();
    };
    MultiSelect.prototype.selectAllItems = function (state, event) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.list)) {
            this.selectAllAction = function () {
                if (_this.mode === 'CheckBox' && _this.showSelectAll) {
                    var args = {
                        module: 'CheckBoxSelection',
                        enable: _this.mode === 'CheckBox',
                        value: state ? 'check' : 'uncheck'
                    };
                    _this.notify('checkSelectAll', args);
                }
                _this.selectAllItem(state, event);
                _this.selectAllAction = null;
            };
            _super.prototype.render.call(this);
        }
        else {
            this.selectAllAction = null;
            if (this.mode === 'CheckBox' && this.showSelectAll) {
                var args = {
                    value: state ? 'check' : 'uncheck',
                    enable: this.mode === 'CheckBox',
                    module: 'CheckBoxSelection'
                };
                this.notify('checkSelectAll', args);
            }
            this.selectAllItem(state, event);
        }
    };
    /**
     * Get the properties to be maintained in the persisted state.
     */
    MultiSelect.prototype.getPersistData = function () {
        return this.addOnPersist(['value']);
    };
    ;
    /**
     * Dynamically change the value of properties.
     * @private
     */
    MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (newProp.dataSource && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object.keys(newProp.dataSource))
            || newProp.query && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(Object.keys(newProp.query))) {
            this.mainList = null;
            this.mainData = null;
            this.isFirstClick = false;
            this.isDynamicDataChange = true;
        }
        if (this.getModuleName() === 'multiselect') {
            this.filterAction = false;
            this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'query':
                case 'dataSource':
                    if (this.mode === 'CheckBox' && this.showSelectAll) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.popupObj)) {
                            this.popupObj.destroy();
                            this.popupObj = null;
                        }
                        this.renderPopup();
                    }
                    break;
                case 'htmlAttributes':
                    this.updateHTMLAttribute();
                    break;
                case 'showClearButton':
                    this.updateClearButton(newProp.showClearButton);
                    break;
                case 'text':
                    this.updateVal(this.value, this.value, 'text');
                    break;
                case 'value':
                    this.updateVal(this.value, oldProp.value, 'value');
                    this.addValidInputClass();
                    if (!this.closePopupOnSelect && this.isPopupOpen()) {
                        this.refreshPopup();
                    }
                    break;
                case 'width':
                    this.setWidth(newProp.width);
                    this.popupObj.setProperties({ width: this.calcPopupWidth() });
                    break;
                case 'placeholder':
                    this.refreshPlaceHolder();
                    break;
                case 'filterBarPlaceholder':
                    if (this.allowFiltering) {
                        this.notify('filterBarPlaceholder', { filterBarPlaceholder: newProp.filterBarPlaceholder });
                    }
                    break;
                case 'delimiterChar':
                    if (this.mode !== 'Box') {
                        this.updateDelimView();
                    }
                    this.updateData(newProp.delimiterChar);
                    break;
                case 'cssClass':
                    this.updateOldPropCssClass(oldProp.cssClass);
                    this.updateCssClass();
                    break;
                case 'enableRtl':
                    this.enableRTL(newProp.enableRtl);
                    _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
                    break;
                case 'readonly':
                    this.updateReadonly(newProp.readonly);
                    this.hidePopup();
                    break;
                case 'enabled':
                    this.hidePopup();
                    this.enable(newProp.enabled);
                    break;
                case 'showSelectAll':
                    if (this.popupObj) {
                        this.popupObj.destroy();
                        this.popupObj = null;
                    }
                    this.renderPopup();
                    break;
                case 'showDropDownIcon':
                    this.dropDownIcon();
                    break;
                case 'floatLabelType':
                    this.setFloatLabelType();
                    this.addValidInputClass();
                    break;
                case 'enableSelectionOrder':
                    break;
                case 'selectAllText':
                    this.notify('selectAllText', false);
                    break;
                case 'popupHeight':
                case 'headerTemplate':
                case 'footerTemplate':
                    this.reInitializePoup();
                    break;
                case 'allowFiltering':
                    if (this.mode === 'CheckBox' && this.popupObj) {
                        this.reInitializePoup();
                    }
                    this.updateSelectElementData(this.allowFiltering);
                    break;
                default:
                    var msProps = void 0;
                    msProps = this.getPropObject(prop, newProp, oldProp);
                    _super.prototype.onPropertyChanged.call(this, msProps.newProperty, msProps.oldProperty);
                    break;
            }
        }
        this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
    };
    MultiSelect.prototype.reInitializePoup = function () {
        if (this.popupObj) {
            this.popupObj.destroy();
            this.popupObj = null;
        }
        this.renderPopup();
    };
    MultiSelect.prototype.updateVal = function (newProp, oldProp, prop) {
        if (!this.list) {
            this.onLoadSelect();
        }
        else if ((this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_4__["DataManager"]) && (!this.listData || !(this.mainList && this.mainData))) {
            this.onLoadSelect();
        }
        else {
            if (prop === 'text') {
                this.initialTextUpdate();
                newProp = this.value;
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0) {
                this.tempValues = oldProp;
            }
            this.initialValueUpdate();
            if (this.mode !== 'Box' && !this.inputFocus) {
                this.updateDelimView();
            }
            if (!this.inputFocus) {
                this.refreshInputHight();
            }
            this.refreshPlaceHolder();
            if (this.mode !== 'CheckBox' && this.changeOnBlur) {
                this.updateValueState(null, newProp, oldProp);
            }
            this.checkPlaceholderSize();
        }
        if (!this.changeOnBlur) {
            this.updateValueState(null, newProp, oldProp);
        }
    };
    /**
     * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
     * but you can insert based on the index parameter.
     * @param  { Object[] } items - Specifies an array of JSON data or a JSON data.
     * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
     * @return {void}.
     */
    MultiSelect.prototype.addItem = function (items, itemIndex) {
        _super.prototype.addItem.call(this, items, itemIndex);
    };
    /**
     * Hides the popup, if the popup in a open state.
     * @returns void
     */
    MultiSelect.prototype.hidePopup = function () {
        var _this = this;
        var delay = 100;
        if (this.isPopupOpen()) {
            var animModel = {
                name: 'FadeOut',
                duration: 100,
                delay: delay ? delay : 0
            };
            var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
            this.trigger('close', eventArgs, function (eventArgs) {
                if (!eventArgs.cancel) {
                    _this.beforePopupOpen = false;
                    _this.overAllWrapper.classList.remove(iconAnimation);
                    _this.popupObj.hide(new _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Animation"](eventArgs.animation));
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["attributes"])(_this.inputElement, { 'aria-expanded': 'false' });
                    if (_this.allowFiltering) {
                        _this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });
                    }
                    _this.popupObj.hide();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([document.body, _this.popupObj.element], 'e-popup-full-page');
                    _ej2_base__WEBPACK_IMPORTED_MODULE_2__["EventHandler"].remove(_this.list, 'keydown', _this.onKeyDown);
                }
            });
        }
    };
    /**
     * Shows the popup, if the popup in a closed state.
     * @returns void
     */
    MultiSelect.prototype.showPopup = function () {
        var _this = this;
        if (!this.enabled) {
            return;
        }
        var args = { cancel: false };
        this.trigger('beforeOpen', args, function (args) {
            if (!args.cancel) {
                if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isBlazor"])() && _this.isServerRendered) && _this.itemTemplate) {
                    _this.DropDownBaseupdateBlazorTemplates(true, false, false, false, false, false, false, false);
                    if (_this.mode !== 'CheckBox' && _this.list) {
                        _this.refreshSelection();
                    }
                }
                if (!_this.ulElement) {
                    _this.beforePopupOpen = true;
                    _super.prototype.render.call(_this);
                    if (_this.mode === 'CheckBox' && _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && _this.allowFiltering) {
                        _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
                    }
                    return;
                }
                if (_this.mode === 'CheckBox' && _ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice && _this.allowFiltering) {
                    _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
                }
                var mainLiLength = _this.ulElement.querySelectorAll('li.' + 'e-list-item').length;
                var liLength = _this.ulElement.querySelectorAll('li.'
                    + _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["dropDownBaseClasses"].li + '.' + HIDE_LIST).length;
                if (mainLiLength > 0 && (mainLiLength === liLength) && (liLength === _this.mainData.length)) {
                    _this.beforePopupOpen = false;
                    return;
                }
                _this.onPopupShown();
            }
        });
    };
    /**
     * Based on the state parameter, entire list item will be selected/deselected.
     * parameter
     * `true`   - Selects entire list items.
     * `false`  - Un Selects entire list items.
     * @returns void
     */
    MultiSelect.prototype.selectAll = function (state) {
        this.isSelectAll = true;
        this.selectAllItems(state);
    };
    MultiSelect.prototype.getModuleName = function () {
        return 'multiselect';
    };
    ;
    /**
     * Allows you to clear the selected values from the Multiselect component.
     * @returns void
     */
    MultiSelect.prototype.clear = function () {
        var _this = this;
        this.selectAll(false);
        if (this.value && this.value.length) {
            setTimeout(function () {
                _this.setProperties({ value: null }, true);
            }, 0);
        }
        else {
            this.setProperties({ value: null }, true);
        }
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    MultiSelect.prototype.render = function () {
        this.setDynValue = this.initStatus = false;
        this.isSelectAll = false;
        this.searchWrapper = this.createElement('span', { className: SEARCHBOX_WRAPPER + ' ' + ((this.mode === 'Box') ? BOX_ELEMENT : '') });
        this.viewWrapper = this.createElement('span', { className: DELIMITER_VIEW + ' ' + DELIMITER_WRAPPER, styles: 'display:none;' });
        this.overAllClear = this.createElement('span', {
            className: CLOSEICON_CLASS, styles: 'display:none;'
        });
        this.componentWrapper = this.createElement('div', { className: ELEMENT_WRAPPER });
        this.overAllWrapper = this.createElement('div', { className: OVER_ALL_WRAPPER });
        if (this.mode === 'CheckBox') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllWrapper], 'e-checkbox');
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
            this.componentWrapper.classList.add(ELEMENT_MOBILE_WRAPPER);
        }
        this.setWidth(this.width);
        this.overAllWrapper.appendChild(this.componentWrapper);
        this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
        if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
            this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
            this.componentWrapper.appendChild(this.delimiterWrapper);
        }
        else {
            this.chipCollectionWrapper = this.createElement('span', {
                className: CHIP_WRAPPER,
                styles: 'display:none'
            });
            if (this.mode === 'Default') {
                this.chipCollectionWrapper.setAttribute('id', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getUniqueID"])('chip_default'));
            }
            else if (this.mode === 'Box') {
                this.chipCollectionWrapper.setAttribute('id', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getUniqueID"])('chip_box'));
            }
            this.componentWrapper.appendChild(this.chipCollectionWrapper);
        }
        if (this.mode !== 'Box') {
            this.componentWrapper.appendChild(this.viewWrapper);
        }
        this.componentWrapper.appendChild(this.searchWrapper);
        if (this.showClearButton && !_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Browser"].isDevice) {
            this.componentWrapper.appendChild(this.overAllClear);
        }
        else {
            this.componentWrapper.classList.add(CLOSE_ICON_HIDE);
        }
        this.dropDownIcon();
        this.inputElement = this.createElement('input', {
            className: INPUT_ELEMENT,
            attrs: {
                spellcheck: 'false',
                type: 'text',
                autocomplete: 'off',
                tabindex: '0'
            }
        });
        if (this.mode === 'Default' || this.mode === 'Box') {
            this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
        }
        if (this.element.tagName !== this.getNgDirective()) {
            this.element.style.display = 'none';
        }
        if (this.element.tagName === this.getNgDirective()) {
            this.element.appendChild(this.overAllWrapper);
            this.searchWrapper.appendChild(this.inputElement);
        }
        else {
            this.element.parentElement.insertBefore(this.overAllWrapper, this.element);
            this.searchWrapper.appendChild(this.inputElement);
            this.searchWrapper.appendChild(this.element);
            this.element.removeAttribute('tabindex');
        }
        if (this.floatLabelType !== 'Never') {
            Object(_float_label__WEBPACK_IMPORTED_MODULE_5__["createFloatLabel"])(this.overAllWrapper, this.searchWrapper, this.element, this.inputElement, this.value, this.floatLabelType, this.placeholder);
        }
        else if (this.floatLabelType === 'Never') {
            this.refreshPlaceHolder();
        }
        this.addValidInputClass();
        this.element.style.opacity = '';
        var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["getUniqueID"])('ej2_dropdownlist');
        this.element.id = id;
        this.hiddenElement = this.createElement('select', {
            attrs: { 'aria-hidden': 'true', 'class': HIDDEN_ELEMENT, 'tabindex': '-1', 'multiple': '' }
        });
        this.componentWrapper.appendChild(this.hiddenElement);
        this.validationAttribute(this.element, this.hiddenElement);
        if (this.mode !== 'CheckBox') {
            this.hideOverAllClear();
        }
        this.wireEvent();
        this.enable(this.enabled);
        this.enableRTL(this.enableRtl);
        this.checkInitialValue();
        if (this.element.hasAttribute('data-val')) {
            this.element.setAttribute('data-val', 'false');
        }
        this.renderComplete();
    };
    MultiSelect.prototype.checkInitialValue = function () {
        var _this = this;
        var isData = this.dataSource instanceof Array ? (this.dataSource.length > 0)
            : !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.dataSource);
        if (!(this.value && this.value.length) &&
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text) &&
            !isData &&
            this.element.tagName === 'SELECT' &&
            this.element.options.length > 0) {
            var optionsElement = this.element.options;
            var valueCol = [];
            var textCol = '';
            for (var index = 0, optionsLen = optionsElement.length; index < optionsLen; index++) {
                var opt = optionsElement[index];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(opt.getAttribute('selected'))) {
                    (opt.getAttribute('value')) ? valueCol.push(opt.getAttribute('value')) : textCol += (opt.text + this.delimiterChar);
                }
            }
            if (valueCol.length > 0) {
                this.setProperties({ value: valueCol }, true);
            }
            else if (textCol !== '') {
                this.setProperties({ text: textCol }, true);
            }
            if (valueCol.length > 0 || textCol !== '') {
                this.refreshInputHight();
                this.refreshPlaceHolder();
            }
        }
        if ((this.value && this.value.length) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text)) {
            this.renderPopup();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) || this.value.length === 0)) {
            this.initialTextUpdate();
        }
        if (this.value && this.value.length) {
            if (!(this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_4__["DataManager"])) {
                this.initialValueUpdate();
                this.initialUpdate();
            }
            else {
                this.setInitialValue = function () {
                    _this.initStatus = false;
                    _this.initialValueUpdate();
                    _this.initialUpdate();
                    _this.setInitialValue = null;
                    _this.initStatus = true;
                };
            }
            this.updateTempValue();
        }
        else {
            this.initialUpdate();
        }
        this.initStatus = true;
        this.checkAutoFocus();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.text)) {
            this.element.setAttribute('data-initial-value', this.text);
        }
    };
    MultiSelect.prototype.checkAutoFocus = function () {
        if (this.element.hasAttribute('autofocus')) {
            this.inputElement.focus();
        }
    };
    MultiSelect.prototype.setFloatLabelType = function () {
        Object(_float_label__WEBPACK_IMPORTED_MODULE_5__["removeFloating"])(this.overAllWrapper, this.componentWrapper, this.searchWrapper, this.inputElement, this.value, this.floatLabelType, this.placeholder);
        if (this.floatLabelType !== 'Never') {
            Object(_float_label__WEBPACK_IMPORTED_MODULE_5__["createFloatLabel"])(this.overAllWrapper, this.searchWrapper, this.element, this.inputElement, this.value, this.floatLabelType, this.placeholder);
        }
    };
    MultiSelect.prototype.addValidInputClass = function () {
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.value) && this.value.length) || this.floatLabelType === 'Always') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.overAllWrapper], 'e-valid-input');
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.overAllWrapper], 'e-valid-input');
        }
    };
    MultiSelect.prototype.dropDownIcon = function () {
        if (this.showDropDownIcon) {
            this.dropIcon = this.createElement('span', { className: dropdownIcon });
            this.componentWrapper.appendChild(this.dropIcon);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["addClass"])([this.componentWrapper], ['e-down-icon']);
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["isNullOrUndefined"])(this.dropIcon)) {
                this.dropIcon.parentElement.removeChild(this.dropIcon);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["removeClass"])([this.componentWrapper], ['e-down-icon']);
            }
        }
    };
    MultiSelect.prototype.initialUpdate = function () {
        if (this.mode !== 'Box' && !(this.setDynValue && this.mode === 'Default' && this.inputFocus)) {
            this.updateDelimView();
        }
        this.updateCssClass();
        this.updateHTMLAttribute();
        this.updateReadonly(this.readonly);
        this.refreshInputHight();
        this.checkPlaceholderSize();
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
     * @method destroy
     * @return {void}
     */
    MultiSelect.prototype.destroy = function () {
        // tslint:disable-next-line
        if (this.isReact) {
            this.clearTemplate();
        }
        if (this.popupObj) {
            this.popupObj.hide();
        }
        this.notify(destroy, {});
        this.unwireListEvents();
        this.unWireEvent();
        this.list = null;
        this.popupObj = null;
        this.mainList = null;
        this.mainData = null;
        this.filterParent = null;
        this.ulElement = null;
        _super.prototype.destroy.call(this);
        var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
        var length = temp.length;
        while (length > 0) {
            this.inputElement.removeAttribute(temp[length - 1]);
            length--;
        }
        this.element.removeAttribute('data-initial-value');
        this.element.style.display = 'block';
        if (this.overAllWrapper.parentElement) {
            if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(this.overAllWrapper);
            }
            else {
                this.overAllWrapper.parentElement.insertBefore(this.element, this.overAllWrapper);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["remove"])(this.overAllWrapper);
            }
        }
    };
    ;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Complex"])({ text: null, value: null, iconCss: null, groupBy: null }, _drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["FieldSettings"])
    ], MultiSelect.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "groupTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('No records found')
    ], MultiSelect.prototype, "noRecordsTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Request failed')
    ], MultiSelect.prototype, "actionFailureTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('None')
    ], MultiSelect.prototype, "sortOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])([])
    ], MultiSelect.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('StartsWith')
    ], MultiSelect.prototype, "filterType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(1000)
    ], MultiSelect.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "ignoreAccent", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])()
    ], MultiSelect.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "enableGroupCheckBox", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('100%')
    ], MultiSelect.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('300px')
    ], MultiSelect.prototype, "popupHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('100%')
    ], MultiSelect.prototype, "popupWidth", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "filterBarPlaceholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])({})
    ], MultiSelect.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "valueTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "footerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "itemTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "allowFiltering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "changeOnBlur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "allowCustomValue", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(1000)
    ], MultiSelect.prototype, "maximumSelectionLength", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(null)
    ], MultiSelect.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "hideSelectedItem", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "closePopupOnSelect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Default')
    ], MultiSelect.prototype, "mode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(',')
    ], MultiSelect.prototype, "delimiterChar", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "ignoreCase", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "showDropDownIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Never')
    ], MultiSelect.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(false)
    ], MultiSelect.prototype, "showSelectAll", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Select All')
    ], MultiSelect.prototype, "selectAllText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])('Unselect All')
    ], MultiSelect.prototype, "unSelectAllText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "enableSelectionOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Property"])(true)
    ], MultiSelect.prototype, "openOnClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "removing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "removed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "selectedAll", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "chipSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "filtering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "tagging", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_2__["Event"])()
    ], MultiSelect.prototype, "customValueSelection", void 0);
    MultiSelect = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_2__["NotifyPropertyChanges"]
    ], MultiSelect);
    return MultiSelect;
}(_drop_down_base_drop_down_base__WEBPACK_IMPORTED_MODULE_0__["DropDownBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/auto-filters.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/auto-filters.js ***!
  \************************************************************************/
/*! exports provided: AutoFilters */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoFilters", function() { return AutoFilters; });
/**
 * AutoFilters class
 * @private
 */
var AutoFilters = /** @__PURE__ @class */ (function () {
    function AutoFilters() {
    }
    return AutoFilters;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/blob-helper.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/blob-helper.js ***!
  \***********************************************************************/
/*! exports provided: BlobHelper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlobHelper", function() { return BlobHelper; });
/**
 * BlobHelper class
 * @private
 */
var BlobHelper = /** @__PURE__ @class */ (function () {
    function BlobHelper() {
        /* tslint:disable:no-any */
        this.parts = [];
    }
    /* tslint:disable:no-any */
    BlobHelper.prototype.append = function (part) {
        this.parts.push(part);
        this.blob = undefined; // Invalidate the blob
    };
    BlobHelper.prototype.getBlob = function () {
        return new Blob(this.parts, { type: 'text/plain' });
    };
    return BlobHelper;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell-style.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/cell-style.js ***!
  \**********************************************************************/
/*! exports provided: CellStyle, Font, CellXfs, Alignment, CellStyleXfs, CellStyles, NumFmt, Border, Borders */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellStyle", function() { return CellStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellXfs", function() { return CellXfs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Alignment", function() { return Alignment; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellStyleXfs", function() { return CellStyleXfs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellStyles", function() { return CellStyles; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumFmt", function() { return NumFmt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Border", function() { return Border; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Borders", function() { return Borders; });
/**
 * CellStyle class
 * @private
 */
var CellStyle = /** @__PURE__ @class */ (function () {
    function CellStyle() {
        this.numFmtId = 0;
        this.backColor = 'none';
        this.fontName = 'Calibri';
        this.fontSize = 10.5;
        this.fontColor = '#000000';
        this.italic = false;
        this.bold = false;
        this.underline = false;
        this.wrapText = false;
        this.hAlign = 'general';
        this.vAlign = 'bottom';
        this.indent = 0;
        this.rotation = 0;
        this.numberFormat = 'GENERAL';
        this.type = 'datetime';
        this.borders = new Borders();
        this.isGlobalStyle = false;
    }
    return CellStyle;
}());

/**
 * Font Class
 * @private
 */
var Font = /** @__PURE__ @class */ (function () {
    function Font() {
        this.sz = 10.5;
        this.name = 'Calibri';
        this.u = false;
        this.b = false;
        this.i = false;
        this.color = 'FF000000';
    }
    return Font;
}());

/**
 * CellXfs class
 * @private
 */
var CellXfs = /** @__PURE__ @class */ (function () {
    function CellXfs() {
    }
    return CellXfs;
}());

/**
 * Alignment class
 * @private
 */
var Alignment = /** @__PURE__ @class */ (function () {
    function Alignment() {
    }
    return Alignment;
}());

/**
 * CellStyleXfs class
 * @private
 */
var CellStyleXfs = /** @__PURE__ @class */ (function () {
    function CellStyleXfs() {
    }
    return CellStyleXfs;
}());

/**
 * CellStyles class
 * @private
 */
var CellStyles = /** @__PURE__ @class */ (function () {
    function CellStyles() {
        this.name = 'Normal';
        this.xfId = 0;
    }
    return CellStyles;
}());

/**
 * NumFmt class
 * @private
 */
var NumFmt = /** @__PURE__ @class */ (function () {
    function NumFmt(id, code) {
        this.numFmtId = id;
        this.formatCode = code;
    }
    return NumFmt;
}());

/**
 * Border class
 * @private
 */
var Border = /** @__PURE__ @class */ (function () {
    function Border(mLine, mColor) {
        this.lineStyle = mLine;
        this.color = mColor;
    }
    return Border;
}());

/**
 * Borders class
 * @private
 */
var Borders = /** @__PURE__ @class */ (function () {
    function Borders() {
        this.left = new Border('none', '#FFFFFF');
        this.right = new Border('none', '#FFFFFF');
        this.top = new Border('none', '#FFFFFF');
        this.bottom = new Border('none', '#FFFFFF');
        this.all = new Border('none', '#FFFFFF');
    }
    return Borders;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell.js":
/*!****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/cell.js ***!
  \****************************************************************/
/*! exports provided: Cell, Cells */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cell", function() { return Cell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cells", function() { return Cells; });
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/**
 * Worksheet class
 * @private
 */
var Cell = /** @__PURE__ @class */ (function () {
    function Cell() {
    }
    return Cell;
}());

/**
 * Cells class
 * @private
 */
var Cells = /** @__PURE__ @class */ (function (_super) {
    __extends(Cells, _super);
    function Cells() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.add = function (cell) {
            var inserted = false;
            var count = 0;
            for (var _i = 0, _a = _this; _i < _a.length; _i++) {
                var c = _a[_i];
                if (c.index === cell.index) {
                    _this[count] = cell;
                    inserted = true;
                }
                count++;
            }
            if (!inserted) {
                _this.push(cell);
            }
        };
        return _this;
    }
    return Cells;
}(Array));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/column.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/column.js ***!
  \******************************************************************/
/*! exports provided: Column */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return Column; });
/**
 * Column class
 * @private
 */
var Column = /** @__PURE__ @class */ (function () {
    function Column() {
    }
    return Column;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/csv-helper.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/csv-helper.js ***!
  \**********************************************************************/
/*! exports provided: CsvHelper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CsvHelper", function() { return CsvHelper; });
/* harmony import */ var _value_formatter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value-formatter */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/value-formatter.js");

/**
 * CsvHelper class
 * @private
 */
var CsvHelper = /** @__PURE__ @class */ (function () {
    /* tslint:disable:no-any */
    function CsvHelper(json, separator) {
        this.csvStr = '';
        if (separator === null || separator === undefined) {
            this.separator = ',';
        }
        else {
            this.separator = separator;
        }
        this.formatter = new _value_formatter__WEBPACK_IMPORTED_MODULE_0__["ValueFormatter"]();
        this.isMicrosoftBrowser = !(!navigator.msSaveBlob);
        if (json.isServerRendered !== null && json.isServerRendered !== undefined) {
            this.isServerRendered = json.isServerRendered;
        }
        if (json.styles !== null && json.styles !== undefined) {
            this.globalStyles = new Map();
            for (var i = 0; i < json.styles.length; i++) {
                if (json.styles[i].name !== undefined && json.styles[i].numberFormat !== undefined) {
                    this.globalStyles.set(json.styles[i].name, json.styles[i].numberFormat);
                }
            }
        }
        // Parses Worksheets data to DOM.        
        if (json.worksheets !== null && json.worksheets !== undefined) {
            this.parseWorksheet(json.worksheets[0]);
        }
        //this.csvStr = 'a1,a2,a3\nb1,b2,b3';
    }
    CsvHelper.prototype.parseWorksheet = function (json) {
        //Rows
        if (json.rows !== null && json.rows !== undefined) {
            this.parseRows(json.rows);
        }
    };
    /* tslint:disable:no-any */
    CsvHelper.prototype.parseRows = function (rows) {
        var count = 1;
        for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
            var row = rows_1[_i];
            //Row index
            if (row.index !== null && row.index !== undefined) {
                while (count < row.index) {
                    this.csvStr += '\n';
                    count++;
                }
                this.parseRow(row);
            }
            else {
                throw Error('Row index is missing.');
            }
        }
    };
    /* tslint:disable:no-any */
    CsvHelper.prototype.parseRow = function (row) {
        if (row.cells !== null && row.cells !== undefined) {
            var count = 1;
            for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
                var cell = _a[_i];
                //cell index
                if (cell.index !== null && cell.index !== undefined) {
                    while (count < cell.index) {
                        this.csvStr += this.separator;
                        count++;
                    }
                    this.parseCell(cell);
                }
                else {
                    throw Error('Cell index is missing.');
                }
            }
        }
    };
    /* tslint:disable:no-any */
    CsvHelper.prototype.parseCell = function (cell) {
        var csv = this.csvStr;
        if (cell.value !== undefined) {
            if (cell.value instanceof Date) {
                if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
                    /* tslint:disable-next-line:max-line-length */
                    try {
                        csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: cell.style.numberFormat }, this.isServerRendered));
                    }
                    catch (error) {
                        /* tslint:disable-next-line:max-line-length */
                        csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', format: cell.style.numberFormat }, this.isServerRendered));
                    }
                }
                else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
                    /* tslint:disable-next-line:max-line-length */
                    try {
                        csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', skeleton: this.globalStyles.get(cell.style.name) }, this.isServerRendered));
                    }
                    catch (error) {
                        /* tslint:disable-next-line:max-line-length */
                        csv += this.parseCellValue(this.formatter.displayText(cell.value, { type: 'dateTime', format: this.globalStyles.get(cell.style.name) }, this.isServerRendered));
                    }
                }
                else {
                    csv += cell.value;
                }
            }
            else if (typeof (cell.value) === 'boolean') {
                csv += cell.value ? 'TRUE' : 'FALSE';
            }
            else if (typeof (cell.value) === 'number') {
                if (cell.style !== undefined && cell.style.numberFormat !== undefined) {
                    /* tslint:disable-next-line:max-line-length */
                    csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: cell.style.numberFormat }, this.isServerRendered));
                }
                else if (cell.style !== undefined && cell.style.name !== undefined && this.globalStyles.has(cell.style.name)) {
                    /* tslint:disable-next-line:max-line-length */
                    csv += this.parseCellValue(this.formatter.displayText(cell.value, { format: this.globalStyles.get(cell.style.name) }, this.isServerRendered));
                }
                else {
                    csv += cell.value;
                }
            }
            else {
                csv += this.parseCellValue(cell.value);
            }
        }
        this.csvStr = csv;
    };
    CsvHelper.prototype.parseCellValue = function (value) {
        var val = '';
        var length = value.length;
        for (var start = 0; start < length; start++) {
            if (value[start] === '\"') {
                val += value[start].replace('\"', '\"\"');
            }
            else {
                val += value[start];
            }
        }
        value = val;
        if (value.indexOf(this.separator) !== -1 || value.indexOf('\n') !== -1) {
            return value = '\"' + value + '\"';
        }
        else {
            return value;
        }
    };
    /**
     * Saves the file with specified name and sends the file to client browser
     * @param  {string} fileName- file name to save.
     * @param  {Blob} buffer- the content to write in file
     */
    CsvHelper.prototype.save = function (fileName) {
        this.buffer = new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
        if (this.isMicrosoftBrowser) {
            navigator.msSaveBlob(this.buffer, fileName);
        }
        else {
            var dataUrl_1 = window.URL.createObjectURL(this.buffer);
            var dwlLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
            dwlLink.download = fileName;
            dwlLink.href = dataUrl_1;
            var event_1 = document.createEvent('MouseEvent');
            event_1.initEvent('click', true, true);
            dwlLink.dispatchEvent(event_1);
            setTimeout(function () {
                window.URL.revokeObjectURL(dataUrl_1);
            });
        }
    };
    CsvHelper.prototype.saveAsBlob = function () {
        return new Blob(['\ufeff' + this.csvStr], { type: 'text/csv;charset=UTF-8' });
    };
    return CsvHelper;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/image.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/image.js ***!
  \*****************************************************************/
/*! exports provided: Image */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return Image; });
/**
 * Image class
 * @private
 */
var Image = /** @__PURE__ @class */ (function () {
    function Image() {
    }
    return Image;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/index.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/index.js ***!
  \*****************************************************************/
/*! exports provided: CellStyle, Font, CellXfs, Alignment, CellStyleXfs, CellStyles, NumFmt, Border, Borders, Cell, Cells, Column, Row, Rows, Workbook, BuiltInProperties, Worksheet, HyperLink, Grouping, FreezePane, MergeCell, MergeCells, Worksheets, CsvHelper, ValueFormatter, BlobHelper */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _cell_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cell-style */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell-style.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellStyle", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["CellStyle"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["Font"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellXfs", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["CellXfs"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Alignment", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["Alignment"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellStyleXfs", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["CellStyleXfs"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellStyles", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["CellStyles"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumFmt", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["NumFmt"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Border", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["Border"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Borders", function() { return _cell_style__WEBPACK_IMPORTED_MODULE_0__["Borders"]; });

/* harmony import */ var _cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cell */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Cell", function() { return _cell__WEBPACK_IMPORTED_MODULE_1__["Cell"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Cells", function() { return _cell__WEBPACK_IMPORTED_MODULE_1__["Cells"]; });

/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./column */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/column.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return _column__WEBPACK_IMPORTED_MODULE_2__["Column"]; });

/* harmony import */ var _row__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./row */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/row.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return _row__WEBPACK_IMPORTED_MODULE_3__["Row"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Rows", function() { return _row__WEBPACK_IMPORTED_MODULE_3__["Rows"]; });

/* harmony import */ var _workbook__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./workbook */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/workbook.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Workbook", function() { return _workbook__WEBPACK_IMPORTED_MODULE_4__["Workbook"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BuiltInProperties", function() { return _workbook__WEBPACK_IMPORTED_MODULE_4__["BuiltInProperties"]; });

/* harmony import */ var _worksheet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./worksheet */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheet.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Worksheet", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["Worksheet"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HyperLink", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["HyperLink"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Grouping", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["Grouping"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FreezePane", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["FreezePane"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MergeCell", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["MergeCell"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MergeCells", function() { return _worksheet__WEBPACK_IMPORTED_MODULE_5__["MergeCells"]; });

/* harmony import */ var _worksheets__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./worksheets */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheets.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Worksheets", function() { return _worksheets__WEBPACK_IMPORTED_MODULE_6__["Worksheets"]; });

/* harmony import */ var _csv_helper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./csv-helper */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/csv-helper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CsvHelper", function() { return _csv_helper__WEBPACK_IMPORTED_MODULE_7__["CsvHelper"]; });

/* harmony import */ var _value_formatter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./value-formatter */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/value-formatter.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueFormatter", function() { return _value_formatter__WEBPACK_IMPORTED_MODULE_8__["ValueFormatter"]; });

/* harmony import */ var _blob_helper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./blob-helper */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/blob-helper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BlobHelper", function() { return _blob_helper__WEBPACK_IMPORTED_MODULE_9__["BlobHelper"]; });

/**
 * index class
 */












/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/row.js":
/*!***************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/row.js ***!
  \***************************************************************/
/*! exports provided: Row, Rows */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return Row; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rows", function() { return Rows; });
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/**
 * Row class
 * @private
 */
var Row = /** @__PURE__ @class */ (function () {
    function Row() {
    }
    return Row;
}());

/**
 * Rows class
 * @private
 */
var Rows = /** @__PURE__ @class */ (function (_super) {
    __extends(Rows, _super);
    function Rows() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.add = function (row) {
            var inserted = false;
            var count = 0;
            for (var _i = 0, _a = _this; _i < _a.length; _i++) {
                var r = _a[_i];
                if (r.index === row.index) {
                    _this[count] = row;
                    inserted = true;
                }
                count++;
            }
            if (!inserted) {
                _this.push(row);
            }
        };
        return _this;
    }
    return Rows;
}(Array));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/value-formatter.js":
/*!***************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/value-formatter.js ***!
  \***************************************************************************/
/*! exports provided: ValueFormatter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueFormatter", function() { return ValueFormatter; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");


// import { IValueFormatter } from '../base/interface';
/**
 * ValueFormatter class to globalize the value.
 * @private
 */
var ValueFormatter = /** @__PURE__ @class */ (function () {
    function ValueFormatter(cultureName) {
        this.intl = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"]();
        // if (!isNullOrUndefined(cultureName)) {
        //     this.intl.culture = cultureName;
        // }
    }
    ValueFormatter.prototype.getFormatFunction = function (format, isServerRendered) {
        if (format.type) {
            if (isServerRendered) {
                format.isServerRendered = true;
            }
            return this.intl.getDateFormat(format);
        }
        else {
            return this.intl.getNumberFormat(format);
        }
    };
    // public getParserFunction(format: NumberFormatOptions | DateFormatOptions): Function {
    //     if ((<DateFormatOptions>format).type) {
    //         return this.intl.getDateParser(<DateFormatOptions>format);
    //     } else {
    //         return this.intl.getNumberParser(<DateFormatOptions>format);
    //     }
    // }
    // public fromView(value: string, format: Function, type?: string): string | number | Date {
    //     if (type === 'date' || type === 'datetime' || type === 'number') {
    //         return format(value);
    //     } else {
    //         return value;
    //     }
    // }
    ValueFormatter.prototype.toView = function (value, format) {
        var result = value;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(format) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            result = format(value);
        }
        return result;
    };
    // public setCulture(cultureName: string): void {
    //     if (!isNullOrUndefined(cultureName)) {
    //         setCulture(cultureName);
    //     }
    // }
    /* tslint:disable:no-any */
    ValueFormatter.prototype.displayText = function (value, format, isServerRendered) {
        return this.toView(value, this.getFormatFunction(format, isServerRendered));
    };
    return ValueFormatter;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/workbook.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/workbook.js ***!
  \********************************************************************/
/*! exports provided: Workbook, BuiltInProperties */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Workbook", function() { return Workbook; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BuiltInProperties", function() { return BuiltInProperties; });
/* harmony import */ var _worksheets__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worksheets */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheets.js");
/* harmony import */ var _worksheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./worksheet */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheet.js");
/* harmony import */ var _cell_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cell-style */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell-style.js");
/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./column */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/column.js");
/* harmony import */ var _row__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./row */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/row.js");
/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./image */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/image.js");
/* harmony import */ var _cell__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cell */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/cell.js");
/* harmony import */ var _ej2_compression__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../ej2-compression */ "./ej2-resources/18.4.46/scripts/ej2-compression/index.js");
/* harmony import */ var _csv_helper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./csv-helper */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/csv-helper.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _blob_helper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./blob-helper */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/blob-helper.js");
/* harmony import */ var _auto_filters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./auto-filters */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/auto-filters.js");












/**
 * Workbook class
 */
var Workbook = /** @__PURE__ @class */ (function () {
    /* tslint:disable:no-any */
    function Workbook(json, saveType, culture, currencyString, separator) {
        this.sharedStringCount = 0;
        this.unitsProportions = [
            96 / 75.0,
            96 / 300.0,
            96,
            96 / 25.4,
            96 / 2.54,
            1,
            96 / 72.0,
            96 / 72.0 / 12700,
        ];
        /* tslint:disable:no-any */
        this.hyperlinkStyle = { fontColor: '#0000FF', underline: true };
        if (culture !== undefined) {
            this.culture = culture;
        }
        else {
            this.culture = 'en-US';
        }
        if (currencyString !== undefined) {
            this.currency = currencyString;
        }
        else {
            this.currency = 'USD';
        }
        this.intl = new _ej2_base__WEBPACK_IMPORTED_MODULE_9__["Internationalization"](this.culture);
        this.mSaveType = saveType;
        if (saveType === 'xlsx') {
            this.mArchive = new _ej2_compression__WEBPACK_IMPORTED_MODULE_7__["ZipArchive"]();
            this.sharedString = [];
            this.mFonts = [];
            this.mBorders = [];
            this.mStyles = [];
            this.printTitles = new Map();
            this.cellStyles = new Map();
            this.mNumFmt = new Map();
            this.mFills = new Map();
            this.mStyles.push(new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]());
            this.mFonts.push(new _cell_style__WEBPACK_IMPORTED_MODULE_2__["Font"]());
            /* tslint:disable */
            this.cellStyles.set('Normal', new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyles"]());
            /* tslint:enable */
            this.mCellXfs = [];
            this.mCellStyleXfs = [];
            this.drawingCount = 0;
            this.imageCount = 0;
            if (json.styles !== null && json.styles !== undefined) {
                /* tslint:disable-next-line:no-any */
                this.globalStyles = new Map();
                for (var i = 0; i < json.styles.length; i++) {
                    if (json.styles[i].name !== undefined) {
                        if (!this.cellStyles.has(json.styles[i].name)) {
                            var cellStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
                            cellStyle.isGlobalStyle = true;
                            this.parserCellStyle(json.styles[i], cellStyle, 'none');
                            var cellStylesIn = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyles"]();
                            cellStylesIn.name = cellStyle.name;
                            cellStylesIn.xfId = (cellStyle.index - 1);
                            this.cellStyles.set(cellStylesIn.name, cellStylesIn);
                            /* tslint:disable-next-line:no-any */
                            var tFormat = {};
                            if (json.styles[i].numberFormat !== undefined) {
                                tFormat.format = json.styles[i].numberFormat;
                            }
                            if (json.styles[i].type !== undefined) {
                                tFormat.type = json.styles[i].type;
                            }
                            else {
                                tFormat.type = 'datetime';
                            }
                            if (tFormat.format !== undefined) {
                                this.globalStyles.set(json.styles[i].name, tFormat);
                            }
                        }
                        else {
                            throw Error('Style name ' + json.styles[i].name + ' is already existed');
                        }
                    }
                }
            }
            // Parses Worksheets data to DOM.        
            if (json.worksheets !== null && json.worksheets !== undefined) {
                this.parserWorksheets(json.worksheets);
            }
            else {
                throw Error('Worksheet is expected.');
            }
            // Parses the BuiltInProperties data to DOM.        
            if (json.builtInProperties !== null && json.builtInProperties !== undefined) {
                this.builtInProperties = new BuiltInProperties();
                this.parserBuiltInProperties(json.builtInProperties, this.builtInProperties);
            }
        }
        else {
            this.csvHelper = new _csv_helper__WEBPACK_IMPORTED_MODULE_8__["CsvHelper"](json, separator);
        }
    }
    /* tslint:disable:no-any */
    Workbook.prototype.parserBuiltInProperties = function (jsonBuiltInProperties, builtInProperties) {
        //Author
        if (jsonBuiltInProperties.author !== null && jsonBuiltInProperties.author !== undefined) {
            builtInProperties.author = jsonBuiltInProperties.author;
        }
        //Comments
        if (jsonBuiltInProperties.comments !== null && jsonBuiltInProperties.comments !== undefined) {
            builtInProperties.comments = jsonBuiltInProperties.comments;
        }
        //Category
        if (jsonBuiltInProperties.category !== null && jsonBuiltInProperties.category !== undefined) {
            builtInProperties.category = jsonBuiltInProperties.category;
        }
        //Company
        if (jsonBuiltInProperties.company !== null && jsonBuiltInProperties.company !== undefined) {
            builtInProperties.company = jsonBuiltInProperties.company;
        }
        //Manager
        if (jsonBuiltInProperties.manager !== null && jsonBuiltInProperties.manager !== undefined) {
            builtInProperties.manager = jsonBuiltInProperties.manager;
        }
        //Subject
        if (jsonBuiltInProperties.subject !== null && jsonBuiltInProperties.subject !== undefined) {
            builtInProperties.subject = jsonBuiltInProperties.subject;
        }
        //Title
        if (jsonBuiltInProperties.title !== null && jsonBuiltInProperties.title !== undefined) {
            builtInProperties.title = jsonBuiltInProperties.title;
        }
        //Creation date
        if (jsonBuiltInProperties.createdDate !== null && jsonBuiltInProperties.createdDate !== undefined) {
            builtInProperties.createdDate = jsonBuiltInProperties.createdDate;
        }
        //Modified date
        if (jsonBuiltInProperties.modifiedDate !== null && jsonBuiltInProperties.modifiedDate !== undefined) {
            builtInProperties.modifiedDate = jsonBuiltInProperties.modifiedDate;
        }
        //Tags
        if (jsonBuiltInProperties.tags !== null && jsonBuiltInProperties.tags !== undefined) {
            builtInProperties.tags = jsonBuiltInProperties.tags;
        }
        //Status
        if (jsonBuiltInProperties.status !== null && jsonBuiltInProperties.status !== undefined) {
            builtInProperties.status = jsonBuiltInProperties.status;
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserWorksheets = function (json) {
        this.worksheets = new _worksheets__WEBPACK_IMPORTED_MODULE_0__["Worksheets"]();
        var length = json.length;
        for (var i = 0; i < length; i++) {
            var jsonSheet = json[i];
            var sheet = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["Worksheet"]();
            this.mergeCells = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["MergeCells"]();
            this.mergedCellsStyle = new Map();
            this.mHyperLinks = [];
            //Name
            if (jsonSheet.name !== null && jsonSheet.name !== undefined) {
                sheet.name = jsonSheet.name;
            }
            else {
                sheet.name = 'Sheet' + (i + 1).toString();
            }
            if (jsonSheet.enableRtl !== null && jsonSheet.enableRtl !== undefined) {
                sheet.enableRtl = jsonSheet.enableRtl;
            }
            sheet.index = (i + 1);
            //Columns
            if (jsonSheet.columns !== null && jsonSheet.columns !== undefined) {
                this.parserColumns(jsonSheet.columns, sheet);
            }
            //Rows
            if (jsonSheet.rows !== null && jsonSheet.rows !== undefined) {
                this.parserRows(jsonSheet.rows, sheet);
            }
            //showGridLines
            if (jsonSheet.showGridLines !== null && jsonSheet.showGridLines !== undefined) {
                sheet.showGridLines = jsonSheet.showGridLines;
            }
            //FreezePanes
            if (jsonSheet.freeze !== null && jsonSheet.freeze !== undefined) {
                this.parserFreezePanes(jsonSheet.freeze, sheet);
            }
            //Print Title
            if (jsonSheet.printTitle !== null && jsonSheet.printTitle !== undefined) {
                this.parserPrintTitle(jsonSheet.printTitle, sheet);
            }
            if (jsonSheet.pageSetup !== undefined) {
                if (jsonSheet.pageSetup.isSummaryRowBelow !== undefined) {
                    sheet.isSummaryRowBelow = jsonSheet.pageSetup.isSummaryRowBelow;
                }
            }
            if (jsonSheet.images !== undefined) {
                this.parserImages(jsonSheet.images, sheet);
            }
            if (jsonSheet.autoFilters !== null && jsonSheet.autoFilters !== undefined) {
                this.parseFilters(jsonSheet.autoFilters, sheet);
            }
            sheet.index = (i + 1);
            sheet.mergeCells = this.mergeCells;
            sheet.hyperLinks = this.mHyperLinks;
            this.worksheets.push(sheet);
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.mergeOptions = function (fromJson, toJson) {
        /* tslint:disable:no-any */
        var result = {};
        this.applyProperties(fromJson, result);
        this.applyProperties(toJson, result);
        return result;
    };
    /* tslint:disable:no-any */
    Workbook.prototype.applyProperties = function (sourceJson, destJson) {
        var keys = Object.keys(sourceJson);
        for (var index = 0; index < keys.length; index++) {
            if (keys[index] !== 'name') {
                destJson[keys[index]] = sourceJson[keys[index]];
            }
        }
    };
    Workbook.prototype.getCellName = function (row, column) {
        return this.getColumnName(column) + row.toString();
    };
    Workbook.prototype.getColumnName = function (col) {
        col--;
        var strColumnName = '';
        do {
            var iCurrentDigit = col % 26;
            col = col / 26 - 1;
            strColumnName = String.fromCharCode(65 + iCurrentDigit) + strColumnName;
        } while (col >= 0);
        return strColumnName;
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserPrintTitle = function (json, sheet) {
        var printTitleName = '';
        var titleRowName;
        if (json.fromRow !== null && json.fromRow !== undefined) {
            var fromRow = json.fromRow;
            var toRow = void 0;
            if (json.toRow !== null && json.toRow !== undefined) {
                toRow = json.toRow;
            }
            else {
                toRow = json.fromRow;
            }
            titleRowName = '$' + fromRow + ':$' + toRow;
        }
        var titleColName;
        if (json.fromColumn !== null && json.fromColumn !== undefined) {
            var fromColumn = json.fromColumn;
            var toColumn = void 0;
            if (json.toColumn !== null && json.toColumn !== undefined) {
                toColumn = json.toColumn;
            }
            else {
                toColumn = json.fromColumn;
            }
            titleColName = '$' + this.getColumnName(fromColumn) + ':$' + this.getColumnName(toColumn);
        }
        if (titleRowName !== undefined) {
            printTitleName += (sheet.name + '!' + titleRowName);
        }
        if (titleColName !== undefined && titleRowName !== undefined) {
            printTitleName += ',' + (sheet.name + '!' + titleColName);
        }
        else if (titleColName !== undefined) {
            printTitleName += (sheet.name + '!' + titleColName);
        }
        if (printTitleName !== '') {
            this.printTitles.set(sheet.index - 1, printTitleName);
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserFreezePanes = function (json, sheet) {
        sheet.freezePanes = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["FreezePane"]();
        if (json.row !== null && json.row !== undefined) {
            sheet.freezePanes.row = json.row;
        }
        else {
            sheet.freezePanes.row = 0;
        }
        if (json.column !== null && json.column !== undefined) {
            sheet.freezePanes.column = json.column;
        }
        else {
            sheet.freezePanes.column = 0;
        }
        sheet.freezePanes.leftCell = this.getCellName(sheet.freezePanes.row + 1, sheet.freezePanes.column + 1);
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserColumns = function (json, sheet) {
        var columnsLength = json.length;
        sheet.columns = [];
        for (var column = 0; column < columnsLength; column++) {
            var col = new _column__WEBPACK_IMPORTED_MODULE_3__["Column"]();
            if (json[column].index !== null && json[column].index !== undefined) {
                col.index = json[column].index;
            }
            else {
                throw Error('Column index is missing.');
            }
            if (json[column].width !== null && json[column].width !== undefined) {
                col.width = json[column].width;
            }
            sheet.columns.push(col);
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserRows = function (json, sheet) {
        var rowsLength = json.length;
        sheet.rows = new _row__WEBPACK_IMPORTED_MODULE_4__["Rows"]();
        var rowId = 0;
        for (var r = 0; r < rowsLength; r++) {
            var row = this.parserRow(json[r], rowId);
            rowId = row.index;
            sheet.rows.add(row);
        }
        this.insertMergedCellsStyle(sheet);
    };
    Workbook.prototype.insertMergedCellsStyle = function (sheet) {
        var _this = this;
        if (this.mergeCells.length > 0) {
            this.mergedCellsStyle.forEach(function (value, key) {
                var row = sheet.rows.filter(function (item) {
                    return item.index === value.y;
                })[0];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_9__["isNullOrUndefined"])(row)) {
                    var cell = row.cells.filter(function (item) {
                        return item.index === value.x;
                    })[0];
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_9__["isNullOrUndefined"])(cell)) {
                        cell.styleIndex = value.styleIndex;
                    }
                    else {
                        var cells = row.cells.filter(function (item) {
                            return item.index <= value.x;
                        });
                        var insertIndex = 0;
                        if (cells.length > 0) {
                            insertIndex = row.cells.indexOf(cells[cells.length - 1]) + 1;
                        }
                        row.cells.splice(insertIndex, 0, _this.createCell(value, key));
                    }
                }
                else {
                    var rows = sheet.rows.filter(function (item) {
                        return item.index <= value.y;
                    });
                    var rowToInsert = new _row__WEBPACK_IMPORTED_MODULE_4__["Row"]();
                    rowToInsert.index = value.y;
                    rowToInsert.cells = new _cell__WEBPACK_IMPORTED_MODULE_6__["Cells"]();
                    rowToInsert.cells.add(_this.createCell(value, key));
                    var insertIndex = 0;
                    if (rows.length > 0) {
                        insertIndex = sheet.rows.indexOf(rows[rows.length - 1]) + 1;
                    }
                    sheet.rows.splice(insertIndex, 0, rowToInsert);
                }
            });
        }
    };
    Workbook.prototype.createCell = function (value, key) {
        var cellToInsert = new _cell__WEBPACK_IMPORTED_MODULE_6__["Cell"]();
        cellToInsert.refName = key;
        cellToInsert.index = value.x;
        cellToInsert.cellStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
        cellToInsert.styleIndex = value.styleIndex;
        return cellToInsert;
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserRow = function (json, rowIndex) {
        var row = new _row__WEBPACK_IMPORTED_MODULE_4__["Row"]();
        //Row Height
        if (json.height !== null && json.height !== undefined) {
            row.height = json.height;
        }
        //Row index
        if (json.index !== null && json.index !== undefined) {
            row.index = json.index;
        }
        else {
            throw Error('Row index is missing.');
        }
        if (json.grouping !== null && json.grouping !== undefined) {
            this.parseGrouping(json.grouping, row);
        }
        this.parseCells(json.cells, row);
        return row;
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parseGrouping = function (json, row) {
        row.grouping = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["Grouping"]();
        if (json.outlineLevel !== undefined) {
            row.grouping.outlineLevel = json.outlineLevel;
        }
        if (json.isCollapsed !== undefined) {
            row.grouping.isCollapsed = json.isCollapsed;
        }
        if (json.isHidden !== undefined) {
            row.grouping.isHidden = json.isHidden;
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parseCells = function (json, row) {
        row.cells = new _cell__WEBPACK_IMPORTED_MODULE_6__["Cells"]();
        var cellsLength = json !== undefined ? json.length : 0;
        var spanMin = 1;
        var spanMax = 1;
        var curCellIndex = 0;
        for (var cellId = 0; cellId < cellsLength; cellId++) {
            /* tslint:disable:no-any */
            var jsonCell = json[cellId];
            var cell = new _cell__WEBPACK_IMPORTED_MODULE_6__["Cell"]();
            //cell index
            if (jsonCell.index !== null && jsonCell.index !== undefined) {
                cell.index = jsonCell.index;
            }
            else {
                throw Error('Cell index is missing.');
            }
            if (cell.index < spanMin) {
                spanMin = cell.index;
            }
            else if (cell.index > spanMax) {
                spanMax = cell.index;
            }
            //Update the Cell name
            cell.refName = this.getCellName(row.index, cell.index);
            //Row span
            if (jsonCell.rowSpan !== null && jsonCell.rowSpan !== undefined) {
                cell.rowSpan = jsonCell.rowSpan - 1;
            }
            else {
                cell.rowSpan = 0;
            }
            //Column span
            if (jsonCell.colSpan !== null && jsonCell.colSpan !== undefined) {
                cell.colSpan = jsonCell.colSpan - 1;
            }
            else {
                cell.colSpan = 0;
            }
            //Hyperlink
            if (jsonCell.hyperlink !== null && jsonCell.hyperlink !== undefined) {
                var hyperLink = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["HyperLink"]();
                if (jsonCell.hyperlink.target !== undefined) {
                    hyperLink.target = jsonCell.hyperlink.target;
                    if (jsonCell.hyperlink.displayText !== undefined) {
                        cell.value = jsonCell.hyperlink.displayText;
                    }
                    else {
                        cell.value = jsonCell.hyperlink.target;
                    }
                    cell.type = this.getCellValueType(cell.value);
                    hyperLink.ref = cell.refName;
                    hyperLink.rId = (this.mHyperLinks.length + 1);
                    this.mHyperLinks.push(hyperLink);
                    cell.cellStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
                    /* tslint:disable-next-line:max-line-length */
                    this.parserCellStyle((jsonCell.style !== undefined ? this.mergeOptions(jsonCell.style, this.hyperlinkStyle) : this.hyperlinkStyle), cell.cellStyle, 'string');
                    cell.styleIndex = cell.cellStyle.index;
                }
            }
            // formulas
            if (jsonCell.formula !== null && jsonCell.formula !== undefined) {
                cell.formula = jsonCell.formula;
                cell.type = 'formula';
            }
            //Cell value
            if (jsonCell.value !== null && jsonCell.value !== undefined) {
                if (cell.formula !== undefined) {
                    cell.value = 0;
                }
                else {
                    cell.value = jsonCell.value;
                    cell.type = this.getCellValueType(cell.value);
                }
            }
            if (jsonCell.style !== null && jsonCell.style !== undefined && cell.styleIndex === undefined) {
                cell.cellStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
                if (cell.value instanceof Date) {
                    this.parserCellStyle(jsonCell.style, cell.cellStyle, cell.type, 14);
                }
                else {
                    this.parserCellStyle(jsonCell.style, cell.cellStyle, cell.type);
                }
                cell.styleIndex = cell.cellStyle.index;
            }
            else if (cell.value instanceof Date) {
                cell.cellStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
                this.parserCellStyle({}, cell.cellStyle, cell.type, 14);
                cell.styleIndex = cell.cellStyle.index;
            }
            this.parseCellType(cell);
            this.mergeCells = this.processMergeCells(cell, row.index, this.mergeCells);
            row.cells.add(cell);
            curCellIndex = (cell.index + 1);
        }
        row.spans = (spanMin) + ':' + (spanMax);
    };
    Workbook.prototype.GetColors = function () {
        var colors;
        colors = new Map();
        /* tslint:disable */
        colors.set('WHITE', 'FFFFFFFF');
        /* tslint:disable */
        colors.set('SILVER', 'FFC0C0C0');
        /* tslint:disable */
        colors.set('GRAY', 'FF808080');
        /* tslint:disable */
        colors.set('BLACK', 'FF000000');
        /* tslint:disable */
        colors.set('RED', 'FFFF0000');
        /* tslint:disable */
        colors.set('MAROON', 'FF800000');
        /* tslint:disable */
        colors.set('YELLOW', 'FFFFFF00');
        /* tslint:disable */
        colors.set('OLIVE', 'FF808000');
        /* tslint:disable */
        colors.set('LIME', 'FF00FF00');
        /* tslint:disable */
        colors.set('GREEN', 'FF008000');
        /* tslint:disable */
        colors.set('AQUA', 'FF00FFFF');
        /* tslint:disable */
        colors.set('TEAL', 'FF008080');
        /* tslint:disable */
        colors.set('BLUE', 'FF0000FF');
        /* tslint:disable */
        colors.set('NAVY', 'FF000080');
        /* tslint:disable */
        colors.set('FUCHSIA', 'FFFF00FF');
        /* tslint:disable */
        colors.set('PURPLE', 'FF800080');
        return colors;
    };
    Workbook.prototype.processColor = function (colorVal) {
        if (colorVal.indexOf('#') === 0) {
            return colorVal.replace('#', 'FF');
        }
        colorVal = colorVal.toUpperCase();
        this.rgbColors = this.GetColors();
        if (this.rgbColors.has(colorVal)) {
            colorVal = this.rgbColors.get(colorVal);
        }
        else {
            colorVal = 'FF000000';
        }
        return colorVal;
    };
    Workbook.prototype.processCellValue = function (value, cell) {
        var cellValue = value;
        if (value.indexOf("<font") !== -1 || value.indexOf("<a") !== -1 || value.indexOf("<b>") !== -1 ||
            value.indexOf("<i>") !== -1 || value.indexOf("<u>") !== -1) {
            var processedVal = '';
            var startindex = value.indexOf('<', 0);
            var endIndex = value.indexOf('>', startindex + 1);
            if (startindex >= 0 && endIndex >= 0) {
                if (startindex !== 0) {
                    processedVal += '<r><t xml:space="preserve">' + value.substring(0, startindex) + '</t></r>';
                }
                while (startindex >= 0 && endIndex >= 0) {
                    endIndex = value.indexOf('>', startindex + 1);
                    if (endIndex >= 0) {
                        var subString = value.substring(startindex + 1, endIndex);
                        startindex = value.indexOf('<', endIndex + 1);
                        if (startindex < 0) {
                            startindex = cellValue.length;
                        }
                        var text = cellValue.substring(endIndex + 1, startindex);
                        if (text.length !== 0) {
                            var subSplit = subString.split(' ');
                            if (subSplit.length > 0) {
                                processedVal += '<r><rPr>';
                            }
                            if (subSplit.length > 1) {
                                for (var _i = 0, subSplit_1 = subSplit; _i < subSplit_1.length; _i++) {
                                    var element = subSplit_1[_i];
                                    var start = element.trim().substring(0, 5);
                                    switch (start) {
                                        case 'size=':
                                            processedVal += '<sz val="' + element.substring(6, element.length - 1) + '"/>';
                                            break;
                                        case 'face=':
                                            processedVal += '<rFont val="' + element.substring(6, element.length - 1) + '"/>';
                                            break;
                                        case 'color':
                                            processedVal += '<color rgb="' + this.processColor(element.substring(7, element.length - 1)) + '"/>';
                                            break;
                                        case 'href=':
                                            var hyperLink = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["HyperLink"]();
                                            hyperLink.target = element.substring(6, element.length - 1).trim();
                                            hyperLink.ref = cell.refName;
                                            hyperLink.rId = (this.mHyperLinks.length + 1);
                                            this.mHyperLinks.push(hyperLink);
                                            processedVal += '<color rgb="FF0000FF"/><u/><b/>';
                                            break;
                                    }
                                }
                            }
                            else if (subSplit.length === 1) {
                                var style = subSplit[0].trim();
                                switch (style) {
                                    case 'b':
                                        processedVal += '<b/>';
                                        break;
                                    case 'i':
                                        processedVal += '<i/>';
                                        break;
                                    case 'u':
                                        processedVal += '<u/>';
                                        break;
                                }
                            }
                            processedVal += '</rPr><t xml:space="preserve">' + text + '</t></r>';
                        }
                    }
                }
                if (processedVal === '') {
                    return cellValue;
                }
                return processedVal;
            }
            else {
                return cellValue;
            }
        }
        else {
            return cellValue;
        }
    };
    Workbook.prototype.applyGlobalStyle = function (json, cellStyle) {
        var index = 0;
        if (this.cellStyles.has(json.name)) {
            cellStyle.index = this.mStyles.filter(function (a) { return (a.name === json.name); })[0].index;
            cellStyle.name = json.name;
        }
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserCellStyle = function (json, cellStyle, cellType, defStyleIndex) {
        //name
        if (json.name !== null && json.name !== undefined) {
            if (cellStyle.isGlobalStyle) {
                cellStyle.name = json.name;
            }
            else {
                this.applyGlobalStyle(json, cellStyle);
                return;
            }
        }
        //background color
        if (json.backColor !== null && json.backColor !== undefined) {
            cellStyle.backColor = json.backColor;
        }
        //borders
        //leftBorder
        cellStyle.borders = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["Borders"]();
        //AllBorder
        if (json.borders !== null && json.borders !== undefined) {
            this.parserBorder(json.borders, cellStyle.borders.all);
        }
        //leftborder
        if (json.leftBorder !== null && json.leftBorder !== undefined) {
            this.parserBorder(json.leftBorder, cellStyle.borders.left);
        }
        //rightBorder
        if (json.rightBorder !== null && json.rightBorder !== undefined) {
            this.parserBorder(json.rightBorder, cellStyle.borders.right);
        }
        //topBorder
        if (json.topBorder !== null && json.topBorder !== undefined) {
            this.parserBorder(json.topBorder, cellStyle.borders.top);
        }
        //bottomBorder
        if (json.bottomBorder !== null && json.bottomBorder !== undefined) {
            this.parserBorder(json.bottomBorder, cellStyle.borders.bottom);
        }
        //fontName
        if (json.fontName !== null && json.fontName !== undefined) {
            cellStyle.fontName = json.fontName;
        }
        //fontSize
        if (json.fontSize !== null && json.fontSize !== undefined) {
            cellStyle.fontSize = json.fontSize;
        }
        //fontColor
        if (json.fontColor !== null && json.fontColor !== undefined) {
            cellStyle.fontColor = json.fontColor;
        }
        //italic
        if (json.italic !== null && json.italic !== undefined) {
            cellStyle.italic = json.italic;
        }
        //bold
        if (json.bold !== null && json.bold !== undefined) {
            cellStyle.bold = json.bold;
        }
        //hAlign
        if (json.hAlign !== null && json.hAlign !== undefined) {
            cellStyle.hAlign = json.hAlign.toLowerCase();
        }
        //indent
        if (json.indent !== null && json.indent !== undefined) {
            cellStyle.indent = json.indent;
            if (!(cellStyle.hAlign === 'left' || cellStyle.hAlign === 'right')) {
                cellStyle.hAlign = 'left';
            }
        }
        if (json.rotation !== null && json.rotation !== undefined) {
            cellStyle.rotation = json.rotation;
        }
        //vAlign
        if (json.vAlign !== null && json.vAlign !== undefined) {
            cellStyle.vAlign = json.vAlign.toLowerCase();
        }
        //underline
        if (json.underline !== null && json.underline !== undefined) {
            cellStyle.underline = json.underline;
        }
        //wrapText
        if (json.wrapText !== null && json.wrapText !== undefined) {
            cellStyle.wrapText = json.wrapText;
        }
        //numberFormat
        if (json.numberFormat !== null && json.numberFormat !== undefined) {
            if (json.type !== null && json.type !== undefined) {
                cellStyle.numberFormat = this.getNumberFormat(json.numberFormat, json.type);
            }
            else {
                cellStyle.numberFormat = this.getNumberFormat(json.numberFormat, cellType);
            }
        }
        else if (defStyleIndex !== undefined) {
            cellStyle.numFmtId = 14;
            cellStyle.numberFormat = 'GENERAL';
        }
        else {
            cellStyle.numberFormat = 'GENERAL';
        }
        cellStyle.index = this.processCellStyle(cellStyle);
    };
    Workbook.prototype.switchNumberFormat = function (numberFormat, type) {
        var format = this.getNumberFormat(numberFormat, type);
        if (format !== numberFormat) {
            var numFmt = this.mNumFmt.get(numberFormat);
            if (numFmt !== undefined) {
                numFmt.formatCode = format;
                if (this.mNumFmt.has(format)) {
                    for (var _i = 0, _a = this.mCellStyleXfs; _i < _a.length; _i++) {
                        var cellStyleXfs = _a[_i];
                        if (cellStyleXfs.numFmtId === numFmt.numFmtId) {
                            cellStyleXfs.numFmtId = this.mNumFmt.get(format).numFmtId;
                        }
                    }
                    for (var _b = 0, _c = this.mCellXfs; _b < _c.length; _b++) {
                        var cellXfs = _c[_b];
                        if (cellXfs.numFmtId === numFmt.numFmtId) {
                            cellXfs.numFmtId = this.mNumFmt.get(format).numFmtId;
                        }
                    }
                }
            }
        }
    };
    Workbook.prototype.getNumberFormat = function (numberFormat, type) {
        var returnFormat;
        switch (type) {
            case 'number':
                try {
                    returnFormat = this.intl.getNumberPattern({ format: numberFormat, currency: this.currency, useGrouping: true }, true);
                }
                catch (error) {
                    returnFormat = numberFormat;
                }
                break;
            case 'datetime':
                try {
                    returnFormat = this.intl.getDatePattern({ skeleton: numberFormat, type: 'dateTime' }, true);
                }
                catch (error) {
                    try {
                        returnFormat = this.intl.getDatePattern({ format: numberFormat, type: 'dateTime' }, true);
                    }
                    catch (error) {
                        returnFormat = numberFormat;
                    }
                }
                break;
            case 'date':
                try {
                    returnFormat = this.intl.getDatePattern({ skeleton: numberFormat, type: 'date' }, true);
                }
                catch (error) {
                    try {
                        returnFormat = this.intl.getDatePattern({ format: numberFormat, type: 'date' }, true);
                    }
                    catch (error) {
                        returnFormat = numberFormat;
                    }
                }
                break;
            case 'time':
                try {
                    returnFormat = this.intl.getDatePattern({ skeleton: numberFormat, type: 'time' }, true);
                }
                catch (error) {
                    try {
                        returnFormat = this.intl.getDatePattern({ format: numberFormat, type: 'time' }, true);
                    }
                    catch (error) {
                        returnFormat = numberFormat;
                    }
                }
                break;
            default:
                returnFormat = numberFormat;
                break;
        }
        return returnFormat;
    };
    /* tslint:disable:no-any */
    Workbook.prototype.parserBorder = function (json, border) {
        if (json.color !== null && json.color !== undefined) {
            border.color = json.color;
        }
        else {
            border.color = '#000000';
        }
        if (json.lineStyle !== null && json.lineStyle !== undefined) {
            border.lineStyle = json.lineStyle;
        }
        else {
            border.lineStyle = 'thin';
        }
    };
    Workbook.prototype.processCellStyle = function (style) {
        if (style.isGlobalStyle) {
            this.processNumFormatId(style);
            this.mStyles.push(style);
            return this.mStyles.length;
        }
        else {
            var compareResult = this.compareStyle(style);
            if (!compareResult.result) {
                this.processNumFormatId(style);
                this.mStyles.push(style);
                return this.mStyles.length;
            }
            else {
                //Return the index of the already existing style.
                return compareResult.index;
            }
        }
    };
    Workbook.prototype.processNumFormatId = function (style) {
        if (style.numberFormat !== 'GENERAL' && !this.mNumFmt.has(style.numberFormat)) {
            var id = this.mNumFmt.size + 164;
            this.mNumFmt.set(style.numberFormat, new _cell_style__WEBPACK_IMPORTED_MODULE_2__["NumFmt"](id, style.numberFormat));
        }
    };
    Workbook.prototype.isNewFont = function (toCompareStyle) {
        var result = false;
        var index = 0;
        for (var _i = 0, _a = this.mFonts; _i < _a.length; _i++) {
            var font = _a[_i];
            index++;
            var fontColor = undefined;
            if (toCompareStyle.fontColor !== undefined) {
                fontColor = ('FF' + toCompareStyle.fontColor.replace('#', ''));
            }
            result = font.color === fontColor &&
                font.b === toCompareStyle.bold &&
                font.i === toCompareStyle.italic &&
                font.u === toCompareStyle.underline &&
                font.name === toCompareStyle.fontName &&
                font.sz === toCompareStyle.fontSize;
            if (result) {
                break;
            }
        }
        index = index - 1;
        return { index: index, result: result };
    };
    Workbook.prototype.isNewBorder = function (toCompareStyle) {
        var bStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
        if (this.isAllBorder(toCompareStyle.borders)) {
            return (bStyle.borders.all.color === toCompareStyle.borders.all.color &&
                bStyle.borders.all.lineStyle === toCompareStyle.borders.all.lineStyle);
        }
        else {
            return (bStyle.borders.left.color === toCompareStyle.borders.left.color &&
                bStyle.borders.left.lineStyle === toCompareStyle.borders.left.lineStyle &&
                bStyle.borders.right.color === toCompareStyle.borders.right.color &&
                bStyle.borders.right.lineStyle === toCompareStyle.borders.right.lineStyle &&
                bStyle.borders.top.color === toCompareStyle.borders.top.color &&
                bStyle.borders.top.lineStyle === toCompareStyle.borders.top.lineStyle &&
                bStyle.borders.bottom.color === toCompareStyle.borders.bottom.color &&
                bStyle.borders.bottom.lineStyle === toCompareStyle.borders.bottom.lineStyle);
        }
    };
    Workbook.prototype.isAllBorder = function (toCompareBorder) {
        var allBorderStyle = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyle"]();
        return allBorderStyle.borders.all.color !== toCompareBorder.all.color &&
            allBorderStyle.borders.all.lineStyle !== toCompareBorder.all.lineStyle;
    };
    Workbook.prototype.compareStyle = function (toCompareStyle) {
        var result = true;
        var index = 0;
        var globalStyleIndex = 0;
        for (var _i = 0, _a = this.mStyles; _i < _a.length; _i++) {
            var baseStyle = _a[_i];
            result = baseStyle.isGlobalStyle ? false : (baseStyle.backColor === toCompareStyle.backColor &&
                baseStyle.bold === toCompareStyle.bold &&
                baseStyle.numFmtId === toCompareStyle.numFmtId &&
                baseStyle.numberFormat === toCompareStyle.numberFormat &&
                baseStyle.type === toCompareStyle.type &&
                baseStyle.fontColor === toCompareStyle.fontColor &&
                baseStyle.fontName === toCompareStyle.fontName &&
                baseStyle.fontSize === toCompareStyle.fontSize &&
                baseStyle.hAlign === toCompareStyle.hAlign &&
                baseStyle.italic === toCompareStyle.italic &&
                baseStyle.underline === toCompareStyle.underline &&
                baseStyle.vAlign === toCompareStyle.vAlign &&
                baseStyle.indent === toCompareStyle.indent &&
                baseStyle.rotation === toCompareStyle.rotation &&
                baseStyle.wrapText === toCompareStyle.wrapText &&
                (baseStyle.borders.all.color === toCompareStyle.borders.all.color &&
                    baseStyle.borders.all.lineStyle === toCompareStyle.borders.all.lineStyle) &&
                (baseStyle.borders.left.color === toCompareStyle.borders.left.color &&
                    baseStyle.borders.left.lineStyle === toCompareStyle.borders.left.lineStyle &&
                    baseStyle.borders.right.color === toCompareStyle.borders.right.color &&
                    baseStyle.borders.right.lineStyle === toCompareStyle.borders.right.lineStyle &&
                    baseStyle.borders.top.color === toCompareStyle.borders.top.color &&
                    baseStyle.borders.top.lineStyle === toCompareStyle.borders.top.lineStyle &&
                    baseStyle.borders.bottom.color === toCompareStyle.borders.bottom.color &&
                    baseStyle.borders.bottom.lineStyle === toCompareStyle.borders.bottom.lineStyle));
            if (result) {
                index = baseStyle.index;
                break;
            }
        }
        return { index: index, result: result };
    };
    Workbook.prototype.contains = function (array, item) {
        var index = array.indexOf(item);
        return index > -1 && index < array.length;
    };
    Workbook.prototype.getCellValueType = function (value) {
        if (value instanceof Date) {
            return 'datetime';
        }
        else if (typeof (value) === 'boolean') {
            return 'boolean';
        }
        else if (typeof (value) === 'number') {
            return 'number';
        }
        else {
            return 'string';
        }
    };
    Workbook.prototype.parseCellType = function (cell) {
        var type = cell.type;
        var saveType;
        var value = cell.value;
        switch (type) {
            case 'datetime':
                value = this.toOADate(value);
                if (cell.cellStyle !== undefined && cell.cellStyle.name !== undefined) {
                    if (this.globalStyles.has(cell.cellStyle.name)) {
                        var value_1 = this.globalStyles.get(cell.cellStyle.name);
                        this.switchNumberFormat(value_1.format, value_1.type);
                    }
                }
                saveType = 'n';
                break;
            //TODO: Update the number format index and style
            case 'boolean':
                value = value ? 1 : 0;
                saveType = 'b';
                break;
            case 'number':
                saveType = 'n';
                if (cell.cellStyle !== undefined && cell.cellStyle.name !== undefined) {
                    if (this.globalStyles.has(cell.cellStyle.name)) {
                        this.switchNumberFormat(this.globalStyles.get(cell.cellStyle.name).format, 'number');
                    }
                }
                break;
            case 'string':
                this.sharedStringCount++;
                saveType = 's';
                var sstvalue = this.processCellValue(value, cell);
                if (!this.contains(this.sharedString, sstvalue)) {
                    this.sharedString.push(sstvalue);
                }
                value = this.sharedString.indexOf(sstvalue);
                break;
            default:
                break;
        }
        cell.saveType = saveType;
        cell.value = value;
    };
    Workbook.prototype.parserImages = function (json, sheet) {
        var imagesLength = json.length;
        sheet.images = [];
        var imageId = 0;
        for (var p = 0; p < imagesLength; p++) {
            var image = this.parserImage(json[p]);
            sheet.images.push(image);
        }
    };
    Workbook.prototype.parseFilters = function (json, sheet) {
        sheet.autoFilters = new _auto_filters__WEBPACK_IMPORTED_MODULE_11__["AutoFilters"]();
        if (json.row !== null && json.row !== undefined)
            sheet.autoFilters.row = json.row;
        else
            throw new Error('Argument Null Exception: row null or empty');
        if (json.lastRow !== null && json.lastRow !== undefined)
            sheet.autoFilters.lastRow = json.lastRow;
        else
            throw new Error('Argument Null Exception: lastRow cannot be null or empty');
        if (json.column !== null && json.column !== undefined)
            sheet.autoFilters.column = json.column;
        else
            throw new Error('Argument Null Exception: column cannot be null or empty');
        if (json.lastColumn !== null && json.row !== undefined)
            sheet.autoFilters.lastColumn = json.lastColumn;
        else
            throw new Error('Argument Null Exception: lastColumn cannot be null or empty');
    };
    Workbook.prototype.parserImage = function (json) {
        var image = new _image__WEBPACK_IMPORTED_MODULE_5__["Image"]();
        if (json.image !== null && json.image !== undefined) {
            image.image = json.image;
        }
        if (json.row !== null && json.row !== undefined) {
            image.row = json.row;
        }
        if (json.column !== null && json.column !== undefined) {
            image.column = json.column;
        }
        if (json.lastRow !== null && json.lastRow !== undefined) {
            image.lastRow = json.lastRow;
        }
        if (json.lastColumn !== null && json.lastColumn !== undefined) {
            image.lastColumn = json.lastColumn;
        }
        if (json.width !== null && json.width !== undefined) {
            image.width = json.width;
        }
        if (json.height !== null && json.height !== undefined) {
            image.height = json.height;
        }
        if (json.horizontalFlip !== null && json.horizontalFlip !== undefined) {
            image.horizontalFlip = json.horizontalFlip;
        }
        if (json.verticalFlip !== null && json.verticalFlip !== undefined) {
            image.verticalFlip = json.verticalFlip;
        }
        if (json.rotation !== null && json.rotation !== undefined) {
            image.rotation = json.rotation;
        }
        return image;
    };
    Workbook.prototype.saveAsBlob = function (blobSaveType) {
        var _this = this;
        switch (blobSaveType) {
            case 'text/csv':
                return new Promise(function (resolve, reject) {
                    var obj = {};
                    obj.blobData = _this.csvHelper.saveAsBlob();
                    resolve(obj);
                });
            default:
                return new Promise(function (resolve, reject) {
                    _this.saveInternal();
                    _this.mArchive.saveAsBlob().then(function (blob) {
                        var obj = {};
                        obj.blobData = new Blob([blob], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
                        resolve(obj);
                    });
                });
        }
    };
    Workbook.prototype.save = function (fileName, proxyUrl) {
        var _this = this;
        if (fileName === null || fileName === undefined || fileName === '') {
            throw new Error('Argument Null Exception: fileName cannot be null or empty');
        }
        var xlsxMatch = fileName.match('.xlsx$');
        var csvMatch = fileName.match('.csv$');
        if (xlsxMatch !== null && xlsxMatch[0] === ('.' + this.mSaveType)) {
            this.saveInternal();
            this.mArchive.save(fileName).then(function () {
                _this.mArchive.destroy();
            });
        }
        else if (csvMatch !== null && csvMatch[0] === ('.' + this.mSaveType)) {
            this.csvHelper.save(fileName);
        }
        else {
            throw Error('Save type and file extension is different.');
        }
    };
    Workbook.prototype.saveInternal = function () {
        this.saveWorkbook();
        this.saveWorksheets();
        this.saveSharedString();
        this.saveStyles();
        this.saveApp(this.builtInProperties);
        this.saveCore(this.builtInProperties);
        this.saveContentType();
        this.saveTopLevelRelation();
        this.saveWorkbookRelation();
    };
    Workbook.prototype.saveWorkbook = function () {
        /* tslint:disable-next-line:max-line-length */
        var workbookTemp = '<?xml version="1.0" encoding="utf-8"?><workbook xmlns:r = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns= "http://schemas.openxmlformats.org/spreadsheetml/2006/main"><workbookPr codeName="ThisWorkbook" defaultThemeVersion= "153222"/><bookViews><workbookView activeTab="0"/></bookViews>';
        var sheets = '<sheets>';
        var length = this.worksheets.length;
        for (var i = 0; i < length; i++) {
            /* tslint:disable-next-line:max-line-length */
            sheets += '<sheet name="' + this.worksheets[i].name + '" sheetId="' + (i + 1).toString() + '" r:id ="rId' + (i + 1).toString() + '" />';
        }
        sheets += '</sheets>';
        workbookTemp += sheets;
        if (this.printTitles.size > 0) {
            var printTitle_1 = '<definedNames>';
            this.printTitles.forEach(function (value, key) {
                printTitle_1 += '<definedName name="_xlnm.Print_Titles" localSheetId="' + key + '">' + value + '</definedName>';
            });
            printTitle_1 += '</definedNames>';
            workbookTemp += printTitle_1;
        }
        this.addToArchive(workbookTemp + '</workbook>', 'xl/workbook.xml');
    };
    Workbook.prototype.saveWorksheets = function () {
        var length = this.worksheets.length;
        for (var i = 0; i < length; i++) {
            this.saveWorksheet(this.worksheets[i], i);
        }
    };
    Workbook.prototype.saveWorksheet = function (sheet, index) {
        var sheetBlob = new _blob_helper__WEBPACK_IMPORTED_MODULE_10__["BlobHelper"]();
        /* tslint:disable-next-line:max-line-length */
        var sheetString = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';
        if (!sheet.isSummaryRowBelow) {
            sheetString += ('<sheetPr>' + '<outlinePr ' + 'summaryBelow="0" >' + '</outlinePr>' + '</sheetPr>');
        }
        else {
            sheetString += ('<sheetPr />');
        }
        sheetString += this.saveSheetView(sheet);
        if (sheet.columns !== undefined) {
            var colString = '<cols>';
            for (var _i = 0, _a = sheet.columns; _i < _a.length; _i++) {
                var column = _a[_i];
                /* tslint:disable-next-line:max-line-length */
                if (column.width !== undefined) {
                    colString += '<col min="' + (column.index) + '" max="' + (column.index) + '" width="' + this.pixelsToColumnWidth(column.width) + '" customWidth="1" />';
                }
                else {
                    colString += '<col min="' + (column.index) + '" max="' + (column.index) + '" width="' + '8.43' + '" customWidth="1" />';
                }
            }
            sheetString += (colString + '</cols>');
        }
        sheetString += ('<sheetData>');
        sheetBlob.append(sheetString);
        sheetString = '';
        if (sheet.rows !== undefined) {
            for (var _b = 0, _c = sheet.rows; _b < _c.length; _b++) {
                var row = _c[_b];
                var rowString = '<row r="' + (row.index) + '" ';
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_9__["isNullOrUndefined"])(row.spans)) {
                    rowString += 'spans="' + row.spans + '" ';
                }
                if (row.height !== undefined) {
                    rowString += ('ht="' + this.pixelsToRowHeight(row.height) + '" customHeight="1" ');
                }
                if (row.grouping !== undefined) {
                    if (row.grouping.isHidden) {
                        rowString += ('hidden="1" ');
                    }
                    if (row.grouping.outlineLevel !== undefined) {
                        rowString += ('outlineLevel="' + row.grouping.outlineLevel + '" ');
                    }
                    if (row.grouping.isCollapsed) {
                        rowString += ('collapsed="1" ');
                    }
                }
                rowString += ('>');
                for (var _d = 0, _e = row.cells; _d < _e.length; _d++) {
                    var cell = _e[_d];
                    if (cell !== undefined && (cell.value !== undefined || cell.cellStyle !== undefined)) {
                        rowString += ('<c r="' + cell.refName + '" ');
                        if (cell.saveType !== undefined) {
                            rowString += ('t="' + cell.saveType + '" ');
                        }
                        if (cell.styleIndex !== undefined) {
                            rowString += ('s="' + cell.styleIndex + '" ');
                        }
                        rowString += (' >');
                        if (cell.formula !== undefined) {
                            rowString += ('<f>' + cell.formula + '</f>');
                        }
                        if (cell.value !== undefined) {
                            rowString += ('<v>' + cell.value + '</v></c>');
                        }
                        else {
                            rowString += ('</c>');
                        }
                    }
                }
                rowString += ('</row>');
                sheetBlob.append(rowString);
            }
        }
        sheetString += ('</sheetData>');
        /* tslint:disable-next-line:max-line-length */
        if (sheet.autoFilters !== null && sheet.autoFilters !== undefined)
            sheetString += ('<autoFilter ref="' + this.getCellName(sheet.autoFilters.row, sheet.autoFilters.column) + ':' + this.getCellName(sheet.autoFilters.lastRow, sheet.autoFilters.lastColumn) + '"/>');
        if (sheet.mergeCells.length > 0) {
            sheetString += ('<mergeCells count="' + sheet.mergeCells.length + '">');
            for (var _f = 0, _g = sheet.mergeCells; _f < _g.length; _f++) {
                var mCell = _g[_f];
                sheetString += ('<mergeCell ref="' + mCell.ref + '" />');
            }
            sheetString += ('</mergeCells>');
        }
        if (sheet.hyperLinks.length > 0) {
            sheetString += ('<hyperlinks>');
            for (var _h = 0, _j = sheet.hyperLinks; _h < _j.length; _h++) {
                var hLink = _j[_h];
                sheetString += ('<hyperlink ref="' + hLink.ref + '" r:id="rId' + hLink.rId + '" />');
            }
            sheetString += ('</hyperlinks>');
        }
        /* tslint:disable-next-line:max-line-length */
        sheetString += ('<pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5" /><headerFooter scaleWithDoc="1" alignWithMargins="0" differentFirst="0" differentOddEven="0" />');
        if (sheet.images != undefined && sheet.images.length > 0) {
            this.drawingCount++;
            this.saveDrawings(sheet, sheet.index);
            sheetString += '<drawing r:id="rId' + (sheet.hyperLinks.length + 1) + '"/>';
        }
        this.addToArchive(this.saveSheetRelations(sheet), ('xl/worksheets/_rels/sheet' + sheet.index + '.xml.rels'));
        sheetBlob.append(sheetString + '</worksheet>');
        this.addToArchive(sheetBlob.getBlob(), 'xl/worksheets' + '/sheet' + (index + 1) + '.xml');
    };
    Workbook.prototype.saveDrawings = function (sheet, index) {
        var drawings = new _blob_helper__WEBPACK_IMPORTED_MODULE_10__["BlobHelper"]();
        /* tslint:disable-next-line:max-line-length */
        var sheetDrawingString = '<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">';
        if (sheet.images !== undefined) {
            var imgId = 0;
            for (var _i = 0, _a = sheet.images; _i < _a.length; _i++) {
                var pic = _a[_i];
                if (pic.height !== undefined && pic.width !== undefined) {
                    this.updatelastRowOffset(sheet, pic);
                    this.updatelastColumnOffSet(sheet, pic);
                }
                else if (pic.lastRow !== undefined && pic.lastColumn !== undefined) {
                    pic.lastRowOffset = 0;
                    pic.lastColOffset = 0;
                }
                imgId++;
                sheetDrawingString += '<xdr:twoCellAnchor editAs="oneCell">';
                sheetDrawingString += '<xdr:from><xdr:col>';
                //col
                sheetDrawingString += pic.column - 1;
                sheetDrawingString += '</xdr:col><xdr:colOff>';
                //colOff
                sheetDrawingString += 0;
                sheetDrawingString += '</xdr:colOff><xdr:row>';
                //row
                sheetDrawingString += pic.row - 1;
                sheetDrawingString += '</xdr:row><xdr:rowOff>';
                //rowOff
                sheetDrawingString += 0;
                sheetDrawingString += '</xdr:rowOff></xdr:from>';
                sheetDrawingString += '<xdr:to><xdr:col>';
                //col
                sheetDrawingString += pic.lastColumn;
                sheetDrawingString += '</xdr:col><xdr:colOff>';
                //colOff
                sheetDrawingString += pic.lastColOffset;
                sheetDrawingString += '</xdr:colOff><xdr:row>';
                //row
                sheetDrawingString += pic.lastRow;
                sheetDrawingString += '</xdr:row><xdr:rowOff>';
                //rowOff
                sheetDrawingString += pic.lastRowOffset;
                sheetDrawingString += '</xdr:rowOff></xdr:to>';
                sheetDrawingString += '<xdr:pic>';
                sheetDrawingString += '<xdr:nvPicPr>';
                sheetDrawingString += '<xdr:cNvPr id="' + imgId + '" name="Picture ' + imgId + '"> </xdr:cNvPr>';
                sheetDrawingString += '<xdr:cNvPicPr><a:picLocks noChangeAspect="1"/></xdr:cNvPicPr> </xdr:nvPicPr>';
                sheetDrawingString += '<xdr:blipFill>';
                /* tslint:disable-next-line:max-line-length */
                sheetDrawingString += '<a:blip xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:embed="rId' + imgId + '" cstate="print">';
                sheetDrawingString += '</a:blip><a:stretch><a:fillRect /></a:stretch></xdr:blipFill>';
                sheetDrawingString += '<xdr:spPr>';
                sheetDrawingString += '<a:xfrm';
                if (pic.rotation != undefined && pic.rotation <= 3600 && pic.rotation >= -3600) {
                    sheetDrawingString += ' rot="' + (pic.rotation * 60000) + '"';
                }
                if (pic.verticalFlip != undefined && pic.verticalFlip != false) {
                    sheetDrawingString += ' flipV="1"';
                }
                if (pic.horizontalFlip != undefined && pic.horizontalFlip != false) {
                    sheetDrawingString += ' flipH="1"';
                }
                sheetDrawingString += '/>';
                sheetDrawingString += '<a:prstGeom prst="rect"><a:avLst /></a:prstGeom></xdr:spPr>';
                sheetDrawingString += '</xdr:pic><xdr:clientData /></xdr:twoCellAnchor>';
                var imageFile = new _blob_helper__WEBPACK_IMPORTED_MODULE_10__["BlobHelper"]();
                var imageData = this.convertBase64toImage(pic.image);
                this.imageCount += 1;
                this.addToArchive(imageData, 'xl/media/image' + this.imageCount + '.png');
            }
            drawings.append(sheetDrawingString);
            drawings.append('</xdr:wsDr>');
            this.saveDrawingRelations(sheet);
            this.addToArchive(drawings.getBlob(), 'xl/drawings/drawing' + this.drawingCount + '.xml');
        }
    };
    Workbook.prototype.updatelastRowOffset = function (sheet, picture) {
        var iCurHeight = picture.height;
        var iCurRow = picture.row;
        var iCurOffset = 0;
        while (iCurHeight >= 0) {
            var iRowHeight = 0;
            if (sheet.rows !== undefined && sheet.rows[iCurRow - 1] !== undefined)
                iRowHeight = this.convertToPixels(sheet.rows[iCurRow - 1].height === undefined ? 15 : sheet.rows[iCurRow - 1].height);
            else
                iRowHeight = this.convertToPixels(15);
            var iSpaceInCell = iRowHeight - (iCurOffset * iRowHeight / 256);
            if (iSpaceInCell > iCurHeight) {
                picture.lastRow = iCurRow;
                picture.lastRowOffset = iCurOffset + (iCurHeight * 256 / iRowHeight);
                var rowHiddenHeight = 0;
                if (sheet.rows !== undefined && sheet.rows[iCurRow - 1] !== undefined)
                    rowHiddenHeight = this.convertToPixels(sheet.rows[iCurRow - 1].height === undefined ? 15 : sheet.rows[iCurRow - 1].height);
                else
                    rowHiddenHeight = this.convertToPixels(15);
                picture.lastRowOffset = (rowHiddenHeight * picture.lastRowOffset) / 256;
                picture.lastRowOffset = Math.round(picture.lastRowOffset / this.unitsProportions[7]);
                break;
            }
            else {
                iCurHeight -= iSpaceInCell;
                iCurRow++;
                iCurOffset = 0;
            }
        }
    };
    Workbook.prototype.updatelastColumnOffSet = function (sheet, picture) {
        var iCurWidth = picture.width;
        var iCurCol = picture.column;
        var iCurOffset = 0;
        while (iCurWidth >= 0) {
            var iColWidth = 0;
            if (sheet.columns !== undefined && sheet.columns[iCurCol - 1] !== undefined)
                iColWidth = this.ColumnWidthToPixels(sheet.columns[iCurCol - 1].width === undefined ? 8.43 : sheet.columns[iCurCol - 1].width);
            else
                iColWidth = this.ColumnWidthToPixels(8.43);
            var iSpaceInCell = iColWidth - (iCurOffset * iColWidth / 1024);
            if (iSpaceInCell > iCurWidth) {
                picture.lastColumn = iCurCol;
                picture.lastColOffset = iCurOffset + (iCurWidth * 1024 / iColWidth);
                var colHiddenWidth = 0;
                if (sheet.columns !== undefined && sheet.columns[iCurCol - 1] !== undefined)
                    colHiddenWidth = this.ColumnWidthToPixels(sheet.columns[iCurCol - 1].width === undefined ? 8.43 : sheet.columns[iCurCol].width);
                else
                    colHiddenWidth = this.ColumnWidthToPixels(8.43);
                picture.lastColOffset = (colHiddenWidth * picture.lastColOffset) / 1024;
                picture.lastColOffset = Math.round(picture.lastColOffset / this.unitsProportions[7]);
                break;
            }
            else {
                iCurWidth -= iSpaceInCell;
                iCurCol++;
                iCurOffset = 0;
            }
        }
    };
    Workbook.prototype.convertToPixels = function (value) {
        return value * this.unitsProportions[6];
    };
    Workbook.prototype.convertBase64toImage = function (img) {
        var byteStr = window.atob(img);
        var buffer = new ArrayBuffer(byteStr.length);
        var data = new Uint8Array(buffer);
        for (var i = 0; i < byteStr.length; i++) {
            data[i] = byteStr.charCodeAt(i);
        }
        var blob = new Blob([data], { type: 'image/png' });
        return blob;
    };
    Workbook.prototype.saveDrawingRelations = function (sheet) {
        /* tslint:disable-next-line:max-line-length */
        var drawingRelation = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
        var length = sheet.images.length;
        var id = this.imageCount - sheet.images.length;
        for (var i = 1; i <= length; i++) {
            id++;
            /* tslint:disable-next-line:max-line-length */
            drawingRelation += '<Relationship Id="rId' + i + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image' + id + '.png" />';
        }
        this.addToArchive((drawingRelation + '</Relationships>'), 'xl/drawings/_rels/drawing' + this.drawingCount + '.xml.rels');
    };
    Workbook.prototype.pixelsToColumnWidth = function (pixels) {
        var dDigitWidth = 7;
        var val = (pixels > dDigitWidth + 5) ?
            this.trunc((pixels - 5) / dDigitWidth * 100 + 0.5) / 100 :
            pixels / (dDigitWidth + 5);
        return (val > 1) ?
            ((val * dDigitWidth + 5) / dDigitWidth * 256.0) / 256.0 :
            (val * (dDigitWidth + 5) / dDigitWidth * 256.0) / 256.0;
    };
    Workbook.prototype.ColumnWidthToPixels = function (val) {
        var dDigitWidth = 7;
        var fileWidth = (val > 1) ?
            ((val * dDigitWidth + 5) / dDigitWidth * 256.0) / 256.0 :
            (val * (dDigitWidth + 5) / dDigitWidth * 256.0) / 256.0;
        return this.trunc(((256 * fileWidth + this.trunc(128 / dDigitWidth)) / 256) * dDigitWidth);
    };
    Workbook.prototype.trunc = function (x) {
        var n = x - x % 1;
        return n === 0 && (x < 0 || (x === 0 && (1 / x !== 1 / 0))) ? -0 : n;
    };
    Workbook.prototype.pixelsToRowHeight = function (pixels) {
        return (pixels * this.unitsProportions[5] / this.unitsProportions[6]);
    };
    Workbook.prototype.saveSheetRelations = function (sheet) {
        /* tslint:disable-next-line:max-line-length */
        var relStr = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
        for (var _i = 0, _a = sheet.hyperLinks; _i < _a.length; _i++) {
            var hLink = _a[_i];
            /* tslint:disable-next-line:max-line-length */
            relStr += '<Relationship Id="rId' + hLink.rId + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="' + hLink.target + '" TargetMode="External" />';
        }
        if (sheet.images != undefined && sheet.images.length > 0) {
            /* tslint:disable-next-line:max-line-length */
            relStr += '<Relationship Id="rId' + (sheet.hyperLinks.length + 1) + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing' + this.drawingCount + '.xml" />';
        }
        relStr += '</Relationships>';
        return relStr;
    };
    Workbook.prototype.saveSheetView = function (sheet) {
        var paneString = '<sheetViews><sheetView workbookViewId="0" ';
        if (sheet.enableRtl === true) {
            paneString += 'rightToLeft="1"';
        }
        if (sheet.showGridLines === false) {
            paneString += 'showGridLines="0" >';
        }
        else {
            paneString += '>';
        }
        if (sheet.freezePanes !== undefined) {
            paneString += '<pane state="frozen"' +
                ' topLeftCell="' + sheet.freezePanes.leftCell + '" ';
            if (sheet.freezePanes.row !== 0) {
                paneString += 'ySplit="' + sheet.freezePanes.row + '" ';
            }
            if (sheet.freezePanes.column !== 0) {
                paneString += 'xSplit="' + sheet.freezePanes.column + '" ';
            }
            paneString += '/>';
        }
        paneString += '</sheetView></sheetViews > ';
        return paneString;
    };
    Workbook.prototype.saveSharedString = function () {
        var length = this.sharedString.length;
        if (length > 0) {
            /* tslint:disable-next-line:max-line-length */
            var sstStart = '<?xml version="1.0" encoding="utf-8"?><sst uniqueCount="' + length + '" count="' + this.sharedStringCount + '" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';
            var si = '';
            for (var i = 0; i < length; i++) {
                if (this.sharedString[i].indexOf('<r>') !== 0) {
                    si += '<si><t>';
                    si += this.processString(this.sharedString[i]);
                    si += '</t></si>';
                }
                else {
                    si += '<si>';
                    si += this.sharedString[i];
                    si += '</si>';
                }
            }
            si += '</sst>';
            this.addToArchive(sstStart + si, 'xl/sharedStrings.xml');
        }
    };
    Workbook.prototype.processString = function (value) {
        if (value.indexOf('&') !== -1) {
            value = value.replace(/&/g, '&amp;');
        }
        if (value.indexOf('<') !== -1) {
            value = value.replace(/</g, '&lt;');
        }
        if (value.indexOf('>') !== -1) {
            value = value.replace(/>/g, '&gt;');
        }
        return value;
    };
    Workbook.prototype.saveStyles = function () {
        this.updateCellXfsStyleXfs();
        /* tslint:disable-next-line:max-line-length */
        var styleTemp = '<?xml version="1.0" encoding="utf-8"?><styleSheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">';
        styleTemp += this.saveNumberFormats();
        styleTemp += this.saveFonts();
        styleTemp += this.saveFills();
        styleTemp += this.saveBorders();
        styleTemp += this.saveCellStyleXfs();
        styleTemp += this.saveCellXfs();
        styleTemp += this.saveCellStyles();
        this.addToArchive(styleTemp + '</styleSheet>', 'xl/styles.xml');
    };
    Workbook.prototype.updateCellXfsStyleXfs = function () {
        for (var _i = 0, _a = this.mStyles; _i < _a.length; _i++) {
            var style = _a[_i];
            var cellXfs = undefined;
            if (style.isGlobalStyle) {
                cellXfs = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellStyleXfs"]();
                cellXfs.xfId = (style.index - 1);
            }
            else {
                cellXfs = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["CellXfs"]();
                cellXfs.xfId = 0;
            }
            //Add font
            var compareFontResult = this.isNewFont(style);
            if (!compareFontResult.result) {
                var font = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["Font"]();
                font.b = style.bold;
                font.i = style.italic;
                font.name = style.fontName;
                font.sz = style.fontSize;
                font.u = style.underline;
                font.color = ('FF' + style.fontColor.replace('#', ''));
                this.mFonts.push(font);
                cellXfs.fontId = this.mFonts.length - 1;
            }
            else {
                cellXfs.fontId = compareFontResult.index;
            }
            //Add fill
            if (style.backColor !== 'none') {
                var backColor = 'FF' + style.backColor.replace('#', '');
                if (this.mFills.has(backColor)) {
                    var fillId = this.mFills.get(backColor);
                    cellXfs.fillId = fillId;
                }
                else {
                    var fillId = this.mFills.size + 2;
                    this.mFills.set(backColor, fillId);
                    cellXfs.fillId = (fillId);
                }
            }
            else {
                cellXfs.fillId = 0;
            }
            //Add border            
            if (!this.isNewBorder(style)) {
                this.mBorders.push(style.borders);
                cellXfs.borderId = this.mBorders.length;
            }
            else {
                cellXfs.borderId = 0;
            }
            //Add Number Format            
            if (style.numberFormat !== 'GENERAL') {
                if (this.mNumFmt.has(style.numberFormat)) {
                    var numFmt = this.mNumFmt.get(style.numberFormat);
                    cellXfs.numFmtId = numFmt.numFmtId;
                }
                else {
                    var id = this.mNumFmt.size + 164;
                    this.mNumFmt.set(style.numberFormat, new _cell_style__WEBPACK_IMPORTED_MODULE_2__["NumFmt"](id, style.numberFormat));
                    cellXfs.numFmtId = id;
                }
            }
            else {
                if (style.numberFormat === 'GENERAL' && style.numFmtId === 14) {
                    cellXfs.numFmtId = 14;
                }
                else {
                    cellXfs.numFmtId = 0;
                }
            }
            //Add alignment            
            if (!style.isGlobalStyle) {
                cellXfs.applyAlignment = 1;
            }
            cellXfs.alignment = new _cell_style__WEBPACK_IMPORTED_MODULE_2__["Alignment"]();
            cellXfs.alignment.indent = style.indent;
            cellXfs.alignment.horizontal = style.hAlign;
            cellXfs.alignment.vertical = style.vAlign;
            cellXfs.alignment.wrapText = style.wrapText ? 1 : 0;
            cellXfs.alignment.rotation = style.rotation;
            if (style.isGlobalStyle) {
                this.mCellStyleXfs.push(cellXfs);
                this.mCellXfs.push(cellXfs);
            }
            else {
                //Add cellxfs
                this.mCellXfs.push(cellXfs);
            }
        }
    };
    Workbook.prototype.saveNumberFormats = function () {
        if (this.mNumFmt.size >= 1) {
            var numFmtStyle_1 = '<numFmts count="' + (this.mNumFmt.size) + '">';
            this.mNumFmt.forEach(function (value, key) {
                numFmtStyle_1 += '<numFmt numFmtId="' + value.numFmtId + '" formatCode="' + value.formatCode.replace(/"/g, '&quot;') + '" />';
            });
            return (numFmtStyle_1 += '</numFmts>');
        }
        else {
            return '';
        }
    };
    Workbook.prototype.saveFonts = function () {
        /* tslint:disable-next-line:max-line-length */
        var fontStyle = '<fonts count="' + (this.mFonts.length) + '">';
        if (this.mFonts.length >= 1) {
            for (var _i = 0, _a = this.mFonts; _i < _a.length; _i++) {
                var font = _a[_i];
                fontStyle += '<font>';
                if (font.b) {
                    fontStyle += '<b />';
                }
                if (font.i) {
                    fontStyle += '<i />';
                }
                if (font.u) {
                    fontStyle += '<u />';
                }
                fontStyle += '<sz val="' + font.sz + '" />';
                fontStyle += '<color rgb="' + font.color + '" />';
                fontStyle += '<name val="' + font.name + '" /></font>';
            }
        }
        return fontStyle + '</fonts>';
    };
    Workbook.prototype.saveFills = function () {
        /* tslint:disable-next-line:max-line-length */
        var fillsStyle = '<fills count="' + (this.mFills.size + 2) + '"><fill><patternFill patternType="none"></patternFill></fill><fill><patternFill patternType="gray125"></patternFill></fill>';
        if (this.mFills.size >= 1) {
            this.mFills.forEach(function (value, key) {
                /* tslint:disable-next-line:max-line-length */
                fillsStyle += '<fill><patternFill patternType="solid"><fgColor rgb="' + key + '" /><bgColor rgb="FFFFFFFF" /></patternFill></fill>';
            });
        }
        return fillsStyle + '</fills>';
    };
    Workbook.prototype.saveBorders = function () {
        /* tslint:disable-next-line:max-line-length */
        var bordersStyle = '<borders count="' + (this.mBorders.length + 1) + '"><border><left /><right /><top /><bottom /><diagonal /></border>';
        if (this.mBorders.length >= 1) {
            for (var _i = 0, _a = this.mBorders; _i < _a.length; _i++) {
                var borders = _a[_i];
                if (this.isAllBorder(borders)) {
                    var color = borders.all.color.replace('#', '');
                    var lineStyle = borders.all.lineStyle;
                    /* tslint:disable-next-line:max-line-length */
                    bordersStyle += '<border><left style="' + lineStyle + '"><color rgb="FF' + color + '" /></left><right style="' + lineStyle + '"><color rgb="FF' + color + '" /></right><top style="' + lineStyle + '"><color rgb="FF' + color + '" /></top><bottom style="' + lineStyle + '"><color rgb="FF' + color + '" /></bottom></border>';
                }
                else {
                    /* tslint:disable-next-line:max-line-length */
                    bordersStyle += '<border><left style="' + borders.left.lineStyle + '"><color rgb="FF' + borders.left.color.replace('#', '') + '" /></left><right style="' + borders.right.lineStyle + '"><color rgb="FF' + borders.right.color.replace('#', '') + '" /></right><top style="' + borders.top.lineStyle + '"><color rgb="FF' + borders.top.color.replace('#', '') + '" /></top><bottom style="' + borders.bottom.lineStyle + '"><color rgb="FF' + borders.bottom.color.replace('#', '') + '" /></bottom></border>';
                }
            }
        }
        return bordersStyle + '</borders>';
    };
    Workbook.prototype.saveCellStyles = function () {
        var _this = this;
        var cellStyleString = '<cellStyles  count="' + (this.cellStyles.size) + '">';
        this.cellStyles.forEach(function (value, key) {
            cellStyleString += '<cellStyle name="' + key + '" xfId="' + _this.cellStyles.get(key).xfId + '"';
            if (key === 'Normal') {
                cellStyleString += ' builtinId="0"';
            }
            cellStyleString += ' />';
        });
        return cellStyleString += '</cellStyles>';
    };
    Workbook.prototype.saveCellStyleXfs = function () {
        /* tslint:disable-next-line:max-line-length */
        var cellXfsStyle = '<cellStyleXfs count="' + (this.mCellStyleXfs.length + 1) + '"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" />';
        if (this.mCellStyleXfs.length >= 1) {
            for (var _i = 0, _a = this.mCellStyleXfs; _i < _a.length; _i++) {
                var cellStyleXf = _a[_i];
                /* tslint:disable-next-line:max-line-length */
                cellXfsStyle += '<xf numFmtId="' + cellStyleXf.numFmtId + '" fontId="' + cellStyleXf.fontId + '" fillId="' + cellStyleXf.fillId + '" borderId="' + cellStyleXf.borderId + '" ';
                if (cellStyleXf.alignment !== undefined) {
                    cellXfsStyle += '>' + this.saveAlignment(cellStyleXf) + '</xf>';
                }
                else {
                    cellXfsStyle += ' />';
                }
            }
        }
        return cellXfsStyle + '</cellStyleXfs>';
    };
    Workbook.prototype.saveCellXfs = function () {
        /* tslint:disable-next-line:max-line-length */
        var cellXfsStyle = '<cellXfs count="' + (this.mCellXfs.length + 1) + '"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />';
        if (this.mCellXfs.length >= 1) {
            for (var _i = 0, _a = this.mCellXfs; _i < _a.length; _i++) {
                var cellXf = _a[_i];
                /* tslint:disable-next-line:max-line-length */
                cellXfsStyle += '<xf numFmtId="' + cellXf.numFmtId + '" fontId="' + cellXf.fontId + '" fillId="' + cellXf.fillId + '" borderId="' + cellXf.borderId + '" xfId="' + cellXf.xfId + '" ';
                if (cellXf.applyAlignment === 1) {
                    cellXfsStyle += 'applyAlignment="1"';
                }
                cellXfsStyle += '>' + this.saveAlignment(cellXf) + '</xf>';
            }
        }
        return cellXfsStyle + '</cellXfs>';
    };
    Workbook.prototype.saveAlignment = function (cellXf) {
        var alignString = '<alignment ';
        if (cellXf.alignment.horizontal !== undefined) {
            alignString += 'horizontal="' + cellXf.alignment.horizontal + '" ';
        }
        if (cellXf.alignment.indent !== undefined && cellXf.alignment.indent !== 0) {
            alignString += 'indent="' + cellXf.alignment.indent + '" ';
        }
        else if (cellXf.alignment.rotation !== undefined && cellXf.alignment.rotation !== 0) {
            alignString += 'textRotation="' + cellXf.alignment.rotation + '" ';
        }
        if (cellXf.alignment.vertical !== undefined) {
            alignString += 'vertical="' + cellXf.alignment.vertical + '" ';
        }
        alignString += 'wrapText="' + cellXf.alignment.wrapText + '" />';
        return alignString;
    };
    Workbook.prototype.saveApp = function (builtInProperties) {
        /* tslint:disable-next-line:max-line-length */
        var appString = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>Essential XlsIO</Application>';
        if (builtInProperties !== undefined) {
            if (builtInProperties.manager !== undefined) {
                appString += '<Manager>' + builtInProperties.manager + '</Manager>';
            }
            if (builtInProperties.company !== undefined) {
                appString += '<Company>' + builtInProperties.company + '</Company>';
            }
        }
        this.addToArchive((appString + '</Properties>'), 'docProps/app.xml');
    };
    Workbook.prototype.saveCore = function (builtInProperties) {
        var createdDate = new Date();
        /* tslint:disable-next-line:max-line-length */
        var coreString = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><cp:coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">';
        if (this.builtInProperties !== undefined) {
            if (builtInProperties.author !== undefined) {
                coreString += '<dc:creator>' + builtInProperties.author + '</dc:creator>';
            }
            if (builtInProperties.subject !== undefined) {
                coreString += '<dc:subject>' + builtInProperties.subject + '</dc:subject>';
            }
            if (builtInProperties.category !== undefined) {
                coreString += '<cp:category>' + builtInProperties.category + '</cp:category>';
            }
            if (builtInProperties.comments !== undefined) {
                coreString += '<dc:description>' + builtInProperties.comments + '</dc:description>';
            }
            if (builtInProperties.title !== undefined) {
                coreString += '<dc:title>' + builtInProperties.title + '</dc:title>';
            }
            if (builtInProperties.tags !== undefined) {
                coreString += '<cp:keywords>' + builtInProperties.tags + '</cp:keywords>';
            }
            if (builtInProperties.status !== undefined) {
                coreString += '<cp:contentStatus>' + builtInProperties.status + '</cp:contentStatus>';
            }
            if (builtInProperties.createdDate !== undefined) {
                /* tslint:disable-next-line:max-line-length */
                coreString += '<dcterms:created xsi:type="dcterms:W3CDTF">' + builtInProperties.createdDate.toISOString() + '</dcterms:created>';
            }
            else {
                coreString += '<dcterms:created xsi:type="dcterms:W3CDTF">' + createdDate.toISOString() + '</dcterms:created>';
            }
            if (builtInProperties.modifiedDate !== undefined) {
                /* tslint:disable-next-line:max-line-length */
                coreString += '<dcterms:modified xsi:type="dcterms:W3CDTF">' + builtInProperties.modifiedDate.toISOString() + '</dcterms:modified>';
            }
            else {
                coreString += '<dcterms:modified xsi:type="dcterms:W3CDTF">' + createdDate.toISOString() + '</dcterms:modified>';
            }
        }
        else {
            coreString += '<dcterms:created xsi:type="dcterms:W3CDTF">' + createdDate.toISOString() + '</dcterms:created>';
            coreString += '<dcterms:modified xsi:type="dcterms:W3CDTF">' + createdDate.toISOString() + '</dcterms:modified>';
        }
        /* tslint:disable-next-line:max-line-length */
        coreString += '</cp:coreProperties>';
        this.addToArchive(coreString, 'docProps/core.xml');
    };
    Workbook.prototype.saveTopLevelRelation = function () {
        /* tslint:disable-next-line:max-line-length */
        var topRelation = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml" /><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>';
        this.addToArchive(topRelation, '_rels/.rels');
    };
    Workbook.prototype.saveWorkbookRelation = function () {
        /* tslint:disable-next-line:max-line-length */
        var wbRelation = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
        var length = this.worksheets.length;
        var count = 0;
        for (var i = 0; i < length; i++, count++) {
            /* tslint:disable-next-line:max-line-length */
            wbRelation += '<Relationship Id="rId' + (i + 1).toString() + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet' + (i + 1).toString() + '.xml" />';
        }
        /* tslint:disable-next-line:max-line-length */
        wbRelation += '<Relationship Id="rId' + (++count).toString() + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />';
        if (this.sharedStringCount > 0) {
            /* tslint:disable-next-line:max-line-length */
            wbRelation += '<Relationship Id="rId' + (++count).toString() + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />';
        }
        this.addToArchive((wbRelation + '</Relationships>'), 'xl/_rels/workbook.xml.rels');
    };
    Workbook.prototype.saveContentType = function () {
        /* tslint:disable-next-line:max-line-length */
        var contentTypeString = '<?xml version="1.0" encoding="utf-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />';
        var sheetsOverride = '';
        var length = this.worksheets.length;
        for (var i = 0; i < length; i++) {
            /* tslint:disable-next-line:max-line-length */
            sheetsOverride += '<Override PartName="/xl/worksheets/sheet' + (i + 1).toString() + '.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />';
            if (this.worksheets[i].images != undefined && this.worksheets[i].images.length > 0) {
                /* tslint:disable-next-line:max-line-length */
                sheetsOverride += '<Override PartName="/xl/drawings/drawing' + (i + 1).toString() + '.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml" />';
            }
        }
        if (this.imageCount > 0)
            sheetsOverride += '<Default Extension="png" ContentType="image/png" />';
        if (this.sharedStringCount > 0) {
            /* tslint:disable-next-line:max-line-length */
            contentTypeString += '<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" />';
        }
        this.addToArchive((contentTypeString + sheetsOverride + '</Types>'), '[Content_Types].xml');
    };
    Workbook.prototype.addToArchive = function (xmlString, itemName) {
        if (typeof (xmlString) === 'string') {
            var blob = new Blob([xmlString], { type: 'text/plain' });
            var archiveItem = new _ej2_compression__WEBPACK_IMPORTED_MODULE_7__["ZipArchiveItem"](blob, itemName);
            this.mArchive.addItem(archiveItem);
        }
        else {
            var archiveItem = new _ej2_compression__WEBPACK_IMPORTED_MODULE_7__["ZipArchiveItem"](xmlString, itemName);
            this.mArchive.addItem(archiveItem);
        }
    };
    Workbook.prototype.processMergeCells = function (cell, rowIndex, mergeCells) {
        if (cell.rowSpan !== 0 || cell.colSpan !== 0) {
            var mCell = new _worksheet__WEBPACK_IMPORTED_MODULE_1__["MergeCell"]();
            mCell.x = cell.index;
            mCell.width = cell.colSpan;
            mCell.y = rowIndex;
            mCell.height = cell.rowSpan;
            var startCell = this.getCellName(mCell.y, mCell.x);
            var endCell = this.getCellName(rowIndex + mCell.height, cell.index + mCell.width);
            mCell.ref = startCell + ':' + endCell;
            var mergedCell = mergeCells.add(mCell);
            var start = { x: mCell.x, y: mCell.y };
            var end = {
                x: (cell.index + mCell.width), y: (rowIndex + mCell.height)
            };
            this.updatedMergedCellStyles(start, end, cell);
        }
        return mergeCells;
    };
    Workbook.prototype.updatedMergedCellStyles = function (sCell, eCell, cell) {
        for (var x = sCell.x; x <= eCell.x; x++) {
            for (var y = sCell.y; y <= eCell.y; y++) {
                this.mergedCellsStyle.set(this.getCellName(y, x), { x: x, y: y, styleIndex: cell.styleIndex });
            }
        }
    };
    /**
     * Returns the tick count corresponding to the given year, month, and day.
     * @param year number value of year
     * @param month number value of month
     * @param day number value of day
     */
    Workbook.prototype.dateToTicks = function (year, month, day) {
        var ticksPerDay = 10000 * 1000 * 60 * 60 * 24;
        var daysToMonth365 = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
        var daysToMonth366 = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];
        if (year >= 1 && year <= 9999 && month >= 1 && month <= 12) {
            var days = this.isLeapYear(year) ? daysToMonth366 : daysToMonth365;
            var y = year - 1;
            var n = y * 365 + ((y / 4) | 0) - ((y / 100) | 0) + ((y / 400) | 0) + days[month - 1] + day - 1;
            return n * ticksPerDay;
        }
        throw new Error('Not a valid date');
    };
    /**
     * Return the tick count corresponding to the given hour, minute, second.
     * @param hour number value of hour
     * @param minute number value if minute
     * @param second number value of second
     */
    Workbook.prototype.timeToTicks = function (hour, minute, second) {
        if (hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60) {
            var totalSeconds = hour * 3600 + minute * 60 + second;
            return totalSeconds * 10000 * 1000;
        }
        throw new Error('Not valid time');
    };
    /**
     * Checks if given year is a leap year.
     * @param year Year value.
     */
    Workbook.prototype.isLeapYear = function (year) {
        return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
    };
    /**
     * Converts `DateTime` to the equivalent OLE Automation date.
     */
    Workbook.prototype.toOADate = function (date) {
        var ticks = 0;
        /* tslint:disable-next-line:max-line-length */
        ticks = this.dateToTicks(date.getFullYear(), (date.getMonth() + 1), date.getDate()) + this.timeToTicks(date.getHours(), date.getMinutes(), date.getSeconds());
        if (ticks === 0) {
            return 0.0;
        }
        var ticksPerDay = 10000 * 1000 * 60 * 60 * 24;
        var daysTo1899 = (((365 * 4 + 1) * 25 - 1) * 4 + 1) * 4 + ((365 * 4 + 1) * 25 - 1) * 3 - 367;
        var doubleDateOffset = daysTo1899 * ticksPerDay;
        var oaDateMinAsTicks = (((365 * 4 + 1) * 25 - 1) - 365) * ticksPerDay;
        if (ticks < oaDateMinAsTicks) {
            throw new Error('Arg_OleAutDateInvalid');
        }
        var millisPerDay = 1000 * 60 * 60 * 24;
        return ((ticks - doubleDateOffset) / 10000) / millisPerDay;
    };
    return Workbook;
}());

/**
 * BuiltInProperties Class
 * @private
 */
var BuiltInProperties = /** @__PURE__ @class */ (function () {
    function BuiltInProperties() {
    }
    return BuiltInProperties;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheet.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheet.js ***!
  \*********************************************************************/
/*! exports provided: Worksheet, HyperLink, Grouping, FreezePane, MergeCell, MergeCells */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Worksheet", function() { return Worksheet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HyperLink", function() { return HyperLink; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Grouping", function() { return Grouping; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FreezePane", function() { return FreezePane; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeCell", function() { return MergeCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeCells", function() { return MergeCells; });
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/**
 * Worksheet class
 * @private
 */
var Worksheet = /** @__PURE__ @class */ (function () {
    function Worksheet() {
        this.isSummaryRowBelow = true;
        this.showGridLines = true;
        this.enableRtl = false;
    }
    return Worksheet;
}());

/**
 * Hyperlink class
 * @private
 */
var HyperLink = /** @__PURE__ @class */ (function () {
    function HyperLink() {
    }
    return HyperLink;
}());

/**
 * Grouping class
 * @private
 */
var Grouping = /** @__PURE__ @class */ (function () {
    function Grouping() {
    }
    return Grouping;
}());

/**
 * FreezePane class
 * @private
 */
var FreezePane = /** @__PURE__ @class */ (function () {
    function FreezePane() {
    }
    return FreezePane;
}());

/**
 * MergeCell
 * @private
 */
var MergeCell = /** @__PURE__ @class */ (function () {
    function MergeCell() {
    }
    return MergeCell;
}());

/**
 * MergeCells class
 * @private
 */
var MergeCells = /** @__PURE__ @class */ (function (_super) {
    __extends(MergeCells, _super);
    function MergeCells() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.add = function (mergeCell) {
            var inserted = false;
            var count = 0;
            for (var _i = 0, _a = _this; _i < _a.length; _i++) {
                var mCell = _a[_i];
                if (MergeCells.isIntersecting(mCell, mergeCell)) {
                    var intersectingCell = new MergeCell();
                    intersectingCell.x = Math.min(mCell.x, mergeCell.x);
                    intersectingCell.y = Math.min(mCell.Y, mergeCell.y);
                    intersectingCell.width = Math.max(mCell.Width + mCell.X, mergeCell.width + mergeCell.x);
                    intersectingCell.height = Math.max(mCell.Height + mCell.Y, mergeCell.height + mergeCell.y);
                    intersectingCell.ref = (_this[count].ref.split(':')[0]) + ':' + (mergeCell.ref.split(':')[1]);
                    _this[count] = intersectingCell;
                    mergeCell = intersectingCell;
                    inserted = true;
                }
                count++;
            }
            if (!inserted) {
                _this.push(mergeCell);
            }
            return mergeCell;
        };
        return _this;
    }
    MergeCells.isIntersecting = function (base, compare) {
        return (base.x <= compare.x + compare.width)
            && (compare.x <= base.x + base.width)
            && (base.y <= compare.y + compare.height)
            && (compare.y <= base.y + base.height);
    };
    return MergeCells;
}(Array));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheets.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-excel-export/worksheets.js ***!
  \**********************************************************************/
/*! exports provided: Worksheets */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Worksheets", function() { return Worksheets; });
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/**
 * Worksheets class
 * @private
 */
var Worksheets = /** @__PURE__ @class */ (function (_super) {
    __extends(Worksheets, _super);
    function Worksheets() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return Worksheets;
}(Array));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-file-utils/encoding.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-file-utils/encoding.js ***!
  \******************************************************************/
/*! exports provided: Encoding, validateNullOrUndefined */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Encoding", function() { return Encoding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateNullOrUndefined", function() { return validateNullOrUndefined; });
/**
 * Encoding class: Contains the details about encoding type, whether to write a Unicode byte order mark (BOM).
 * ```typescript
 * let encoding : Encoding = new Encoding();
 * encoding.type = 'Utf8';
 * encoding.getBytes('Encoding', 0, 5);
 * ```
 */
var Encoding = /** @__PURE__ @class */ (function () {
    /**
     * Initializes a new instance of the Encoding class. A parameter specifies whether to write a Unicode byte order mark
     * @param  {boolean} includeBom?-true to specify that a Unicode byte order mark is written; otherwise, false.
     */
    function Encoding(includeBom) {
        this.emitBOM = true;
        this.encodingType = 'Ansi';
        this.initBOM(includeBom);
    }
    Object.defineProperty(Encoding.prototype, "includeBom", {
        /**
         * Gets a value indicating whether to write a Unicode byte order mark
         * @returns boolean- true to specify that a Unicode byte order mark is written; otherwise, false
         */
        get: function () {
            return this.emitBOM;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Encoding.prototype, "type", {
        /**
         * Gets the encoding type.
         * @returns EncodingType
         */
        get: function () {
            return this.encodingType;
        },
        /**
         * Sets the encoding type.
         * @param  {EncodingType} value
         */
        set: function (value) {
            this.encodingType = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Initialize the includeBom to emit BOM or Not
     * @param  {boolean} includeBom
     */
    Encoding.prototype.initBOM = function (includeBom) {
        if (includeBom === undefined || includeBom === null) {
            this.emitBOM = true;
        }
        else {
            this.emitBOM = includeBom;
        }
    };
    /**
     * Calculates the number of bytes produced by encoding the characters in the specified string
     * @param  {string} chars - The string containing the set of characters to encode
     * @returns {number} - The number of bytes produced by encoding the specified characters
     */
    Encoding.prototype.getByteCount = function (chars) {
        var byteCount = 0;
        validateNullOrUndefined(chars, 'string');
        if (chars === '') {
            var byte = this.utf8Len(chars.charCodeAt(0));
            return byte;
        }
        if (this.type === null || this.type === undefined) {
            this.type = 'Ansi';
        }
        return this.getByteCountInternal(chars, 0, chars.length);
    };
    /**
     * Return the Byte of character
     * @param  {number} codePoint
     * @returns {number}
     */
    Encoding.prototype.utf8Len = function (codePoint) {
        var bytes = codePoint <= 0x7F ? 1 :
            codePoint <= 0x7FF ? 2 :
                codePoint <= 0xFFFF ? 3 :
                    codePoint <= 0x1FFFFF ? 4 : 0;
        return bytes;
    };
    /**
     * for 4 byte character return surrogate pair true, otherwise false
     * @param  {number} codeUnit
     * @returns {boolean}
     */
    Encoding.prototype.isHighSurrogate = function (codeUnit) {
        return codeUnit >= 0xD800 && codeUnit <= 0xDBFF;
    };
    /**
     * for 4byte character generate the surrogate pair
     * @param  {number} highCodeUnit
     * @param  {number} lowCodeUnit
     */
    Encoding.prototype.toCodepoint = function (highCodeUnit, lowCodeUnit) {
        highCodeUnit = (0x3FF & highCodeUnit) << 10;
        var u = highCodeUnit | (0x3FF & lowCodeUnit);
        return u + 0x10000;
    };
    /**
     * private method to get the byte count for specific charindex and count
     * @param  {string} chars
     * @param  {number} charIndex
     * @param  {number} charCount
     */
    Encoding.prototype.getByteCountInternal = function (chars, charIndex, charCount) {
        var byteCount = 0;
        if (this.encodingType === 'Utf8' || this.encodingType === 'Unicode') {
            var isUtf8 = this.encodingType === 'Utf8';
            for (var i = 0; i < charCount; i++) {
                var charCode = chars.charCodeAt(isUtf8 ? charIndex : charIndex++);
                if (this.isHighSurrogate(charCode)) {
                    if (isUtf8) {
                        var high = charCode;
                        var low = chars.charCodeAt(++charIndex);
                        byteCount += this.utf8Len(this.toCodepoint(high, low));
                    }
                    else {
                        byteCount += 4;
                        ++i;
                    }
                }
                else {
                    if (isUtf8) {
                        byteCount += this.utf8Len(charCode);
                    }
                    else {
                        byteCount += 2;
                    }
                }
                if (isUtf8) {
                    charIndex++;
                }
            }
            return byteCount;
        }
        else {
            byteCount = charCount;
            return byteCount;
        }
    };
    /**
     * Encodes a set of characters from the specified string into the ArrayBuffer.
     * @param  {string} s- The string containing the set of characters to encode
     * @param  {number} charIndex-The index of the first character to encode.
     * @param  {number} charCount- The number of characters to encode.
     * @returns {ArrayBuffer} - The ArrayBuffer that contains the resulting sequence of bytes.
     */
    Encoding.prototype.getBytes = function (s, charIndex, charCount) {
        validateNullOrUndefined(s, 'string');
        validateNullOrUndefined(charIndex, 'charIndex');
        validateNullOrUndefined(charCount, 'charCount');
        if (charIndex < 0 || charCount < 0) {
            throw new RangeError('Argument Out Of Range Exception: charIndex or charCount is less than zero');
        }
        if (s.length - charIndex < charCount) {
            throw new RangeError('Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string');
        }
        var bytes;
        if (s === '') {
            bytes = new ArrayBuffer(0);
            return bytes;
        }
        if (this.type === null || this.type === undefined) {
            this.type = 'Ansi';
        }
        var byteCount = this.getByteCountInternal(s, charIndex, charCount);
        switch (this.type) {
            case 'Utf8':
                bytes = this.getBytesOfUtf8Encoding(byteCount, s, charIndex, charCount);
                return bytes;
            case 'Unicode':
                bytes = this.getBytesOfUnicodeEncoding(byteCount, s, charIndex, charCount);
                return bytes;
            default:
                bytes = this.getBytesOfAnsiEncoding(byteCount, s, charIndex, charCount);
                return bytes;
        }
    };
    /**
     * Decodes a sequence of bytes from the specified ArrayBuffer into the string.
     * @param  {ArrayBuffer} bytes- The ArrayBuffer containing the sequence of bytes to decode.
     * @param  {number} index- The index of the first byte to decode.
     * @param  {number} count- The number of bytes to decode.
     * @returns {string} - The string that contains the resulting set of characters.
     */
    Encoding.prototype.getString = function (bytes, index, count) {
        validateNullOrUndefined(bytes, 'bytes');
        validateNullOrUndefined(index, 'index');
        validateNullOrUndefined(count, 'count');
        if (index < 0 || count < 0) {
            throw new RangeError('Argument Out Of Range Exception: index or count is less than zero');
        }
        if (bytes.byteLength - index < count) {
            throw new RangeError('Argument Out Of Range Exception: index and count do not denote a valid range in bytes');
        }
        if (bytes.byteLength === 0 || count === 0) {
            return '';
        }
        if (this.type === null || this.type === undefined) {
            this.type = 'Ansi';
        }
        var out = '';
        var byteCal = new Uint8Array(bytes);
        switch (this.type) {
            case 'Utf8':
                var s = this.getStringOfUtf8Encoding(byteCal, index, count);
                return s;
            case 'Unicode':
                var byteUnicode = new Uint16Array(bytes);
                out = this.getStringofUnicodeEncoding(byteUnicode, index, count);
                return out;
            default:
                var j = index;
                for (var i = 0; i < count; i++) {
                    var c = byteCal[j];
                    out += String.fromCharCode(c); // 1 byte(ASCII) character                  
                    j++;
                }
                return out;
        }
    };
    Encoding.prototype.getBytesOfAnsiEncoding = function (byteCount, s, charIndex, charCount) {
        var bytes = new ArrayBuffer(byteCount);
        var bufview = new Uint8Array(bytes);
        var k = 0;
        for (var i = 0; i < charCount; i++) {
            var charcode = s.charCodeAt(charIndex++);
            if (charcode < 0x800) {
                bufview[k] = charcode;
            }
            else {
                bufview[k] = 63; //replacement character '?'
            }
            k++;
        }
        return bytes;
    };
    Encoding.prototype.getBytesOfUtf8Encoding = function (byteCount, s, charIndex, charCount) {
        var bytes = new ArrayBuffer(byteCount);
        var uint = new Uint8Array(bytes);
        var index = charIndex;
        var j = 0;
        for (var i = 0; i < charCount; i++) {
            var charcode = s.charCodeAt(index);
            if (charcode <= 0x7F) { // 1 byte character 2^7
                uint[j] = charcode;
            }
            else if (charcode < 0x800) { // 2 byte character 2^11
                uint[j] = 0xc0 | (charcode >> 6);
                uint[++j] = 0x80 | (charcode & 0x3f);
            }
            else if ((charcode < 0xd800 || charcode >= 0xe000)) { // 3 byte character 2^16        
                uint[j] = 0xe0 | (charcode >> 12);
                uint[++j] = 0x80 | ((charcode >> 6) & 0x3f);
                uint[++j] = 0x80 | (charcode & 0x3f);
            }
            else {
                uint[j] = 0xef;
                uint[++j] = 0xbf;
                uint[++j] = 0xbd; // U+FFFE "replacement character"
            }
            ++j;
            ++index;
        }
        return bytes;
    };
    Encoding.prototype.getBytesOfUnicodeEncoding = function (byteCount, s, charIndex, charCount) {
        var bytes = new ArrayBuffer(byteCount);
        var uint16 = new Uint16Array(bytes);
        for (var i = 0; i < charCount; i++) {
            var charcode = s.charCodeAt(i);
            uint16[i] = charcode;
        }
        return bytes;
    };
    Encoding.prototype.getStringOfUtf8Encoding = function (byteCal, index, count) {
        var j = 0;
        var i = index;
        var s = '';
        for (j; j < count; j++) {
            var c = byteCal[i++];
            while (i > byteCal.length) {
                return s;
            }
            if (c > 127) {
                if (c > 191 && c < 224 && i < count) {
                    c = (c & 31) << 6 | byteCal[i] & 63;
                }
                else if (c > 223 && c < 240 && i < byteCal.byteLength) {
                    c = (c & 15) << 12 | (byteCal[i] & 63) << 6 | byteCal[++i] & 63;
                }
                else if (c > 239 && c < 248 && i < byteCal.byteLength) {
                    c = (c & 7) << 18 | (byteCal[i] & 63) << 12 | (byteCal[++i] & 63) << 6 | byteCal[++i] & 63;
                }
                ++i;
            }
            s += String.fromCharCode(c); // 1 byte(ASCII) character                          
        }
        return s;
    };
    Encoding.prototype.getStringofUnicodeEncoding = function (byteUni, index, count) {
        if (count > byteUni.length) {
            throw new RangeError('ArgumentOutOfRange_Count');
        }
        var byte16 = new Uint16Array(count);
        var out = '';
        for (var i = 0; i < count && i < byteUni.length; i++) {
            byte16[i] = byteUni[index++];
        }
        out = String.fromCharCode.apply(null, byte16);
        return out;
    };
    /**
     * To clear the encoding instance
     * @return {void}
     */
    Encoding.prototype.destroy = function () {
        this.emitBOM = undefined;
        this.encodingType = undefined;
    };
    return Encoding;
}());

/**
 * To check the object is null or undefined and throw error if it is null or undefined
 * @param {Object} value - object to check is null or undefined
 * @return {boolean}
 * @throws {ArgumentException} - if the value is null or undefined
 * @private
 */
function validateNullOrUndefined(value, message) {
    if (value === null || value === undefined) {
        throw new Error('ArgumentException: ' + message + ' cannot be null or undefined');
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-file-utils/index.js":
/*!***************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-file-utils/index.js ***!
  \***************************************************************/
/*! exports provided: XmlWriter, Namespace, XmlElement, XmlAttribute, StreamWriter, Encoding, validateNullOrUndefined, Save */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _xml_writer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./xml-writer */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/xml-writer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlWriter", function() { return _xml_writer__WEBPACK_IMPORTED_MODULE_0__["XmlWriter"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Namespace", function() { return _xml_writer__WEBPACK_IMPORTED_MODULE_0__["Namespace"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlElement", function() { return _xml_writer__WEBPACK_IMPORTED_MODULE_0__["XmlElement"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlAttribute", function() { return _xml_writer__WEBPACK_IMPORTED_MODULE_0__["XmlAttribute"]; });

/* harmony import */ var _stream_writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stream-writer */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/stream-writer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StreamWriter", function() { return _stream_writer__WEBPACK_IMPORTED_MODULE_1__["StreamWriter"]; });

/* harmony import */ var _encoding__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./encoding */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/encoding.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Encoding", function() { return _encoding__WEBPACK_IMPORTED_MODULE_2__["Encoding"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "validateNullOrUndefined", function() { return _encoding__WEBPACK_IMPORTED_MODULE_2__["validateNullOrUndefined"]; });

/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/save.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Save", function() { return _save__WEBPACK_IMPORTED_MODULE_3__["Save"]; });

// export all modules from current location
// example: export * from './module'
/**
 * file utils modules
 */






/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-file-utils/save.js":
/*!**************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-file-utils/save.js ***!
  \**************************************************************/
/*! exports provided: Save */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Save", function() { return Save; });
/**
 * Save class provide method to save file
 * ```typescript
 * let blob : Blob = new Blob([''], { type: 'text/plain' });
 * Save.save('fileName.txt',blob);
 */
var Save = /** @__PURE__ @class */ (function () {
    /**
     * Initialize new instance of {save}
     */
    function Save() {
        // tslint:disable
    }
    /**
     * Saves the file with specified name and sends the file to client browser
     * @param  {string} fileName- file name to save.
     * @param  {Blob} buffer- the content to write in file
     * @param  {boolean} isMicrosoftBrowser- specify whether microsoft browser or not
     * @returns {void}
     */
    Save.save = function (fileName, buffer) {
        if (fileName === null || fileName === undefined || fileName === '') {
            throw new Error('ArgumentException: fileName cannot be undefined, null or empty');
        }
        var extension = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length);
        var mimeType = this.getMimeType(extension);
        if (mimeType !== '') {
            buffer = new Blob([buffer], { type: mimeType });
        }
        if (this.isMicrosoftBrowser) {
            navigator.msSaveBlob(buffer, fileName);
        }
        else {
            var downloadLink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
            this.saveInternal(fileName, extension, buffer, downloadLink, 'download' in downloadLink);
        }
    };
    Save.saveInternal = function (fileName, extension, buffer, downloadLink, hasDownloadAttribute) {
        if (hasDownloadAttribute) {
            downloadLink.download = fileName;
            var dataUrl_1 = window.URL.createObjectURL(buffer);
            downloadLink.href = dataUrl_1;
            var event_1 = document.createEvent('MouseEvent');
            event_1.initEvent('click', true, true);
            downloadLink.dispatchEvent(event_1);
            setTimeout(function () {
                window.URL.revokeObjectURL(dataUrl_1);
                dataUrl_1 = undefined;
            });
        }
        else {
            if (extension !== 'docx' && extension !== 'xlsx') {
                var url = window.URL.createObjectURL(buffer);
                var isPopupBlocked = window.open(url, '_blank');
                if (!isPopupBlocked) {
                    window.location.href = url;
                }
            }
            else {
                var reader_1 = new FileReader();
                reader_1.onloadend = function () {
                    var isPopupBlocked = window.open(reader_1.result, '_blank');
                    if (!isPopupBlocked) {
                        window.location.href = reader_1.result;
                    }
                };
                reader_1.readAsDataURL(buffer);
            }
        }
    };
    /**
     *
     * @param {string} extension - get mime type of the specified extension
     * @private
     */
    Save.getMimeType = function (extension) {
        var mimeType = '';
        switch (extension) {
            case 'html':
                mimeType = 'text/html';
                break;
            case 'pdf':
                mimeType = 'application/pdf';
                break;
            case 'docx':
                mimeType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
                break;
            case 'xlsx':
                mimeType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
                break;
            case 'txt':
                mimeType = 'text/plain';
                break;
        }
        return mimeType;
    };
    return Save;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-file-utils/stream-writer.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-file-utils/stream-writer.js ***!
  \***********************************************************************/
/*! exports provided: StreamWriter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StreamWriter", function() { return StreamWriter; });
/* harmony import */ var _encoding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encoding */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/encoding.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./save */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/save.js");


/**
 * StreamWriter class contains the implementation for writing characters to a file in a particular encoding
 * ```typescript
 * let writer = new StreamWriter();
 * writer.write('Hello World');
 * writer.save('Sample.txt');
 * writer.dispose();
 * ```
 */
var StreamWriter = /** @__PURE__ @class */ (function () {
    /**
     * Initializes a new instance of the StreamWriter class by using the specified encoding.
     * @param  {Encoding} encoding?- The character encoding to use.
     */
    function StreamWriter(encoding) {
        this.bufferBlob = new Blob(['']);
        this.bufferText = '';
        this.init(encoding);
        _save__WEBPACK_IMPORTED_MODULE_1__["Save"].isMicrosoftBrowser = !(!navigator.msSaveBlob);
    }
    Object.defineProperty(StreamWriter.prototype, "buffer", {
        /**
         * Gets the content written to the StreamWriter as Blob.
         * @returns Blob
         */
        get: function () {
            this.flush();
            return this.bufferBlob;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StreamWriter.prototype, "encoding", {
        /**
         * Gets the encoding.
         * @returns Encoding
         */
        get: function () {
            return this.enc;
        },
        enumerable: true,
        configurable: true
    });
    StreamWriter.prototype.init = function (encoding) {
        if (encoding === null || encoding === undefined) {
            this.enc = new _encoding__WEBPACK_IMPORTED_MODULE_0__["Encoding"](false);
            this.enc.type = 'Utf8';
        }
        else {
            this.enc = encoding;
            this.setBomByte();
        }
    };
    /**
     * Private method to set Byte Order Mark(BOM) value based on EncodingType
     */
    StreamWriter.prototype.setBomByte = function () {
        if (this.encoding.includeBom) {
            switch (this.encoding.type) {
                case 'Unicode':
                    var arrayUnicode = new ArrayBuffer(2);
                    var uint8 = new Uint8Array(arrayUnicode);
                    uint8[0] = 255;
                    uint8[1] = 254;
                    this.bufferBlob = new Blob([arrayUnicode]);
                    break;
                case 'Utf8':
                    var arrayUtf8 = new ArrayBuffer(3);
                    var utf8 = new Uint8Array(arrayUtf8);
                    utf8[0] = 239;
                    utf8[1] = 187;
                    utf8[2] = 191;
                    this.bufferBlob = new Blob([arrayUtf8]);
                    break;
                default:
                    this.bufferBlob = new Blob(['']);
                    break;
            }
        }
    };
    /**
     * Saves the file with specified name and sends the file to client browser
     * @param  {string} fileName - The file name to save
     * @returns {void}
     */
    StreamWriter.prototype.save = function (fileName) {
        if (this.bufferText !== '') {
            this.flush();
        }
        _save__WEBPACK_IMPORTED_MODULE_1__["Save"].save(fileName, this.buffer);
    };
    /**
     * Writes the specified string.
     * @param  {string} value - The string to write. If value is null or undefined, nothing is written.
     * @returns {void}
     */
    StreamWriter.prototype.write = function (value) {
        if (this.encoding === undefined) {
            throw new Error('Object Disposed Exception: current writer is disposed');
        }
        Object(_encoding__WEBPACK_IMPORTED_MODULE_0__["validateNullOrUndefined"])(value, 'string');
        this.bufferText += value;
        if (this.bufferText.length >= 10240) {
            this.flush();
        }
    };
    StreamWriter.prototype.flush = function () {
        if (this.bufferText === undefined || this.bufferText === null || this.bufferText.length === 0) {
            return;
        }
        var bufferArray = this.encoding.getBytes(this.bufferText, 0, this.bufferText.length);
        this.bufferText = '';
        this.bufferBlob = new Blob([this.bufferBlob, bufferArray]);
    };
    /**
     * Writes the specified string followed by a line terminator
     * @param  {string} value - The string to write. If value is null or undefined, nothing is written
     * @returns {void}
     */
    StreamWriter.prototype.writeLine = function (value) {
        if (this.encoding === undefined) {
            throw new Error('Object Disposed Exception: current writer is disposed');
        }
        Object(_encoding__WEBPACK_IMPORTED_MODULE_0__["validateNullOrUndefined"])(value, 'string');
        this.bufferText = this.bufferText + value + '\r\n';
        if (this.bufferText.length >= 10240) {
            this.flush();
        }
    };
    /**
     * Releases the resources used by the StreamWriter
     * @returns {void}
     */
    StreamWriter.prototype.destroy = function () {
        this.bufferBlob = undefined;
        this.bufferText = undefined;
        if (this.enc instanceof _encoding__WEBPACK_IMPORTED_MODULE_0__["Encoding"]) {
            this.enc.destroy();
        }
        this.enc = undefined;
    };
    return StreamWriter;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-file-utils/xml-writer.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-file-utils/xml-writer.js ***!
  \********************************************************************/
/*! exports provided: XmlWriter, Namespace, XmlElement, XmlAttribute */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlWriter", function() { return XmlWriter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Namespace", function() { return Namespace; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlElement", function() { return XmlElement; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlAttribute", function() { return XmlAttribute; });
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./save */ "./ej2-resources/18.4.46/scripts/ej2-file-utils/save.js");

/**
 * XmlWriter class provide method to create XML data
 */
var XmlWriter = /** @__PURE__ @class */ (function () {
    /**
     * Initialize new instance of {XmlWriter}
     */
    function XmlWriter() {
        this.contentPos = 0;
        this.bufferText = '';
        this.bufferBlob = new Blob([''], { type: 'text/plain' });
        this.currentState = 'Initial';
        this.namespaceStack = [];
        this.namespaceStack.push(new Namespace());
        this.namespaceStack[0].set('xmlns', 'http://www.w3.org/2000/xmlns/', 'Special');
        this.namespaceStack.push(new Namespace());
        this.namespaceStack[1].set('xml', 'http://www.w3.org/XML/1998/namespace', 'Special');
        this.namespaceStack.push(new Namespace());
        this.namespaceStack[2].set('', '', 'Implied');
        this.elementStack = [];
        this.elementStack.push(new XmlElement());
        this.elementStack[0].set('', '', '', this.namespaceStack.length - 1);
        this.attributeStack = [];
        _save__WEBPACK_IMPORTED_MODULE_0__["Save"].isMicrosoftBrowser = !(!navigator.msSaveBlob);
    }
    Object.defineProperty(XmlWriter.prototype, "buffer", {
        /**
         * Gets the content written to the {XmlWriter} as Blob.
         * @returns {Blob}
         */
        get: function () {
            this.flush();
            return this.bufferBlob;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Writes processing instruction with a space between the name and text
     * @param {string} name - name of the processing instruction
     * @param {string} text - text to write in the processing instruction
     * @throws ArgumentException
     * @throws InvalidArgumentException
     * @throws InvalidOperationException
     */
    XmlWriter.prototype.writeProcessingInstruction = function (name, text) {
        if (name === undefined || name === null || name.length === 0) {
            throw new Error('ArgumentException: name should not be undefined, null or empty');
        }
        this.checkName(name);
        if (text === undefined || text === null) {
            text = '';
        }
        if (name.length === 3 && name === 'xml') {
            if (this.currentState !== 'Initial') {
                // tslint:disable-next-line:max-line-length
                throw new Error('InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it');
            }
        }
        if (this.currentState !== 'Initial' || this.bufferBlob === undefined) {
            throw new Error('InvalidOperationException: Wrong Token');
        }
        else {
            this.writeStartDocument();
            this.writeProcessingInstructionInternal(name, text);
        }
    };
    /**
     * Writes Xml declaration with version and standalone attribute
     * @param {boolean} standalone - if true it write standalone=yes else standalone=no
     * @throws InvalidOperation
     */
    XmlWriter.prototype.writeStartDocument = function (standalone) {
        if (this.currentState !== 'Initial' || this.bufferBlob === undefined) {
            throw new Error('InvalidOperationException: Wrong Token');
        }
        this.currentState = 'StartDocument';
        this.rawText('<?xml version="1.0" encoding="utf-8');
        if (standalone !== null && standalone !== undefined) {
            this.rawText('" standalone="');
            this.rawText(standalone ? 'yes' : 'no');
        }
        this.rawText('"?>');
    };
    /**
     * Closes any open tag or attribute and write the state back to start
     */
    XmlWriter.prototype.writeEndDocument = function () {
        while (this.elementStack.length - 1 > 0) {
            this.writeEndElement();
        }
        this.currentState = 'EndDocument';
        this.flush();
    };
    /**
     * Writes the specified start tag and associates it with the given namespace and prefix.
     * @param {string} prefix - namespace prefix of element
     * @param {string} localName -localName of element
     * @param {string} namespace - namespace URI associate with element
     * @throws ArgumentException
     * @throws InvalidOperationException
     */
    XmlWriter.prototype.writeStartElement = function (prefix, localName, namespace) {
        if (this.bufferBlob === undefined) {
            throw new Error('InvalidOperationException: Wrong Token');
        }
        if (localName === undefined || localName === null || localName.length === 0) {
            throw new Error('ArgumentException: localName cannot be undefined, null or empty');
        }
        this.checkName(localName);
        if (this.currentState === 'Initial') {
            this.writeStartDocument();
        }
        if (this.currentState === 'StartElement') {
            this.startElementContent();
        }
        this.currentState = 'StartElement';
        if (prefix === undefined || prefix === null) {
            if (namespace !== undefined && namespace !== null) {
                prefix = this.lookupPrefix(namespace);
            }
            if (prefix === undefined || prefix === null) {
                prefix = '';
            }
        }
        else if (prefix.length > 0) {
            if (namespace === undefined || namespace === null) {
                namespace = this.lookupNamespace(prefix);
            }
            if (namespace === undefined || namespace === null || (namespace !== undefined && namespace.length === 0)) {
                throw new Error('ArgumentException: Cannot use a prefix with an empty namespace');
            }
        }
        if (namespace === undefined || namespace === null) {
            namespace = this.lookupNamespace(prefix);
        }
        this.writeStartElementInternal(prefix, localName, namespace);
    };
    /**
     * Closes one element and pop corresponding namespace scope
     */
    XmlWriter.prototype.writeEndElement = function () {
        if (this.currentState === 'StartElement') {
            this.startElementContent();
            this.currentState = 'ElementContent';
        }
        else if (this.currentState === 'ElementContent') {
            this.currentState = 'ElementContent';
        }
        this.currentState = 'EndElement';
        var top = this.elementStack.length - 1;
        this.writeEndElementInternal(this.elementStack[top].prefix, this.elementStack[top].localName);
        this.namespaceStack.splice(this.elementStack[top].previousTop + 1);
        this.elementStack.splice(top);
        if (this.bufferText.length > 10240) {
            this.flush();
        }
    };
    /**
     * Writes an element with the specified prefix, local name, namespace URI, and value.
     * @param {string} prefix - namespace prefix of element
     * @param {string} localName - localName of element
     * @param {string} namespace - namespace URI associate with element
     * @param {string} value - value of element
     */
    XmlWriter.prototype.writeElementString = function (prefix, localName, namespace, value) {
        this.writeStartElement(prefix, localName, namespace);
        if (value !== undefined && value !== null && value.length !== 0) {
            this.writeString(value);
        }
        this.writeEndElement();
    };
    /**
     * Writes out the attribute with the specified prefix, local name, namespace URI, and value
     * @param {string} prefix - namespace prefix of element
     * @param {string} localName - localName of element
     * @param {string} namespace - namespace URI associate with element
     * @param {string} value - value of element
     */
    XmlWriter.prototype.writeAttributeString = function (prefix, localName, namespace, value) {
        this.writeStartAttribute(prefix, localName, namespace, value);
        this.writeStringInternal(value, true);
        this.writeEndAttribute();
    };
    /**
     * Writes the given text content
     * @param {string} text - text to write
     * @throws InvalidOperationException
     */
    XmlWriter.prototype.writeString = function (text) {
        this.writeInternal(text, false);
    };
    /**
     * Write given text as raw data
     * @param {string} text - text to write
     * @throws InvalidOperationException
     */
    XmlWriter.prototype.writeRaw = function (text) {
        this.writeInternal(text, true);
    };
    XmlWriter.prototype.writeInternal = function (text, isRawString) {
        if (text === undefined || text === null) {
            return;
        }
        else {
            if (this.currentState !== 'StartElement' && this.currentState !== 'ElementContent') {
                throw new Error('InvalidOperationException: Wrong Token');
            }
            if (this.currentState === 'StartElement') {
                this.startElementContent();
            }
            this.currentState = 'ElementContent';
            if (isRawString) {
                this.rawText(text);
            }
            else {
                this.writeStringInternal(text, false);
            }
        }
    };
    /**
     * Saves the file with specified name and sends the file to client browser
     * @param {string} fileName - file name
     */
    XmlWriter.prototype.save = function (fileName) {
        while (this.elementStack.length - 1 > 0) {
            this.writeEndElement();
        }
        if (this.bufferText !== '') {
            this.flush();
        }
        _save__WEBPACK_IMPORTED_MODULE_0__["Save"].save(fileName, this.buffer);
    };
    /**
     * Releases the resources used by XmlWriter.
     */
    XmlWriter.prototype.destroy = function () {
        this.bufferBlob = undefined;
        for (var i = 0; i < this.namespaceStack.length; i++) {
            this.namespaceStack[i].destroy();
        }
        this.namespaceStack = [];
        for (var i = 0; i < this.elementStack.length; i++) {
            this.elementStack[i].destroy();
        }
        this.elementStack = [];
        this.bufferText = '';
        this.contentPos = 0;
    };
    XmlWriter.prototype.flush = function () {
        if (this.bufferBlob === undefined) {
            return;
        }
        this.bufferBlob = new Blob([this.bufferBlob, this.bufferText], { type: 'text/plain' });
        this.bufferText = '';
    };
    XmlWriter.prototype.writeProcessingInstructionInternal = function (name, text) {
        this.bufferText += '<?';
        this.rawText(name);
        if (text.length > 0) {
            this.bufferText += ' ';
            text = text.replace(/\?\>/g, '? >');
            this.bufferText += text;
        }
        this.bufferText += '?';
        this.bufferText += '>';
    };
    XmlWriter.prototype.writeStartAttribute = function (prefix, localName, namespace, value) {
        if (localName === undefined || localName === null || localName.length === 0) {
            if (prefix === 'xmlns') {
                localName = 'xmlns';
                prefix = '';
            }
            else {
                throw new Error('ArgumentException: localName cannot be undefined, null or empty');
            }
        }
        if (this.currentState !== 'StartElement') {
            throw new Error('InvalidOperationException: Wrong Token');
        }
        this.checkName(localName);
        this.writeStartAttributePrefixAndNameSpace(prefix, localName, namespace, value);
    };
    XmlWriter.prototype.writeStartAttributePrefixAndNameSpace = function (prefix, localName, namespace, value) {
        if (prefix === undefined || prefix === null) {
            if (namespace !== undefined && namespace !== null) {
                if (!(localName === 'xmlns' && namespace === 'http://www.w3.org/2000/xmlns/')) {
                    prefix = this.lookupPrefix(namespace);
                }
            }
            if (prefix === undefined || prefix === null) {
                prefix = '';
            }
        }
        if (namespace === undefined || namespace === null) {
            if (prefix !== undefined && prefix !== null && prefix.length > 0) {
                namespace = this.lookupNamespace(prefix);
            }
            if (namespace === undefined || namespace === null) {
                namespace = '';
            }
        }
        this.writeStartAttributeSpecialAttribute(prefix, localName, namespace, value);
    };
    XmlWriter.prototype.writeStartAttributeSpecialAttribute = function (prefix, localName, namespace, value) {
        if (prefix.length === 0) {
            if (localName[0] === 'x' && localName === 'xmlns') {
                this.skipPushAndWrite(prefix, localName, namespace);
                this.pushNamespaceExplicit('', value);
                return;
            }
            else if (namespace.length > 0) {
                prefix = this.lookupPrefix(namespace);
            }
        }
        else {
            if (prefix[0] === 'x') {
                if (prefix === 'xmlns') {
                    this.skipPushAndWrite(prefix, localName, namespace);
                    this.pushNamespaceExplicit(localName, value);
                    return;
                }
                else if (prefix === 'xml') {
                    if (localName === 'space' || localName === 'lang') {
                        this.skipPushAndWrite(prefix, localName, namespace);
                        return;
                    }
                }
            }
            if (namespace.length === 0) {
                prefix = '';
            }
        }
        if (prefix !== undefined && prefix !== null && prefix.length !== 0) {
            this.pushNamespaceImplicit(prefix, namespace);
        }
        this.skipPushAndWrite(prefix, localName, namespace);
    };
    XmlWriter.prototype.writeEndAttribute = function () {
        this.currentState = 'StartElement';
        this.bufferText += '"';
    };
    XmlWriter.prototype.writeStartElementInternal = function (prefix, localName, namespace) {
        this.bufferText += '<';
        if (prefix.length > 0) {
            this.rawText(prefix);
            this.bufferText += ':';
        }
        this.rawText(localName);
        var top = this.elementStack.length;
        this.elementStack.push(new XmlElement());
        this.elementStack[top].set(prefix, localName, namespace, this.namespaceStack.length - 1);
        this.pushNamespaceImplicit(prefix, namespace);
        for (var i = 0; i < this.attributeStack.length; i++) {
            this.attributeStack[i].destroy();
        }
        this.attributeStack = [];
    };
    XmlWriter.prototype.writeEndElementInternal = function (prefix, localName) {
        if (this.contentPos !== this.bufferText.length + 1) {
            this.bufferText += '</';
            if (prefix !== undefined && prefix !== null && prefix.length !== 0) {
                this.rawText(prefix);
                this.bufferText += ':';
            }
            this.rawText(localName);
            this.bufferText += '>';
        }
        else {
            this.bufferText = this.bufferText.substring(0, this.bufferText.length - 1);
            this.bufferText += ' />';
        }
    };
    XmlWriter.prototype.writeStartAttributeInternal = function (prefix, localName, namespaceName) {
        this.bufferText += ' ';
        if (prefix !== undefined && prefix !== null && prefix.length > 0) {
            this.rawText(prefix);
            this.bufferText += ':';
        }
        this.rawText(localName);
        this.bufferText += '=';
        this.bufferText += '"';
    };
    XmlWriter.prototype.writeNamespaceDeclaration = function (prefix, namespaceUri) {
        this.writeStartNamespaceDeclaration(prefix);
        this.writeStringInternal(namespaceUri, true);
        this.bufferText += '"';
    };
    XmlWriter.prototype.writeStartNamespaceDeclaration = function (prefix) {
        if (prefix === undefined || prefix === null || prefix.length === 0) {
            this.rawText(' xmlns=\"');
        }
        else {
            this.rawText(' xmlns:');
            this.rawText(prefix);
            this.bufferText += '=';
            this.bufferText += '"';
        }
    };
    XmlWriter.prototype.writeStringInternal = function (text, inAttributeValue) {
        if (text === null || text === undefined) {
            text = '';
        }
        var tempText = '';
        text = text.replace(/\&/g, '&amp;');
        text = text.replace(/\</g, '&lt;');
        text = text.replace(/\>/g, '&gt;');
        if (inAttributeValue) {
            text = text.replace(/\"/g, '&quot;');
        }
        this.bufferText += text;
        if (!inAttributeValue) {
            this.contentPos = 0;
        }
    };
    XmlWriter.prototype.startElementContent = function () {
        var start = this.elementStack[this.elementStack.length - 1].previousTop;
        for (var i = this.namespaceStack.length - 1; i > start; i--) {
            if (this.namespaceStack[i].kind === 'NeedToWrite') {
                this.writeNamespaceDeclaration(this.namespaceStack[i].prefix, this.namespaceStack[i].namespaceUri);
            }
        }
        this.bufferText += '>';
        this.contentPos = this.bufferText.length + 1;
    };
    XmlWriter.prototype.rawText = function (text) {
        this.bufferText += text;
    };
    XmlWriter.prototype.addNamespace = function (prefix, ns, kind) {
        var top = this.namespaceStack.length;
        this.namespaceStack.push(new Namespace());
        this.namespaceStack[top].set(prefix, ns, kind);
    };
    XmlWriter.prototype.lookupPrefix = function (namespace) {
        for (var i = this.namespaceStack.length - 1; i >= 0; i--) {
            if (this.namespaceStack[i].namespaceUri === namespace) {
                return this.namespaceStack[i].prefix;
            }
        }
        return undefined;
    };
    XmlWriter.prototype.lookupNamespace = function (prefix) {
        for (var i = this.namespaceStack.length - 1; i >= 0; i--) {
            if (this.namespaceStack[i].prefix === prefix) {
                return this.namespaceStack[i].namespaceUri;
            }
        }
        return undefined;
    };
    XmlWriter.prototype.lookupNamespaceIndex = function (prefix) {
        for (var i = this.namespaceStack.length - 1; i >= 0; i--) {
            if (this.namespaceStack[i].prefix === prefix) {
                return i;
            }
        }
        return -1;
    };
    XmlWriter.prototype.pushNamespaceImplicit = function (prefix, ns) {
        var kind;
        var existingNsIndex = this.lookupNamespaceIndex(prefix);
        if (existingNsIndex !== -1) {
            if (existingNsIndex > this.elementStack[this.elementStack.length - 1].previousTop) {
                if (this.namespaceStack[existingNsIndex].namespaceUri !== ns) {
                    throw new Error('XmlException namespace Uri needs to be the same as the one that is already declared');
                }
                return;
            }
            else {
                if (this.namespaceStack[existingNsIndex].kind === 'Special') {
                    if (prefix === 'xml') {
                        if (ns !== this.namespaceStack[existingNsIndex].namespaceUri) {
                            throw new Error('InvalidArgumentException: Xml String');
                        }
                        else {
                            kind = 'Implied';
                        }
                    }
                    else {
                        throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');
                    }
                }
                else {
                    kind = (this.namespaceStack[existingNsIndex].namespaceUri === ns) ? 'Implied' : 'NeedToWrite';
                }
            }
        }
        else {
            if ((ns === 'http://www.w3.org/XML/1998/namespace' && prefix !== 'xml') ||
                (ns === 'http://www.w3.org/2000/xmlns/' && prefix !== 'xmlns')) {
                throw new Error('InvalidArgumentException');
            }
            kind = 'NeedToWrite';
        }
        this.addNamespace(prefix, ns, kind);
    };
    XmlWriter.prototype.pushNamespaceExplicit = function (prefix, ns) {
        var existingNsIndex = this.lookupNamespaceIndex(prefix);
        if (existingNsIndex !== -1) {
            if (existingNsIndex > this.elementStack[this.elementStack.length - 1].previousTop) {
                this.namespaceStack[existingNsIndex].kind = 'Written';
                return;
            }
        }
        this.addNamespace(prefix, ns, 'Written');
        return;
    };
    XmlWriter.prototype.addAttribute = function (prefix, localName, namespaceName) {
        var top = this.attributeStack.length;
        this.attributeStack.push(new XmlAttribute());
        this.attributeStack[top].set(prefix, localName, namespaceName);
        for (var i = 0; i < top; i++) {
            if (this.attributeStack[i].isDuplicate(prefix, localName, namespaceName)) {
                throw new Error('XmlException: duplicate attribute name');
            }
        }
    };
    XmlWriter.prototype.skipPushAndWrite = function (prefix, localName, namespace) {
        this.addAttribute(prefix, localName, namespace);
        this.writeStartAttributeInternal(prefix, localName, namespace);
    };
    XmlWriter.prototype.checkName = function (text) {
        var format = /[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/;
        if (format.test(text)) {
            throw new Error('InvalidArgumentException: invalid name character');
        }
    };
    return XmlWriter;
}());

/**
 * class for managing namespace collection
 */
var Namespace = /** @__PURE__ @class */ (function () {
    function Namespace() {
    }
    /**
     * set value for current namespace instance
     * @param {string} prefix namespace's prefix
     * @param {string} namespaceUri namespace URI
     * @param {string} kind namespace kind
     */
    Namespace.prototype.set = function (prefix, namespaceUri, kind) {
        this.prefix = prefix;
        this.namespaceUri = namespaceUri;
        this.kind = kind;
    };
    /**
     * Releases the resources used by Namespace
     */
    Namespace.prototype.destroy = function () {
        this.prefix = undefined;
        this.namespaceUri = undefined;
        this.kind = undefined;
    };
    return Namespace;
}());

/**
 * class for managing element collection
 */
var XmlElement = /** @__PURE__ @class */ (function () {
    function XmlElement() {
    }
    /**
     * set value of current element
     * @param {string} prefix - element prefix
     * @param {string} localName - element local name
     * @param {string} namespaceUri -namespace URI
     * @param {string} previousTop - previous namespace top
     */
    XmlElement.prototype.set = function (prefix, localName, namespaceUri, previousTop) {
        this.previousTop = previousTop;
        this.prefix = prefix;
        this.namespaceUri = namespaceUri;
        this.localName = localName;
    };
    /**
     * Releases the resources used by XmlElement
     */
    XmlElement.prototype.destroy = function () {
        this.previousTop = undefined;
        this.prefix = undefined;
        this.localName = undefined;
        this.namespaceUri = undefined;
    };
    return XmlElement;
}());

/**
 * class for managing attribute collection
 */
var XmlAttribute = /** @__PURE__ @class */ (function () {
    function XmlAttribute() {
    }
    /**
     * set value of current attribute
     * @param {string} prefix - namespace's prefix
     * @param {string} namespaceUri - namespace URI
     * @param {string} localName - attribute localName
     */
    XmlAttribute.prototype.set = function (prefix, localName, namespaceUri) {
        this.prefix = prefix;
        this.namespaceUri = namespaceUri;
        this.localName = localName;
    };
    /**
     * get whether the attribute is duplicate or not
     * @param {string} prefix - namespace's prefix
     * @param {string} namespaceUri - namespace URI
     * @param {string} localName - attribute localName
     */
    XmlAttribute.prototype.isDuplicate = function (prefix, localName, namespaceUri) {
        return ((this.localName === localName) && ((this.prefix === prefix) || (this.namespaceUri === namespaceUri)));
    };
    /**
     * Releases the resources used by XmlAttribute
     */
    XmlAttribute.prototype.destroy = function () {
        this.prefix = undefined;
        this.namespaceUri = undefined;
        this.localName = undefined;
    };
    return XmlAttribute;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/color-picker.js":
/*!*******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/color-picker.js ***!
  \*******************************************************************************/
/*! exports provided: ColorPicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return ColorPicker; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_splitbuttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-splitbuttons */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _input_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../input/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/index.js");
/* harmony import */ var _numerictextbox_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../numerictextbox/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/index.js");
/* harmony import */ var _slider_slider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../slider/slider */ "./ej2-resources/18.4.46/scripts/ej2-inputs/slider/slider.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};










var APPLY = 'e-apply';
var CANCEL = 'e-cancel';
var CURRENT = 'e-current';
var CONTAINER = 'e-container';
var CTRLBTN = 'e-ctrl-btn';
var CTRLSWITCH = 'e-switch-ctrl-btn';
var DISABLED = 'e-disabled';
var FORMATSWITCH = 'e-value-switch-btn';
var HANDLER = 'e-handler';
var HEX = 'e-hex';
var HIDEHEX = 'e-hide-hex-value';
var HIDEOPACITY = 'e-hide-opacity';
var HIDERGBA = 'e-hide-switchable-value';
var HIDEVALUE = 'e-hide-value';
var HIDEVALUESWITCH = 'e-hide-valueswitcher';
var HSVAREA = 'e-hsv-color';
var HSVCONTAINER = 'e-hsv-container';
var INPUTWRAPPER = 'e-selected-value';
var MODESWITCH = 'e-mode-switch-btn';
var NOCOLOR = 'e-nocolor-item';
var OPACITY = 'e-opacity-value';
var PALETTES = 'e-palette';
var PALETTECONTENT = 'e-color-palette';
var PICKERCONTENT = 'e-color-picker';
var PREVIEW = 'e-preview-container';
var PREVIOUS = 'e-previous';
var RTL = 'e-rtl';
var SHOWVALUE = 'e-show-value';
var SELECT = 'e-selected';
var SPLITPREVIEW = 'e-split-preview';
var TILE = 'e-tile';
var presets = {
    default: ['#000000', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#ffeb3b',
        '#ffffff', '#ffebee', '#fce4ec', '#f3e5f5', '#ede7f6', '#e3f2fd', '#e1f5fe', '#e0f7fa', '#e0f2f1', '#fffde7',
        '#f2f2f2', '#ffcdd2', '#f8bbd0', '#e1bee7', '#d1c4e9', '#bbdefb', '#b3e5fc', '#b2ebf2', '#b2dfdb', '#fff9c4',
        '#e6e6e6', '#ef9a9a', '#f48fb1', '#ce93d8', '#b39ddb', '#90caf9', '#81d4fa', '#80deea', '#80cbc4', '#fff59d',
        '#cccccc', '#e57373', '#f06292', '#ba68c8', '#9575cd', '#64b5f6', '#4fc3f7', '#4dd0e1', '#4db6ac', '#fff176',
        '#b3b3b3', '#ef5350', '#ec407a', '#ab47bc', '#7e57c2', '#42a5f5', '#29b6f6', '#26c6da', '#26a69a', '#ffee58',
        '#999999', '#e53935', '#d81b60', '#8e24aa', '#5e35b1', '#1e88e5', '#039be5', '#00acc1', '#00897b', '#fdd835',
        '#808080', '#d32f2f', '#c2185b', '#7b1fa2', '#512da8', '#1976d2', '#0288d1', '#0097a7', '#00796b', '#fbc02d',
        '#666666', '#c62828', '#ad1457', '#6a1b9a', '#4527a0', '#1565c0', '#0277bd', '#00838f', '#00695c', '#f9a825',
        '#4d4d4d', '#b71c1c', '#880e4f', '#4a148c', '#311b92', '#0d47a1', '#01579b', '#006064', '#004d40', '#f57f17']
};
/**
 * ColorPicker component is a user interface to select and adjust color values. It provides supports for various
 * color specification like Red Green Blue, Hue Saturation Value and Hex codes.
 * ```html
 * <input type="color" id="color-picker">
 * ```
 * ```typescript
 * <script>
 *   let colorPickerObj: ColorPicker = new ColorPicker(null , "#color-picker");
 * </script>
 * ```
 */
var ColorPicker = /** @__PURE__ @class */ (function (_super) {
    __extends(ColorPicker, _super);
    function ColorPicker(options, element) {
        return _super.call(this, options, element) || this;
    }
    ColorPicker.prototype.preRender = function () {
        var ele = this.element;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
        }
        var localeText = { Apply: 'Apply', Cancel: 'Cancel', ModeSwitcher: 'Switch Mode' };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('colorpicker', localeText, this.locale);
        if (ele.getAttribute('ejs-for') && !ele.getAttribute('name')) {
            ele.setAttribute('name', ele.id);
        }
    };
    /**
     * To Initialize the component rendering
     * @private
     */
    ColorPicker.prototype.render = function () {
        this.initWrapper();
        if (this.inline) {
            this.createWidget();
        }
        else {
            this.createSplitBtn();
        }
        if (!this.enableOpacity) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.container.parentElement], HIDEOPACITY);
        }
        this.renderComplete();
    };
    ColorPicker.prototype.initWrapper = function () {
        var wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-wrapper' });
        this.element.parentNode.insertBefore(wrapper, this.element);
        wrapper.appendChild(this.element);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'tabindex': '-1', 'spellcheck': 'false' });
        this.container = this.createElement('div', { className: CONTAINER });
        this.getWrapper().appendChild(this.container);
        var value = this.value ? this.roundValue(this.value).toLowerCase() : '#008000ff';
        if (this.noColor && this.mode === 'Palette' && this.value === '') {
            value = '';
        }
        var slicedValue = value.slice(0, 7);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initialInputValue)) {
            this.initialInputValue = slicedValue;
        }
        this.element.value = slicedValue;
        if (this.enableOpacity) {
            this.setProperties({ 'value': value }, true);
        }
        else {
            this.setProperties({ 'value': slicedValue }, true);
        }
        if (this.enableRtl) {
            wrapper.classList.add(RTL);
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.cssClass.split(' '));
        }
        this.tileRipple = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.container, { selector: '.' + TILE });
        this.ctrlBtnRipple = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.container, { selector: '.e-btn' });
    };
    ColorPicker.prototype.getWrapper = function () {
        return this.element.parentElement;
    };
    ColorPicker.prototype.createWidget = function () {
        if (this.mode === 'Palette') {
            this.createPalette();
            if (!this.inline) {
                this.firstPaletteFocus();
            }
        }
        else {
            this.createPicker();
            if (!this.inline) {
                this.getDragHandler().focus();
            }
        }
        this.isRgb = true;
        this.createInput();
        this.createCtrlBtn();
        if (!this.disabled) {
            this.wireEvents();
        }
        if (this.inline && this.disabled) {
            this.toggleDisabled(true);
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.refreshPopupPos();
        }
    };
    ColorPicker.prototype.createSplitBtn = function () {
        var _this = this;
        var splitButton = this.createElement('button', { className: 'e-split-colorpicker' });
        this.getWrapper().appendChild(splitButton);
        this.splitBtn = new _ej2_splitbuttons__WEBPACK_IMPORTED_MODULE_1__["SplitButton"]({
            iconCss: 'e-selected-color',
            target: this.container,
            disabled: this.disabled,
            enableRtl: this.enableRtl,
            open: this.onOpen.bind(this),
            click: function (args) {
                _this.trigger('change', {
                    currentValue: { hex: _this.value.slice(0, 7), rgba: _this.convertToRgbString(_this.hexToRgb(_this.value)) },
                    previousValue: { hex: null, rgba: null }, value: _this.value
                });
            }
        });
        this.splitBtn.createElement = this.createElement;
        this.splitBtn.appendTo(splitButton);
        var preview = this.createElement('span', { className: SPLITPREVIEW });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-selected-color', splitButton).appendChild(preview);
        preview.style.backgroundColor = this.convertToRgbString(this.hexToRgb(this.value));
        var popupEle = this.getPopupEle();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([popupEle], 'e-colorpicker-popup');
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([popupEle], this.cssClass.split(' '));
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            var popupInst = this.getPopupInst();
            popupInst.relateTo = document.body;
            popupInst.position = { X: 'center', Y: 'center' };
            popupInst.targetType = 'container';
            popupInst.collision = { X: 'fit', Y: 'fit' };
            popupInst.offsetY = 4;
            popupEle.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["getZindexPartial"])(this.splitBtn.element).toString();
        }
        this.bindCallBackEvent();
    };
    ColorPicker.prototype.onOpen = function (args) {
        this.trigger('open', { element: this.container });
    };
    ColorPicker.prototype.getPopupInst = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(this.getPopupEle(), _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Popup"]);
    };
    ColorPicker.prototype.bindCallBackEvent = function () {
        var _this = this;
        this.splitBtn.beforeOpen = function (args) {
            var callBackPromise = new _ej2_splitbuttons__WEBPACK_IMPORTED_MODULE_1__["Deferred"]();
            _this.trigger('beforeOpen', args, function (observeOpenArgs) {
                if (!observeOpenArgs.cancel) {
                    var popupEle = _this.getPopupEle();
                    popupEle.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0 + pageYOffset);
                    popupEle.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0 + pageXOffset);
                    popupEle.style.display = 'block';
                    _this.createWidget();
                    popupEle.style.display = '';
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                        _this.modal = _this.createElement('div');
                        _this.modal.className = 'e-' + _this.getModuleName() + ' e-modal';
                        _this.modal.style.display = 'none';
                        document.body.insertBefore(_this.modal, popupEle);
                        document.body.className += ' e-colorpicker-overflow';
                        _this.modal.style.display = 'block';
                        _this.modal.style.zIndex = (Number(popupEle.style.zIndex) - 1).toString();
                    }
                }
                args.cancel = observeOpenArgs.cancel;
                callBackPromise.resolve(observeOpenArgs);
            });
            return callBackPromise;
        };
        this.splitBtn.beforeClose = function (args) {
            var callBackPromise = new _ej2_splitbuttons__WEBPACK_IMPORTED_MODULE_1__["Deferred"]();
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.event)) {
                var beforeCloseArgs = { element: _this.container, event: args.event, cancel: false };
                _this.trigger('beforeClose', beforeCloseArgs, function (observedCloseArgs) {
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && args.event.target === _this.modal) {
                        observedCloseArgs.cancel = true;
                    }
                    if (!observedCloseArgs.cancel) {
                        _this.onPopupClose();
                    }
                    args.cancel = observedCloseArgs.cancel;
                    callBackPromise.resolve(observedCloseArgs);
                });
            }
            else {
                callBackPromise.resolve(args);
            }
            return callBackPromise;
        };
    };
    ColorPicker.prototype.onPopupClose = function () {
        this.unWireEvents();
        this.destroyOtherComp();
        this.container.style.width = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + SPLITPREVIEW, this.splitBtn.element).style.backgroundColor
            = this.convertToRgbString(this.hexToRgb(this.value));
        this.container.innerHTML = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.container], [PICKERCONTENT, PALETTECONTENT]);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.modal) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], 'e-colorpicker-overflow');
            this.modal.style.display = 'none';
            this.modal.outerHTML = '';
            this.modal = null;
        }
    };
    ColorPicker.prototype.createPalette = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(this.container, [PALETTECONTENT], [PICKERCONTENT]);
        if (this.presetColors) {
            var paletteGroup = this.createElement('div', { className: 'e-custom-palette' });
            this.appendElement(paletteGroup);
            var keys = Object.keys(this.presetColors);
            if (keys.length === 1) {
                this.appendPalette(this.presetColors[keys[0]], keys[0], paletteGroup);
            }
            else {
                for (var i = 0, len = keys.length; i < len; i++) {
                    this.appendPalette(this.presetColors[keys[i]], keys[i], paletteGroup);
                }
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-row', paletteGroup).length > 10) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([paletteGroup], 'e-palette-group');
            }
        }
        else {
            this.appendPalette(presets.default, 'default');
        }
        if (this.mode === 'Palette' && !this.modeSwitcher && this.noColor) {
            this.setNoColor();
        }
        var width = parseInt(getComputedStyle(this.container).borderBottomWidth, 10);
        this.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.container.children[0].offsetWidth + width + width);
        this.rgb = this.hexToRgb(this.roundValue(this.value));
        this.hsv = this.rgbToHsv.apply(this, this.rgb);
    };
    ColorPicker.prototype.firstPaletteFocus = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + SELECT, this.container.children[0])) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + PALETTES, this.container)[0].focus();
        }
    };
    ColorPicker.prototype.appendPalette = function (colors, key, refEle) {
        var palette = this.createElement('div', { className: PALETTES, attrs: { 'tabindex': '0' } });
        if (refEle) {
            refEle.appendChild(palette);
        }
        else {
            this.appendElement(palette);
        }
        var row;
        var tile;
        var roundedColor;
        for (var i = 0, len = colors.length; i < len; i++) {
            if (i === 0 || i % this.columns === 0) {
                row = this.createElement('div', {
                    className: 'e-row', attrs: { 'role': 'row' }
                });
                palette.appendChild(row);
            }
            roundedColor = this.roundValue(colors[i]).toLowerCase();
            tile = this.createElement('span', {
                className: TILE, attrs: { 'role': 'gridcell', 'aria-label': roundedColor, 'aria-selected': 'false' }
            });
            this.trigger('beforeTileRender', { element: tile, presetName: key, value: colors[i] });
            row.appendChild(tile);
            if (this.value === roundedColor) {
                this.addTileSelection(tile);
                palette.focus();
            }
            tile.style.backgroundColor = this.convertToRgbString(this.hexToRgb(roundedColor));
        }
    };
    ColorPicker.prototype.setNoColor = function () {
        var noColorEle = this.container.querySelector('.e-row').children[0];
        noColorEle.classList.add(NOCOLOR);
        if (!this.value) {
            noColorEle.classList.add(SELECT);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(noColorEle, '.' + PALETTES).focus();
        }
        ['aria-selected', 'aria-label'].forEach(function (attr) { noColorEle.removeAttribute(attr); });
        noColorEle.style.backgroundColor = '';
    };
    ColorPicker.prototype.appendElement = function (ele, insertPos) {
        if (insertPos === void 0) { insertPos = 0; }
        var refEle = this.container.children[insertPos];
        refEle ? this.container.insertBefore(ele, refEle) : this.container.appendChild(ele);
    };
    ColorPicker.prototype.addTileSelection = function (ele) {
        ele.classList.add(SELECT);
        ele.setAttribute('aria-selected', 'true');
    };
    ColorPicker.prototype.createPicker = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(this.container, [PICKERCONTENT], [PALETTECONTENT]);
        var hsvContainer = this.createElement('div', { className: HSVCONTAINER });
        this.appendElement(hsvContainer);
        hsvContainer.appendChild(this.createElement('div', { className: HSVAREA }));
        var dragHandler = this.createElement('span', { className: HANDLER, attrs: { 'tabindex': '0' } });
        hsvContainer.appendChild(dragHandler);
        this.rgb = this.hexToRgb(this.value);
        this.hsv = this.rgbToHsv.apply(this, this.rgb);
        this.setHsvContainerBg();
        this.setHandlerPosition();
        this.createSlider();
        this.createDragTooltip();
    };
    ColorPicker.prototype.setHsvContainerBg = function (h) {
        if (h === void 0) { h = this.hsv[0]; }
        this.getHsvContainer().style.backgroundColor = this.convertToRgbString(this.hsvToRgb(h, 100, 100, 1));
    };
    ColorPicker.prototype.getHsvContainer = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HSVCONTAINER, this.container);
    };
    ColorPicker.prototype.setHandlerPosition = function () {
        var dragHandler = this.getDragHandler();
        var hsvArea = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HSVAREA, this.container);
        if (this.enableRtl) {
            dragHandler.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(hsvArea.offsetWidth * Math.abs(100 - this.hsv[1]) / 100);
        }
        else {
            dragHandler.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(hsvArea.offsetWidth * this.hsv[1] / 100);
        }
        dragHandler.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(hsvArea.offsetHeight * (100 - this.hsv[2]) / 100);
    };
    ColorPicker.prototype.createSlider = function () {
        var sliderPreviewWrapper = this.createElement('div', { className: 'e-slider-preview' });
        this.appendElement(sliderPreviewWrapper, 1);
        this.createPreview(sliderPreviewWrapper);
        var sliderWrapper = this.createElement('div', { className: 'e-colorpicker-slider' });
        sliderPreviewWrapper.insertBefore(sliderWrapper, sliderPreviewWrapper.children[0]);
        var slider = this.createElement('div', { className: 'e-hue-slider' });
        sliderWrapper.appendChild(slider);
        this.hueSlider = new _slider_slider__WEBPACK_IMPORTED_MODULE_5__["Slider"]({
            value: this.hsv[0],
            min: 0,
            max: 359,
            enableRtl: this.enableRtl,
            enabled: !this.disabled,
            change: this.hueChange.bind(this)
        });
        this.hueSlider.createElement = this.createElement;
        this.hueSlider.appendTo(slider);
        if (this.enableOpacity) {
            slider = this.createElement('div', { className: 'e-opacity-slider' });
            sliderWrapper.appendChild(slider);
            this.createOpacitySlider(slider);
        }
    };
    ColorPicker.prototype.createOpacitySlider = function (slider) {
        this.opacitySlider = new _slider_slider__WEBPACK_IMPORTED_MODULE_5__["Slider"]({
            value: this.rgb[3] * 100,
            min: 0,
            max: 100,
            enableRtl: this.enableRtl,
            enabled: !this.disabled,
            change: this.opacityChange.bind(this)
        });
        this.opacitySlider.createElement = this.createElement;
        this.opacitySlider.appendTo(slider);
        var opacityBgTrack = this.createElement('div', { className: 'e-opacity-empty-track' });
        slider.appendChild(opacityBgTrack);
        this.updateOpacitySliderBg();
    };
    ColorPicker.prototype.updateOpacitySliderBg = function () {
        var direction = this.enableRtl ? 'to left' : 'to right';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-slider-track', this.opacitySlider.element).style.background =
            'linear-gradient(' + direction + ', rgba(' + this.rgb.slice(0, 3) + ', 0) 0%, ' +
                this.convertToRgbString(this.rgb.slice(0, 3)) + ' 100%)';
    };
    ColorPicker.prototype.hueChange = function (args) {
        this.hsv[0] = args.value;
        this.setHsvContainerBg();
        this.convertToOtherFormat();
    };
    ColorPicker.prototype.opacityChange = function (args) {
        var value = args.value;
        var pValue = this.rgbToHex(this.rgb);
        this.hsv[3] = value / 100;
        this.rgb[3] = value / 100;
        var cValue = this.rgbToHex(this.rgb);
        this.updateOpacityInput(value);
        var rgb = this.convertToRgbString(this.rgb);
        this.updatePreview(rgb);
        this.triggerEvent(cValue, pValue, rgb);
    };
    ColorPicker.prototype.updateOpacityInput = function (value) {
        if (this.enableOpacity && !this.getWrapper().classList.contains(HIDEVALUE)) {
            var opacityTextBoxInst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + OPACITY, this.container), _numerictextbox_index__WEBPACK_IMPORTED_MODULE_4__["NumericTextBox"]);
            opacityTextBoxInst.value = value;
            opacityTextBoxInst.dataBind();
        }
    };
    ColorPicker.prototype.createPreview = function (parentEle) {
        var previewContainer = this.createElement('div', { className: PREVIEW });
        parentEle.appendChild(previewContainer);
        var preview = this.createElement('span', { className: 'e-preview ' + CURRENT });
        previewContainer.appendChild(preview);
        var colorValue = this.convertToRgbString(this.rgb);
        preview.style.backgroundColor = colorValue;
        preview = this.createElement('span', { className: 'e-preview ' + PREVIOUS });
        previewContainer.appendChild(preview);
        preview.style.backgroundColor = colorValue;
    };
    ColorPicker.prototype.isPicker = function () {
        return !this.container.classList.contains(PALETTECONTENT);
    };
    ColorPicker.prototype.getPopupEle = function () {
        return this.container.parentElement;
    };
    ColorPicker.prototype.createNumericInput = function (element, value, label, max) {
        var _this = this;
        var numericInput = new _numerictextbox_index__WEBPACK_IMPORTED_MODULE_4__["NumericTextBox"]({
            value: value,
            placeholder: label,
            min: 0,
            max: max,
            format: '###.##',
            showSpinButton: false,
            floatLabelType: 'Always',
            enableRtl: this.enableRtl,
            enabled: !this.disabled,
            readonly: this.isPicker() ? false : true,
            change: function (args) {
                if (args.event) {
                    _this.inputHandler(args.event);
                }
            }
        });
        numericInput.createElement = this.createElement;
        numericInput.appendTo(element);
    };
    ColorPicker.prototype.createInput = function () {
        var isPicker = this.isPicker();
        var wrapper = this.getWrapper();
        if ((isPicker && !wrapper.classList.contains(HIDEVALUE)) || (!isPicker && wrapper.classList.contains(SHOWVALUE))) {
            var inputWrap = this.createElement('div', { className: INPUTWRAPPER });
            isPicker ? this.appendElement(inputWrap, 2) : this.appendElement(inputWrap, 1);
            var container = this.createElement('div', { className: 'e-input-container' });
            inputWrap.appendChild(container);
            if (!wrapper.classList.contains(HIDEVALUESWITCH)) {
                this.appendValueSwitchBtn(inputWrap);
            }
            if (!wrapper.classList.contains(HIDEHEX)) {
                var hexInput = this.createElement('input', {
                    className: HEX,
                    attrs: { 'maxlength': '7', 'spellcheck': 'false' }
                });
                container.appendChild(hexInput);
                _input_index__WEBPACK_IMPORTED_MODULE_3__["Input"].createInput({
                    element: hexInput,
                    floatLabelType: 'Always',
                    properties: {
                        placeholder: 'HEX',
                        enableRtl: this.enableRtl,
                        enabled: !this.disabled,
                        readonly: this.isPicker() ? false : true
                    }
                }, this.createElement);
                _input_index__WEBPACK_IMPORTED_MODULE_3__["Input"].setValue(this.value.slice(0, 7), hexInput);
                hexInput.addEventListener('input', this.inputHandler.bind(this));
            }
            if (!wrapper.classList.contains(HIDERGBA)) {
                var label = void 0;
                var value = void 0;
                if (this.isRgb) {
                    label = 'RGB';
                    value = this.rgb;
                }
                else {
                    label = 'HSV';
                    value = this.hsv;
                }
                var clsName = ['rh', 'gs', 'bv'];
                for (var i = 0; i < 3; i++) {
                    this.createNumericInput(container.appendChild(this.createElement('input', { className: 'e-' + clsName[i] + '-value' })), value[i], label[i], 255);
                }
                if (this.enableOpacity) {
                    this.appendOpacityValue(container);
                }
            }
        }
    };
    ColorPicker.prototype.appendOpacityValue = function (container) {
        this.createNumericInput(container.appendChild(this.createElement('input', { className: OPACITY })), this.rgb[3] * 100, 'A', 100);
    };
    ColorPicker.prototype.appendValueSwitchBtn = function (targetEle) {
        var valueSwitchBtn = this.createElement('button', {
            className: 'e-icons e-css e-btn e-flat e-icon-btn ' + FORMATSWITCH
        });
        targetEle.appendChild(valueSwitchBtn);
        if (this.isPicker() && !this.getWrapper().classList.contains(HIDERGBA)) {
            valueSwitchBtn.addEventListener('click', this.formatSwitchHandler.bind(this));
        }
    };
    ColorPicker.prototype.createCtrlBtn = function () {
        if (this.modeSwitcher || this.showButtons) {
            this.l10n.setLocale(this.locale);
            var btnWrapper = this.createElement('div', { className: CTRLSWITCH });
            this.container.appendChild(btnWrapper);
            if (this.showButtons) {
                var controlBtnWrapper = this.createElement('div', { className: CTRLBTN });
                btnWrapper.appendChild(controlBtnWrapper);
                var apply = this.l10n.getConstant('Apply');
                controlBtnWrapper.appendChild(this.createElement('button', {
                    innerHTML: apply,
                    className: 'e-btn e-css e-flat e-primary e-small ' + APPLY,
                    attrs: { 'title': apply }
                }));
                var cancel = this.l10n.getConstant('Cancel');
                controlBtnWrapper.appendChild(this.createElement('button', {
                    innerHTML: cancel,
                    className: 'e-btn e-css e-flat e-small ' + CANCEL,
                    attrs: { 'title': cancel }
                }));
            }
            if (this.modeSwitcher) {
                this.appendModeSwitchBtn();
            }
        }
    };
    ColorPicker.prototype.appendModeSwitchBtn = function () {
        var modeSwitcher = this.createElement('button', {
            className: 'e-icons e-btn e-flat e-icon-btn ' + MODESWITCH, attrs: { title: this.l10n.getConstant('ModeSwitcher') }
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLSWITCH, this.container).insertBefore(modeSwitcher, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLBTN, this.container));
    };
    ColorPicker.prototype.createDragTooltip = function () {
        var _this = this;
        var tooltip = new _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Tooltip"]({
            opensOn: 'Custom',
            showTipPointer: false,
            cssClass: 'e-color-picker-tooltip',
            beforeOpen: function (args) {
                _this.tooltipEle = args.element;
            },
            animation: { open: { effect: 'None' }, close: { effect: 'None' } }
        });
        tooltip.createElement = this.createElement;
        tooltip.appendTo(this.container);
        tooltip.open(this.container);
        this.tooltipEle.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["getZindexPartial"])(this.tooltipEle).toString();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-tip-content', this.tooltipEle).appendChild(this.createElement('div', { className: 'e-tip-transparent' }));
    };
    ColorPicker.prototype.getTooltipInst = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(this.container, _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Tooltip"]);
    };
    ColorPicker.prototype.setTooltipOffset = function (value) {
        this.getTooltipInst().offsetY = value;
    };
    ColorPicker.prototype.toggleDisabled = function (enable) {
        enable ? this.getWrapper().classList.add(DISABLED) : this.getWrapper().classList.remove(DISABLED);
        if (this.showButtons) {
            ([].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-btn', this.container))).forEach(function (ele) {
                enable ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(ele, { 'disabled': '' }) : ele.removeAttribute('disabled');
            });
        }
    };
    ColorPicker.prototype.convertToRgbString = function (rgb) {
        return rgb.length ? rgb.length === 4 ? 'rgba(' + rgb.join() + ')' : 'rgb(' + rgb.join() + ')' : '';
    };
    ColorPicker.prototype.convertToHsvString = function (hsv) {
        return hsv.length === 4 ? 'hsva(' + hsv.join() + ')' : 'hsv(' + hsv.join() + ')';
    };
    ColorPicker.prototype.updateHsv = function () {
        this.hsv[1] = this.hsv[1] > 100 ? 100 : this.hsv[1];
        this.hsv[2] = this.hsv[2] > 100 ? 100 : this.hsv[2];
        this.setHandlerPosition();
    };
    ColorPicker.prototype.convertToOtherFormat = function (isKey) {
        if (isKey === void 0) { isKey = false; }
        var pValue = this.rgbToHex(this.rgb);
        this.rgb = this.hsvToRgb.apply(this, this.hsv);
        var cValue = this.rgbToHex(this.rgb);
        var rgba = this.convertToRgbString(this.rgb);
        this.updatePreview(rgba);
        this.updateInput(cValue);
        this.triggerEvent(cValue, pValue, rgba, isKey);
    };
    ColorPicker.prototype.updateInput = function (value) {
        var wrapper = this.getWrapper();
        if (!wrapper.classList.contains(HIDEVALUE)) {
            if (!wrapper.classList.contains(HIDEHEX)) {
                _input_index__WEBPACK_IMPORTED_MODULE_3__["Input"].setValue(value.substr(0, 7), Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HEX, this.container));
            }
            if (!wrapper.classList.contains(HIDERGBA)) {
                if (this.isRgb) {
                    this.updateValue(this.rgb, false);
                }
                else {
                    this.updateValue(this.hsv, false);
                }
            }
        }
    };
    ColorPicker.prototype.updatePreview = function (value) {
        if (this.enableOpacity) {
            this.updateOpacitySliderBg();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-tip-transparent', this.tooltipEle).style.backgroundColor = value;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PREVIEW + ' .' + CURRENT, this.container).style.backgroundColor = value;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PREVIEW + ' .' + PREVIOUS, this.container).style.backgroundColor
            = this.convertToRgbString(this.hexToRgb(this.value));
    };
    ColorPicker.prototype.getDragHandler = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HANDLER, this.container);
    };
    ColorPicker.prototype.removeTileSelection = function () {
        var selectedEle = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + SELECT, this.container.children[0]));
        selectedEle.forEach(function (ele) {
            ele.classList.remove(SELECT);
            ele.setAttribute('aria-selected', 'false');
        });
    };
    ColorPicker.prototype.convertRgbToNumberArray = function (value) {
        return (value.slice(value.indexOf('(') + 1, value.indexOf(')'))).split(',').map(function (n, i) {
            return (i !== 3) ? parseInt(n, 10) : parseFloat(n);
        });
    };
    /**
     * To get color value in specified type.
     * @param value - Specify the color value.
     * @param type - Specify the type to which the specified color needs to be converted.
     * @method getValue
     * @return {string}
     */
    ColorPicker.prototype.getValue = function (value, type) {
        if (!value) {
            value = this.value;
        }
        type = !type ? 'hex' : type.toLowerCase();
        if (value[0] === 'r') {
            var cValue = this.convertRgbToNumberArray(value);
            if (type === 'hex' || type === 'hexa') {
                var hex = this.rgbToHex(cValue);
                return type === 'hex' ? hex.slice(0, 7) : hex;
            }
            else {
                if (type === 'hsv') {
                    return this.convertToHsvString(this.rgbToHsv.apply(this, cValue.slice(0, 3)));
                }
                else {
                    if (type === 'hsva') {
                        return this.convertToHsvString(this.rgbToHsv.apply(this, cValue));
                    }
                    else {
                        return 'null';
                    }
                }
            }
        }
        else {
            if (value[0] === 'h') {
                var cValue = this.hsvToRgb.apply(this, this.convertRgbToNumberArray(value));
                if (type === 'rgba') {
                    return this.convertToRgbString(cValue);
                }
                else {
                    if (type === 'hex' || type === 'hexa') {
                        var hex = this.rgbToHex(cValue);
                        return type === 'hex' ? hex.slice(0, 7) : hex;
                    }
                    else {
                        if (type === 'rgb') {
                            return this.convertToRgbString(cValue.slice(0, 3));
                        }
                        else {
                            return 'null';
                        }
                    }
                }
            }
            else {
                value = this.roundValue(value);
                var rgb = this.hexToRgb(value);
                if (type === 'rgb' || type === 'hsv') {
                    rgb = rgb.slice(0, 3);
                }
                if (type === 'rgba' || type === 'rgb') {
                    return this.convertToRgbString(rgb);
                }
                else {
                    if (type === 'hsva' || type === 'hsv') {
                        return this.convertToHsvString(this.rgbToHsv.apply(this, rgb));
                    }
                    else {
                        if (type === 'hex') {
                            return value.slice(0, 7);
                        }
                        else {
                            if (type === 'a') {
                                return rgb[3].toString();
                            }
                            else {
                                return 'null';
                            }
                        }
                    }
                }
            }
        }
    };
    /**
     * To show/hide ColorPicker popup based on current state of the SplitButton.
     * @method toggle
     * @return {void}
     */
    ColorPicker.prototype.toggle = function () {
        this.container.parentElement.classList.contains('e-popup-close') ? this.splitBtn.toggle() : this.closePopup(null);
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    ColorPicker.prototype.getModuleName = function () {
        return 'colorpicker';
    };
    /**
     * Gets the properties to be maintained in the persisted state.
     * @return {string}
     */
    ColorPicker.prototype.getPersistData = function () {
        return this.addOnPersist(['value']);
    };
    ColorPicker.prototype.wireEvents = function () {
        if (this.isPicker()) {
            var dragHandler = this.getDragHandler();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(dragHandler, 'keydown', this.pickerKeyDown, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown, this);
            if (this.modeSwitcher || this.showButtons) {
                this.addCtrlSwitchEvent();
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PREVIOUS, this.container), 'click', this.previewHandler, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.container, 'click', this.paletteClickHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.container, 'keydown', this.paletteKeyDown, this);
        }
    };
    ColorPicker.prototype.formResetHandler = function () {
        this.value = this.initialInputValue;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'value': this.initialInputValue });
    };
    ColorPicker.prototype.addCtrlSwitchEvent = function () {
        var ctrlSwitchBtn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLSWITCH, this.container);
        if (ctrlSwitchBtn) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(ctrlSwitchBtn, 'click', this.btnClickHandler, this);
        }
    };
    ColorPicker.prototype.pickerKeyDown = function (e) {
        switch (e.keyCode) {
            case 39:
                this.handlerDragPosition(1, this.enableRtl ? -1 : 1, e);
                break;
            case 37:
                this.handlerDragPosition(1, this.enableRtl ? 1 : -1, e);
                break;
            case 38:
                this.handlerDragPosition(2, 1, e);
                break;
            case 40:
                this.handlerDragPosition(2, -1, e);
                break;
            case 13:
                e.preventDefault();
                var cValue = this.rgbToHex(this.rgb);
                this.enterKeyHandler(cValue, e);
        }
    };
    ColorPicker.prototype.enterKeyHandler = function (value, e) {
        this.triggerChangeEvent(value);
        if (!this.inline) {
            this.closePopup(e);
            this.splitBtn.element.focus();
        }
    };
    ColorPicker.prototype.closePopup = function (e) {
        var _this = this;
        var beforeCloseArgs = { element: this.container, event: e, cancel: false };
        this.trigger('beforeClose', beforeCloseArgs, function (observedcloseArgs) {
            if (!observedcloseArgs.cancel) {
                _this.splitBtn.toggle();
                _this.onPopupClose();
            }
        });
    };
    ColorPicker.prototype.triggerChangeEvent = function (value) {
        var hex = value.slice(0, 7);
        this.trigger('change', {
            currentValue: { hex: hex, rgba: this.convertToRgbString(this.rgb) },
            previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) },
            value: this.enableOpacity ? value : hex
        });
        if (this.enableOpacity) {
            this.setProperties({ 'value': value }, true);
        }
        else {
            this.setProperties({ 'value': hex }, true);
        }
        this.element.value = hex ? hex : '#000000';
    };
    ColorPicker.prototype.handlerDragPosition = function (prob, value, e) {
        e.preventDefault();
        this.hsv[prob] += value * (e.ctrlKey ? 1 : 3);
        if (this.hsv[prob] < 0) {
            this.hsv[prob] = 0;
        }
        this.updateHsv();
        this.convertToOtherFormat(true);
    };
    ColorPicker.prototype.handlerDown = function (e) {
        e.preventDefault();
        var x;
        var y;
        if (e.type === 'mousedown') {
            this.clientX = Math.abs(e.pageX - pageXOffset);
            this.clientY = Math.abs(e.pageY - pageYOffset);
            this.setTooltipOffset(8);
        }
        else {
            this.clientX = Math.abs(e.changedTouches[0].pageX - pageXOffset);
            this.clientY = Math.abs(e.changedTouches[0].pageY - pageYOffset);
            this.setTooltipOffset(-8);
        }
        this.setHsv(this.clientX, this.clientY);
        this.getDragHandler().style.transition = 'left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)';
        this.updateHsv();
        this.convertToOtherFormat();
        this.getDragHandler().focus();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousemove touchmove', this.handlerMove, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup touchend', this.handlerEnd, this);
    };
    ColorPicker.prototype.handlerMove = function (e) {
        if (e.type !== 'touchmove') {
            e.preventDefault();
        }
        var x;
        var y;
        if (e.type === 'mousemove') {
            x = Math.abs(e.pageX - pageXOffset);
            y = Math.abs(e.pageY - pageYOffset);
        }
        else {
            x = Math.abs(e.changedTouches[0].pageX - pageXOffset);
            y = Math.abs(e.changedTouches[0].pageY - pageYOffset);
        }
        this.setHsv(x, y);
        var dragHandler = this.getDragHandler();
        var left = parseInt(dragHandler.style.left, 10);
        var top = parseInt(dragHandler.style.top, 10);
        this.updateHsv();
        this.convertToOtherFormat();
        this.getTooltipInst().refresh(dragHandler);
        if (!this.tooltipEle.style.transform) {
            if (Math.abs(this.clientX - x) > 8 || Math.abs(this.clientY - y) > 8) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HSVAREA, this.container).style.cursor = 'pointer';
                dragHandler.style.transition = 'none';
                if (!this.inline) {
                    this.tooltipEle.style.zIndex = (parseInt(this.getPopupEle().style.zIndex, 10) + 1).toString();
                }
                this.tooltipEle.style.transform = 'rotate(45deg)';
                dragHandler.classList.add('e-hide-handler');
            }
        }
    };
    ColorPicker.prototype.setHsv = function (clientX, clientY) {
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HSVAREA, this.container);
        var position = ele.getBoundingClientRect();
        if (this.enableRtl) {
            clientX = clientX > position.right ? 0 : Math.abs(clientX - position.right);
        }
        else {
            clientX = clientX > position.left ? Math.abs(clientX - position.left) : 0;
        }
        clientY = clientY > position.top ? Math.abs(clientY - position.top) : 0;
        this.hsv[2] = Math.round(Number(100 * (ele.offsetHeight -
            Math.max(0, Math.min(ele.offsetHeight, (clientY - ele.offsetTop)))) / ele.offsetHeight) * 10) / 10;
        this.hsv[1] =
            Math.round(Number(100 * (Math.max(0, Math.min(ele.offsetWidth, (clientX - ele.offsetLeft)))) / ele.offsetWidth) * 10) / 10;
    };
    ColorPicker.prototype.handlerEnd = function (e) {
        if (e.type !== 'touchend') {
            e.preventDefault();
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousemove touchmove', this.handlerMove);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mouseup touchend', this.handlerEnd);
        var dragHandler = this.getDragHandler();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + HSVAREA, this.container).style.cursor = '';
        if (this.tooltipEle.style.transform) {
            this.tooltipEle.style.transform = '';
            dragHandler.classList.remove('e-hide-handler');
        }
        if (!this.inline && !this.showButtons) {
            this.closePopup(e);
        }
    };
    ColorPicker.prototype.btnClickHandler = function (e) {
        var target = e.target;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + MODESWITCH)) {
            e.stopPropagation();
            this.switchToPalette();
        }
        else {
            if (target.classList.contains(APPLY) || target.classList.contains(CANCEL)) {
                this.ctrlBtnClick(target, e);
            }
        }
    };
    ColorPicker.prototype.switchToPalette = function () {
        this.trigger('beforeModeSwitch', { element: this.container, mode: 'Palette' });
        this.unWireEvents();
        this.destroyOtherComp();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-slider-preview', this.container));
        if (!this.getWrapper().classList.contains(HIDEVALUE)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INPUTWRAPPER, this.container));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.getHsvContainer());
        this.createPalette();
        this.firstPaletteFocus();
        this.createInput();
        this.refreshPopupPos();
        this.wireEvents();
        this.trigger('onModeSwitch', { element: this.container, mode: 'Palette' });
    };
    ColorPicker.prototype.refreshPopupPos = function () {
        if (!this.inline) {
            var popupEle = this.getPopupEle();
            popupEle.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0 + pageXOffset);
            popupEle.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0 + pageYOffset);
            this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement);
        }
    };
    ColorPicker.prototype.formatSwitchHandler = function (e) {
        var target = e.target.parentElement;
        if (this.isRgb) {
            this.updateValue(this.hsv, true, 3, [360, 100, 100]);
            this.isRgb = false;
        }
        else {
            this.updateValue(this.rgb, true, 2);
            this.isRgb = true;
        }
    };
    ColorPicker.prototype.updateValue = function (value, format, idx, max) {
        var clsName = ['e-rh-value', 'e-gs-value', 'e-bv-value'];
        var inst;
        for (var i = 0, len = clsName.length; i < len; i++) {
            inst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + clsName[i], this.container), _numerictextbox_index__WEBPACK_IMPORTED_MODULE_4__["NumericTextBox"]);
            inst.value = Math.round(value[i]);
            if (format) {
                inst.placeholder = clsName[i].substr(idx, 1).toUpperCase();
                inst.max = max ? max[i] : 255;
            }
            inst.dataBind();
        }
    };
    ColorPicker.prototype.previewHandler = function (e) {
        var target = e.target;
        var pValue = this.rgbToHex(this.rgb);
        this.rgb = this.convertRgbToNumberArray(target.style.backgroundColor);
        if (!this.rgb[3]) {
            this.rgb[3] = 1;
        }
        var cValue = this.rgbToHex(this.rgb);
        var hsv = this.rgbToHsv.apply(this, this.rgb);
        if (hsv[0] !== this.hsv[0]) {
            this.hueSlider.setProperties({ 'value': hsv[0] }, true);
            this.hueSlider.refresh();
        }
        this.setHsvContainerBg(hsv[0]);
        if (this.enableOpacity && hsv[3] !== this.hsv[3]) {
            this.opacitySlider.setProperties({ 'value': hsv[3] * 100 }, true);
            this.opacitySlider.refresh();
            this.updateOpacitySliderBg();
        }
        this.hsv = hsv;
        this.setHandlerPosition();
        this.updateInput(cValue);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PREVIEW + ' .' + CURRENT, this.container).style.backgroundColor = this.convertToRgbString(this.rgb);
        this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
    };
    ColorPicker.prototype.paletteClickHandler = function (e) {
        e.preventDefault();
        var target = e.target;
        if (target.classList.contains(TILE)) {
            this.removeTileSelection();
            this.addTileSelection(target);
            if (target.classList.contains(NOCOLOR)) {
                this.noColorTile();
            }
            else {
                var cValue = target.getAttribute('aria-label');
                var pValue = this.rgbToHex(this.rgb);
                this.rgb = this.hexToRgb(this.roundValue(cValue));
                this.hsv = this.rgbToHsv.apply(this, this.rgb);
                if (this.getWrapper().classList.contains(SHOWVALUE)) {
                    this.updateInput(cValue);
                }
                this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb));
            }
            if (!this.inline && !this.showButtons) {
                this.closePopup(e);
            }
        }
        else {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + MODESWITCH)) {
                this.switchToPicker();
            }
            else {
                if (target.classList.contains(APPLY) || target.classList.contains(CANCEL)) {
                    this.ctrlBtnClick(target, e);
                }
                else {
                    if (this.getWrapper().classList.contains(SHOWVALUE) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + FORMATSWITCH)) {
                        this.formatSwitchHandler(e);
                    }
                }
            }
        }
    };
    ColorPicker.prototype.noColorTile = function (isKey) {
        if (isKey === void 0) { isKey = false; }
        var pValue = this.rgbToHex(this.rgb);
        this.rgb = [];
        this.hsv = [];
        this.triggerEvent('', pValue, '', isKey);
    };
    ColorPicker.prototype.switchToPicker = function () {
        var wrapper = this.getWrapper();
        this.trigger('beforeModeSwitch', { element: this.container, mode: 'Picker' });
        this.unWireEvents();
        ([].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + PALETTES, this.container))).forEach(function (ele) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
        });
        if (wrapper.classList.contains(SHOWVALUE)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INPUTWRAPPER, this.container));
        }
        this.container.style.width = '';
        var grpEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-custom-palette', this.container);
        if (this.presetColors) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(grpEle);
        }
        this.createPicker();
        this.getDragHandler().focus();
        this.createInput();
        this.refreshPopupPos();
        this.wireEvents();
        this.trigger('onModeSwitch', { element: this.container, mode: 'Picker' });
    };
    ColorPicker.prototype.ctrlBtnClick = function (ele, e) {
        if (ele.classList.contains(APPLY)) {
            var cValue = this.rgbToHex(this.rgb);
            this.triggerChangeEvent(cValue);
        }
        if (!this.inline) {
            this.closePopup(e);
            this.splitBtn.element.focus();
        }
    };
    ColorPicker.prototype.paletteKeyDown = function (e) {
        var target = e.target;
        if (!target.classList.contains(PALETTES)) {
            return;
        }
        var selectedEle;
        var idx;
        var tiles = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + TILE, target));
        var prevSelectedEle = (tiles.filter(function (tile) { return tile.classList.contains('e-selected'); })).pop();
        switch (!e.altKey && e.keyCode) {
            case 39:
                e.preventDefault();
                selectedEle = prevSelectedEle ? tiles[this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? -1 : 1)]
                    : tiles[this.enableRtl ? tiles.length - 1 : 0];
                this.keySelectionChanges(selectedEle);
                break;
            case 37:
                e.preventDefault();
                selectedEle = prevSelectedEle ? tiles[this.tilePosition(tiles, prevSelectedEle, this.enableRtl ? 1 : -1)]
                    : tiles[this.enableRtl ? 0 : tiles.length - 1];
                this.keySelectionChanges(selectedEle);
                break;
            case 38:
                e.preventDefault();
                idx = prevSelectedEle ? this.tilePosition(tiles, prevSelectedEle, -this.columns) : 0;
                selectedEle = tiles[idx] ? tiles[idx] : tiles[idx - this.columns];
                this.keySelectionChanges(selectedEle);
                break;
            case 40:
                e.preventDefault();
                idx = prevSelectedEle ? this.tilePosition(tiles, prevSelectedEle, this.columns) : tiles.length - 1;
                if (tiles[idx]) {
                    selectedEle = tiles[idx];
                }
                else {
                    idx %= tiles.length;
                    idx += tiles[tiles.length - 1].parentElement.childElementCount;
                    selectedEle = tiles[idx];
                }
                this.keySelectionChanges(selectedEle);
                break;
            case 13:
                e.preventDefault();
                if (prevSelectedEle) {
                    var cValue = prevSelectedEle.getAttribute('aria-label');
                    this.enterKeyHandler(cValue ? cValue : '', e);
                }
        }
    };
    ColorPicker.prototype.keySelectionChanges = function (newEle) {
        this.removeTileSelection();
        this.addTileSelection(newEle);
        if (newEle.classList.contains(NOCOLOR)) {
            this.noColorTile(true);
        }
        else {
            var cValue = newEle.getAttribute('aria-label');
            var pValue = this.rgbToHex(this.rgb);
            this.rgb = this.hexToRgb(cValue);
            this.hsv = this.rgbToHsv.apply(this, this.rgb);
            if (this.getWrapper().classList.contains(SHOWVALUE)) {
                this.updateInput(cValue);
            }
            this.triggerEvent(cValue, pValue, this.convertToRgbString(this.rgb), true);
        }
    };
    ColorPicker.prototype.tilePosition = function (items, element, cIdx) {
        items = Array.prototype.slice.call(items);
        var n = items.length;
        var emptyCount = this.columns - items[n - 1].parentElement.childElementCount;
        var idx = items.indexOf(element);
        idx += cIdx;
        idx < 0 ? idx += n + emptyCount : idx %= n + emptyCount;
        return idx;
    };
    ColorPicker.prototype.inputHandler = function (e) {
        var target = e.target;
        if (!target.value.length) {
            return;
        }
        var hsv;
        var pValue;
        var label = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-float-text', target.parentElement).textContent;
        switch (label) {
            case 'HEX':
                var value = '';
                if ((target.value[0] === '#' && target.value.length !== 5) || (target.value[0] !== '#' && target.value.length !== 4)) {
                    value = this.roundValue(target.value);
                }
                if (value.length === 9) {
                    pValue = this.rgbToHex(this.rgb);
                    this.rgb = this.hexToRgb(value + value.substr(-2));
                    this.inputValueChange(this.rgbToHsv.apply(this, this.rgb), pValue, target.value);
                }
                else {
                    return;
                }
                break;
            case 'R':
                if (this.rgb[0] !== Number(target.value)) {
                    pValue = this.rgbToHex(this.rgb);
                    this.rgb[0] = Number(target.value);
                    hsv = this.rgbToHsv.apply(this, this.rgb);
                    this.inputValueChange(hsv, pValue);
                }
                break;
            case 'G':
                if (this.rgb[1] !== Number(target.value)) {
                    pValue = this.rgbToHex(this.rgb);
                    this.rgb[1] = Number(target.value);
                    hsv = this.rgbToHsv.apply(this, this.rgb);
                    this.inputValueChange(hsv, pValue);
                }
                break;
            case 'B':
                if (this.rgb[2] !== Number(target.value)) {
                    pValue = this.rgbToHex(this.rgb);
                    this.rgb[2] = Number(target.value);
                    hsv = this.rgbToHsv.apply(this, this.rgb);
                    this.inputValueChange(hsv, pValue);
                }
                break;
            case 'H':
                this.hueSlider.value = Number(target.value);
                break;
            case 'S':
                if (this.hsv[1] !== Number(target.value)) {
                    this.hsv[1] = Number(target.value);
                    this.updateHsv();
                    this.convertToOtherFormat();
                }
                break;
            case 'V':
                if (this.hsv[2] !== Number(target.value)) {
                    this.hsv[2] = Number(target.value);
                    this.updateHsv();
                    this.convertToOtherFormat();
                }
                break;
            case 'A':
                this.opacitySlider.value = Number(target.value);
                break;
        }
    };
    ColorPicker.prototype.inputValueChange = function (hsv, pValue, value) {
        if (hsv[0] !== this.hsv[0]) {
            this.hueSlider.setProperties({ 'value': hsv[0] }, true);
            this.hueSlider.refresh();
            this.setHsvContainerBg(hsv[0]);
        }
        this.hsv = hsv;
        var cValue = this.rgbToHex(this.rgb);
        this.setHandlerPosition();
        this.updateInput(value ? value : cValue);
        var rgba = this.convertToRgbString(this.rgb);
        this.updatePreview(rgba);
        this.triggerEvent(cValue, pValue, rgba);
    };
    ColorPicker.prototype.triggerEvent = function (cValue, pValue, rgba, isKey) {
        if (isKey === void 0) { isKey = false; }
        var hex = cValue.slice(0, 7);
        if (!this.showButtons && !isKey) {
            this.trigger('change', { currentValue: { hex: hex, rgba: rgba },
                previousValue: { hex: this.value.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(this.value)) }, value: cValue });
            this.setProperties({ 'value': cValue }, true);
            this.element.value = hex ? hex : '#000000';
        }
        else {
            this.trigger('select', {
                currentValue: { hex: hex, rgba: rgba },
                previousValue: { hex: pValue.slice(0, 7), rgba: this.convertToRgbString(this.hexToRgb(pValue)) }
            });
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers.
     * Also it maintains the initial input element from the DOM.
     * @method destroy
     * @return {void}
     */
    ColorPicker.prototype.destroy = function () {
        var _this = this;
        var wrapper = this.getWrapper();
        _super.prototype.destroy.call(this);
        ['tabindex', 'spellcheck'].forEach(function (attr) { _this.element.removeAttribute(attr); });
        if (this.inline) {
            this.unWireEvents();
            this.destroyOtherComp();
        }
        else {
            if (this.isPopupOpen()) {
                this.unWireEvents();
                this.destroyOtherComp();
            }
            this.splitBtn.destroy();
            this.splitBtn = null;
        }
        this.tileRipple();
        this.tileRipple = null;
        this.ctrlBtnRipple();
        this.ctrlBtnRipple = null;
        if (this.element.nextElementSibling) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.nextElementSibling);
        }
        if (wrapper) {
            wrapper.parentElement.insertBefore(this.element, wrapper);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(wrapper);
        }
        this.container = null;
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.formResetHandler);
        }
    };
    ColorPicker.prototype.destroyOtherComp = function () {
        if (this.isPicker()) {
            this.hueSlider.destroy();
            if (this.enableOpacity) {
                this.opacitySlider.destroy();
                this.opacitySlider = null;
            }
            this.hueSlider = null;
            var tooltipInst = this.getTooltipInst();
            tooltipInst.close();
            tooltipInst.destroy();
            this.tooltipEle = null;
        }
    };
    ColorPicker.prototype.isPopupOpen = function () {
        return this.getPopupEle().classList.contains('e-popup-open');
    };
    ColorPicker.prototype.unWireEvents = function () {
        if (this.isPicker()) {
            var wrapper = this.getWrapper();
            var dragHandler = this.getDragHandler();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(dragHandler, 'keydown', this.pickerKeyDown);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown);
            if (this.modeSwitcher || this.showButtons) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLSWITCH, this.container), 'click', this.btnClickHandler);
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PREVIOUS, this.container), 'click', this.previewHandler);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.container, 'click', this.paletteClickHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.container, 'keydown', this.paletteKeyDown);
        }
    };
    ColorPicker.prototype.roundValue = function (value) {
        if (!value) {
            return '';
        }
        if (value[0] !== '#') {
            value = '#' + value;
        }
        var len = value.length;
        if (len === 4) {
            value += 'f';
            len = 5;
        }
        if (len === 5) {
            var tempValue = '';
            for (var i = 1, len_1 = value.length; i < len_1; i++) {
                tempValue += (value.charAt(i) + value.charAt(i));
            }
            value = '#' + tempValue;
            len = 9;
        }
        if (len === 7) {
            value += 'ff';
        }
        return value;
    };
    ColorPicker.prototype.hexToRgb = function (hex) {
        if (!hex) {
            return [];
        }
        hex = hex.trim();
        if (hex.length !== 9) {
            hex = this.roundValue(hex);
        }
        var opacity = Number((parseInt(hex.slice(-2), 16) / 255).toFixed(2));
        hex = hex.slice(1, 7);
        var bigInt = parseInt(hex, 16);
        var h = [];
        h.push((bigInt >> 16) & 255);
        h.push((bigInt >> 8) & 255);
        h.push(bigInt & 255);
        h.push(opacity);
        return h;
    };
    ColorPicker.prototype.rgbToHsv = function (r, g, b, opacity) {
        if (this.rgb && !this.rgb.length) {
            return [];
        }
        r /= 255;
        g /= 255;
        b /= 255;
        var max = Math.max(r, g, b);
        var min = Math.min(r, g, b);
        var h;
        var s;
        var v = max;
        var d = max - min;
        s = max === 0 ? 0 : d / max;
        if (max === min) {
            h = 0;
        }
        else {
            switch (max) {
                case r:
                    h = (g - b) / d + (g < b ? 6 : 0);
                    break;
                case g:
                    h = (b - r) / d + 2;
                    break;
                case b:
                    h = (r - g) / d + 4;
                    break;
            }
            h /= 6;
        }
        var hsv = [Math.round(h * 360), Math.round(s * 1000) / 10, Math.round(v * 1000) / 10];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(opacity)) {
            hsv.push(opacity);
        }
        return hsv;
    };
    ColorPicker.prototype.hsvToRgb = function (h, s, v, opacity) {
        var r;
        var g;
        var b;
        var i;
        var f;
        var p;
        var q;
        var t;
        s /= 100;
        v /= 100;
        if (s === 0) {
            r = g = b = v;
            return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), opacity];
        }
        h /= 60;
        i = Math.floor(h);
        f = h - i;
        p = v * (1 - s);
        q = v * (1 - s * f);
        t = v * (1 - s * (1 - f));
        switch (i) {
            case 0:
                r = v;
                g = t;
                b = p;
                break;
            case 1:
                r = q;
                g = v;
                b = p;
                break;
            case 2:
                r = p;
                g = v;
                b = t;
                break;
            case 3:
                r = p;
                g = q;
                b = v;
                break;
            case 4:
                r = t;
                g = p;
                b = v;
                break;
            default:
                r = v;
                g = p;
                b = q;
        }
        var rgb = [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(opacity)) {
            rgb.push(opacity);
        }
        return rgb;
    };
    ColorPicker.prototype.rgbToHex = function (rgb) {
        return rgb.length ? ('#' + this.hex(rgb[0]) + this.hex(rgb[1]) + this.hex(rgb[2]) +
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rgb[3]) ? (rgb[3] !== 0 ? (Math.round(rgb[3] * 255) + 0x10000).toString(16).substr(-2) : '00') : '')) : '';
    };
    ColorPicker.prototype.hex = function (x) {
        return ('0' + x.toString(16)).slice(-2);
    };
    ColorPicker.prototype.changeModeSwitcherProp = function (prop) {
        var ctrlSwitchWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLSWITCH, this.container);
        if (prop) {
            if (ctrlSwitchWrapper) {
                this.appendModeSwitchBtn();
            }
            else {
                this.createCtrlBtn();
                if (this.isPicker() && !this.disabled) {
                    this.addCtrlSwitchEvent();
                }
            }
        }
        else {
            if (ctrlSwitchWrapper) {
                if (this.showButtons) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + MODESWITCH, ctrlSwitchWrapper));
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(ctrlSwitchWrapper);
                }
            }
        }
    };
    ColorPicker.prototype.changeShowBtnProps = function (prop) {
        var ctrlBtnWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLSWITCH, this.container);
        if (prop) {
            if (ctrlBtnWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(ctrlBtnWrapper);
            }
            this.createCtrlBtn();
            if (this.isPicker() && !this.disabled) {
                this.addCtrlSwitchEvent();
            }
        }
        else {
            if (this.modeSwitcher) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CTRLBTN, ctrlBtnWrapper));
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(ctrlBtnWrapper);
            }
        }
    };
    ColorPicker.prototype.changeValueProp = function (newProp) {
        if (this.isPicker()) {
            this.rgb = this.hexToRgb(newProp);
            this.hsv = this.rgbToHsv.apply(this, this.rgb);
            this.setHandlerPosition();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.hueSlider.element, '.e-slider-preview'));
            this.createSlider();
            this.setHsvContainerBg();
            this.updateInput(newProp);
            if (this.rgb.length === 4) {
                this.updateOpacityInput(this.rgb[3] * 100);
            }
        }
        else {
            this.removeTileSelection();
            var ele = this.container.querySelector('span[aria-label="' + this.roundValue(newProp) + '"]');
            if (ele) {
                this.addTileSelection(ele);
            }
        }
    };
    ColorPicker.prototype.setInputEleProps = function (prop) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INPUTWRAPPER, this.container));
        this.createInput();
    };
    ColorPicker.prototype.changeDisabledProp = function (newProp) {
        if (this.isPicker()) {
            this.hueSlider.enabled = !newProp;
            this.opacitySlider.enabled = !newProp;
            this.setInputEleProps(newProp);
        }
        if (newProp) {
            this.toggleDisabled(true);
            this.unWireEvents();
        }
        else {
            this.toggleDisabled(false);
            this.wireEvents();
        }
    };
    ColorPicker.prototype.changeCssClassProps = function (newProp, oldProp) {
        var wrapper = this.getWrapper();
        var popupWrapper = this.getPopupEle();
        if (oldProp) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([wrapper, popupWrapper], oldProp.split(' '));
        }
        if (newProp) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper, popupWrapper], newProp.split(' '));
        }
    };
    ColorPicker.prototype.changeRtlProps = function (newProp) {
        if (newProp) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.getWrapper()], 'e-rtl');
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.getWrapper()], 'e-rtl');
        }
    };
    ColorPicker.prototype.changePaletteProps = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.container.children[0]);
        this.container.style.width = '';
        this.createPalette();
    };
    ColorPicker.prototype.changeOpacityProps = function (newProp) {
        var wrapper = this.getWrapper();
        if (newProp) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.container.parentElement], HIDEOPACITY);
            this.createOpacitySlider(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-colorpicker-slider', this.container).appendChild(this.createElement('div', { className: 'e-opacity-slider' })));
            if (!wrapper.classList.contains(HIDEVALUE) && !wrapper.classList.contains(HIDERGBA)) {
                this.appendOpacityValue(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-input-container', this.container));
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.container.parentElement], HIDEOPACITY);
            this.opacitySlider.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.opacitySlider.element);
            this.opacitySlider = null;
            if (!wrapper.classList.contains(HIDEVALUE) && !wrapper.classList.contains(HIDERGBA)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + OPACITY, this.container).parentElement);
            }
        }
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {ColorPickerModel} newProp
     * @param  {ColorPickerModel} oldProp
     * @returns void
     * @private
     */
    ColorPicker.prototype.onPropertyChanged = function (newProp, oldProp) {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value)) {
            var value = this.roundValue(newProp.value);
            if (value.length === 9) {
                this.element.value = this.roundValue(value).slice(0, 7);
                var preview = this.splitBtn && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + SPLITPREVIEW, this.splitBtn.element);
                if (preview) {
                    preview.style.backgroundColor = this.convertToRgbString(this.hexToRgb(newProp.value));
                }
            }
            else {
                this.value = oldProp.value;
            }
        }
        if (!this.inline && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.inline)) {
            var otherCompModel = ['disabled', 'enableRtl'];
            this.splitBtn.setProperties(Object(_ej2_splitbuttons__WEBPACK_IMPORTED_MODULE_1__["getModel"])(newProp, otherCompModel));
            if (!this.isPopupOpen()) {
                this.changeCssClassProps(newProp.cssClass, oldProp.cssClass);
                this.changeRtlProps(newProp.enableRtl);
                return;
            }
        }
        var _loop_1 = function (prop) {
            switch (prop) {
                case 'inline':
                    if (newProp.inline) {
                        this_1.getWrapper().appendChild(this_1.container);
                        this_1.splitBtn.destroy();
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this_1.element.nextElementSibling);
                        if (!this_1.container.children.length) {
                            this_1.createWidget();
                        }
                    }
                    else {
                        this_1.destroyOtherComp();
                        this_1.unWireEvents();
                        this_1.container.innerHTML = '';
                        this_1.createSplitBtn();
                    }
                    break;
                case 'cssClass':
                    this_1.changeCssClassProps(newProp.cssClass, oldProp.cssClass);
                    var props = newProp.cssClass.split(' ').concat(oldProp.cssClass.split(' '));
                    props = props.reduce(function (a, b) { if (a.indexOf(b) < 0) {
                        a.push(b);
                    } return a; }, []);
                    var count_1 = 0;
                    props.forEach(function (cls) {
                        if (count_1 === 0 &&
                            (cls === HIDEVALUE || cls === HIDEVALUESWITCH || cls === SHOWVALUE || cls === HIDEHEX || cls === HIDERGBA)) {
                            var inputWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INPUTWRAPPER, _this.container);
                            if (inputWrap) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INPUTWRAPPER, _this.container));
                            }
                            _this.createInput();
                            count_1++;
                        }
                    });
                    break;
                case 'enableRtl':
                    if (this_1.isPicker()) {
                        this_1.hueSlider.enableRtl = newProp.enableRtl;
                        if (this_1.enableOpacity) {
                            this_1.opacitySlider.enableRtl = newProp.enableRtl;
                        }
                        this_1.setInputEleProps(newProp.enableRtl);
                    }
                    this_1.changeRtlProps(newProp.enableRtl);
                    break;
                case 'disabled':
                    this_1.changeDisabledProp(newProp.disabled);
                    break;
                case 'value':
                    if (this_1.value !== oldProp.value) {
                        this_1.changeValueProp(newProp.value);
                    }
                    break;
                case 'showButtons':
                    this_1.changeShowBtnProps(newProp.showButtons);
                    break;
                case 'mode':
                    if (newProp.mode === 'Picker') {
                        this_1.switchToPicker();
                    }
                    else {
                        this_1.switchToPalette();
                    }
                    break;
                case 'modeSwitcher':
                    this_1.changeModeSwitcherProp(newProp.modeSwitcher);
                    break;
                case 'columns':
                case 'presetColors':
                    if (!this_1.isPicker()) {
                        this_1.changePaletteProps();
                    }
                    break;
                case 'noColor':
                    if (newProp.noColor) {
                        if (this_1.mode === 'Palette' && !this_1.modeSwitcher) {
                            this_1.setNoColor();
                        }
                    }
                    else {
                        this_1.changePaletteProps();
                    }
                    break;
                case 'enableOpacity':
                    this_1.changeOpacityProps(newProp.enableOpacity);
                    break;
            }
        };
        var this_1 = this;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            _loop_1(prop);
        }
    };
    /**
     * Sets the focus to Colorpicker
     * its native method
     * @public
     */
    ColorPicker.prototype.focusIn = function () {
        this.element.parentElement.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('#008000ff')
    ], ColorPicker.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ColorPicker.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ColorPicker.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Picker')
    ], ColorPicker.prototype, "mode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ColorPicker.prototype, "modeSwitcher", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ColorPicker.prototype, "presetColors", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ColorPicker.prototype, "showButtons", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(10)
    ], ColorPicker.prototype, "columns", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ColorPicker.prototype, "inline", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ColorPicker.prototype, "noColor", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ColorPicker.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ColorPicker.prototype, "enableOpacity", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "beforeTileRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "beforeModeSwitch", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "onModeSwitch", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ColorPicker.prototype, "created", void 0);
    ColorPicker = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], ColorPicker);
    return ColorPicker;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/index.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/index.js ***!
  \************************************************************************/
/*! exports provided: ColorPicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _color_picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color-picker */ "./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/color-picker.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return _color_picker__WEBPACK_IMPORTED_MODULE_0__["ColorPicker"]; });

/**
 * ColorPicker modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/form-validator.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/form-validator.js ***!
  \***********************************************************************************/
/*! exports provided: regex, ErrorOption, FormValidator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regex", function() { return regex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorOption", function() { return ErrorOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormValidator", function() { return FormValidator; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




/**
 * global declarations
 */
// tslint:disable-next-line:no-any
var regex = {
    EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +
        '|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),
    URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,
    DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),
    DIGITS: new RegExp('^[0-9]*$'),
    PHONE: new RegExp('^[+]?[0-9]{9,13}$'),
    CREDITCARD: new RegExp('^\\d{13,16}$')
};
/**
 * ErrorOption values
 * @private
 */
var ErrorOption;
(function (ErrorOption) {
    /**
     * Defines the error message.
     */
    ErrorOption[ErrorOption["Message"] = 0] = "Message";
    /**
     * Defines the error element type.
     */
    ErrorOption[ErrorOption["Label"] = 1] = "Label";
})(ErrorOption || (ErrorOption = {}));
/**
 * FormValidator class enables you to validate the form fields based on your defined rules
 * ```html
 * <form id='formId'>
 *  <input type='text' name='Name' />
 *  <input type='text' name='Age' />
 * </form>
 * <script>
 *   let formObject = new FormValidator('#formId', {
 *      rules: { Name: { required: true }, Age: { range: [18, 30] } };
 *   });
 *   formObject.validate();
 * </script>
 * ```
 */
var FormValidator = /** @__PURE__ @class */ (function (_super) {
    __extends(FormValidator, _super);
    // Initializes the FormValidator 
    function FormValidator(element, options) {
        var _this = _super.call(this, options, element) || this;
        _this.validated = [];
        _this.errorRules = [];
        _this.allowSubmit = false;
        _this.required = 'required';
        _this.infoElement = null;
        _this.inputElement = null;
        _this.selectQuery = 'input:not([type=reset]):not([type=button]), select, textarea';
        // tslint:disable-next-line:no-any
        _this.localyMessage = {};
        /**
         * Specifies the default messages for validation rules.
         * @default { List of validation message }
         */
        _this.defaultMessages = {
            required: 'This field is required.',
            email: 'Please enter a valid email address.',
            url: 'Please enter a valid URL.',
            date: 'Please enter a valid date.',
            dateIso: 'Please enter a valid date ( ISO ).',
            creditcard: 'Please enter valid card number',
            number: 'Please enter a valid number.',
            digits: 'Please enter only digits.',
            maxLength: 'Please enter no more than {0} characters.',
            minLength: 'Please enter at least {0} characters.',
            rangeLength: 'Please enter a value between {0} and {1} characters long.',
            range: 'Please enter a value between {0} and {1}.',
            max: 'Please enter a value less than or equal to {0}.',
            min: 'Please enter a value greater than or equal to {0}.',
            regex: 'Please enter a correct value.',
            tel: 'Please enter a valid phone number.',
            pattern: 'Please enter a correct pattern value.',
            equalTo: 'Please enter the valid match text',
        };
        if (typeof _this.rules === 'undefined') {
            _this.rules = {};
        }
        _this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('formValidator', _this.defaultMessages, _this.locale);
        if (_this.locale) {
            _this.localeFunc();
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["onIntlChange"].on('notifyExternalChange', _this.afterLocalization, _this);
        element = typeof element === 'string' ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(element, document) : element;
        // Set novalidate to prevent default HTML5 form validation
        if (_this.element != null) {
            _this.element.setAttribute('novalidate', '');
            _this.inputElements = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(_this.selectQuery, _this.element);
            _this.createHTML5Rules();
            _this.wireEvents();
        }
        else {
            return undefined;
        }
        return _this;
    }
    FormValidator_1 = FormValidator;
    // tslint:enable
    /**
     * Add validation rules to the corresponding input element based on `name` attribute.
     * @param {string} name `name` of form field.
     * @param {Object} rules Validation rules for the corresponding element.
     * @return {void}
     */
    FormValidator.prototype.addRules = function (name, rules) {
        if (name) {
            if (this.rules.hasOwnProperty(name)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.rules[name], rules, {});
            }
            else {
                this.rules[name] = rules;
            }
        }
    };
    /**
     * Remove validation to the corresponding field based on name attribute.
     * When no parameter is passed, remove all the validations in the form.
     * @param {string} name Input name attribute value.
     * @param {string[]} rules List of validation rules need to be remove from the corresponding element.
     * @return {void}
     */
    FormValidator.prototype.removeRules = function (name, rules) {
        if (!name && !rules) {
            this.rules = {};
        }
        else if (this.rules[name] && !rules) {
            delete this.rules[name];
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.rules[name] && rules)) {
            for (var i = 0; i < rules.length; i++) {
                delete this.rules[name][rules[i]];
            }
        }
        else {
            return;
        }
    };
    /**
     * Validate the current form values using defined rules.
     * Returns `true` when the form is valid otherwise `false`
     * @param {string} selected - Optional parameter to validate specified element.
     * @return {boolean}
     */
    FormValidator.prototype.validate = function (selected) {
        var rules = Object.keys(this.rules);
        if (selected && rules.length) {
            this.validateRules(selected);
            //filter the selected element it don't have any valid input element
            return rules.indexOf(selected) !== -1 && this.errorRules.filter(function (data) {
                return data.name === selected;
            }).length === 0;
        }
        else {
            this.errorRules = [];
            for (var _i = 0, rules_1 = rules; _i < rules_1.length; _i++) {
                var name_1 = rules_1[_i];
                this.validateRules(name_1);
            }
            return this.errorRules.length === 0;
        }
    };
    /**
     * Reset the value of all the fields in form.
     * @return {void}
     */
    FormValidator.prototype.reset = function () {
        this.element.reset();
        this.clearForm();
    };
    /**
     * Get input element by name.
     * @param {string} name - Input element name attribute value.
     * @return {HTMLInputElement}
     */
    FormValidator.prototype.getInputElement = function (name) {
        this.inputElement = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('[name="' + name + '"]', this.element));
        return this.inputElement;
    };
    /**
     * Destroy the form validator object and error elements.
     * @return {void}
     */
    FormValidator.prototype.destroy = function () {
        this.reset();
        this.unwireEvents();
        this.rules = {};
        var elements = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + this.errorClass + ', .' + this.validClass, this.element);
        for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
            var element = elements_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(element);
        }
        _super.prototype.destroy.call(this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["onIntlChange"].off('notifyExternalChange', this.afterLocalization);
    };
    /**
     * @private
     */
    FormValidator.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'locale':
                    this.localeFunc();
                    break;
            }
        }
    };
    ;
    /**
     * @private
     */
    FormValidator.prototype.localeFunc = function () {
        for (var _i = 0, _a = Object.keys(this.defaultMessages); _i < _a.length; _i++) {
            var key = _a[_i];
            this.l10n.setLocale(this.locale);
            var value = this.l10n.getConstant(key);
            this.localyMessage[key] = value;
        }
    };
    /**
     * @private
     */
    FormValidator.prototype.getModuleName = function () {
        return 'formValidator';
    };
    /**
     * @private
     */
    // tslint:disable-next-line:no-any
    FormValidator.prototype.afterLocalization = function (args) {
        this.locale = args.locale;
        this.localeFunc();
    };
    /**
     * Allows you to refresh the form validator base events to the elements inside the form.
     * @return {void}
     */
    FormValidator.prototype.refresh = function () {
        this.unwireEvents();
        this.inputElements = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(this.selectQuery, this.element);
        this.wireEvents();
    };
    FormValidator.prototype.clearForm = function () {
        this.errorRules = [];
        this.validated = [];
        var elements = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(this.selectQuery, this.element);
        for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {
            var element = elements_2[_i];
            var input = element;
            input.removeAttribute('aria-invalid');
            input.classList.remove(this.errorClass);
            if (input.name.length > 0) {
                this.getInputElement(input.name);
                this.getErrorElement(input.name);
                this.hideMessage(input.name);
            }
            input.classList.remove(this.validClass);
        }
    };
    FormValidator.prototype.createHTML5Rules = function () {
        var defRules = ['required', 'validateHidden', 'regex', 'rangeLength', 'maxLength', 'minLength', 'dateIso', 'digits',
            'pattern', 'data-val-required', 'type', 'data-validation', 'min', 'max', 'range', 'equalTo', 'data-val-minlength-min',
            'data-val-equalto-other', 'data-val-maxlength-max', 'data-val-range-min', 'data-val-regex-pattern', 'data-val-length-max',
            'data-val-creditcard', 'data-val-phone'];
        var acceptedTypes = ['hidden', 'email', 'url', 'date', 'number', 'tel'];
        for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {
            var input = _a[_i];
            // Default attribute rules 
            var allRule = {};
            for (var _b = 0, defRules_1 = defRules; _b < defRules_1.length; _b++) {
                var rule = defRules_1[_b];
                if (input.getAttribute(rule) !== null) {
                    switch (rule) {
                        case 'required':
                            this.defRule(input, allRule, rule, input.required);
                            break;
                        case 'data-validation':
                            rule = input.getAttribute(rule);
                            this.defRule(input, allRule, rule, true);
                            break;
                        case 'type':
                            if (acceptedTypes.indexOf(input.type) !== -1) {
                                this.defRule(input, allRule, input.type, true);
                            }
                            break;
                        case 'rangeLength':
                        case 'range':
                            this.defRule(input, allRule, rule, JSON.parse(input.getAttribute(rule)));
                            break;
                        case 'equalTo':
                            var id = input.getAttribute(rule);
                            this.defRule(input, allRule, rule, id);
                            break;
                        default:
                            if (input.getAttribute('data-val') === 'true') {
                                this.annotationRule(input, allRule, rule, input.getAttribute(rule));
                            }
                            else {
                                this.defRule(input, allRule, rule, input.getAttribute(rule));
                            }
                    }
                }
            }
            //adding pattern type validation
            if (Object.keys(allRule).length !== 0) {
                this.addRules(input.name, allRule);
            }
        }
    };
    FormValidator.prototype.annotationRule = function (input, ruleCon, ruleName, value) {
        var annotationRule = ruleName.split('-');
        var rulesList = ['required', 'creditcard', 'phone', 'maxlength', 'minlength', 'range', 'regex', 'equalto'];
        var ruleFirstName = annotationRule[annotationRule.length - 1];
        var ruleSecondName = annotationRule[annotationRule.length - 2];
        if (rulesList.indexOf(ruleFirstName) !== -1) {
            switch (ruleFirstName) {
                case 'required':
                    this.defRule(input, ruleCon, 'required', value);
                    break;
                case 'creditcard':
                    this.defRule(input, ruleCon, 'creditcard', value);
                    break;
                case 'phone':
                    this.defRule(input, ruleCon, 'tel', value);
                    break;
            }
        }
        else if (rulesList.indexOf(ruleSecondName) !== -1) {
            switch (ruleSecondName) {
                case 'maxlength':
                    this.defRule(input, ruleCon, 'maxLength', value);
                    break;
                case 'minlength':
                    this.defRule(input, ruleCon, 'minLength', value);
                    break;
                case 'range':
                    var minvalue = input.getAttribute('data-val-range-min');
                    var maxvalue = input.getAttribute('data-val-range-max');
                    this.defRule(input, ruleCon, 'range', [minvalue, maxvalue]);
                    break;
                case 'equalto':
                    var id = input.getAttribute(ruleName).split('.');
                    this.defRule(input, ruleCon, 'equalTo', id[id.length - 1]);
                    break;
                case 'regex':
                    this.defRule(input, ruleCon, 'regex', value);
                    break;
            }
        }
    };
    FormValidator.prototype.defRule = function (input, ruleCon, ruleName, value) {
        var message = input.getAttribute('data-' + ruleName + '-message');
        var annotationMessage = input.getAttribute('data-val-' + ruleName);
        var customMessage;
        if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {
            this.getInputElement(input.name);
            customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);
        }
        if (message) {
            value = [value, message];
        }
        else if (annotationMessage) {
            value = [value, annotationMessage];
        }
        else if (customMessage) {
            value = [value, customMessage];
        }
        ruleCon[ruleName] = value;
    };
    // Wire events to the form elements
    FormValidator.prototype.wireEvents = function () {
        for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {
            var input = _a[_i];
            if (FormValidator_1.isCheckable(input)) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(input, 'click', this.clickHandler, this);
            }
            else if (input.tagName === 'SELECT') {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(input, 'change', this.changeHandler, this);
            }
            else {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(input, 'focusout', this.focusOutHandler, this);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(input, 'keyup', this.keyUpHandler, this);
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'submit', this.submitHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'reset', this.resetHandler, this);
    };
    // UnWire events to the form elements
    FormValidator.prototype.unwireEvents = function () {
        for (var _i = 0, _a = (this.inputElements); _i < _a.length; _i++) {
            var input = _a[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(input);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'submit', this.submitHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'reset', this.resetHandler);
    };
    // Handle input element focusout event
    FormValidator.prototype.focusOutHandler = function (e) {
        this.trigger('focusout', e);
        //FormValidator.triggerCallback(this.focusout, e);
        var element = e.target;
        if (this.rules[element.name]) {
            if (this.rules[element.name][this.required] || element.value.length > 0) {
                this.validate(element.name);
            }
            else if (this.validated.indexOf(element.name) === -1) {
                this.validated.push(element.name);
            }
        }
    };
    // Handle input element keyup event
    FormValidator.prototype.keyUpHandler = function (e) {
        this.trigger('keyup', e);
        var element = e.target;
        // List of keys need to prevent while validation
        var excludeKeys = [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225];
        if (e.which === 9 && (!this.rules[element.name] || (this.rules[element.name] && !this.rules[element.name][this.required]))) {
            return;
        }
        if (this.validated.indexOf(element.name) !== -1 && this.rules[element.name] && excludeKeys.indexOf(e.which) === -1) {
            this.validate(element.name);
        }
    };
    // Handle input click event
    FormValidator.prototype.clickHandler = function (e) {
        this.trigger('click', e);
        var element = e.target;
        // If element type is not submit allow validation
        if (element.type !== 'submit') {
            this.validate(element.name);
        }
        else if (element.getAttribute('formnovalidate') !== null) {
            // Prevent form validation, if submit button has formnovalidate attribute
            this.allowSubmit = true;
        }
    };
    // Handle input change event
    FormValidator.prototype.changeHandler = function (e) {
        this.trigger('change', e);
        var element = e.target;
        this.validate(element.name);
    };
    // Handle form submit event
    FormValidator.prototype.submitHandler = function (e) {
        this.trigger('submit', e);
        //FormValidator.triggerCallback(this.submit, e);
        // Prevent form submit if validation failed
        if (!this.allowSubmit && !this.validate()) {
            e.preventDefault();
        }
        else {
            this.allowSubmit = false;
        }
    };
    // Handle form reset
    FormValidator.prototype.resetHandler = function () {
        this.clearForm();
    };
    // Validate each rule based on input element name
    FormValidator.prototype.validateRules = function (name) {
        if (!this.rules[name]) {
            return;
        }
        var rules = Object.keys(this.rules[name]);
        var hiddenType = false;
        var validateHiddenType = false;
        var vhPos = rules.indexOf('validateHidden');
        var hPos = rules.indexOf('hidden');
        this.getInputElement(name);
        if (hPos !== -1) {
            hiddenType = true;
        }
        if (vhPos !== -1) {
            validateHiddenType = true;
        }
        if (!hiddenType || (hiddenType && validateHiddenType)) {
            if (vhPos !== -1) {
                rules.splice(vhPos, 1);
            }
            if (hPos !== -1) {
                rules.splice((hPos - 1), 1);
            }
            this.getErrorElement(name);
            for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) {
                var rule = rules_2[_i];
                var errorMessage = this.getErrorMessage(this.rules[name][rule], rule);
                var errorRule = { name: name, message: errorMessage };
                var eventArgs = {
                    inputName: name,
                    element: this.inputElement,
                    message: errorMessage
                };
                if (!this.isValid(name, rule) && !this.inputElement.classList.contains(this.ignore)) {
                    this.removeErrorRules(name);
                    this.errorRules.push(errorRule);
                    // Set aria attributes to invalid elements
                    this.inputElement.setAttribute('aria-invalid', 'true');
                    this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');
                    this.inputElement.classList.add(this.errorClass);
                    this.inputElement.classList.remove(this.validClass);
                    if (!this.infoElement) {
                        this.createErrorElement(name, errorRule.message, this.inputElement);
                    }
                    else {
                        this.showMessage(errorRule);
                    }
                    eventArgs.errorElement = this.infoElement;
                    eventArgs.status = 'failure';
                    this.inputElement.classList.add(this.errorClass);
                    this.inputElement.classList.remove(this.validClass);
                    this.optionalValidationStatus(name, eventArgs);
                    this.trigger('validationComplete', eventArgs);
                    // Set aria-required to required rule elements
                    if (rule === 'required') {
                        this.inputElement.setAttribute('aria-required', 'true');
                    }
                    break;
                }
                else {
                    this.hideMessage(name);
                    eventArgs.status = 'success';
                    this.trigger('validationComplete', eventArgs);
                }
            }
        }
        else {
            return;
        }
    };
    // Update the optional validation status
    FormValidator.prototype.optionalValidationStatus = function (name, refer) {
        if (!this.rules[name][this.required] && !this.inputElement.value.length && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.infoElement)) {
            this.infoElement.innerHTML = this.inputElement.value;
            this.infoElement.setAttribute('aria-invalid', 'false');
            refer.status = '';
            this.hideMessage(name);
        }
    };
    // Check the input element whether it's value satisfy the validation rule or not
    FormValidator.prototype.isValid = function (name, rule) {
        var params = this.rules[name][rule];
        var param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
        var currentRule = this.rules[name][rule];
        var args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };
        this.trigger('validationBegin', args);
        if (!args.param && rule === 'required') {
            return true;
        }
        if (currentRule && typeof currentRule[0] === 'function') {
            var fn = currentRule[0];
            return fn.call(this, { element: this.inputElement, value: this.inputElement.value });
        }
        else if (FormValidator_1.isCheckable(this.inputElement)) {
            if (rule !== 'required') {
                return true;
            }
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('input[name=' + name + ']:checked', this.element).length > 0;
        }
        else {
            return FormValidator_1.checkValidator[rule](args);
        }
    };
    // Return default error message or custom error message 
    FormValidator.prototype.getErrorMessage = function (ruleValue, rule) {
        var message = this.inputElement.getAttribute('data-' + rule + '-message') ?
            this.inputElement.getAttribute('data-' + rule + '-message') :
            (ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :
                (Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];
        var formats = message.match(/{(\d)}/g);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(formats)) {
            for (var i = 0; i < formats.length; i++) {
                var value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;
                message = message.replace(formats[i], value);
            }
        }
        return message;
    };
    // Create error element based on name and error message
    FormValidator.prototype.createErrorElement = function (name, message, input) {
        var errorElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])(this.errorElement, {
            className: this.errorClass,
            innerHTML: message,
            attrs: { for: name }
        });
        // Create message design if errorOption is message
        if (this.errorOption === ErrorOption.Message) {
            errorElement.classList.remove(this.errorClass);
            errorElement.classList.add('e-message');
            errorElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])(this.errorContainer, { className: this.errorClass, innerHTML: errorElement.outerHTML });
        }
        errorElement.id = this.inputElement.name + '-info';
        // Append error message into MVC error message element
        if (this.element.querySelector('[data-valmsg-for="' + input.id + '"]')) {
            this.element.querySelector('[data-valmsg-for="' + input.id + '"]').appendChild(errorElement);
        }
        else if (input.hasAttribute('data-msg-containerid') === true) {
            // Append error message into custom div element
            var containerId = input.getAttribute('data-msg-containerid');
            var divElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + containerId, this.element);
            divElement.appendChild(errorElement);
        }
        else if (this.customPlacement != null) {
            // Call custom placement function if customPlacement is not null
            this.customPlacement.call(this, this.inputElement, errorElement);
        }
        else {
            this.inputElement.parentNode.insertBefore(errorElement, this.inputElement.nextSibling);
        }
        errorElement.style.display = 'block';
        this.getErrorElement(name);
        this.validated.push(name);
        this.checkRequired(name);
    };
    // Get error element by name
    FormValidator.prototype.getErrorElement = function (name) {
        this.infoElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.errorElement + '.' + this.errorClass, this.inputElement.parentElement);
        if (!this.infoElement) {
            this.infoElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.errorElement + '.' + this.errorClass + '[for="' + name + '"]', this.element);
        }
        return this.infoElement;
    };
    // Remove existing rule from errorRules object
    FormValidator.prototype.removeErrorRules = function (name) {
        for (var i = 0; i < this.errorRules.length; i++) {
            var rule = this.errorRules[i];
            if (rule.name === name) {
                this.errorRules.splice(i, 1);
            }
        }
    };
    // Show error message to the input element
    FormValidator.prototype.showMessage = function (errorRule) {
        this.infoElement.style.display = 'block';
        this.infoElement.innerHTML = errorRule.message;
        this.checkRequired(errorRule.name);
    };
    // Hide error message based on input name
    FormValidator.prototype.hideMessage = function (name) {
        if (this.infoElement) {
            this.infoElement.style.display = 'none';
            this.removeErrorRules(name);
            this.inputElement.classList.add(this.validClass);
            this.inputElement.classList.remove(this.errorClass);
            this.inputElement.setAttribute('aria-invalid', 'false');
        }
    };
    // Check whether the input element have required rule and its value is not empty
    FormValidator.prototype.checkRequired = function (name) {
        if (!this.rules[name][this.required] && !this.inputElement.value.length && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.infoElement)) {
            this.infoElement.innerHTML = this.inputElement.value;
            this.infoElement.setAttribute('aria-invalid', 'false');
            this.hideMessage(name);
        }
    };
    // Return boolean result if the input have chekcable or submit types
    FormValidator.isCheckable = function (input) {
        var inputType = input.getAttribute('type');
        return inputType && (inputType === 'checkbox' || inputType === 'radio' || inputType === 'submit');
    };
    var FormValidator_1;
    // List of function to validate the rules
    FormValidator.checkValidator = {
        required: function (option) {
            return !isNaN(Date.parse(option.value)) ? !isNaN(new Date(option.value).getTime()) : option.value.toString().length > 0;
        },
        email: function (option) {
            return regex.EMAIL.test(option.value);
        },
        url: function (option) {
            return regex.URL.test(option.value);
        },
        dateIso: function (option) {
            return regex.DATE_ISO.test(option.value);
        },
        tel: function (option) {
            return regex.PHONE.test(option.value);
        },
        creditcard: function (option) {
            return regex.CREDITCARD.test(option.value);
        },
        number: function (option) {
            return !isNaN(Number(option.value)) && option.value.indexOf(' ') === -1;
        },
        digits: function (option) {
            return regex.DIGITS.test(option.value);
        },
        maxLength: function (option) {
            return option.value.length <= option.param;
        },
        minLength: function (option) {
            return option.value.length >= option.param;
        },
        rangeLength: function (option) {
            var param = option.param;
            return option.value.length >= param[0] && option.value.length <= param[1];
        },
        range: function (option) {
            var param = option.param;
            return !isNaN(Number(option.value)) && Number(option.value) >= param[0] && Number(option.value) <= param[1];
        },
        date: function (option) {
            return !isNaN(new Date(option.value).getTime());
        },
        max: function (option) {
            if (!isNaN(Number(option.value))) {
                // Maximum rule validation for number
                return +option.value <= option.param;
            }
            // Maximum rule validation for date
            return new Date(option.value).getTime() <= new Date(JSON.parse(JSON.stringify(option.param))).getTime();
        },
        min: function (option) {
            if (!isNaN(Number(option.value))) {
                // Minimum rule validation for number
                return +option.value >= option.param;
            }
            else if ((option.value).indexOf(',') !== -1) {
                var uNum = (option.value).replace(/,/g, '');
                return parseFloat(uNum) >= option.param;
            }
            else {
                // Minimum rule validation for date
                return new Date(option.value).getTime() >= new Date(JSON.parse(JSON.stringify(option.param))).getTime();
            }
        },
        regex: function (option) {
            return new RegExp(option.param).test(option.value);
        },
        equalTo: function (option) {
            var compareTo = option.formElement.querySelector('#' + option.param);
            option.param = compareTo.value;
            return option.param === option.value;
        },
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], FormValidator.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('e-hidden')
    ], FormValidator.prototype, "ignore", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FormValidator.prototype, "rules", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('e-error')
    ], FormValidator.prototype, "errorClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('e-valid')
    ], FormValidator.prototype, "validClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('label')
    ], FormValidator.prototype, "errorElement", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('div')
    ], FormValidator.prototype, "errorContainer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(ErrorOption.Label)
    ], FormValidator.prototype, "errorOption", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "focusout", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "keyup", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "click", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "submit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "validationBegin", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "validationComplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], FormValidator.prototype, "customPlacement", void 0);
    FormValidator = FormValidator_1 = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], FormValidator);
    return FormValidator;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/index.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/index.js ***!
  \**************************************************************************/
/*! exports provided: regex, ErrorOption, FormValidator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _form_validator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./form-validator */ "./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/form-validator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "regex", function() { return _form_validator__WEBPACK_IMPORTED_MODULE_0__["regex"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorOption", function() { return _form_validator__WEBPACK_IMPORTED_MODULE_0__["ErrorOption"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormValidator", function() { return _form_validator__WEBPACK_IMPORTED_MODULE_0__["FormValidator"]; });

/**
 * Input box Component
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js":
/*!***********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/index.js ***!
  \***********************************************************/
/*! exports provided: NumericTextBox, Input, TicksData, ColorRangeData, LimitData, TooltipData, Slider, regex, ErrorOption, FormValidator, FilesProp, ButtonsProps, AsyncSettings, Uploader, ColorPicker, TextBox, regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputFocusHandler, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo, MaskedTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _numerictextbox_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numerictextbox/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumericTextBox", function() { return _numerictextbox_index__WEBPACK_IMPORTED_MODULE_0__["NumericTextBox"]; });

/* harmony import */ var _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./maskedtextbox/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "regularExpressions", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["regularExpressions"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createMask", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["createMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyMask", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["applyMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wireEvents", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["wireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unwireEvents", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["unwireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindClearEvent", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["bindClearEvent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unstrippedValue", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["unstrippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "strippedValue", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["strippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputFocusHandler", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["maskInputFocusHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputBlurHandler", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["maskInputBlurHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputDropHandler", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["maskInputDropHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mobileRemoveFunction", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["mobileRemoveFunction"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMaskValue", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["setMaskValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setElementValue", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["setElementValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInput", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["maskInput"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getVal", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["getVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaskedVal", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["getMaskedVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskUndo", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["MaskUndo"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskedTextBox", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["MaskedTextBox"]; });

/* harmony import */ var _input_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./input/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _input_index__WEBPACK_IMPORTED_MODULE_2__["Input"]; });

/* harmony import */ var _slider_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./slider/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/slider/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TicksData", function() { return _slider_index__WEBPACK_IMPORTED_MODULE_3__["TicksData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorRangeData", function() { return _slider_index__WEBPACK_IMPORTED_MODULE_3__["ColorRangeData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LimitData", function() { return _slider_index__WEBPACK_IMPORTED_MODULE_3__["LimitData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipData", function() { return _slider_index__WEBPACK_IMPORTED_MODULE_3__["TooltipData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return _slider_index__WEBPACK_IMPORTED_MODULE_3__["Slider"]; });

/* harmony import */ var _form_validator_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./form-validator/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/form-validator/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "regex", function() { return _form_validator_index__WEBPACK_IMPORTED_MODULE_4__["regex"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorOption", function() { return _form_validator_index__WEBPACK_IMPORTED_MODULE_4__["ErrorOption"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormValidator", function() { return _form_validator_index__WEBPACK_IMPORTED_MODULE_4__["FormValidator"]; });

/* harmony import */ var _uploader_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uploader/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FilesProp", function() { return _uploader_index__WEBPACK_IMPORTED_MODULE_5__["FilesProp"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonsProps", function() { return _uploader_index__WEBPACK_IMPORTED_MODULE_5__["ButtonsProps"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSettings", function() { return _uploader_index__WEBPACK_IMPORTED_MODULE_5__["AsyncSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Uploader", function() { return _uploader_index__WEBPACK_IMPORTED_MODULE_5__["Uploader"]; });

/* harmony import */ var _color_picker_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./color-picker/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/color-picker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return _color_picker_index__WEBPACK_IMPORTED_MODULE_6__["ColorPicker"]; });

/* harmony import */ var _textbox_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textbox/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextBox", function() { return _textbox_index__WEBPACK_IMPORTED_MODULE_7__["TextBox"]; });

/**
 * NumericTextBox all modules
 */










/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/index.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/input/index.js ***!
  \*****************************************************************/
/*! exports provided: Input */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return _input__WEBPACK_IMPORTED_MODULE_0__["Input"]; });

/**
 * Input box Component
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js ***!
  \*****************************************************************/
/*! exports provided: Input */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");


var CLASSNAMES = {
    RTL: 'e-rtl',
    DISABLE: 'e-disabled',
    INPUT: 'e-input',
    TEXTAREA: 'e-multi-line-input',
    INPUTGROUP: 'e-input-group',
    FLOATINPUT: 'e-float-input',
    FLOATLINE: 'e-float-line',
    FLOATTEXT: 'e-float-text',
    CLEARICON: 'e-clear-icon',
    CLEARICONHIDE: 'e-clear-icon-hide',
    LABELTOP: 'e-label-top',
    LABELBOTTOM: 'e-label-bottom',
    NOFLOATLABEL: 'e-no-float-label',
    INPUTCUSTOMTAG: 'e-input-custom-tag',
    FLOATCUSTOMTAG: 'e-float-custom-tag'
};
/**
 * Base for Input creation through util methods.
 */
var Input;
(function (Input) {
    var privateInputObj = {
        container: null,
        buttons: [],
        clearButton: null
    };
    var floatType;
    /**
     * Create a wrapper to input element with multiple span elements and set the basic properties to input based components.
     * ```
     * E.g : Input.createInput({ element: element, floatLabelType : "Auto", properties: { placeholder: 'Search' } });
     * ```
     * @param args
     */
    function createInput(args, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var inputObject = { container: null, buttons: [], clearButton: null };
        floatType = args.floatLabelType;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.floatLabelType) || args.floatLabelType === 'Never') {
            inputObject.container = createInputContainer(args, CLASSNAMES.INPUTGROUP, CLASSNAMES.INPUTCUSTOMTAG, 'span', makeElement);
            args.element.parentNode.insertBefore(inputObject.container, args.element);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([args.element], CLASSNAMES.INPUT);
            inputObject.container.appendChild(args.element);
        }
        else {
            createFloatingInput(args, inputObject, makeElement);
        }
        bindInitialEvent(args);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.properties) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.properties.showClearButton) &&
            args.properties.showClearButton && args.element.tagName !== 'TEXTAREA') {
            setClearButton(args.properties.showClearButton, args.element, inputObject, true, makeElement);
            inputObject.clearButton.setAttribute('role', 'button');
            if (inputObject.container.classList.contains(CLASSNAMES.FLOATINPUT)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([inputObject.container], CLASSNAMES.INPUTGROUP);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.buttons) && args.element.tagName !== 'TEXTAREA') {
            for (var i = 0; i < args.buttons.length; i++) {
                inputObject.buttons.push(appendSpan(args.buttons[i], inputObject.container, makeElement));
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.element) && args.element.tagName === 'TEXTAREA') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([inputObject.container], CLASSNAMES.TEXTAREA);
        }
        validateInputType(inputObject.container, args.element);
        inputObject = setPropertyValue(args, inputObject);
        privateInputObj = inputObject;
        return inputObject;
    }
    Input.createInput = createInput;
    function bindInitialEvent(args) {
        checkInputValue(args.floatLabelType, args.element);
        args.element.addEventListener('focus', function () {
            var parent = getParentNode(this);
            if (parent.classList.contains('e-input-group') || parent.classList.contains('e-outline')
                || parent.classList.contains('e-filled')) {
                parent.classList.add('e-input-focus');
            }
        });
        args.element.addEventListener('blur', function () {
            var parent = getParentNode(this);
            if (parent.classList.contains('e-input-group') || parent.classList.contains('e-outline')
                || parent.classList.contains('e-filled')) {
                parent.classList.remove('e-input-focus');
            }
        });
        args.element.addEventListener('input', function () {
            checkInputValue(floatType, args.element);
        });
    }
    Input.bindInitialEvent = bindInitialEvent;
    function checkInputValue(floatLabelType, inputElement) {
        var inputValue = inputElement.value;
        if (inputValue !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputValue) && inputElement.parentElement) {
            inputElement.parentElement.classList.add('e-valid-input');
        }
        else if (floatLabelType !== 'Always' && inputElement.parentElement) {
            inputElement.parentElement.classList.remove('e-valid-input');
        }
    }
    function _focusFn() {
        var label = getParentNode(this).getElementsByClassName('e-float-text')[0];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], CLASSNAMES.LABELTOP);
            if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], CLASSNAMES.LABELBOTTOM);
            }
        }
    }
    function _blurFn() {
        var parent = getParentNode(this);
        if ((parent.getElementsByTagName('textarea')[0]) ? parent.getElementsByTagName('textarea')[0].value === '' :
            parent.getElementsByTagName('input')[0].value === '') {
            var label = parent.getElementsByClassName('e-float-text')[0];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
                if (label.classList.contains(CLASSNAMES.LABELTOP)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], CLASSNAMES.LABELTOP);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], CLASSNAMES.LABELBOTTOM);
            }
        }
    }
    function wireFloatingEvents(element) {
        element.addEventListener('focus', _focusFn);
        element.addEventListener('blur', _blurFn);
    }
    Input.wireFloatingEvents = wireFloatingEvents;
    function unwireFloatingEvents(element) {
        element.removeEventListener('focus', _focusFn);
        element.removeEventListener('blur', _blurFn);
    }
    function createFloatingInput(args, inputObject, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var inputElement;
        var floatLinelement;
        var floatLabelElement;
        if (args.floatLabelType === 'Auto') {
            wireFloatingEvents(args.element);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputObject.container)) {
            inputObject.container = createInputContainer(args, CLASSNAMES.FLOATINPUT, CLASSNAMES.FLOATCUSTOMTAG, 'div', makeElement);
            args.element.parentNode.insertBefore(inputObject.container, args.element);
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.customTag)) {
                inputObject.container.classList.add(CLASSNAMES.FLOATCUSTOMTAG);
            }
            inputObject.container.classList.add(CLASSNAMES.FLOATINPUT);
        }
        floatLinelement = makeElement('span', { className: CLASSNAMES.FLOATLINE });
        floatLabelElement = makeElement('label', { className: CLASSNAMES.FLOATTEXT });
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.element.id) && args.element.id !== '') {
            floatLabelElement.id = 'label_' + args.element.id.replace(/ /g, '_');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(args.element, { 'aria-labelledby': floatLabelElement.id });
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.element.placeholder) && args.element.placeholder !== '') {
            floatLabelElement.innerText = encodePlaceHolder(args.element.placeholder);
            args.element.removeAttribute('placeholder');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.properties) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.properties.placeholder) &&
            args.properties.placeholder !== '') {
            floatLabelElement.innerText = encodePlaceHolder(args.properties.placeholder);
        }
        if (!floatLabelElement.innerText) {
            inputObject.container.classList.add(CLASSNAMES.NOFLOATLABEL);
        }
        if (inputObject.container.classList.contains('e-float-icon-left')) {
            var inputWrap = inputObject.container.querySelector('.e-input-in-wrap');
            inputWrap.appendChild(args.element);
            inputWrap.appendChild(floatLinelement);
            inputWrap.appendChild(floatLabelElement);
        }
        else {
            inputObject.container.appendChild(args.element);
            inputObject.container.appendChild(floatLinelement);
            inputObject.container.appendChild(floatLabelElement);
        }
        updateLabelState(args.element.value, floatLabelElement);
        if (args.floatLabelType === 'Always') {
            if (floatLabelElement.classList.contains(CLASSNAMES.LABELBOTTOM)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([floatLabelElement], CLASSNAMES.LABELBOTTOM);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([floatLabelElement], CLASSNAMES.LABELTOP);
        }
        if (args.floatLabelType === 'Auto') {
            args.element.addEventListener('input', function (event) {
                updateLabelState(args.element.value, floatLabelElement);
            });
            args.element.addEventListener('blur', function (event) {
                updateLabelState(args.element.value, floatLabelElement);
            });
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.element.getAttribute('id'))) {
            floatLabelElement.setAttribute('for', args.element.getAttribute('id'));
        }
    }
    function checkFloatLabelType(type, container) {
        if (type === 'Always' && container.classList.contains('e-outline')) {
            container.classList.add('e-valid-input');
        }
    }
    function setPropertyValue(args, inputObject) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.properties)) {
            for (var _i = 0, _a = Object.keys(args.properties); _i < _a.length; _i++) {
                var prop = _a[_i];
                switch (prop) {
                    case 'cssClass':
                        setCssClass(args.properties.cssClass, [inputObject.container]);
                        checkFloatLabelType(args.floatLabelType, inputObject.container);
                        break;
                    case 'enabled':
                        setEnabled(args.properties.enabled, args.element, args.floatLabelType, inputObject.container);
                        break;
                    case 'enableRtl':
                        setEnableRtl(args.properties.enableRtl, [inputObject.container]);
                        break;
                    case 'placeholder':
                        setPlaceholder(args.properties.placeholder, args.element);
                        break;
                    case 'readonly':
                        setReadonly(args.properties.readonly, args.element);
                        break;
                }
            }
        }
        return inputObject;
    }
    function updateIconState(value, button) {
        if (value) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([button], CLASSNAMES.CLEARICONHIDE);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([button], CLASSNAMES.CLEARICONHIDE);
        }
    }
    function updateLabelState(value, label) {
        if (value) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], CLASSNAMES.LABELTOP);
            if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], CLASSNAMES.LABELBOTTOM);
            }
        }
        else {
            if (label.classList.contains(CLASSNAMES.LABELTOP)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([label], CLASSNAMES.LABELTOP);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([label], CLASSNAMES.LABELBOTTOM);
        }
    }
    function getParentNode(element) {
        var parentNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.parentNode) ? element
            : element.parentNode;
        if (parentNode && parentNode.classList.contains('e-input-in-wrap')) {
            parentNode = parentNode.parentNode;
        }
        return parentNode;
    }
    /**
     * To create clear button.
     */
    function createClearButton(element, inputObject, initial, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var button = makeElement('span', { className: CLASSNAMES.CLEARICON });
        var container = inputObject.container;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(initial)) {
            container.appendChild(button);
        }
        else {
            var baseElement = inputObject.container.classList.contains(CLASSNAMES.FLOATINPUT) ?
                inputObject.container.querySelector('.' + CLASSNAMES.FLOATTEXT) : element;
            baseElement.insertAdjacentElement('afterend', button);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(container) &&
            container.classList.contains(CLASSNAMES.FLOATINPUT)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([container], CLASSNAMES.INPUTGROUP);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([button], CLASSNAMES.CLEARICONHIDE);
        wireClearBtnEvents(element, button, container);
        button.setAttribute('aria-label', 'close');
        return button;
    }
    function wireClearBtnEvents(element, button, container) {
        button.addEventListener('click', function (event) {
            if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
                event.preventDefault();
                if (element !== document.activeElement) {
                    element.focus();
                }
                element.value = '';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([button], CLASSNAMES.CLEARICONHIDE);
            }
        });
        element.addEventListener('input', function (event) {
            updateIconState(element.value, button);
        });
        element.addEventListener('focus', function (event) {
            updateIconState(element.value, button);
        });
        element.addEventListener('blur', function (event) {
            setTimeout(function () { Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([button], CLASSNAMES.CLEARICONHIDE); }, 200);
        });
    }
    Input.wireClearBtnEvents = wireClearBtnEvents;
    function validateLabel(element, floatLabelType) {
        var parent = getParentNode(element);
        if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') {
            var label = getParentNode(element).getElementsByClassName('e-float-text')[0];
            updateLabelState(element.value, label);
        }
    }
    /**
     * To create input box contianer.
     */
    function createInputContainer(args, className, tagClass, tag, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var container;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.customTag)) {
            container = makeElement(args.customTag, { className: className });
            container.classList.add(tagClass);
        }
        else {
            container = makeElement(tag, { className: className });
        }
        container.classList.add('e-control-wrapper');
        return container;
    }
    function encodePlaceHolder(placeholder) {
        var result = '';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(placeholder) && placeholder !== '') {
            var spanEle = document.createElement('span');
            spanEle.innerHTML = '<input  placeholder="' + placeholder + '"/>';
            var hiddenInput = (spanEle.children[0]);
            result = hiddenInput.placeholder;
        }
        return result;
    }
    /**
     * Sets the value to the input element.
     * ```
     * E.g : Input.setValue('content', element, "Auto", true );
     * ```
     * @param value - Specify the value of the input element.
     * @param element - The element on which the specified value is updated.
     * @param floatLabelType - Specify the float label type of the input element.
     * @param clearButton - Boolean value to specify whether the clear icon is enabled / disabled on the input.
     */
    function setValue(value, element, floatLabelType, clearButton) {
        element.value = value;
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(floatLabelType)) && floatLabelType === 'Auto') {
            validateLabel(element, floatLabelType);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(clearButton) && clearButton) {
            var parentElement = getParentNode(element);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentElement)) {
                var button = parentElement.getElementsByClassName(CLASSNAMES.CLEARICON)[0];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(button)) {
                    if (element.value && parentElement.classList.contains('e-input-focus')) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([button], CLASSNAMES.CLEARICONHIDE);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([button], CLASSNAMES.CLEARICONHIDE);
                    }
                }
            }
        }
        checkInputValue(floatLabelType, element);
    }
    Input.setValue = setValue;
    /**
     * Sets the single or multiple cssClass to wrapper of input element.
     * ```
     * E.g : Input.setCssClass('e-custom-class', [element]);
     * ```
     * @param cssClass - Css class names which are needed to add.
     * @param elements - The elements which are needed to add / remove classes.
     * @param oldClass - Css class names which are needed to remove. If old classes are need to remove, can give this optional parameter.
     */
    function setCssClass(cssClass, elements, oldClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldClass) && oldClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(elements, oldClass.split(' '));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClass) && cssClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(elements, cssClass.split(' '));
        }
    }
    Input.setCssClass = setCssClass;
    /**
     * Set the width to the wrapper of input element.
     * ```
     * E.g : Input.setWidth('200px', container);
     * ```
     * @param width - Width value which is need to add.
     * @param container - The element on which the width is need to add.
     */
    function setWidth(width, container) {
        if (typeof width === 'number') {
            container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else if (typeof width === 'string') {
            container.style.width = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width));
        }
    }
    Input.setWidth = setWidth;
    /**
     * Set the placeholder attribute to the input element.
     * ```
     * E.g : Input.setPlaceholder('Search here', element);
     * ```
     * @param placeholder - Placeholder value which is need to add.
     * @param element - The element on which the placeholder is need to add.
     */
    function setPlaceholder(placeholder, element) {
        var parentElement;
        placeholder = encodePlaceHolder(placeholder);
        parentElement = getParentNode(element);
        if (parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(placeholder) && placeholder !== '') {
                parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = placeholder;
                parentElement.classList.remove(CLASSNAMES.NOFLOATLABEL);
                element.removeAttribute('placeholder');
            }
            else {
                parentElement.classList.add(CLASSNAMES.NOFLOATLABEL);
                parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = '';
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(placeholder) && placeholder !== '') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'placeholder': placeholder, 'aria-placeholder': placeholder });
            }
            else {
                element.removeAttribute('placeholder');
                element.removeAttribute('aria-placeholder');
            }
        }
    }
    Input.setPlaceholder = setPlaceholder;
    /**
     * Set the read only attribute to the input element
     * ```
     * E.g : Input.setReadonly(true, element);
     * ```
     * @param isReadonly
     * - Boolean value to specify whether to set read only. Setting "True" value enables read only.
     * @param element
     * - The element which is need to enable read only.
     */
    function setReadonly(isReadonly, element, floatLabelType) {
        if (isReadonly) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { readonly: '' });
        }
        else {
            element.removeAttribute('readonly');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(floatLabelType)) {
            validateLabel(element, floatLabelType);
        }
    }
    Input.setReadonly = setReadonly;
    /**
     * Displays the element direction from right to left when its enabled.
     * ```
     * E.g : Input.setEnableRtl(true, [inputObj.container]);
     * ```
     * @param isRtl
     * - Boolean value to specify whether to set RTL. Setting "True" value enables the RTL mode.
     * @param elements
     * - The elements that are needed to enable/disable RTL.
     */
    function setEnableRtl(isRtl, elements) {
        if (isRtl) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(elements, CLASSNAMES.RTL);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(elements, CLASSNAMES.RTL);
        }
    }
    Input.setEnableRtl = setEnableRtl;
    /**
     * Enables or disables the given input element.
     * ```
     * E.g : Input.setEnabled(false, element);
     * ```
     * @param isEnable
     * - Boolean value to specify whether to enable or disable.
     * @param element
     * - Element to be enabled or disabled.
     */
    function setEnabled(isEnable, element, floatLabelType, inputContainer) {
        var disabledAttrs = { 'disabled': 'disabled', 'aria-disabled': 'true' };
        var considerWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputContainer) ? false : true;
        if (isEnable) {
            element.classList.remove(CLASSNAMES.DISABLE);
            removeAttributes(disabledAttrs, element);
            if (considerWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([inputContainer], CLASSNAMES.DISABLE);
            }
        }
        else {
            element.classList.add(CLASSNAMES.DISABLE);
            addAttributes(disabledAttrs, element);
            if (considerWrapper) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([inputContainer], CLASSNAMES.DISABLE);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(floatLabelType)) {
            validateLabel(element, floatLabelType);
        }
    }
    Input.setEnabled = setEnabled;
    function setClearButton(isClear, element, inputObject, initial, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        if (isClear) {
            inputObject.clearButton = createClearButton(element, inputObject, initial, makeElement);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(inputObject.clearButton);
            inputObject.clearButton = null;
        }
    }
    Input.setClearButton = setClearButton;
    /**
     * Removing the multiple attributes from the given element such as "disabled","id" , etc.
     * ```
     * E.g : Input.removeAttributes({ 'disabled': 'disabled', 'aria-disabled': 'true' }, element);
     * ```
     * @param attrs
     *  - Array of attributes which are need to removed from the element.
     * @param element
     *  - Element on which the attributes are needed to be removed.
     */
    function removeAttributes(attrs, element) {
        for (var _i = 0, _a = Object.keys(attrs); _i < _a.length; _i++) {
            var key = _a[_i];
            var parentElement = void 0;
            parentElement = getParentNode(element);
            if (key === 'disabled') {
                element.classList.remove(CLASSNAMES.DISABLE);
            }
            if (key === 'disabled' && parentElement.classList.contains(CLASSNAMES.INPUTGROUP)) {
                parentElement.classList.remove(CLASSNAMES.DISABLE);
            }
            if (key === 'placeholder' && parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
                parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = '';
            }
            else {
                element.removeAttribute(key);
            }
        }
    }
    Input.removeAttributes = removeAttributes;
    /**
     * Adding the multiple attributes to the given element such as "disabled","id" , etc.
     * ```
     * E.g : Input.addAttributes({ 'id': 'inputpopup' }, element);
     * ```
     * @param attrs
     * - Array of attributes which is added to element.
     * @param element
     * - Element on which the attributes are needed to be added.
     */
    function addAttributes(attrs, element) {
        for (var _i = 0, _a = Object.keys(attrs); _i < _a.length; _i++) {
            var key = _a[_i];
            var parentElement = void 0;
            parentElement = getParentNode(element);
            if (key === 'disabled') {
                element.classList.add(CLASSNAMES.DISABLE);
            }
            if (key === 'disabled' && parentElement.classList.contains(CLASSNAMES.INPUTGROUP)) {
                parentElement.classList.add(CLASSNAMES.DISABLE);
            }
            if (key === 'placeholder' && parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
                parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[key];
            }
            else {
                element.setAttribute(key, attrs[key]);
            }
        }
    }
    Input.addAttributes = addAttributes;
    function removeFloating(input) {
        var container = input.container;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(container) && container.classList.contains(CLASSNAMES.FLOATINPUT)) {
            var inputEle = container.querySelector('textarea') ? container.querySelector('textarea') :
                container.querySelector('input');
            var placeholder = container.querySelector('.' + CLASSNAMES.FLOATTEXT).textContent;
            var clearButton = container.querySelector('.e-clear-icon') !== null;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(container.querySelector('.' + CLASSNAMES.FLOATLINE));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(container.querySelector('.' + CLASSNAMES.FLOATTEXT));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(container, [CLASSNAMES.INPUTGROUP], [CLASSNAMES.FLOATINPUT]);
            unwireFloatingEvents(inputEle);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(inputEle, { 'placeholder': placeholder });
            inputEle.classList.add(CLASSNAMES.INPUT);
            if (!clearButton && inputEle.tagName === 'INPUT') {
                inputEle.removeAttribute('required');
            }
        }
    }
    Input.removeFloating = removeFloating;
    function addFloating(input, type, placeholder, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var container = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(input, '.' + CLASSNAMES.INPUTGROUP);
        floatType = type;
        if (type !== 'Never') {
            var customTag = container.tagName;
            customTag = customTag !== 'DIV' && customTag !== 'SPAN' ? customTag : null;
            var args = { element: input, floatLabelType: type, customTag: customTag, properties: { placeholder: placeholder } };
            var iconEle = container.querySelector('.e-clear-icon');
            var inputObj = { container: container };
            input.classList.remove(CLASSNAMES.INPUT);
            createFloatingInput(args, inputObj, makeElement);
            var isPrependIcon = container.classList.contains('e-float-icon-left');
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconEle)) {
                if (isPrependIcon) {
                    var inputWrap = container.querySelector('.e-input-in-wrap');
                    iconEle = inputWrap.querySelector('.e-input-group-icon');
                }
                else {
                    iconEle = container.querySelector('.e-input-group-icon');
                }
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconEle)) {
                if (isPrependIcon) {
                    iconEle = container.querySelector('.e-input-group-icon');
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconEle)) {
                    container.classList.remove(CLASSNAMES.INPUTGROUP);
                }
            }
            else {
                var floatLine = container.querySelector('.' + CLASSNAMES.FLOATLINE);
                var floatText = container.querySelector('.' + CLASSNAMES.FLOATTEXT);
                var wrapper = isPrependIcon ? container.querySelector('.e-input-in-wrap') : container;
                wrapper.insertBefore(input, iconEle);
                wrapper.insertBefore(floatLine, iconEle);
                wrapper.insertBefore(floatText, iconEle);
            }
        }
        checkFloatLabelType(type, input.parentElement);
    }
    Input.addFloating = addFloating;
    /**
     * Enable or Disable the ripple effect on the icons inside the Input. Ripple effect is only applicable for material theme.
     * ```
     * E.g : Input.setRipple(true, [inputObjects]);
     * ```
     * @param isRipple
     * - Boolean value to specify whether to enable the ripple effect.
     * @param inputObject
     * - Specify the collection of input objects.
     */
    function setRipple(isRipple, inputObj) {
        for (var i = 0; i < inputObj.length; i++) {
            _internalRipple(isRipple, inputObj[i].container);
        }
    }
    Input.setRipple = setRipple;
    function _internalRipple(isRipple, container, button) {
        var argsButton = [];
        argsButton.push(button);
        var buttons = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(button) ?
            container.querySelectorAll('.e-input-group-icon') : argsButton;
        if (isRipple && buttons.length > 0) {
            for (var index = 0; index < buttons.length; index++) {
                buttons[index].addEventListener('mousedown', _onMouseDownRipple, false);
                buttons[index].addEventListener('mouseup', _onMouseUpRipple, false);
            }
        }
        else if (buttons.length > 0) {
            for (var index = 0; index < buttons.length; index++) {
                buttons[index].removeEventListener('mousedown', _onMouseDownRipple, this);
                buttons[index].removeEventListener('mouseup', _onMouseUpRipple, this);
            }
        }
    }
    function _onMouseRipple(container, button) {
        if (!container.classList.contains('e-disabled') && !container.querySelector('input').readOnly) {
            button.classList.add('e-input-btn-ripple');
        }
    }
    function _onMouseDownRipple() {
        var ele = this;
        var parentEle = this.parentElement;
        while (!parentEle.classList.contains('e-input-group')) {
            parentEle = parentEle.parentElement;
        }
        _onMouseRipple(parentEle, ele);
    }
    function _onMouseUpRipple() {
        var ele = this;
        setTimeout(function () { ele.classList.remove('e-input-btn-ripple'); }, 500);
    }
    function createIconEle(iconClass, makeElement) {
        var button = makeElement('span', { className: iconClass });
        button.classList.add('e-input-group-icon');
        return button;
    }
    /**
     * Creates a new span element with the given icons added and append it in container element.
     * ```
     * E.g : Input.addIcon('append', 'e-icon-spin', inputObj.container, inputElement);
     * ```
     * @param position - Specify the icon placement on the input.Possible values are append and prepend.
     * @param iconClass - Icon classes which are need to add to the span element which is going to created.
     * Span element acts as icon or button element for input.
     * @param container - The container on which created span element is going to append.
     * @param inputElement - The inputElement on which created span element is going to prepend.
     */
    // tslint:disable
    function addIcon(position, icons, container, input, internalCreate) {
        // tslint:enable
        var result = typeof (icons) === 'string' ? icons.split(',')
            : icons;
        if (position.toLowerCase() === 'append') {
            for (var _i = 0, result_1 = result; _i < result_1.length; _i++) {
                var icon = result_1[_i];
                appendSpan(icon, container, internalCreate);
            }
        }
        else {
            for (var _a = 0, result_2 = result; _a < result_2.length; _a++) {
                var icon = result_2[_a];
                prependSpan(icon, container, input, internalCreate);
            }
        }
    }
    Input.addIcon = addIcon;
    /**
     * Creates a new span element with the given icons added and prepend it in input element.
     * ```
     * E.g : Input.prependSpan('e-icon-spin', inputObj.container, inputElement);
     * ```
     * @param iconClass - Icon classes which are need to add to the span element which is going to created.
     * Span element acts as icon or button element for input.
     * @param container - The container on which created span element is going to append.
     * @param inputElement - The inputElement on which created span element is going to prepend.
     */
    // tslint:disable
    function prependSpan(iconClass, container, inputElement, internalCreateElement) {
        // tslint:enable
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var button = createIconEle(iconClass, makeElement);
        container.classList.add('e-float-icon-left');
        var innerWrapper = container.querySelector('.e-input-in-wrap');
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(innerWrapper)) {
            innerWrapper = makeElement('span', { className: 'e-input-in-wrap' });
            inputElement.parentNode.insertBefore(innerWrapper, inputElement);
            var result = container.querySelectorAll(inputElement.tagName + ' ~ *');
            innerWrapper.appendChild(inputElement);
            for (var i = 0; i < result.length; i++) {
                innerWrapper.appendChild(result[i]);
            }
        }
        innerWrapper.parentNode.insertBefore(button, innerWrapper);
        if (!container.classList.contains(CLASSNAMES.INPUTGROUP)) {
            container.classList.add(CLASSNAMES.INPUTGROUP);
        }
        _internalRipple(true, container, button);
        return button;
    }
    Input.prependSpan = prependSpan;
    /**
     * Creates a new span element with the given icons added and append it in container element.
     * ```
     * E.g : Input.appendSpan('e-icon-spin', inputObj.container);
     * ```
     * @param iconClass - Icon classes which are need to add to the span element which is going to created.
     * Span element acts as icon or button element for input.
     * @param container - The container on which created span element is going to append.
     */
    function appendSpan(iconClass, container, internalCreateElement) {
        var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
        var button = createIconEle(iconClass, makeElement);
        if (!container.classList.contains(CLASSNAMES.INPUTGROUP)) {
            container.classList.add(CLASSNAMES.INPUTGROUP);
        }
        var wrap = (container.classList.contains('e-float-icon-left')) ? container.querySelector('.e-input-in-wrap') :
            container;
        wrap.appendChild(button);
        _internalRipple(true, container, button);
        return button;
    }
    Input.appendSpan = appendSpan;
    function validateInputType(containerElement, input) {
        if (input.type === 'hidden') {
            containerElement.classList.add('e-hidden');
        }
        else if (containerElement.classList.contains('e-hidden')) {
            containerElement.classList.remove('e-hidden');
        }
    }
    Input.validateInputType = validateInputType;
})(Input || (Input = {}));


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/index.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/index.js ***!
  \******************************************************************************/
/*! exports provided: regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputFocusHandler, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _mask_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mask-base */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/mask-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "regularExpressions", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["regularExpressions"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createMask", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["createMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyMask", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["applyMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wireEvents", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["wireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unwireEvents", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["unwireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindClearEvent", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["bindClearEvent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unstrippedValue", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["unstrippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "strippedValue", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["strippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputFocusHandler", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["maskInputFocusHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputBlurHandler", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["maskInputBlurHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputDropHandler", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["maskInputDropHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mobileRemoveFunction", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["mobileRemoveFunction"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMaskValue", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["setMaskValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setElementValue", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["setElementValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInput", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["maskInput"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getVal", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["getVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaskedVal", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["getMaskedVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskUndo", function() { return _mask_base__WEBPACK_IMPORTED_MODULE_0__["MaskUndo"]; });

/**
 * MaskedTextbox base modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/mask-base.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/mask-base.js ***!
  \**********************************************************************************/
/*! exports provided: regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputFocusHandler, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regularExpressions", function() { return regularExpressions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMask", function() { return createMask; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyMask", function() { return applyMask; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wireEvents", function() { return wireEvents; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwireEvents", function() { return unwireEvents; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindClearEvent", function() { return bindClearEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unstrippedValue", function() { return unstrippedValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "strippedValue", function() { return strippedValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maskInputFocusHandler", function() { return maskInputFocusHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maskInputBlurHandler", function() { return maskInputBlurHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maskInputDropHandler", function() { return maskInputDropHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mobileRemoveFunction", function() { return mobileRemoveFunction; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMaskValue", function() { return setMaskValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setElementValue", function() { return setElementValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maskInput", function() { return maskInput; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVal", function() { return getVal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaskedVal", function() { return getMaskedVal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaskUndo", function() { return MaskUndo; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _input_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../input/input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js");
/**
 * MaskedTextBox base module
 */


var ERROR = 'e-error';
var INPUTGROUP = 'e-input-group';
var FLOATINPUT = 'e-float-input';
var UTILMASK = 'e-utility-mask';
var TOPLABEL = 'e-label-top';
var BOTTOMLABEL = 'e-label-bottom';
/**
 * @hidden
 * Built-in masking elements collection.
 */
var regularExpressions = {
    '0': '[0-9]',
    '9': '[0-9 ]',
    '#': '[0-9 +-]',
    'L': '[A-Za-z]',
    '?': '[A-Za-z ]',
    '&': '[^\x7f ]+',
    'C': '[^\x7f]+',
    'A': '[A-Za-z0-9]',
    'a': '[A-Za-z0-9 ]',
};
/**
 * @hidden
 * Generate required masking elements to the MaskedTextBox from user mask input.
 */
function createMask() {
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, {
        'role': 'textbox', 'autocomplete': 'off', 'autocorrect': 'off', 'autocapitalize': 'off',
        'spellcheck': 'false', 'aria-live': 'assertive', 'aria-valuenow': ''
    });
    if (this.mask) {
        var splitMask = this.mask.split(']');
        for (var i = 0; i < splitMask.length; i++) {
            if (splitMask[i][splitMask[i].length - 1] === '\\') {
                splitMask[i] = splitMask[i] + ']';
                var splitInnerMask = splitMask[i].split('[');
                for (var j = 0; j < splitInnerMask.length; j++) {
                    if (splitInnerMask[j][splitInnerMask[j].length - 1] === '\\') {
                        splitInnerMask[j] = splitInnerMask[j] + '[';
                    }
                    pushIntoRegExpCollec.call(this, splitInnerMask[j]);
                }
            }
            else {
                var splitInnerMask = splitMask[i].split('[');
                if (splitInnerMask.length > 1) {
                    var chkSpace = false;
                    for (var j = 0; j < splitInnerMask.length; j++) {
                        if (splitInnerMask[j] === '\\') {
                            this.customRegExpCollec.push('[');
                            this.hiddenMask += splitInnerMask[j] + '[';
                        }
                        else if (splitInnerMask[j] === '') {
                            chkSpace = true;
                        }
                        else if ((splitInnerMask[j] !== '' && chkSpace) || j === splitInnerMask.length - 1) {
                            this.customRegExpCollec.push('[' + splitInnerMask[j] + ']');
                            this.hiddenMask += this.promptChar;
                            chkSpace = false;
                        }
                        else {
                            pushIntoRegExpCollec.call(this, splitInnerMask[j]);
                        }
                    }
                }
                else {
                    pushIntoRegExpCollec.call(this, splitInnerMask[0]);
                }
            }
        }
        this.escapeMaskValue = this.hiddenMask;
        this.promptMask = this.hiddenMask.replace(/[09?LCAa#&]/g, this.promptChar);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters)) {
            for (var i = 0; i < this.promptMask.length; i++) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters[this.promptMask[i]])) {
                    this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
                }
            }
        }
        var escapeNumber = 0;
        if (this.hiddenMask.match(new RegExp(/\\/))) {
            for (var i = 0; i < this.hiddenMask.length; i++) {
                var j = 0;
                if (i >= 1) {
                    j = i;
                }
                escapeNumber = this.hiddenMask.length - this.promptMask.length;
                j = j - escapeNumber;
                if ((i > 0 && this.hiddenMask[i - 1] !== '\\') && (this.hiddenMask[i] === '>' ||
                    this.hiddenMask[i] === '<' || this.hiddenMask[i] === '|')) {
                    this.promptMask = this.promptMask.substring(0, j) +
                        this.promptMask.substring((i + 1) - escapeNumber, this.promptMask.length);
                    this.escapeMaskValue = this.escapeMaskValue.substring(0, j) +
                        this.escapeMaskValue.substring((i + 1) - escapeNumber, this.escapeMaskValue.length);
                }
                if (this.hiddenMask[i] === '\\') {
                    this.promptMask = this.promptMask.substring(0, j) + this.hiddenMask[i + 1] +
                        this.promptMask.substring((i + 2) - escapeNumber, this.promptMask.length);
                    this.escapeMaskValue = this.escapeMaskValue.substring(0, j) + this.escapeMaskValue[i + 1] +
                        this.escapeMaskValue.substring((i + 2) - escapeNumber, this.escapeMaskValue.length);
                }
            }
        }
        else {
            this.promptMask = this.promptMask.replace(/[>|<]/g, '');
            this.escapeMaskValue = this.hiddenMask.replace(/[>|<]/g, '');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-invalid': 'false' });
    }
}
/**
 * @hidden
 * Apply mask ability with masking elements to the MaskedTextBox.
 */
function applyMask() {
    setElementValue.call(this, this.promptMask);
    setMaskValue.call(this, this.value);
}
/**
 * @hidden
 * To wire required events to the MaskedTextBox.
 */
function wireEvents() {
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', maskInputKeyDownHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keypress', maskInputKeyPressHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', maskInputKeyUpHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'input', maskInputHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', maskInputFocusHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'blur', maskInputBlurHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'paste', maskInputPasteHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'cut', maskInputCutHandler, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'drop', maskInputDropHandler, this);
    if (this.enabled) {
        bindClearEvent.call(this);
        if (this.formElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', resetFormHandler, this);
        }
    }
}
/**
 * @hidden
 * To unwire events attached to the MaskedTextBox.
 */
function unwireEvents() {
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', maskInputKeyDownHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keypress', maskInputKeyPressHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', maskInputKeyUpHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'input', maskInputHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', maskInputFocusHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'blur', maskInputBlurHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'paste', maskInputPasteHandler);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'cut', maskInputCutHandler);
    if (this.formElement) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', resetFormHandler);
    }
}
/**
 * @hidden
 * To bind required events to the MaskedTextBox clearButton.
 */
function bindClearEvent() {
    if (this.showClearButton) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputObj.clearButton, 'mousedown touchstart', resetHandler, this);
    }
}
function resetHandler(e) {
    e.preventDefault();
    if (!this.inputObj.clearButton.classList.contains('e-clear-icon-hide')) {
        clear.call(this, e);
        this.value = '';
    }
}
function clear(event) {
    var value = this.element.value;
    setElementValue.call(this, this.promptMask);
    this.redoCollec.unshift({
        value: this.promptMask, startIndex: this.element.selectionStart, endIndex: this.element.selectionEnd
    });
    triggerMaskChangeEvent.call(this, event, value);
    this.element.setSelectionRange(0, 0);
}
function resetFormHandler() {
    if (this.element.tagName === 'EJS-MASKEDTEXTBOX') {
        setElementValue.call(this, this.promptMask);
    }
    else {
        this.value = this.initInputValue;
    }
}
/**
 * @hidden
 * To get masked value from the MaskedTextBox.
 */
function unstrippedValue(element) {
    return element.value;
}
/**
 * @hidden
 * To extract raw value from the MaskedTextBox.
 */
function strippedValue(element, maskValues) {
    var value = '';
    var k = 0;
    var checkMask = false;
    var maskValue = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maskValues)) ? maskValues : (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element) &&
        !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this)) ? element.value : maskValues;
    if (maskValue !== this.promptMask) {
        for (var i = 0; i < this.customRegExpCollec.length; i++) {
            if (checkMask) {
                checkMask = false;
            }
            if (this.customRegExpCollec[k] === '>' || this.customRegExpCollec[k] === '<' ||
                this.customRegExpCollec[k] === '|' || this.customRegExpCollec[k] === '\\') {
                --i;
                checkMask = true;
            }
            if (!checkMask) {
                if ((maskValue[i] !== this.promptChar) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customRegExpCollec[k]) &&
                    ((this._callPasteHandler || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.regExpCollec[this.customRegExpCollec[k]])) ||
                        (this.customRegExpCollec[k].length > 2 && this.customRegExpCollec[k][0] === '[' &&
                            this.customRegExpCollec[k][this.customRegExpCollec[k].length - 1] === ']') ||
                        (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters) &&
                            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters[this.customRegExpCollec[k]]))))) && (maskValue !== '')) {
                    value += maskValue[i];
                }
            }
            ++k;
        }
    }
    if (this.mask === null || this.mask === '' && this.value !== undefined) {
        value = maskValue;
    }
    return value;
}
function pushIntoRegExpCollec(value) {
    for (var k = 0; k < value.length; k++) {
        this.hiddenMask += value[k];
        if (value[k] !== '\\') {
            this.customRegExpCollec.push(value[k]);
        }
    }
}
function maskInputFocusHandler(event) {
    var _this = this;
    var eventArgs = {
        selectionStart: 0,
        event: event,
        value: this.value,
        maskedValue: this.element.value,
        container: this.inputObj.container,
        selectionEnd: (this.promptMask.length > 0) ? this.promptMask.length : this.element.value.length,
    };
    this.trigger('focus', eventArgs, function (eventArgs) {
        if (_this.mask) {
            _this.isFocus = true;
            if (_this.element.value === '') {
                setElementValue.call(_this, _this.promptMask);
            }
            else {
                setElementValue.call(_this, _this.element.value);
            }
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.version === '11.0') {
                _this.element.setSelectionRange(eventArgs.selectionStart, eventArgs.selectionEnd);
            }
            else {
                var delay = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIos) ? 450 : 0;
                setTimeout(function () {
                    _this.element.setSelectionRange(eventArgs.selectionStart, eventArgs.selectionEnd);
                }, delay);
            }
        }
    });
}
function maskInputBlurHandler(event) {
    this.blurEventArgs = {
        event: event,
        value: this.value,
        maskedValue: this.element.value,
        container: this.inputObj.container
    };
    this.trigger('blur', this.blurEventArgs);
    if (this.mask) {
        this.isFocus = false;
        if (this.placeholder && this.element.value === this.promptMask && this.floatLabelType !== 'Always') {
            setElementValue.call(this, '');
            var labelElement = this.element.parentNode.querySelector('.e-float-text');
            if (this.floatLabelType === 'Auto' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(labelElement) && labelElement.classList.contains(TOPLABEL)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([labelElement], TOPLABEL);
            }
        }
    }
}
function maskInputPasteHandler(event) {
    var _this = this;
    if (this.mask && !this.readonly) {
        var sIndex_1 = this.element.selectionStart;
        var eIndex_1 = this.element.selectionEnd;
        var oldValue_1 = this.element.value;
        setElementValue.call(this, '');
        this._callPasteHandler = true;
        setTimeout(function () {
            var value = _this.element.value.replace(/ /g, '');
            if (_this.redoCollec.length > 0 && _this.redoCollec[0].value === _this.element.value) {
                value = strippedValue.call(_this, _this.element);
            }
            setElementValue.call(_this, oldValue_1);
            _this.element.selectionStart = sIndex_1;
            _this.element.selectionEnd = eIndex_1;
            var i = 0;
            _this.maskKeyPress = true;
            do {
                validateValue.call(_this, value[i], false, null);
                ++i;
            } while (i < value.length);
            _this.maskKeyPress = false;
            _this._callPasteHandler = false;
            if (_this.element.value === oldValue_1) {
                var i_1 = 0;
                _this.maskKeyPress = true;
                do {
                    validateValue.call(_this, value[i_1], false, null);
                    ++i_1;
                } while (i_1 < value.length);
                _this.maskKeyPress = false;
            }
            else {
                triggerMaskChangeEvent.call(_this, event, oldValue_1);
            }
        }, 1);
    }
}
function maskInputCutHandler(event) {
    var _this = this;
    if (this.mask && !this.readonly) {
        var preValue_1 = this.element.value;
        var sIndex_2 = this.element.selectionStart;
        var eIndex = this.element.selectionEnd;
        this.undoCollec.push({ value: this.element.value, startIndex: this.element.selectionStart, endIndex: this.element.selectionEnd });
        var value_1 = this.element.value.substring(0, sIndex_2) + this.promptMask.substring(sIndex_2, eIndex) +
            this.element.value.substring(eIndex);
        setTimeout(function () {
            setElementValue.call(_this, value_1);
            _this.element.selectionStart = _this.element.selectionEnd = sIndex_2;
            if (_this.element.value !== preValue_1) {
                triggerMaskChangeEvent.call(_this, event, null);
            }
        }, 0);
    }
}
function maskInputDropHandler(event) {
    event.preventDefault();
}
function maskInputHandler(event) {
    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE === true && this.element.value === '' && this.floatLabelType === 'Never') {
        return;
    }
    var eventArgs = { ctrlKey: false, keyCode: 229 };
    // tslint:disable-next-line
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(event, eventArgs);
    if (this.mask) {
        if (this.element.value === '') {
            this.redoCollec.unshift({
                value: this.promptMask, startIndex: this.element.selectionStart, endIndex: this.element.selectionEnd
            });
        }
        if (this.element.value.length === 1) {
            this.element.value = this.element.value + this.promptMask;
            this.element.setSelectionRange(1, 1);
        }
        if (!this._callPasteHandler) {
            removeMaskInputValues.call(this, event);
        }
        if (this.element.value.length > this.promptMask.length) {
            var startIndex = this.element.selectionStart;
            var addedValues = this.element.value.length - this.promptMask.length;
            var value = this.element.value.substring(startIndex - addedValues, startIndex);
            this.maskKeyPress = false;
            var i = 0;
            do {
                validateValue.call(this, value[i], event.ctrlKey, event);
                ++i;
            } while (i < value.length);
            if (this.element.value !== this.preEleVal) {
                triggerMaskChangeEvent.call(this, event, null);
            }
        }
        var val = strippedValue.call(this, this.element);
        this.prevValue = val;
        this.value = val;
        if (val === '') {
            setElementValue.call(this, this.promptMask);
            this.element.setSelectionRange(0, 0);
        }
    }
}
function maskInputKeyDownHandler(event) {
    if (this.mask && !this.readonly) {
        var value = this;
        if (event.keyCode !== 229) {
            if (event.ctrlKey && (event.keyCode === 89 || event.keyCode === 90)) {
                event.preventDefault();
            }
            removeMaskInputValues.call(this, event);
        }
        var startValue = this.element.value;
        if (event.ctrlKey && (event.keyCode === 89 || event.keyCode === 90)) {
            var collec = void 0;
            if (event.keyCode === 90 && this.undoCollec.length > 0 && startValue !== this.undoCollec[this.undoCollec.length - 1].value) {
                collec = this.undoCollec[this.undoCollec.length - 1];
                this.redoCollec.unshift({
                    value: this.element.value, startIndex: this.element.selectionStart,
                    endIndex: this.element.selectionEnd
                });
                setElementValue.call(this, collec.value);
                this.element.selectionStart = collec.startIndex;
                this.element.selectionEnd = collec.endIndex;
                this.undoCollec.splice(this.undoCollec.length - 1, 1);
            }
            else if (event.keyCode === 89 && this.redoCollec.length > 0 && startValue !== this.redoCollec[0].value) {
                collec = this.redoCollec[0];
                this.undoCollec.push({
                    value: this.element.value, startIndex: this.element.selectionStart,
                    endIndex: this.element.selectionEnd
                });
                setElementValue.call(this, collec.value);
                this.element.selectionStart = collec.startIndex;
                this.element.selectionEnd = collec.endIndex;
                this.redoCollec.splice(0, 1);
            }
        }
    }
}
function mobileRemoveFunction() {
    var collec;
    var sIndex = this.element.selectionStart;
    var eIndex = this.element.selectionEnd;
    if (this.redoCollec.length > 0) {
        collec = this.redoCollec[0];
        setElementValue.call(this, collec.value);
        if ((collec.startIndex - sIndex) === 1) {
            this.element.selectionStart = collec.startIndex;
            this.element.selectionEnd = collec.endIndex;
        }
        else {
            this.element.selectionStart = sIndex + 1;
            this.element.selectionEnd = eIndex + 1;
        }
    }
    else {
        setElementValue.call(this, this.promptMask);
        this.element.selectionStart = this.element.selectionEnd = sIndex;
    }
}
function autoFillMaskInputValues(isRemove, oldEventVal, event) {
    if (event.type === 'input') {
        isRemove = false;
        oldEventVal = this.element.value;
        setElementValue.call(this, this.promptMask);
        setMaskValue.call(this, oldEventVal);
    }
    return isRemove;
}
function removeMaskInputValues(event) {
    var isRemove = false;
    var oldEventVal;
    var isDeleted = false;
    if (this.element.value.length < this.promptMask.length) {
        isRemove = true;
        oldEventVal = this.element.value;
        isRemove = autoFillMaskInputValues.call(this, isRemove, oldEventVal, event);
        mobileRemoveFunction.call(this);
    }
    if (this.element.value.length >= this.promptMask.length && event.type === 'input') {
        isRemove = autoFillMaskInputValues.call(this, isRemove, oldEventVal, event);
    }
    var initStartIndex = this.element.selectionStart;
    var initEndIndex = this.element.selectionEnd;
    var startIndex = this.element.selectionStart;
    var endIndex = this.element.selectionEnd;
    var maskValue = this.hiddenMask.replace(/[>|\\<]/g, '');
    var curMask = maskValue[startIndex - 1];
    var parentElement = this.element.parentNode;
    var deleteEndIndex = this.element.selectionEnd;
    if (isRemove || event.keyCode === 8 || event.keyCode === 46) {
        this.undoCollec.push({ value: this.element.value, startIndex: this.element.selectionStart, endIndex: endIndex });
        var multipleDel = false;
        var preValue = this.element.value;
        if (startIndex > 0 || ((event.keyCode === 8 || event.keyCode === 46) && startIndex < this.element.value.length
            && ((this.element.selectionEnd - startIndex) !== this.element.value.length))) {
            var index = startIndex;
            if (startIndex !== endIndex) {
                startIndex = endIndex;
                if (event.keyCode === 46) {
                    multipleDel = true;
                }
            }
            else if (event.keyCode === 46) {
                ++index;
            }
            else {
                --index;
            }
            for (var k = startIndex; (event.keyCode === 8 || isRemove || multipleDel) ? k > index : k < index; (event.keyCode === 8 || isRemove || multipleDel) ? k-- : k++) {
                for (var i = startIndex; (event.keyCode === 8 || isRemove || multipleDel) ? i > 0 : i < this.element.value.length; (event.keyCode === 8 || isRemove || multipleDel) ? i-- : i++) {
                    var sIndex = void 0;
                    if (((event.keyCode === 8 || multipleDel) && ((initStartIndex !== initEndIndex && initStartIndex !== startIndex) ||
                        (initStartIndex === initEndIndex))) || isRemove) {
                        curMask = maskValue[i - 1];
                        sIndex = startIndex - 1;
                    }
                    else {
                        curMask = maskValue[i];
                        sIndex = startIndex;
                        ++startIndex;
                    }
                    var oldValue = this.element.value[sIndex];
                    if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.regExpCollec[curMask]) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters)
                        && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters[curMask]))
                        && ((this.hiddenMask[sIndex] !== this.promptChar && this.customRegExpCollec[sIndex][0] !== '['
                            && this.customRegExpCollec[sIndex][this.customRegExpCollec[sIndex].length - 1] !== ']')))
                        || (this.promptMask[sIndex] !== this.promptChar && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters))) {
                        this.element.selectionStart = this.element.selectionEnd = sIndex;
                        event.preventDefault();
                        if (event.keyCode === 46 && !multipleDel) {
                            ++this.element.selectionStart;
                        }
                    }
                    else {
                        var value = this.element.value;
                        var prompt_1 = this.promptChar;
                        var elementValue = value.substring(0, sIndex) + prompt_1 + value.substring(startIndex, value.length);
                        setElementValue.call(this, elementValue);
                        event.preventDefault();
                        if (event.keyCode === 46 && !multipleDel) {
                            sIndex++;
                        }
                        this.element.selectionStart = this.element.selectionEnd = sIndex;
                        isDeleted = true;
                    }
                    startIndex = this.element.selectionStart;
                    if ((!isDeleted && event.keyCode === 8) || multipleDel || (!isDeleted && !(event.keyCode === 46))) {
                        sIndex = startIndex - 1;
                    }
                    else {
                        sIndex = startIndex;
                        isDeleted = false;
                    }
                    oldValue = this.element.value[sIndex];
                    if (((initStartIndex !== initEndIndex) && (this.element.selectionStart === initStartIndex))
                        || (this.promptMask[sIndex] === this.promptChar) || ((oldValue !== this.promptMask[sIndex]) &&
                        (this.promptMask[sIndex] !== this.promptChar) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters))) {
                        break;
                    }
                }
            }
        }
        if (event.keyCode === 46 && multipleDel && isDeleted) {
            this.element.selectionStart = this.element.selectionEnd = deleteEndIndex;
        }
        if (this.element.selectionStart === 0 && (this.element.selectionEnd === this.element.value.length)) {
            setElementValue.call(this, this.promptMask);
            event.preventDefault();
            this.element.selectionStart = this.element.selectionEnd = startIndex;
        }
        this.redoCollec.unshift({
            value: this.element.value, startIndex: this.element.selectionStart,
            endIndex: this.element.selectionEnd
        });
        if (this.element.value !== preValue) {
            triggerMaskChangeEvent.call(this, event, oldEventVal);
        }
    }
}
function maskInputKeyPressHandler(event) {
    if (this.mask && !this.readonly) {
        var oldValue = this.element.value;
        if ((!event.ctrlKey) || (event.ctrlKey && event.code !== 'KeyA' && event.code !== 'KeyY'
            && event.code !== 'KeyZ' && event.code !== 'KeyX' && event.code !== 'KeyC' && event.code !== 'KeyV')) {
            this.maskKeyPress = true;
            var key = event.key;
            if (key === 'Spacebar') {
                key = String.fromCharCode(event.keyCode);
            }
            if (!key) {
                this.isIosInvalid = true;
                validateValue.call(this, String.fromCharCode(event.keyCode), event.ctrlKey, event);
                event.preventDefault();
                this.isIosInvalid = false;
            }
            else if (key && key.length === 1) {
                validateValue.call(this, key, event.ctrlKey, event);
                event.preventDefault();
            }
            if (event.keyCode === 32 && key === ' ' && this.promptChar === ' ') {
                this.element.selectionStart = this.element.selectionEnd = this.element.selectionStart - key.length;
            }
        }
        if (this.element.value !== oldValue) {
            triggerMaskChangeEvent.call(this, event, oldValue);
        }
    }
}
function triggerMaskChangeEvent(event, oldValue) {
    var prevOnChange = this.isProtectedOnChange;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.changeEventArgs) && !this.isInitial) {
        var eventArgs = {};
        this.changeEventArgs = { value: this.element.value, maskedValue: this.element.value, isInteraction: false, isInteracted: false };
        if (this.mask) {
            this.changeEventArgs.value = strippedValue.call(this, this.element);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event)) {
            this.changeEventArgs.isInteracted = true;
            this.changeEventArgs.isInteraction = true;
            this.changeEventArgs.event = event;
        }
        this.isProtectedOnChange = true;
        this.value = this.changeEventArgs.value;
        this.isProtectedOnChange = prevOnChange;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, this.changeEventArgs);
        /* istanbul ignore next */
        if (this.isAngular && this.preventChange) {
            this.preventChange = false;
        }
        else {
            this.trigger('change', eventArgs);
        }
    }
    this.preEleVal = this.element.value;
    this.prevValue = strippedValue.call(this, this.element);
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-valuenow': this.element.value });
}
function maskInputKeyUpHandler(event) {
    if (this.mask && !this.readonly) {
        var collec = void 0;
        if (!this.maskKeyPress && event.keyCode === 229) {
            var oldEventVal = void 0;
            if (this.element.value.length === 1) {
                this.element.value = this.element.value + this.promptMask;
                this.element.setSelectionRange(1, 1);
            }
            if (this.element.value.length > this.promptMask.length) {
                var startIndex = this.element.selectionStart;
                var addedValues = this.element.value.length - this.promptMask.length;
                var val_1 = this.element.value.substring(startIndex - addedValues, startIndex);
                if (this.undoCollec.length > 0) {
                    collec = this.undoCollec[this.undoCollec.length - 1];
                    var startIndex_1 = this.element.selectionStart;
                    oldEventVal = collec.value;
                    var oldVal = collec.value.substring(startIndex_1 - addedValues, startIndex_1);
                    collec = this.redoCollec[0];
                    val_1 = val_1.trim();
                    var isSpace = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isAndroid && val_1 === '';
                    if (!isSpace && oldVal !== val_1 && collec.value.substring(startIndex_1 - addedValues, startIndex_1) !== val_1) {
                        validateValue.call(this, val_1, event.ctrlKey, event);
                    }
                    else if (isSpace) {
                        preventUnsupportedValues.call(this, event, startIndex_1 - 1, this.element.selectionEnd - 1, val_1, event.ctrlKey, false);
                    }
                }
                else {
                    oldEventVal = this.promptMask;
                    validateValue.call(this, val_1, event.ctrlKey, event);
                }
                this.maskKeyPress = false;
                triggerMaskChangeEvent.call(this, event, oldEventVal);
            }
        }
        else {
            removeMaskError.call(this);
        }
        var val = strippedValue.call(this, this.element);
        if (!((this.element.selectionStart === 0) && (this.promptMask === this.element.value) && val === '')
            || (val === '' && this.value !== val)) {
            this.prevValue = val;
            this.value = val;
        }
    }
    else {
        triggerMaskChangeEvent.call(this, event);
    }
    if (this.element.selectionStart === 0 && this.element.selectionEnd === 0) {
        // tslint:disable-next-line
        var temp_1 = this.element;
        setTimeout(function () {
            temp_1.setSelectionRange(0, 0);
        }, 0);
    }
}
function mobileSwipeCheck(key) {
    if (key.length > 1 && ((this.promptMask.length + key.length) < this.element.value.length)) {
        var elementValue = this.redoCollec[0].value.substring(0, this.redoCollec[0].startIndex) + key +
            this.redoCollec[0].value.substring(this.redoCollec[0].startIndex, this.redoCollec[0].value.length);
        setElementValue.call(this, elementValue);
        this.element.selectionStart = this.element.selectionEnd = this.redoCollec[0].startIndex + key.length;
    }
    this.element.selectionStart = this.element.selectionStart - key.length;
    this.element.selectionEnd = this.element.selectionEnd - key.length;
}
function mobileValidation(key) {
    if (!this.maskKeyPress) {
        mobileSwipeCheck.call(this, key);
    }
}
function validateValue(key, isCtrlKey, event) {
    mobileValidation.call(this, key);
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(key)) {
        return;
    }
    var startIndex = this.element.selectionStart;
    var initStartIndex = startIndex;
    var endIndex = this.element.selectionEnd;
    var curMask;
    var allowText = false;
    var value = this.element.value;
    var eventOldVal;
    var prevSupport = false;
    var isEqualVal = false;
    for (var k = 0; k < key.length; k++) {
        var keyValue = key[k];
        startIndex = this.element.selectionStart;
        endIndex = this.element.selectionEnd;
        if (!this.maskKeyPress && initStartIndex === startIndex) {
            startIndex = startIndex + k;
        }
        if ((!this.maskKeyPress || startIndex < this.promptMask.length)) {
            for (var i = startIndex; i < this.promptMask.length; i++) {
                var maskValue = this.escapeMaskValue;
                curMask = maskValue[startIndex];
                if (this.hiddenMask[startIndex] === '\\' && this.hiddenMask[startIndex + 1] === key) {
                    isEqualVal = true;
                }
                if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.regExpCollec[curMask]) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters)
                    || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters[curMask])))
                    && ((this.hiddenMask[startIndex] !== this.promptChar && this.customRegExpCollec[startIndex][0] !== '['
                        && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] !== ']')))
                    || ((this.promptMask[startIndex] !== this.promptChar) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters))
                    || (this.promptChar === curMask && this.escapeMaskValue === this.mask)) {
                    this.element.selectionStart = this.element.selectionEnd = startIndex + 1;
                    startIndex = this.element.selectionStart;
                    curMask = this.hiddenMask[startIndex];
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customCharacters[curMask])) {
                var customValStr = this.customCharacters[curMask];
                var customValArr = customValStr.split(',');
                for (var i = 0; i < customValArr.length; i++) {
                    if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
                        allowText = true;
                        break;
                    }
                }
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.regExpCollec[curMask]) && keyValue.match(new RegExp(this.regExpCollec[curMask]))
                && this.promptMask[startIndex] === this.promptChar) {
                allowText = true;
            }
            else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
                && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
                && keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
                allowText = true;
            }
            if ((!this.maskKeyPress || startIndex < this.hiddenMask.length) && allowText) {
                if (k === 0) {
                    if (this.maskKeyPress) {
                        this.undoCollec.push({ value: value, startIndex: startIndex, endIndex: startIndex });
                    }
                    else {
                        var sIndex = this.element.selectionStart;
                        var eIndex = this.element.selectionEnd;
                        if (this.redoCollec.length > 0) {
                            eventOldVal = this.redoCollec[0].value;
                            setElementValue.call(this, eventOldVal);
                            this.undoCollec.push(this.redoCollec[0]);
                        }
                        else {
                            this.undoCollec.push({ value: this.promptMask, startIndex: startIndex, endIndex: startIndex });
                            eventOldVal = this.promptMask;
                            setElementValue.call(this, eventOldVal);
                        }
                        this.element.selectionStart = sIndex;
                        this.element.selectionEnd = eIndex;
                    }
                }
                startIndex = this.element.selectionStart;
                applySupportedValues.call(this, event, startIndex, keyValue, eventOldVal, isEqualVal);
                prevSupport = true;
                if (k === key.length - 1) {
                    this.redoCollec.unshift({
                        value: this.element.value, startIndex: this.element.selectionStart, endIndex: this.element.selectionEnd
                    });
                }
                allowText = false;
            }
            else {
                startIndex = this.element.selectionStart;
                preventUnsupportedValues.call(this, event, startIndex, initStartIndex, key, isCtrlKey, prevSupport);
            }
            if (k === key.length - 1 && !allowText) {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isAndroid || (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isAndroid && startIndex < this.promptMask.length)) {
                    this.redoCollec.unshift({
                        value: this.element.value, startIndex: this.element.selectionStart, endIndex: this.element.selectionEnd
                    });
                }
            }
        }
        else {
            if (key.length === 1 && !isCtrlKey && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event)) {
                addMaskErrorClass.call(this);
            }
        }
    }
}
function applySupportedValues(event, startIndex, keyValue, eventOldVal, isEqualVal) {
    if (this.hiddenMask.length > this.promptMask.length) {
        keyValue = changeToLowerUpperCase.call(this, keyValue, this.element.value);
    }
    if (!isEqualVal) {
        var value = this.element.value;
        var elementValue = value.substring(0, startIndex) + keyValue + value.substring(startIndex + 1, value.length);
        setElementValue.call(this, elementValue);
        this.element.selectionStart = this.element.selectionEnd = startIndex + 1;
    }
}
function preventUnsupportedValues(event, sIdx, idx, key, ctrl, chkSupport) {
    if (!this.maskKeyPress) {
        var eventOldVal = void 0;
        var value = this.element.value;
        if (sIdx >= this.promptMask.length) {
            setElementValue.call(this, value.substring(0, sIdx));
        }
        else {
            if (idx === sIdx) {
                setElementValue.call(this, value.substring(0, sIdx) + value.substring(sIdx + 1, value.length));
            }
            else {
                if (this.promptMask.length === this.element.value.length) {
                    setElementValue.call(this, value.substring(0, sIdx) + value.substring(sIdx, value.length));
                }
                else {
                    setElementValue.call(this, value.substring(0, idx) + value.substring(idx + 1, value.length));
                }
            }
            this.element.selectionStart = this.element.selectionEnd = (chkSupport ||
                this.element.value[idx] !== this.promptChar) ? sIdx : idx;
        }
        eventOldVal = this.element.value;
        addMaskErrorClass.call(this);
    }
    if (key.length === 1 && !ctrl && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event)) {
        addMaskErrorClass.call(this);
    }
}
function addMaskErrorClass() {
    var _this = this;
    var parentElement = this.element.parentNode;
    var timer = 200;
    if (parentElement.classList.contains(INPUTGROUP) || parentElement.classList.contains(FLOATINPUT)) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([parentElement], ERROR);
    }
    else {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], ERROR);
    }
    if (this.isIosInvalid === true) {
        timer = 400;
    }
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-invalid': 'true' });
    setTimeout(function () {
        if (!_this.maskKeyPress) {
            removeMaskError.call(_this);
        }
    }, timer);
}
function removeMaskError() {
    var parentElement = this.element.parentNode;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentElement)) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([parentElement], ERROR);
    }
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], ERROR);
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-invalid': 'false' });
}
/**
 * @hidden
 * Validates user input using masking elements '<' , '>' and '|'.
 */
function changeToLowerUpperCase(key, value) {
    var promptMask;
    var i;
    var j = 0;
    var curVal = value;
    var caseCount = 0;
    for (i = 0; i < this.hiddenMask.length; i++) {
        if (this.hiddenMask[i] === '\\') {
            promptMask = curVal.substring(0, i) + '\\' + curVal.substring(i, curVal.length);
        }
        if (this.hiddenMask[i] === '>' || this.hiddenMask[i] === '<' || this.hiddenMask[i] === '|') {
            if (this.hiddenMask[i] !== curVal[i]) {
                promptMask = curVal.substring(0, i) + this.hiddenMask[i] + curVal.substring(i, curVal.length);
            }
            ++caseCount;
        }
        if (promptMask) {
            if (((promptMask[i] === this.promptChar) && (i > this.element.selectionStart)) ||
                (this.element.value.indexOf(this.promptChar) < 0 && (this.element.selectionStart + caseCount) === i)) {
                caseCount = 0;
                break;
            }
            curVal = promptMask;
        }
    }
    while (i >= 0 && promptMask) {
        if (i === 0 || promptMask[i - 1] !== '\\') {
            var val = this.element.value;
            if (promptMask[i] === '>') {
                key = key.toUpperCase();
                break;
            }
            else if (promptMask[i] === '<') {
                key = key.toLowerCase();
                break;
            }
            else if (promptMask[i] === '|') {
                break;
            }
        }
        --i;
    }
    return key;
}
/**
 * @hidden
 * To set updated values in the MaskedTextBox.
 */
function setMaskValue(val) {
    if (this.mask && val !== undefined && (this.prevValue === undefined || this.prevValue !== val)) {
        this.maskKeyPress = true;
        setElementValue.call(this, this.promptMask);
        if (val !== '' && !(val === null && this.floatLabelType === 'Never' && this.placeholder)) {
            this.element.selectionStart = 0;
            this.element.selectionEnd = 0;
        }
        if (val !== null) {
            for (var i = 0; i < val.length; i++) {
                validateValue.call(this, val[i], false, null);
            }
        }
        var newVal = strippedValue.call(this, this.element);
        this.prevValue = newVal;
        this.value = newVal;
        triggerMaskChangeEvent.call(this, null, null);
        this.maskKeyPress = false;
        var labelElement = this.element.parentNode.querySelector('.e-float-text');
        if (this.element.value === this.promptMask && this.floatLabelType === 'Auto' && this.placeholder &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(labelElement) && labelElement.classList.contains(TOPLABEL) && !this.isFocus) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([labelElement], TOPLABEL);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([labelElement], BOTTOMLABEL);
            setElementValue.call(this, '');
        }
    }
    if (this.mask === null || this.mask === '' && this.value !== undefined) {
        setElementValue.call(this, this.value);
    }
}
/**
 * @hidden
 * To set updated values in the input element.
 */
function setElementValue(val, element) {
    if (!this.isFocus && this.floatLabelType === 'Auto' && this.placeholder && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
        val = '';
    }
    var value = strippedValue.call(this, (element ? element : this.element), val);
    if (value === null || value === '') {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue(val, (element ? element : this.element), this.floatLabelType, false);
        if (this.showClearButton) {
            this.inputObj.clearButton.classList.add('e-clear-icon-hide');
        }
    }
    else {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue(val, (element ? element : this.element), this.floatLabelType, this.showClearButton);
    }
}
/**
 * @hidden
 * Provide mask support to input textbox through utility method.
 */
function maskInput(args) {
    var inputEle = getMaskInput(args);
    applyMask.call(inputEle);
    var val = strippedValue.call(this, this.element);
    this.prevValue = val;
    this.value = val;
    if (args.mask) {
        unwireEvents.call(inputEle);
        wireEvents.call(inputEle);
    }
}
function getMaskInput(args) {
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([args.element], UTILMASK);
    var inputEle = {
        element: args.element,
        mask: args.mask,
        promptMask: '',
        hiddenMask: '',
        escapeMaskValue: '',
        promptChar: args.promptChar ? (args.promptChar.length > 1) ? args.promptChar = args.promptChar[0]
            : args.promptChar : '_',
        value: args.value ? args.value : null,
        regExpCollec: regularExpressions,
        customRegExpCollec: [],
        customCharacters: args.customCharacters,
        undoCollec: [],
        redoCollec: [],
        maskKeyPress: false,
        prevValue: ''
    };
    createMask.call(inputEle);
    return inputEle;
}
/**
 * @hidden
 * Gets raw value of the textbox which has been masked through utility method.
 */
function getVal(args) {
    return strippedValue.call(getUtilMaskEle(args), args.element);
}
/**
 * @hidden
 * Gets masked value of the textbox which has been masked through utility method.
 */
function getMaskedVal(args) {
    return unstrippedValue.call(getUtilMaskEle(args), args.element);
}
function getUtilMaskEle(args) {
    var value = '';
    var inputEle;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args) && args.element.classList.contains(UTILMASK)) {
        inputEle = getMaskInput(args);
    }
    return inputEle;
}
/**
 * @hidden
 * Arguments to perform undo and redo functionalities.
 */
var MaskUndo = /** @__PURE__ @class */ (function () {
    function MaskUndo() {
    }
    return MaskUndo;
}());

var maskUndo = new MaskUndo();


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/index.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/index.js ***!
  \*************************************************************************/
/*! exports provided: regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputFocusHandler, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo, MaskedTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _base_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "regularExpressions", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["regularExpressions"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createMask", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["createMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyMask", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["applyMask"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wireEvents", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["wireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unwireEvents", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["unwireEvents"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindClearEvent", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["bindClearEvent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unstrippedValue", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["unstrippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "strippedValue", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["strippedValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputFocusHandler", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["maskInputFocusHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputBlurHandler", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["maskInputBlurHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInputDropHandler", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["maskInputDropHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mobileRemoveFunction", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["mobileRemoveFunction"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setMaskValue", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["setMaskValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setElementValue", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["setElementValue"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maskInput", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["maskInput"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getVal", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["getVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaskedVal", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["getMaskedVal"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskUndo", function() { return _base_index__WEBPACK_IMPORTED_MODULE_0__["MaskUndo"]; });

/* harmony import */ var _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./maskedtextbox/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskedTextBox", function() { return _maskedtextbox_index__WEBPACK_IMPORTED_MODULE_1__["MaskedTextBox"]; });

/**
 * MaskedTextbox modules
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/index.js":
/*!***************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/index.js ***!
  \***************************************************************************************/
/*! exports provided: MaskedTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _maskedtextbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./maskedtextbox */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/maskedtextbox.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaskedTextBox", function() { return _maskedtextbox__WEBPACK_IMPORTED_MODULE_0__["MaskedTextBox"]; });

/**
 * MaskedTextbox modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/maskedtextbox.js":
/*!***********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/maskedtextbox/maskedtextbox.js ***!
  \***********************************************************************************************/
/*! exports provided: MaskedTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaskedTextBox", function() { return MaskedTextBox; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _input_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../input/input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js");
/* harmony import */ var _base_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/index */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/index.js");
/* harmony import */ var _base_mask_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/mask-base */ "./ej2-resources/18.4.46/scripts/ej2-inputs/maskedtextbox/base/mask-base.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};







var ROOT = 'e-control-wrapper e-mask';
var INPUT = 'e-input';
var COMPONENT = 'e-maskedtextbox';
var CONTROL = 'e-control';
var MASKINPUT_FOCUS = 'e-input-focus';
var wrapperAttr = ['title', 'style', 'class'];
/**
 * The MaskedTextBox allows the user to enter the valid input only based on the provided mask.
 * ```html
 * <input id="mask" type="text" />
 * ```
 * ```typescript
 * <script>
 * var maskObj = new MaskedTextBox({ mask: "(999) 9999-999" });
 * maskObj.appendTo('#mask');
 * </script>
 * ```
 */
var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
    __extends(MaskedTextBox, _super);
    function MaskedTextBox(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.initInputValue = '';
        _this.isAngular = false;
        _this.preventChange = false;
        _this.maskOptions = options;
        return _this;
    }
    /**
     * Gets the component name
     * @private
     */
    MaskedTextBox.prototype.getModuleName = function () {
        return 'maskedtextbox';
    };
    /**
     * Initializes the event handler
     * @private
     */
    MaskedTextBox.prototype.preRender = function () {
        this.promptMask = '';
        this.hiddenMask = '';
        this.escapeMaskValue = '';
        this.regExpCollec = _base_index__WEBPACK_IMPORTED_MODULE_2__["regularExpressions"];
        this.customRegExpCollec = [];
        this.undoCollec = [];
        this.redoCollec = [];
        this.changeEventArgs = {};
        this.focusEventArgs = {};
        this.blurEventArgs = {};
        this.maskKeyPress = false;
        this.isFocus = false;
        this.isInitial = false;
        this.isIosInvalid = false;
        var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
        this.cloneElement = this.element.cloneNode(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.cloneElement], [CONTROL, COMPONENT, 'e-lib']);
        this.angularTagName = null;
        this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (this.element.tagName === 'EJS-MASKEDTEXTBOX') {
            this.angularTagName = this.element.tagName;
            var input = this.createElement('input');
            for (var i = 0; i < this.element.attributes.length; i++) {
                input.setAttribute(this.element.attributes[i].nodeName, this.element.attributes[i].nodeValue);
                input.innerHTML = this.element.innerHTML;
            }
            if (this.element.hasAttribute('id')) {
                this.element.removeAttribute('id');
            }
            this.element.classList.remove('e-control', 'e-maskedtextbox');
            this.element.classList.add('e-mask-container');
            this.element.appendChild(input);
            this.element = input;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, this.element);
        }
        this.updateHTMLAttrToElement();
        this.checkHtmlAttributes(false);
        if (this.formElement) {
            this.initInputValue = this.value;
        }
    };
    /**
     * Gets the properties to be maintained in the persisted state.
     * @return {string}
     */
    MaskedTextBox.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Initializes the component rendering.
     * @private
     */
    MaskedTextBox.prototype.render = function () {
        var _this = this;
        if (this.element.tagName.toLowerCase() === 'input') {
            var checkBlazor = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered;
            if (this.floatLabelType === 'Never') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], INPUT);
            }
            this.createWrapper();
            this.updateHTMLAttrToWrapper();
            if (this.element.name === '') {
                this.element.setAttribute('name', this.element.id);
            }
            this.isInitial = true;
            if (checkBlazor && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE === true) {
                setTimeout(function () { _this.resetMaskedTextBox(); });
            }
            else {
                this.resetMaskedTextBox();
            }
            this.isInitial = false;
            this.setMaskPlaceholder(true, false);
            this.setWidth(this.width);
            this.preEleVal = this.element.value;
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.version === '11.0' || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'edge')) {
                this.element.blur();
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIos) {
                this.element.blur();
            }
            if (this.element.getAttribute('value') || this.value) {
                this.element.setAttribute('value', this.element.value);
            }
            this.renderComplete();
        }
    };
    MaskedTextBox.prototype.updateHTMLAttrToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttr.indexOf(key) < 0) {
                    this.element.setAttribute(key, this.htmlAttributes[key]);
                }
            }
        }
    };
    MaskedTextBox.prototype.updateCssClass = function (newClass, oldClass) {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setCssClass(this.getValidClassList(newClass), [this.inputObj.container], this.getValidClassList(oldClass));
    };
    MaskedTextBox.prototype.getValidClassList = function (maskClassName) {
        var result = maskClassName;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maskClassName) && maskClassName !== '') {
            result = (maskClassName.replace(/\s+/g, ' ')).trim();
        }
        return result;
    };
    MaskedTextBox.prototype.updateHTMLAttrToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (wrapperAttr.indexOf(key) > -1) {
                    if (key === 'class') {
                        var updatedClassValues = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
                        if (updatedClassValues !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputObj.container], updatedClassValues.split(' '));
                        }
                    }
                    else if (key === 'style') {
                        var maskStyle = this.inputObj.container.getAttribute(key);
                        maskStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maskStyle) ? (maskStyle + this.htmlAttributes[key]) :
                            this.htmlAttributes[key];
                        this.inputObj.container.setAttribute(key, maskStyle);
                    }
                    else {
                        this.inputObj.container.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    MaskedTextBox.prototype.resetMaskedTextBox = function () {
        this.promptMask = '';
        this.hiddenMask = '';
        this.escapeMaskValue = '';
        this.customRegExpCollec = [];
        this.undoCollec = [];
        this.redoCollec = [];
        if (this.promptChar.length > 1) {
            this.promptChar = this.promptChar[0];
        }
        _base_index__WEBPACK_IMPORTED_MODULE_2__["createMask"].call(this);
        _base_index__WEBPACK_IMPORTED_MODULE_2__["applyMask"].call(this);
        if (this.mask === null || this.mask === '' && this.value !== undefined) {
            _base_index__WEBPACK_IMPORTED_MODULE_2__["setElementValue"].call(this, this.value);
        }
        var val = _base_index__WEBPACK_IMPORTED_MODULE_2__["strippedValue"].call(this, this.element);
        this.prevValue = val;
        this.value = val;
        if (!this.isInitial) {
            _base_index__WEBPACK_IMPORTED_MODULE_2__["unwireEvents"].call(this);
        }
        _base_index__WEBPACK_IMPORTED_MODULE_2__["wireEvents"].call(this);
    };
    MaskedTextBox.prototype.setMaskPlaceholder = function (setVal, dynamicPlaceholder) {
        if (dynamicPlaceholder || this.placeholder) {
            _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.element);
            if (this.element.value === this.promptMask && setVal && this.floatLabelType !== 'Always') {
                _base_index__WEBPACK_IMPORTED_MODULE_2__["setElementValue"].call(this, '');
            }
            if (this.floatLabelType === 'Never') {
                _base_mask_base__WEBPACK_IMPORTED_MODULE_3__["maskInputBlurHandler"].call(this);
            }
        }
    };
    MaskedTextBox.prototype.setWidth = function (width) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(width)) {
            if (typeof width === 'number') {
                this.inputObj.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
                this.element.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
            }
            else if (typeof width === 'string') {
                var elementWidth = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width));
                this.inputObj.container.style.width = elementWidth;
                this.element.style.width = elementWidth;
            }
        }
    };
    MaskedTextBox.prototype.checkHtmlAttributes = function (isDynamic) {
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes)
            : ['placeholder', 'disabled', 'value', 'readonly'];
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var key = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute(key))) {
                switch (key) {
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maskOptions) || (this.maskOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.element.placeholder }, !isDynamic);
                        }
                        break;
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maskOptions) || (this.maskOptions['enabled'] === undefined)) || isDynamic) {
                            var enabled = this.element.getAttribute(key) === 'disabled' || this.element.getAttribute(key) === '' ||
                                this.element.getAttribute(key) === 'true' ? false : true;
                            this.setProperties({ enabled: enabled }, !isDynamic);
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maskOptions) || (this.maskOptions['value'] === undefined)) || isDynamic) {
                            this.setProperties({ value: this.element.value }, !isDynamic);
                        }
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.maskOptions) || (this.maskOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.element.getAttribute(key) === 'readonly' || this.element.getAttribute(key) === ''
                                || this.element.getAttribute(key) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                }
            }
        }
    };
    MaskedTextBox.prototype.createWrapper = function () {
        var updatedCssClassValues = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValues = this.getValidClassList(this.cssClass);
        }
        this.inputObj = _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].createInput({
            element: this.element,
            floatLabelType: this.floatLabelType,
            properties: {
                enableRtl: this.enableRtl,
                cssClass: updatedCssClassValues,
                enabled: this.enabled,
                readonly: this.readonly,
                placeholder: this.placeholder,
                showClearButton: this.showClearButton
            }
        }, this.createElement);
        this.inputObj.container.setAttribute('class', ROOT + ' ' + this.inputObj.container.getAttribute('class'));
    };
    /**
     * Calls internally if any of the property value is changed.
     * @hidden
     */
    MaskedTextBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'value':
                    _base_index__WEBPACK_IMPORTED_MODULE_2__["setMaskValue"].call(this, this.value);
                    if (this.placeholder) {
                        this.setMaskPlaceholder(false, false);
                    }
                    break;
                case 'placeholder':
                    this.setMaskPlaceholder(true, true);
                    break;
                case 'width':
                    this.setWidth(newProp.width);
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'enabled':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnabled(newProp.enabled, this.element, this.floatLabelType, this.inputObj.container);
                    break;
                case 'readonly':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setReadonly(newProp.readonly, this.element);
                    break;
                case 'enableRtl':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnableRtl(newProp.enableRtl, [this.inputObj.container]);
                    break;
                case 'customCharacters':
                    this.customCharacters = newProp.customCharacters;
                    this.resetMaskedTextBox();
                    break;
                case 'showClearButton':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setClearButton(newProp.showClearButton, this.element, this.inputObj, undefined, this.createElement);
                    _base_index__WEBPACK_IMPORTED_MODULE_2__["bindClearEvent"].call(this);
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].removeFloating(this.inputObj);
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].addFloating(this.element, this.floatLabelType, this.placeholder, this.createElement);
                    break;
                case 'htmlAttributes':
                    this.updateHTMLAttrToElement();
                    this.updateHTMLAttrToWrapper();
                    this.checkHtmlAttributes(true);
                    break;
                case 'mask':
                    var strippedValue_1 = this.value;
                    this.mask = newProp.mask;
                    this.updateValue(strippedValue_1);
                    break;
                case 'promptChar':
                    if (newProp.promptChar.length > 1) {
                        newProp.promptChar = newProp.promptChar[0];
                    }
                    if (newProp.promptChar) {
                        this.promptChar = newProp.promptChar;
                    }
                    else {
                        this.promptChar = '_';
                    }
                    var value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
                    if (this.promptMask === this.element.value) {
                        value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
                    }
                    this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
                    this.undoCollec = this.redoCollec = [];
                    _base_index__WEBPACK_IMPORTED_MODULE_2__["setElementValue"].call(this, value);
                    break;
            }
        }
        this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
    };
    MaskedTextBox.prototype.updateValue = function (strippedVal) {
        this.resetMaskedTextBox();
        _base_index__WEBPACK_IMPORTED_MODULE_2__["setMaskValue"].call(this, strippedVal);
    };
    /**
     * Gets the value of the MaskedTextBox with the masked format.
     * By using `value` property, you can get the raw value of maskedtextbox without literals and prompt characters.
     * @return {string}
     */
    MaskedTextBox.prototype.getMaskedValue = function () {
        return _base_index__WEBPACK_IMPORTED_MODULE_2__["unstrippedValue"].call(this, this.element);
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    MaskedTextBox.prototype.focusIn = function () {
        if (document.activeElement !== this.element && this.enabled) {
            this.element.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.inputObj.container], [MASKINPUT_FOCUS]);
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    MaskedTextBox.prototype.focusOut = function () {
        if (document.activeElement === this.element && this.enabled) {
            this.element.blur();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.inputObj.container], [MASKINPUT_FOCUS]);
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers.
     * Also it maintains the initial input element from the DOM.
     * @method destroy
     * @return {void}
     */
    MaskedTextBox.prototype.destroy = function () {
        _base_index__WEBPACK_IMPORTED_MODULE_2__["unwireEvents"].call(this);
        var attrArray = ['aria-labelledby', 'role', 'autocomplete', 'aria-readonly',
            'autocorrect', 'aria-disabled', 'aria-placeholder', 'autocapitalize',
            'spellcheck', 'aria-autocomplete',
            'aria-live', 'aria-valuenow', 'aria-invalid'];
        for (var i = 0; i < attrArray.length; i++) {
            this.element.removeAttribute(attrArray[i]);
        }
        this.element.classList.remove('e-input');
        this.inputObj.container.insertAdjacentElement('afterend', this.element);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputObj.container);
        _super.prototype.destroy.call(this);
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], MaskedTextBox.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], MaskedTextBox.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], MaskedTextBox.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MaskedTextBox.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MaskedTextBox.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MaskedTextBox.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "mask", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('_')
    ], MaskedTextBox.prototype, "promptChar", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MaskedTextBox.prototype, "customCharacters", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MaskedTextBox.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MaskedTextBox.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MaskedTextBox.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MaskedTextBox.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MaskedTextBox.prototype, "blur", void 0);
    MaskedTextBox = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], MaskedTextBox);
    return MaskedTextBox;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/index.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/index.js ***!
  \**************************************************************************/
/*! exports provided: NumericTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _numerictextbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numerictextbox */ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/numerictextbox.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumericTextBox", function() { return _numerictextbox__WEBPACK_IMPORTED_MODULE_0__["NumericTextBox"]; });

/**
 * NumericTextBox modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/numerictextbox.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/numerictextbox/numerictextbox.js ***!
  \***********************************************************************************/
/*! exports provided: NumericTextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumericTextBox", function() { return NumericTextBox; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _input_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../input/input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






var ROOT = 'e-control-wrapper e-numeric';
var SPINICON = 'e-input-group-icon';
var SPINUP = 'e-spin-up';
var SPINDOWN = 'e-spin-down';
var ERROR = 'e-error';
var INCREMENT = 'increment';
var DECREMENT = 'decrement';
var INTREGEXP = new RegExp('^(-)?(\\d*)$');
var DECIMALSEPARATOR = '.';
var COMPONENT = 'e-numerictextbox';
var CONTROL = 'e-control';
var NUMERIC_FOCUS = 'e-input-focus';
var HIDDENELEMENT = 'e-numeric-hidden';
var wrapperAttributes = ['title', 'style', 'class'];
/**
 * Represents the NumericTextBox component that allows the user to enter only numeric values.
 * ```html
 * <input type='text' id="numeric"/>
 * ```
 * ```typescript
 * <script>
 *   var numericObj = new NumericTextBox({ value: 10 });
 *   numericObj.appendTo("#numeric");
 * </script>
 * ```
 */
var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
    __extends(NumericTextBox, _super);
    function NumericTextBox(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isVue = false;
        _this.preventChange = false;
        _this.isAngular = false;
        _this.isDynamicChange = false;
        _this.numericOptions = options;
        return _this;
    }
    NumericTextBox.prototype.preRender = function () {
        this.isPrevFocused = false;
        this.decimalSeparator = '.';
        this.intRegExp = new RegExp('/^(-)?(\d*)$/');
        this.isCalled = false;
        var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
        this.cloneElement = this.element.cloneNode(true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.cloneElement], [CONTROL, COMPONENT, 'e-lib']);
        this.angularTagName = null;
        this.formEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (this.element.tagName === 'EJS-NUMERICTEXTBOX') {
            this.angularTagName = this.element.tagName;
            var input = this.createElement('input');
            var index = 0;
            for (index; index < this.element.attributes.length; index++) {
                var attributeName = this.element.attributes[index].nodeName;
                if (attributeName !== 'id') {
                    input.setAttribute(this.element.attributes[index].nodeName, this.element.attributes[index].nodeValue);
                    input.innerHTML = this.element.innerHTML;
                }
            }
            if (this.element.hasAttribute('name')) {
                this.element.removeAttribute('name');
            }
            this.element.classList.remove('e-control', 'e-numerictextbox');
            this.element.appendChild(input);
            this.element = input;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, this.element);
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' });
            var localeText = {
                incrementTitle: 'Increment value', decrementTitle: 'Decrement value', placeholder: this.placeholder
            };
            this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('numerictextbox', localeText, this.locale);
            if (this.l10n.getConstant('placeholder') !== '') {
                this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
            }
        }
        this.isValidState = true;
        this.inputStyle = null;
        this.inputName = null;
        this.cultureInfo = {};
        this.initCultureInfo();
        this.initCultureFunc();
        this.prevValue = this.value;
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            this.updateHTMLAttrToElement();
            this.checkAttributes(false);
            if (this.formEle) {
                this.inputEleValue = this.value;
            }
        }
        this.validateMinMax();
        this.validateStep();
        if (this.placeholder === null && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            this.updatePlaceholder();
        }
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    NumericTextBox.prototype.render = function () {
        if (this.element.tagName.toLowerCase() === 'input') {
            if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                this.createWrapper();
                if (this.showSpinButton) {
                    this.spinBtnCreation();
                }
                this.setElementWidth(this.width);
                if (!this.container.classList.contains('e-input-group')) {
                    this.container.classList.add('e-input-group');
                }
                this.changeValue(this.value === null || isNaN(this.value) ?
                    null : this.strictMode ? this.trimValue(this.value) : this.value);
            }
            else {
                this.container = this.element.parentElement;
                this.inputWrapper = { container: this.container };
                this.hiddenInput = this.container.querySelector('input[type="hidden"]');
                if (this.showClearButton) {
                    this.inputWrapper.clearButton = this.container.querySelector('.e-clear-icon');
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].wireClearBtnEvents(this.element, this.inputWrapper.clearButton, this.inputWrapper.container);
                }
                if (this.showSpinButton) {
                    this.spinDown = this.container.querySelector('.' + SPINDOWN);
                    this.spinUp = this.container.querySelector('.' + SPINUP);
                    this.wireSpinBtnEvents();
                }
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].bindInitialEvent({
                    element: this.element, buttons: null, customTag: null, floatLabelType: this.floatLabelType, properties: this.properties
                });
            }
            this.wireEvents();
            if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                if (this.value !== null && !isNaN(this.value)) {
                    if (this.decimals) {
                        this.setProperties({ value: this.roundNumber(this.value, this.decimals) }, true);
                    }
                }
                if (this.element.getAttribute('value') || this.value) {
                    this.element.setAttribute('value', this.element.value);
                    this.hiddenInput.setAttribute('value', this.hiddenInput.value);
                }
            }
            this.elementPrevValue = this.element.value;
            if (this.element.hasAttribute('data-val')) {
                this.element.setAttribute('data-val', 'false');
            }
            this.renderComplete();
        }
    };
    NumericTextBox.prototype.checkAttributes = function (isDynamic) {
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['value', 'min', 'max', 'step', 'disabled', 'readonly', 'style', 'name', 'placeholder'];
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute(prop))) {
                switch (prop) {
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['enabled'] === undefined)) || isDynamic) {
                            var enabled = this.element.getAttribute(prop) === 'disabled' || this.element.getAttribute(prop) === ''
                                || this.element.getAttribute(prop) === 'true' ? false : true;
                            this.setProperties({ enabled: enabled }, !isDynamic);
                        }
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.element.getAttribute(prop) === 'readonly' || this.element.getAttribute(prop) === ''
                                || this.element.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.element.placeholder }, !isDynamic);
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['value'] === undefined)) || isDynamic) {
                            var setNumber = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, setNumber, {}), !isDynamic);
                        }
                        break;
                    case 'min':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['min'] === undefined)) || isDynamic) {
                            var minValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));
                            if (minValue !== null && !isNaN(minValue)) {
                                this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, minValue, {}), !isDynamic);
                            }
                        }
                        break;
                    case 'max':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['max'] === undefined)) || isDynamic) {
                            var maxValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));
                            if (maxValue !== null && !isNaN(maxValue)) {
                                this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, maxValue, {}), !isDynamic);
                            }
                        }
                        break;
                    case 'step':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.numericOptions) || (this.numericOptions['step'] === undefined)) || isDynamic) {
                            var stepValue = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));
                            if (stepValue !== null && !isNaN(stepValue)) {
                                this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, stepValue, {}), !isDynamic);
                            }
                        }
                        break;
                    case 'style':
                        this.inputStyle = this.element.getAttribute(prop);
                        break;
                    case 'name':
                        this.inputName = this.element.getAttribute(prop);
                        break;
                    default:
                        var value = this.instance.getNumberParser({ format: 'n' })(this.element.getAttribute(prop));
                        if ((value !== null && !isNaN(value)) || (prop === 'value')) {
                            this.setProperties(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, value, {}), true);
                        }
                        break;
                }
            }
        }
    };
    NumericTextBox.prototype.updatePlaceholder = function () {
        this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
    };
    NumericTextBox.prototype.initCultureFunc = function () {
        this.instance = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
    };
    NumericTextBox.prototype.initCultureInfo = function () {
        this.cultureInfo.format = this.format;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('currency', this) !== null) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('currency', this.currency, this.cultureInfo);
            this.setProperties({ currencyCode: this.currency }, true);
        }
    };
    /* Wrapper creation */
    NumericTextBox.prototype.createWrapper = function () {
        var updatedCssClassValue = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValue = this.getNumericValidClassList(this.cssClass);
        }
        var inputObj = _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].createInput({
            element: this.element,
            floatLabelType: this.floatLabelType,
            properties: {
                readonly: this.readonly,
                placeholder: this.placeholder,
                cssClass: updatedCssClassValue,
                enableRtl: this.enableRtl,
                showClearButton: this.showClearButton,
                enabled: this.enabled
            }
        }, this.createElement);
        this.inputWrapper = inputObj;
        this.container = inputObj.container;
        this.container.setAttribute('class', ROOT + ' ' + this.container.getAttribute('class'));
        this.updateHTMLAttrToWrapper();
        if (this.readonly) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-readonly': 'true' });
        }
        this.hiddenInput = (this.createElement('input', { attrs: { type: 'text',
                'validateHidden': 'true', 'class': HIDDENELEMENT } }));
        this.inputName = this.inputName !== null ? this.inputName : this.element.id;
        this.element.removeAttribute('name');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.hiddenInput, { 'name': this.inputName });
        this.container.insertBefore(this.hiddenInput, this.container.childNodes[1]);
        this.updateDataAttribute(false);
        if (this.inputStyle !== null) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.container, { 'style': this.inputStyle });
        }
    };
    NumericTextBox.prototype.updateDataAttribute = function (isDynamic) {
        var attr = {};
        if (!isDynamic) {
            for (var a = 0; a < this.element.attributes.length; a++) {
                attr[this.element.attributes[a].name] = this.element.getAttribute(this.element.attributes[a].name);
            }
        }
        else {
            attr = this.htmlAttributes;
        }
        for (var _i = 0, _a = Object.keys(attr); _i < _a.length; _i++) {
            var key = _a[_i];
            if (key.indexOf('data') === 0) {
                this.hiddenInput.setAttribute(key, attr[key]);
            }
        }
    };
    NumericTextBox.prototype.updateHTMLAttrToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var pro = _a[_i];
                if (wrapperAttributes.indexOf(pro) < 0) {
                    this.element.setAttribute(pro, this.htmlAttributes[pro]);
                }
            }
        }
    };
    NumericTextBox.prototype.updateCssClass = function (newClass, oldClass) {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setCssClass(this.getNumericValidClassList(newClass), [this.container], this.getNumericValidClassList(oldClass));
    };
    NumericTextBox.prototype.getNumericValidClassList = function (numericClassName) {
        var result = numericClassName;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(numericClassName) && numericClassName !== '') {
            result = (numericClassName.replace(/\s+/g, ' ')).trim();
        }
        return result;
    };
    NumericTextBox.prototype.updateHTMLAttrToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var pro = _a[_i];
                if (wrapperAttributes.indexOf(pro) > -1) {
                    if (pro === 'class') {
                        var updatedClassValue = this.getNumericValidClassList(this.htmlAttributes[pro]);
                        if (updatedClassValue !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.container], updatedClassValue.split(' '));
                        }
                    }
                    else if (pro === 'style') {
                        var numericStyle = this.container.getAttribute(pro);
                        numericStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(numericStyle) ? (numericStyle + this.htmlAttributes[pro]) :
                            this.htmlAttributes[pro];
                        this.container.setAttribute(pro, numericStyle);
                    }
                    else {
                        this.container.setAttribute(pro, this.htmlAttributes[pro]);
                    }
                }
            }
        }
    };
    NumericTextBox.prototype.setElementWidth = function (width) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(width)) {
            if (typeof width === 'number') {
                this.container.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
            }
            else if (typeof width === 'string') {
                this.container.style.width = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width));
            }
        }
    };
    /* Spinner creation */
    NumericTextBox.prototype.spinBtnCreation = function () {
        this.spinDown = _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].appendSpan(SPINICON + ' ' + SPINDOWN, this.container, this.createElement);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.spinDown, {
            'title': this.l10n.getConstant('decrementTitle'),
            'aria-label': this.l10n.getConstant('decrementTitle')
        });
        this.spinUp = _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].appendSpan(SPINICON + ' ' + SPINUP, this.container, this.createElement);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.spinUp, {
            'title': this.l10n.getConstant('incrementTitle'),
            'aria-label': this.l10n.getConstant('incrementTitle')
        });
        this.wireSpinBtnEvents();
    };
    NumericTextBox.prototype.validateMinMax = function () {
        if (!(typeof (this.min) === 'number' && !isNaN(this.min))) {
            this.setProperties({ min: -(Number.MAX_VALUE) }, true);
        }
        if (!(typeof (this.max) === 'number' && !isNaN(this.max))) {
            this.setProperties({ max: Number.MAX_VALUE }, true);
        }
        if (this.decimals !== null) {
            if (this.min !== -(Number.MAX_VALUE)) {
                this.setProperties({ min: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.min)) }, true);
            }
            if (this.max !== (Number.MAX_VALUE)) {
                this.setProperties({ max: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.max)) }, true);
            }
        }
        this.setProperties({ min: this.min > this.max ? this.max : this.min }, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-valuemin': this.min.toString(), 'aria-valuemax': this.max.toString() });
    };
    NumericTextBox.prototype.formattedValue = function (decimals, value) {
        return this.instance.getNumberFormat({
            maximumFractionDigits: decimals,
            minimumFractionDigits: decimals, useGrouping: false
        })(value);
    };
    NumericTextBox.prototype.validateStep = function () {
        if (this.decimals !== null) {
            this.setProperties({ step: this.instance.getNumberParser({ format: 'n' })(this.formattedValue(this.decimals, this.step)) }, true);
        }
    };
    NumericTextBox.prototype.action = function (operation, event) {
        this.isInteract = true;
        var value = this.isFocused ? this.instance.getNumberParser({ format: 'n' })(this.element.value) : this.value;
        this.changeValue(this.performAction(value, this.step, operation));
        this.raiseChangeEvent(event);
    };
    NumericTextBox.prototype.checkErrorClass = function () {
        if (this.isValidState) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.container], ERROR);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.container], ERROR);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-invalid': this.isValidState ? 'false' : 'true' });
    };
    NumericTextBox.prototype.bindClearEvent = function () {
        if (this.showClearButton) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.inputWrapper.clearButton, 'mousedown touchstart', this.resetHandler, this);
        }
    };
    NumericTextBox.prototype.resetHandler = function (e) {
        e.preventDefault();
        if (!(this.inputWrapper.clearButton.classList.contains('e-clear-icon-hide'))) {
            this.clear(e);
        }
        this.isInteract = true;
        this.raiseChangeEvent(e);
    };
    NumericTextBox.prototype.clear = function (event) {
        this.setProperties({ value: null }, true);
        this.setElementValue('');
        this.hiddenInput.value = '';
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (formElement) {
            var element = this.element.nextElementSibling;
            var keyupEvent = document.createEvent('KeyboardEvent');
            keyupEvent.initEvent('keyup', false, true);
            element.dispatchEvent(keyupEvent);
        }
    };
    NumericTextBox.prototype.resetFormHandler = function () {
        if (this.element.tagName === 'EJS-NUMERICTEXTBOX') {
            this.updateValue(null);
        }
        else {
            this.updateValue(this.inputEleValue);
        }
    };
    NumericTextBox.prototype.setSpinButton = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinDown)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.spinDown, {
                'title': this.l10n.getConstant('decrementTitle'),
                'aria-label': this.l10n.getConstant('decrementTitle')
            });
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.spinUp)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.spinUp, {
                'title': this.l10n.getConstant('incrementTitle'),
                'aria-label': this.l10n.getConstant('incrementTitle')
            });
        }
    };
    NumericTextBox.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.focusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'blur', this.focusOutHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.keyDownHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keyup', this.keyUpHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'input', this.inputHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keypress', this.keyPressHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'change', this.changeHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'paste', this.pasteHandler, this);
        if (this.enabled) {
            this.bindClearEvent();
            if (this.formEle) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formEle, 'reset', this.resetFormHandler, this);
            }
        }
    };
    NumericTextBox.prototype.wireSpinBtnEvents = function () {
        /* bind spin button events */
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.mouseDownOnSpinner, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.mouseDownOnSpinner, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.mouseUpOnSpinner, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.mouseUpOnSpinner, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.touchMoveOnSpinner, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.touchMoveOnSpinner, this);
    };
    NumericTextBox.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.focusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'blur', this.focusOutHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keyup', this.keyUpHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'input', this.inputHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', this.keyDownHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keypress', this.keyPressHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'change', this.changeHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'paste', this.pasteHandler);
        if (this.formEle) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formEle, 'reset', this.resetFormHandler);
        }
    };
    NumericTextBox.prototype.unwireSpinBtnEvents = function () {
        /* unbind spin button events */
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.mouseDownOnSpinner);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.mouseDownOnSpinner);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.mouseUpOnSpinner);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.mouseUpOnSpinner);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinUp, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.touchMoveOnSpinner);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinDown, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.touchMoveOnSpinner);
    };
    NumericTextBox.prototype.changeHandler = function (event) {
        event.stopPropagation();
        if (!this.element.value.length) {
            this.setProperties({ value: null }, true);
        }
        var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
        this.updateValue(parsedInput, event);
    };
    NumericTextBox.prototype.raiseChangeEvent = function (event) {
        if (this.prevValue !== this.value) {
            var eventArgs = {};
            this.changeEventArgs = { value: this.value, previousValue: this.prevValue, isInteracted: this.isInteract,
                isInteraction: this.isInteract, event: event };
            if (event) {
                this.changeEventArgs.event = event;
            }
            if (this.changeEventArgs.event === undefined) {
                this.changeEventArgs.isInteracted = false;
                this.changeEventArgs.isInteraction = false;
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, this.changeEventArgs);
            this.prevValue = this.value;
            this.isInteract = false;
            this.elementPrevValue = this.element.value;
            this.preventChange = false;
            this.trigger('change', eventArgs);
        }
    };
    NumericTextBox.prototype.pasteHandler = function () {
        var _this = this;
        if (!this.enabled || this.readonly) {
            return;
        }
        var beforeUpdate = this.element.value;
        setTimeout(function () {
            if (!_this.numericRegex().test(_this.element.value)) {
                _this.setElementValue(beforeUpdate);
            }
        });
    };
    NumericTextBox.prototype.preventHandler = function () {
        var _this = this;
        var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
        setTimeout(function () {
            if (_this.element.selectionStart > 0) {
                var currentPos = _this.element.selectionStart;
                var prevPos = _this.element.selectionStart - 1;
                var start = 0;
                var ignoreKeyCode = void 0;
                var valArray = _this.element.value.split('');
                var numericObject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getNumericObject"])(_this.locale);
                var decimalSeparator = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('decimal', numericObject);
                ignoreKeyCode = decimalSeparator.charCodeAt(0);
                if (_this.element.value[prevPos] === ' ' && _this.element.selectionStart > 0 && !iOS) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.prevVal)) {
                        _this.element.value = _this.element.value.trim();
                    }
                    else if (prevPos !== 0) {
                        _this.element.value = _this.prevVal;
                    }
                    else if (prevPos === 0) {
                        _this.element.value = _this.element.value.trim();
                    }
                    _this.element.setSelectionRange(prevPos, prevPos);
                }
                else if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1])) &&
                    _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) !== 45) {
                    if ((valArray.indexOf(_this.element.value[_this.element.selectionStart - 1]) !==
                        valArray.lastIndexOf(_this.element.value[_this.element.selectionStart - 1]) &&
                        _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) === ignoreKeyCode) ||
                        _this.element.value[_this.element.selectionStart - 1].charCodeAt(0) !== ignoreKeyCode) {
                        _this.element.value = _this.element.value.substring(0, prevPos) +
                            _this.element.value.substring(currentPos, _this.element.value.length);
                        _this.element.setSelectionRange(prevPos, prevPos);
                        if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1])) && _this.element.selectionStart > 0
                            && _this.element.value.length) {
                            _this.preventHandler();
                        }
                    }
                }
                else if (isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 2])) && _this.element.selectionStart > 1 &&
                    _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) !== 45) {
                    if ((valArray.indexOf(_this.element.value[_this.element.selectionStart - 2]) !==
                        valArray.lastIndexOf(_this.element.value[_this.element.selectionStart - 2]) &&
                        _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) === ignoreKeyCode) ||
                        _this.element.value[_this.element.selectionStart - 2].charCodeAt(0) !== ignoreKeyCode) {
                        _this.element.setSelectionRange(prevPos, prevPos);
                        _this.nextEle = _this.element.value[_this.element.selectionStart];
                        _this.cursorPosChanged = true;
                        _this.preventHandler();
                    }
                }
                if (_this.cursorPosChanged === true && _this.element.value[_this.element.selectionStart] === _this.nextEle &&
                    isNaN(parseFloat(_this.element.value[_this.element.selectionStart - 1]))) {
                    _this.element.setSelectionRange(_this.element.selectionStart + 1, _this.element.selectionStart + 1);
                    _this.cursorPosChanged = false;
                    _this.nextEle = null;
                }
                if (_this.element.value.trim() === '') {
                    _this.element.setSelectionRange(start, start);
                }
                if (_this.element.selectionStart > 0) {
                    if ((_this.element.value[_this.element.selectionStart - 1].charCodeAt(0) === 45) && _this.element.selectionStart > 1) {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.prevVal)) {
                            _this.element.value = _this.element.value;
                        }
                        else {
                            _this.element.value = _this.prevVal;
                        }
                        _this.element.setSelectionRange(_this.element.selectionStart, _this.element.selectionStart);
                    }
                }
                _this.prevVal = _this.element.value;
            }
        });
    };
    NumericTextBox.prototype.keyUpHandler = function (event) {
        if (!this.enabled || this.readonly) {
            return;
        }
        var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
        if (!iOS && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.preventHandler();
        }
        var parseValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);
        parseValue = parseValue === null || isNaN(parseValue) ? null : parseValue;
        this.hiddenInput.value = parseValue || parseValue === 0 ? parseValue.toString() : null;
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (formElement) {
            var element = this.element.nextElementSibling;
            var keyupEvent = document.createEvent('KeyboardEvent');
            keyupEvent.initEvent('keyup', false, true);
            element.dispatchEvent(keyupEvent);
        }
    };
    ;
    NumericTextBox.prototype.inputHandler = function (event) {
        // tslint:disable-next-line
        var numerictextboxObj = this;
        if (!this.enabled || this.readonly) {
            return;
        }
        var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
        var fireFox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
        if ((fireFox || iOS) && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.preventHandler();
        }
        /* istanbul ignore next */
        if (this.isAngular
            && this.element.value !== Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('decimal', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getNumericObject"])(this.locale))
            && this.element.value !== Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('minusSign', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getNumericObject"])(this.locale))) {
            var parsedValue = this.instance.getNumberParser({ format: 'n' })(this.element.value);
            parsedValue = isNaN(parsedValue) ? null : parsedValue;
            numerictextboxObj.localChange({ value: parsedValue });
            this.preventChange = true;
        }
        if (this.isVue) {
            var current = this.instance.getNumberParser({ format: 'n' })(this.element.value);
            var previous = this.instance.getNumberParser({ format: 'n' })(this.elementPrevValue);
            var eventArgs = {
                event: event,
                value: (current === null || isNaN(current) ? null : current),
                previousValue: (previous === null || isNaN(previous) ? null : previous)
            };
            this.preventChange = true;
            this.elementPrevValue = this.element.value;
            this.trigger('input', eventArgs);
        }
    };
    ;
    NumericTextBox.prototype.keyDownHandler = function (event) {
        if (!this.readonly) {
            switch (event.keyCode) {
                case 38:
                    event.preventDefault();
                    this.action(INCREMENT, event);
                    break;
                case 40:
                    event.preventDefault();
                    this.action(DECREMENT, event);
                    break;
                default: break;
            }
        }
    };
    ;
    NumericTextBox.prototype.performAction = function (value, step, operation) {
        if (value === null || isNaN(value)) {
            value = 0;
        }
        var updatedValue = operation === INCREMENT ? value + step : value - step;
        updatedValue = this.correctRounding(value, step, updatedValue);
        return this.strictMode ? this.trimValue(updatedValue) : updatedValue;
    };
    ;
    NumericTextBox.prototype.correctRounding = function (value, step, result) {
        var floatExp = new RegExp('[,.](.*)');
        var valueText = value.toString();
        var stepText = step.toString();
        var floatValue = floatExp.test(value.toString());
        var floatStep = floatExp.test(step.toString());
        if (floatValue || floatStep) {
            var valueCount = floatValue ? floatExp.exec(value.toString())[0].length : 0;
            var stepCount = floatStep ? floatExp.exec(step.toString())[0].length : 0;
            var max = Math.max(valueCount, stepCount);
            return value = this.roundValue(result, max);
        }
        return result;
    };
    ;
    NumericTextBox.prototype.roundValue = function (result, precision) {
        precision = precision || 0;
        var divide = Math.pow(10, precision);
        return result *= divide, result = Math.round(result) / divide;
    };
    ;
    NumericTextBox.prototype.updateValue = function (value, event) {
        if (event) {
            this.isInteract = true;
        }
        if (value !== null && !isNaN(value)) {
            if (this.decimals) {
                value = this.roundNumber(value, this.decimals);
            }
        }
        this.changeValue(value === null || isNaN(value) ? null : this.strictMode ? this.trimValue(value) : value);
        /* istanbul ignore next */
        if (!this.isDynamicChange) {
            this.raiseChangeEvent(event);
        }
    };
    NumericTextBox.prototype.updateCurrency = function (prop, propVal) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, propVal, this.cultureInfo);
        this.updateValue(this.value);
    };
    NumericTextBox.prototype.changeValue = function (value) {
        if (!(value || value === 0)) {
            value = null;
            this.setProperties({ value: value }, true);
        }
        else {
            var numberOfDecimals = void 0;
            numberOfDecimals = this.getNumberOfDecimals(value);
            this.setProperties({ value: this.roundNumber(value, numberOfDecimals) }, true);
        }
        this.modifyText();
        if (!this.strictMode) {
            this.validateState();
        }
    };
    ;
    NumericTextBox.prototype.modifyText = function () {
        if (this.value || this.value === 0) {
            var value = this.formatNumber();
            var elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);
            this.setElementValue(elementValue);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-valuenow': value });
            this.hiddenInput.value = this.value.toString();
            if (this.value !== null && this.serverDecimalSeparator) {
                this.hiddenInput.value = this.hiddenInput.value.replace('.', this.serverDecimalSeparator);
            }
        }
        else {
            this.setElementValue('');
            this.element.removeAttribute('aria-valuenow');
            this.hiddenInput.value = null;
        }
    };
    ;
    NumericTextBox.prototype.setElementValue = function (val, element) {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue(val, (element ? element : this.element), this.floatLabelType, this.showClearButton);
    };
    NumericTextBox.prototype.validateState = function () {
        this.isValidState = true;
        if (this.value || this.value === 0) {
            this.isValidState = !(this.value > this.max || this.value < this.min);
        }
        this.checkErrorClass();
    };
    NumericTextBox.prototype.getNumberOfDecimals = function (value) {
        var numberOfDecimals;
        var EXPREGEXP = new RegExp('[eE][\-+]?([0-9]+)');
        var valueString = value.toString();
        if (EXPREGEXP.test(valueString)) {
            var result = EXPREGEXP.exec(valueString);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(result)) {
                valueString = value.toFixed(Math.min(parseInt(result[1], 10), 20));
            }
        }
        var decimalPart = valueString.split('.')[1];
        numberOfDecimals = !decimalPart || !decimalPart.length ? 0 : decimalPart.length;
        if (this.decimals !== null) {
            numberOfDecimals = numberOfDecimals < this.decimals ? numberOfDecimals : this.decimals;
        }
        return numberOfDecimals;
    };
    NumericTextBox.prototype.formatNumber = function () {
        var numberOfDecimals;
        numberOfDecimals = this.getNumberOfDecimals(this.value);
        return this.instance.getNumberFormat({
            maximumFractionDigits: numberOfDecimals,
            minimumFractionDigits: numberOfDecimals, useGrouping: false
        })(this.value);
    };
    ;
    NumericTextBox.prototype.trimValue = function (value) {
        if (value > this.max) {
            return this.max;
        }
        if (value < this.min) {
            return this.min;
        }
        return value;
    };
    ;
    NumericTextBox.prototype.roundNumber = function (value, precision) {
        var result = value;
        var decimals = precision || 0;
        var result1 = result.toString().split('e');
        result = Math.round(Number(result1[0] + 'e' + (result1[1] ? (Number(result1[1]) + decimals) : decimals)));
        var result2 = result.toString().split('e');
        result = Number(result2[0] + 'e' + (result2[1] ? (Number(result2[1]) - decimals) : -decimals));
        return Number(result.toFixed(decimals));
    };
    ;
    NumericTextBox.prototype.cancelEvent = function (event) {
        event.preventDefault();
        return false;
    };
    NumericTextBox.prototype.keyPressHandler = function (event) {
        if (!this.enabled || this.readonly) {
            return true;
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.version === '11.0' && event.keyCode === 13) {
            var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
            this.updateValue(parsedInput, event);
            return true;
        }
        if (event.which === 0 || event.metaKey || event.ctrlKey || event.keyCode === 8 || event.keyCode === 13) {
            return true;
        }
        var currentChar = String.fromCharCode(event.which);
        var text = this.element.value;
        text = text.substring(0, this.element.selectionStart) + currentChar + text.substring(this.element.selectionEnd);
        if (!this.numericRegex().test(text)) {
            event.preventDefault();
            event.stopPropagation();
            return false;
        }
        else {
            return true;
        }
    };
    ;
    NumericTextBox.prototype.numericRegex = function () {
        var numericObject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getNumericObject"])(this.locale);
        var decimalSeparator = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('decimal', numericObject);
        var fractionRule = '*';
        if (decimalSeparator === DECIMALSEPARATOR) {
            decimalSeparator = '\\' + decimalSeparator;
        }
        if (this.decimals === 0 && this.validateDecimalOnType) {
            return INTREGEXP;
        }
        if (this.decimals && this.validateDecimalOnType) {
            fractionRule = '{0,' + this.decimals + '}';
        }
        return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
            ')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
    };
    ;
    NumericTextBox.prototype.mouseWheel = function (event) {
        event.preventDefault();
        var delta;
        var rawEvent = event;
        if (rawEvent.wheelDelta) {
            delta = rawEvent.wheelDelta / 120;
        }
        else if (rawEvent.detail) {
            delta = -rawEvent.detail / 3;
        }
        if (delta > 0) {
            this.action(INCREMENT, event);
        }
        else if (delta < 0) {
            this.action(DECREMENT, event);
        }
        this.cancelEvent(event);
    };
    NumericTextBox.prototype.focusHandler = function (event) {
        var _this = this;
        this.focusEventArgs = { event: event, value: this.value, container: this.container };
        this.trigger('focus', this.focusEventArgs);
        if (!this.enabled || this.readonly) {
            return;
        }
        this.isFocused = true;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.container], ERROR);
        this.prevValue = this.value;
        if ((this.value || this.value === 0)) {
            var formatValue_1 = this.formatNumber();
            this.setElementValue(formatValue_1);
            if (!this.isPrevFocused) {
                if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.version === '11.0') {
                    this.element.setSelectionRange(0, formatValue_1.length);
                }
                else {
                    var delay = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIos) ? 600 : 0;
                    setTimeout(function () {
                        _this.element.setSelectionRange(0, formatValue_1.length);
                    }, delay);
                }
            }
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel, this);
        }
    };
    ;
    NumericTextBox.prototype.focusOutHandler = function (event) {
        var _this = this;
        this.blurEventArgs = { event: event, value: this.value, container: this.container };
        this.trigger('blur', this.blurEventArgs);
        if (!this.enabled || this.readonly) {
            return;
        }
        if (this.isPrevFocused) {
            event.preventDefault();
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                var value_1 = this.element.value;
                this.element.focus();
                this.isPrevFocused = false;
                var ele_1 = this.element;
                setTimeout(function () {
                    _this.setElementValue(value_1, ele_1);
                }, 200);
            }
        }
        else {
            this.isFocused = false;
            if (!this.element.value.length) {
                this.setProperties({ value: null }, true);
            }
            var parsedInput = this.instance.getNumberParser({ format: 'n' })(this.element.value);
            this.updateValue(parsedInput);
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mousewheel DOMMouseScroll', this.mouseWheel);
            }
        }
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (formElement) {
            var element = this.element.nextElementSibling;
            var focusEvent = document.createEvent('FocusEvent');
            focusEvent.initEvent('focusout', false, true);
            element.dispatchEvent(focusEvent);
        }
    };
    ;
    NumericTextBox.prototype.mouseDownOnSpinner = function (event) {
        var _this = this;
        if (this.isFocused) {
            this.isPrevFocused = true;
            event.preventDefault();
        }
        if (!this.getElementData(event)) {
            return;
        }
        var result = this.getElementData(event);
        var target = event.currentTarget;
        var action = (target.classList.contains(SPINUP)) ? INCREMENT : DECREMENT;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'mouseleave', this.mouseUpClick, this);
        this.timeOut = setInterval(function () { _this.isCalled = true; _this.action(action, event); }, 150);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup', this.mouseUpClick, this);
    };
    NumericTextBox.prototype.touchMoveOnSpinner = function (event) {
        var target = document.elementFromPoint(event.clientX, event.clientY);
        if (!(target.classList.contains(SPINICON))) {
            clearInterval(this.timeOut);
        }
    };
    NumericTextBox.prototype.mouseUpOnSpinner = function (event) {
        if (this.isPrevFocused) {
            this.element.focus();
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                this.isPrevFocused = false;
            }
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            event.preventDefault();
        }
        if (!this.getElementData(event)) {
            return;
        }
        var target = event.currentTarget;
        var action = (target.classList.contains(SPINUP)) ? INCREMENT : DECREMENT;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mouseleave', this.mouseUpClick);
        if (!this.isCalled) {
            this.action(action, event);
        }
        this.isCalled = false;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mouseup', this.mouseUpClick);
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (formElement) {
            var element = this.element.nextElementSibling;
            var keyupEvent = document.createEvent('KeyboardEvent');
            keyupEvent.initEvent('keyup', false, true);
            element.dispatchEvent(keyupEvent);
        }
    };
    NumericTextBox.prototype.getElementData = function (event) {
        if ((event.which && event.which === 3) || (event.button && event.button === 2)
            || !this.enabled || this.readonly) {
            return false;
        }
        clearInterval(this.timeOut);
        return true;
    };
    NumericTextBox.prototype.floatLabelTypeUpdate = function () {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].removeFloating(this.inputWrapper);
        var hiddenInput = this.hiddenInput;
        this.hiddenInput.remove();
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].addFloating(this.element, this.floatLabelType, this.placeholder, this.createElement);
        this.container.insertBefore(hiddenInput, this.container.childNodes[1]);
    };
    NumericTextBox.prototype.mouseUpClick = function (event) {
        event.stopPropagation();
        clearInterval(this.timeOut);
        this.isCalled = false;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinUp, 'mouseleave', this.mouseUpClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.spinDown, 'mouseleave', this.mouseUpClick);
    };
    /**
     * Increments the NumericTextBox value with the specified step value.
     * @param  {number} step - Specifies the value used to increment the NumericTextBox value.
     * if its not given then numeric value will be incremented based on the step property value.
     */
    NumericTextBox.prototype.increment = function (step) {
        if (step === void 0) { step = this.step; }
        this.isInteract = false;
        this.changeValue(this.performAction(this.value, step, INCREMENT));
        this.raiseChangeEvent();
    };
    /**
     * Decrements the NumericTextBox value with specified step value.
     * @param  {number} step - Specifies the value used to decrement the NumericTextBox value.
     * if its not given then numeric value will be decremented based on the step property value.
     */
    NumericTextBox.prototype.decrement = function (step) {
        if (step === void 0) { step = this.step; }
        this.isInteract = false;
        this.changeValue(this.performAction(this.value, step, DECREMENT));
        this.raiseChangeEvent();
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers.
     * Also it maintains the initial input element from the DOM.
     * @method destroy
     * @return {void}
     */
    NumericTextBox.prototype.destroy = function () {
        this.unwireEvents();
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.hiddenInput);
            if (this.showSpinButton) {
                this.unwireSpinBtnEvents();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.spinUp);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.spinDown);
            }
            var attrArray = ['aria-labelledby', 'role', 'autocomplete', 'aria-readonly',
                'autocorrect', 'aria-disabled', 'aria-placeholder', 'autocapitalize',
                'spellcheck', 'aria-autocomplete', 'tabindex', 'aria-valuemin',
                'aria-valuemax', 'aria-live', 'aria-valuenow', 'aria-invalid'];
            for (var i = 0; i < attrArray.length; i++) {
                this.element.removeAttribute(attrArray[i]);
            }
            this.element.classList.remove('e-input');
            this.container.insertAdjacentElement('afterend', this.element);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.container);
            _super.prototype.destroy.call(this);
        }
    };
    /**
     * Returns the value of NumericTextBox with the format applied to the NumericTextBox.
     */
    NumericTextBox.prototype.getText = function () {
        return this.element.value;
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    NumericTextBox.prototype.focusIn = function () {
        if (document.activeElement !== this.element && this.enabled) {
            this.element.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.container], [NUMERIC_FOCUS]);
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    NumericTextBox.prototype.focusOut = function () {
        if (document.activeElement === this.element && this.enabled) {
            this.element.blur();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.container], [NUMERIC_FOCUS]);
        }
    };
    /**
     * Gets the properties to be maintained in the persisted state.
     * @return {string}
     */
    NumericTextBox.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Calls internally if any of the property value is changed.
     * @private
     */
    NumericTextBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        var elementVal;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'width':
                    this.setElementWidth(newProp.width);
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'enabled':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnabled(newProp.enabled, this.element);
                    break;
                case 'enableRtl':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnableRtl(newProp.enableRtl, [this.container]);
                    break;
                case 'readonly':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setReadonly(newProp.readonly, this.element);
                    if (this.readonly) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-readonly': 'true' });
                    }
                    else {
                        this.element.removeAttribute('aria-readonly');
                    }
                    break;
                case 'htmlAttributes':
                    this.updateHTMLAttrToElement();
                    this.updateHTMLAttrToWrapper();
                    this.updateDataAttribute(true);
                    this.checkAttributes(true);
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].validateInputType(this.container, this.element);
                    break;
                case 'placeholder':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(newProp.placeholder, this.element);
                    break;
                case 'step':
                    this.step = newProp.step;
                    this.validateStep();
                    break;
                case 'showSpinButton':
                    this.updateSpinButton(newProp);
                    break;
                case 'showClearButton':
                    this.updateClearButton(newProp);
                    break;
                case 'floatLabelType':
                    this.floatLabelType = newProp.floatLabelType;
                    this.floatLabelTypeUpdate();
                    break;
                case 'value':
                    this.isDynamicChange = (this.isAngular || this.isVue) && this.preventChange;
                    this.updateValue(newProp.value);
                    if (this.isDynamicChange) {
                        this.preventChange = false;
                        this.isDynamicChange = false;
                    }
                    break;
                case 'min':
                case 'max':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(prop, newProp), this);
                    this.validateMinMax();
                    this.updateValue(this.value);
                    break;
                case 'strictMode':
                    this.strictMode = newProp.strictMode;
                    this.updateValue(this.value);
                    this.validateState();
                    break;
                case 'locale':
                    this.initCultureFunc();
                    this.l10n.setLocale(this.locale);
                    this.setSpinButton();
                    this.updatePlaceholder();
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.element);
                    this.updateValue(this.value);
                    break;
                case 'currency':
                    var propVal = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(prop, newProp);
                    this.setProperties({ currencyCode: propVal }, true);
                    this.updateCurrency(prop, propVal);
                    break;
                case 'currencyCode':
                    var propValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(prop, newProp);
                    this.setProperties({ currency: propValue }, true);
                    this.updateCurrency('currency', propValue);
                    break;
                case 'format':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(prop, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(prop, newProp), this);
                    this.initCultureInfo();
                    this.updateValue(this.value);
                    break;
                case 'decimals':
                    this.decimals = newProp.decimals;
                    this.updateValue(this.value);
            }
        }
    };
    NumericTextBox.prototype.updateClearButton = function (newProp) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            if (this.showClearButton) {
                this.inputWrapper.clearButton = this.container.querySelector('.e-clear-icon');
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].wireClearBtnEvents(this.element, this.inputWrapper.clearButton, this.inputWrapper.container);
            }
        }
        else {
            _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setClearButton(newProp.showClearButton, this.element, this.inputWrapper, undefined, this.createElement);
            this.bindClearEvent();
        }
    };
    NumericTextBox.prototype.updateSpinButton = function (newProp) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            if (this.showSpinButton) {
                this.spinDown = this.container.querySelector('.' + SPINDOWN);
                this.spinUp = this.container.querySelector('.' + SPINUP);
                this.wireSpinBtnEvents();
            }
        }
        else {
            if (newProp.showSpinButton) {
                this.spinBtnCreation();
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.spinUp);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.spinDown);
            }
        }
    };
    /**
     * Gets the component name
     * @private
     */
    NumericTextBox.prototype.getModuleName = function () {
        return 'numerictextbox';
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], NumericTextBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(-(Number.MAX_VALUE))
    ], NumericTextBox.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(Number.MAX_VALUE)
    ], NumericTextBox.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1)
    ], NumericTextBox.prototype, "step", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], NumericTextBox.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], NumericTextBox.prototype, "showSpinButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], NumericTextBox.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], NumericTextBox.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], NumericTextBox.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], NumericTextBox.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('n2')
    ], NumericTextBox.prototype, "format", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "decimals", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "currency", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], NumericTextBox.prototype, "currencyCode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], NumericTextBox.prototype, "strictMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], NumericTextBox.prototype, "validateDecimalOnType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], NumericTextBox.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], NumericTextBox.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], NumericTextBox.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], NumericTextBox.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], NumericTextBox.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], NumericTextBox.prototype, "blur", void 0);
    NumericTextBox = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], NumericTextBox);
    return NumericTextBox;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/slider/index.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/slider/index.js ***!
  \******************************************************************/
/*! exports provided: TicksData, ColorRangeData, LimitData, TooltipData, Slider */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slider */ "./ej2-resources/18.4.46/scripts/ej2-inputs/slider/slider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TicksData", function() { return _slider__WEBPACK_IMPORTED_MODULE_0__["TicksData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorRangeData", function() { return _slider__WEBPACK_IMPORTED_MODULE_0__["ColorRangeData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LimitData", function() { return _slider__WEBPACK_IMPORTED_MODULE_0__["LimitData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipData", function() { return _slider__WEBPACK_IMPORTED_MODULE_0__["TooltipData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return _slider__WEBPACK_IMPORTED_MODULE_0__["Slider"]; });

/**
 * Slider modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/slider/slider.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/slider/slider.js ***!
  \*******************************************************************/
/*! exports provided: TicksData, ColorRangeData, LimitData, TooltipData, Slider */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TicksData", function() { return TicksData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorRangeData", function() { return ColorRangeData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LimitData", function() { return LimitData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipData", function() { return TooltipData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






/**
 * Configures the ticks data of the Slider.
 */
var TicksData = /** @__PURE__ @class */ (function (_super) {
    __extends(TicksData, _super);
    function TicksData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], TicksData.prototype, "placement", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(10)
    ], TicksData.prototype, "largeStep", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1)
    ], TicksData.prototype, "smallStep", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TicksData.prototype, "showSmallTicks", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TicksData.prototype, "format", void 0);
    return TicksData;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * It illustrates the color track data in slider.
 * {% codeBlock src='slider/colorrange/index.md' %}{% endcodeBlock %}
 */
var ColorRangeData = /** @__PURE__ @class */ (function (_super) {
    __extends(ColorRangeData, _super);
    function ColorRangeData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ColorRangeData.prototype, "color", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ColorRangeData.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ColorRangeData.prototype, "end", void 0);
    return ColorRangeData;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * It illustrates the limit data in slider.
 * {% codeBlock src='slider/limits/index.md' %}{% endcodeBlock %}
 */
var LimitData = /** @__PURE__ @class */ (function (_super) {
    __extends(LimitData, _super);
    function LimitData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], LimitData.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], LimitData.prototype, "minStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], LimitData.prototype, "minEnd", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], LimitData.prototype, "maxStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], LimitData.prototype, "maxEnd", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], LimitData.prototype, "startHandleFixed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], LimitData.prototype, "endHandleFixed", void 0);
    return LimitData;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * It illustrates the tooltip data in slider.
 */
var TooltipData = /** @__PURE__ @class */ (function (_super) {
    __extends(TooltipData, _super);
    function TooltipData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], TooltipData.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Before')
    ], TooltipData.prototype, "placement", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Focus')
    ], TooltipData.prototype, "showOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TooltipData.prototype, "isVisible", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TooltipData.prototype, "format", void 0);
    return TooltipData;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

var bootstrapTooltipOffset = 6;
var bootstrap4TooltipOffset = 3;
var classNames = {
    root: 'e-slider',
    rtl: 'e-rtl',
    sliderHiddenInput: 'e-slider-input',
    controlWrapper: 'e-control-wrapper',
    sliderHandle: 'e-handle',
    rangeBar: 'e-range',
    sliderButton: 'e-slider-button',
    firstButton: 'e-first-button',
    secondButton: 'e-second-button',
    scale: 'e-scale',
    tick: 'e-tick',
    large: 'e-large',
    tickValue: 'e-tick-value',
    sliderTooltip: 'e-slider-tooltip',
    sliderHover: 'e-slider-hover',
    sliderFirstHandle: 'e-handle-first',
    sliderSecondHandle: 'e-handle-second',
    sliderDisabled: 'e-disabled',
    sliderContainer: 'e-slider-container',
    horizontalTooltipBefore: 'e-slider-horizontal-before',
    horizontalTooltipAfter: 'e-slider-horizontal-after',
    verticalTooltipBefore: 'e-slider-vertical-before',
    verticalTooltipAfter: 'e-slider-vertical-after',
    materialTooltip: 'e-material-tooltip',
    materialTooltipOpen: 'e-material-tooltip-open',
    materialTooltipActive: 'e-tooltip-active',
    materialSlider: 'e-material-slider',
    sliderTrack: 'e-slider-track',
    sliderHorizantalColor: 'e-slider-horizantal-color',
    sliderVerticalColor: 'e-slider-vertical-color',
    sliderHandleFocused: 'e-handle-focused',
    verticalSlider: 'e-vertical',
    horizontalSlider: 'e-horizontal',
    sliderHandleStart: 'e-handle-start',
    sliderTooltipStart: 'e-material-tooltip-start',
    sliderTabHandle: 'e-tab-handle',
    sliderButtonIcon: 'e-button-icon',
    sliderSmallSize: 'e-small-size',
    sliderTickPosition: 'e-tick-pos',
    sliderFirstTick: 'e-first-tick',
    sliderLastTick: 'e-last-tick',
    sliderButtonClass: 'e-slider-btn',
    sliderTooltipWrapper: 'e-tooltip-wrap',
    sliderTabTrack: 'e-tab-track',
    sliderTabRange: 'e-tab-range',
    sliderActiveHandle: 'e-handle-active',
    sliderMaterialHandle: 'e-material-handle',
    sliderMaterialRange: 'e-material-range',
    sliderMaterialDefault: 'e-material-default',
    materialTooltipShow: 'e-material-tooltip-show',
    materialTooltipHide: 'e-material-tooltip-hide',
    readonly: 'e-read-only',
    limits: 'e-limits',
    limitBarDefault: 'e-limit-bar',
    limitBarFirst: 'e-limit-first',
    limitBarSecond: 'e-limit-second',
    dragHorizontal: 'e-drag-horizontal',
    dragVertical: 'e-drag-vertical'
};
/**
 * The Slider component allows the user to select a value or range
 * of values in-between a min and max range, by dragging the handle over the slider bar.
 * ```html
 * <div id='slider'></div>
 * ```
 * ```typescript
 * <script>
 *   var sliderObj = new Slider({ value: 10 });
 *   sliderObj.appendTo('#slider');
 * </script>
 * ```
 */
var Slider = /** @__PURE__ @class */ (function (_super) {
    __extends(Slider, _super);
    function Slider(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.horDir = 'left';
        _this.verDir = 'bottom';
        _this.transition = {
            handle: 'left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), ' +
                'top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)',
            rangeBar: 'all .4s cubic-bezier(.25, .8, .25, 1)'
        };
        _this.transitionOnMaterialTooltip = {
            handle: 'left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out',
            rangeBar: 'left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out'
        };
        _this.scaleTransform = 'transform .4s cubic-bezier(.25, .8, .25, 1)';
        _this.customAriaText = null;
        _this.drag = true;
        _this.initialTooltip = true;
        return _this;
    }
    Slider.prototype.preRender = function () {
        var localeText = { incrementTitle: 'Increase', decrementTitle: 'Decrease' };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('slider', localeText, this.locale);
        this.isElementFocused = false;
        this.tickElementCollection = [];
        this.tooltipFormatInfo = {};
        this.ticksFormatInfo = {};
        this.initCultureInfo();
        this.initCultureFunc();
        this.formChecker();
    };
    Slider.prototype.formChecker = function () {
        var formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (formElement) {
            this.isForm = true;
            // this condition needs to be checked, if the slider is going to be refreshed by `refresh()`
            // then we need to revert the slider `value` back to `formResetValue` to preserve the initial value
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formResetValue)) {
                this.setProperties({ 'value': this.formResetValue }, true);
            }
            this.formResetValue = this.value;
            if (this.type === 'Range' &&
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formResetValue) || typeof (this.formResetValue) !== 'object')) {
                this.formResetValue = [parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min)), parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))];
            }
            else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formResetValue)) {
                this.formResetValue = parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min));
            }
            this.formElement = formElement;
        }
        else {
            this.isForm = false;
        }
    };
    Slider.prototype.initCultureFunc = function () {
        this.internationalization = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
    };
    Slider.prototype.initCultureInfo = function () {
        this.tooltipFormatInfo.format = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip.format)) ? this.tooltip.format : null;
        this.ticksFormatInfo.format = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks.format)) ? this.ticks.format : null;
    };
    Slider.prototype.formatString = function (value, formatInfo) {
        var formatValue = null;
        var formatString = null;
        if ((value || value === 0)) {
            formatValue = this.formatNumber(value);
            var numberOfDecimals = this.numberOfDecimals(value);
            formatString = this.internationalization.getNumberFormat(formatInfo)(this.makeRoundNumber(value, numberOfDecimals));
        }
        return { elementVal: formatValue, formatString: formatString };
    };
    ;
    Slider.prototype.formatNumber = function (value) {
        var numberOfDecimals = this.numberOfDecimals(value);
        return this.internationalization.getNumberFormat({
            maximumFractionDigits: numberOfDecimals,
            minimumFractionDigits: numberOfDecimals, useGrouping: false
        })(value);
    };
    ;
    Slider.prototype.numberOfDecimals = function (value) {
        var decimalPart = value.toString().split('.')[1];
        var numberOfDecimals = !decimalPart || !decimalPart.length ? 0 : decimalPart.length;
        return numberOfDecimals;
    };
    Slider.prototype.makeRoundNumber = function (value, precision) {
        var decimals = precision || 0;
        return Number(value.toFixed(decimals));
    };
    ;
    Slider.prototype.fractionalToInteger = function (value) {
        value = (this.numberOfDecimals(value) === 0) ? Number(value).toFixed(this.noOfDecimals) : value;
        var tens = 1;
        for (var i = 0; i < this.noOfDecimals; i++) {
            tens *= 10;
        }
        value = Number((value * tens).toFixed(0));
        return value;
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    Slider.prototype.render = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.initialize();
        }
        this.initRender();
        this.wireEvents();
        this.setZindex();
        this.renderComplete();
    };
    Slider.prototype.initialize = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], classNames.root);
        this.setCSSClass();
    };
    Slider.prototype.setElementWidth = function (width) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(width)) {
            if (typeof width === 'number') {
                this.sliderContainer.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
            }
            else if (typeof width === 'string') {
                this.sliderContainer.style.width = (width.match(/px|%|em/)) ? (width) : (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width));
            }
        }
    };
    Slider.prototype.setCSSClass = function (oldCSSClass) {
        if (oldCSSClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldCSSClass.split(' '));
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.cssClass.split(' '));
        }
    };
    Slider.prototype.setEnabled = function () {
        if (!this.enabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.sliderContainer], [classNames.sliderDisabled]);
            if (this.tooltip.isVisible && this.tooltipElement && this.tooltip.showOn === 'Always') {
                this.tooltipElement.classList.add(classNames.sliderDisabled);
            }
            this.unwireEvents();
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.sliderContainer], [classNames.sliderDisabled]);
            if (this.tooltip.isVisible && this.tooltipElement && this.tooltip.showOn === 'Always') {
                this.tooltipElement.classList.remove(classNames.sliderDisabled);
            }
            this.wireEvents();
        }
    };
    Slider.prototype.getTheme = function (container) {
        var theme = window.getComputedStyle(container, ':after').getPropertyValue('content');
        return theme.replace(/['"]+/g, '');
    };
    /**
     * Initialize the rendering
     * @private
     */
    Slider.prototype.initRender = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.sliderContainer = this.element.parentElement;
            this.sliderTrack = this.element.querySelector('.e-slider-track');
            this.hiddenInput = this.element.parentElement.querySelector('.e-slider-input');
        }
        else {
            this.sliderContainer = this.createElement('div', { className: classNames.sliderContainer + ' ' + classNames.controlWrapper });
            this.element.parentNode.insertBefore(this.sliderContainer, this.element);
            this.sliderContainer.appendChild(this.element);
            this.sliderTrack = this.createElement('div', { className: classNames.sliderTrack });
            this.element.appendChild(this.sliderTrack);
        }
        this.setElementWidth(this.width);
        this.element.tabIndex = -1;
        this.getThemeInitialization();
        this.setHandler();
        this.createRangeBar();
        if (this.limits.enabled) {
            this.createLimitBar();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.setOrientClass();
            this.hiddenInput = (this.createElement('input', {
                attrs: {
                    type: 'hidden', value: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? this.min.toString() : this.value.toString()),
                    name: this.element.getAttribute('name') || this.element.getAttribute('id') ||
                        '_' + (Math.random() * 1000).toFixed(0) + 'slider', class: classNames.sliderHiddenInput
                }
            }));
            this.hiddenInput.tabIndex = -1;
            this.sliderContainer.appendChild(this.hiddenInput);
        }
        if (this.showButtons) {
            this.setButtons();
        }
        this.setEnableRTL();
        if (this.type === 'Range') {
            this.rangeValueUpdate();
        }
        else {
            this.value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min.toString())) : this.value;
        }
        this.previousVal = this.type !== 'Range' ? this.checkHandleValue(parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.value.toString()))) :
            [this.checkHandleValue(parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.value[0].toString()))),
                this.checkHandleValue(parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.value[1].toString())))];
        this.previousChanged = this.previousVal;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.hasAttribute('name'))) {
            this.element.removeAttribute('name');
        }
        this.setValue();
        if (this.limits.enabled) {
            this.setLimitBar();
        }
        if (this.ticks.placement !== 'None') {
            this.renderScale();
        }
        if (this.tooltip.isVisible) {
            this.renderTooltip();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            if (!this.enabled) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.sliderContainer], [classNames.sliderDisabled]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.sliderContainer], [classNames.sliderDisabled]);
            }
            if (this.readonly) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.sliderContainer], [classNames.readonly]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.sliderContainer], [classNames.readonly]);
            }
        }
    };
    Slider.prototype.getThemeInitialization = function () {
        this.isMaterial = this.getTheme(this.sliderContainer) === 'material'
            || this.getTheme(this.sliderContainer) === 'material-dark';
        this.isBootstrap = this.getTheme(this.sliderContainer) === 'bootstrap'
            || this.getTheme(this.sliderContainer) === 'bootstrap-dark';
        this.isBootstrap4 = this.getTheme(this.sliderContainer) === 'bootstrap4';
        this.isMaterialTooltip = this.isMaterial && this.type !== 'Range' && this.tooltip.isVisible;
    };
    Slider.prototype.createRangeBar = function () {
        if (this.type !== 'Default') {
            this.rangeBar = (this.createElement('div', { attrs: { class: classNames.rangeBar } }));
            this.element.appendChild(this.rangeBar);
            if (this.drag && this.type === 'Range') {
                if (this.orientation === 'Horizontal') {
                    this.rangeBar.classList.add(classNames.dragHorizontal);
                }
                else {
                    this.rangeBar.classList.add(classNames.dragVertical);
                }
            }
        }
    };
    Slider.prototype.createLimitBar = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.limitBarFirst = this.element.querySelectorAll('.e-limits')[0];
            if (this.type === 'Range') {
                this.limitBarSecond = this.element.querySelectorAll('.e-limit-second')[0];
            }
        }
        else {
            var firstElementClassName = this.type !== 'Range' ? classNames.limitBarDefault :
                classNames.limitBarFirst;
            firstElementClassName += ' ' + classNames.limits;
            this.limitBarFirst = (this.createElement('div', {
                attrs: { class: firstElementClassName }
            }));
            this.element.appendChild(this.limitBarFirst);
            if (this.type === 'Range') {
                this.limitBarSecond = (this.createElement('div', {
                    attrs: {
                        class: classNames.limitBarSecond + ' ' + classNames.limits
                    }
                }));
                this.element.appendChild(this.limitBarSecond);
            }
        }
    };
    Slider.prototype.setOrientClass = function () {
        if (this.orientation !== 'Vertical') {
            this.sliderContainer.classList.remove(classNames.verticalSlider);
            this.sliderContainer.classList.add(classNames.horizontalSlider);
            this.firstHandle.setAttribute('aria-orientation', 'horizontal');
            if (this.type === 'Range') {
                this.secondHandle.setAttribute('aria-orientation', 'horizontal');
            }
        }
        else {
            this.sliderContainer.classList.remove(classNames.horizontalSlider);
            this.sliderContainer.classList.add(classNames.verticalSlider);
            this.firstHandle.setAttribute('aria-orientation', 'vertical');
            if (this.type === 'Range') {
                this.secondHandle.setAttribute('aria-orientation', 'vertical');
            }
        }
    };
    Slider.prototype.setAriaAttributes = function (element) {
        var _this = this;
        var min = this.min;
        var max = this.max;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0) {
            min = this.customValues[0];
            max = this.customValues[this.customValues.length - 1];
        }
        if (this.type !== 'Range') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, {
                'aria-valuemin': min.toString(), 'aria-valuemax': max.toString()
            });
        }
        else {
            var range = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0 ?
                [[min.toString(), (this.customValues[this.value[1]]).toString()],
                    [(this.customValues[this.value[0]]).toString(), max.toString()]] :
                [[min.toString(), this.value[1].toString()], [this.value[0].toString(), max.toString()]];
            range.forEach(function (range, index) {
                var element = index === 0 ? _this.firstHandle : _this.secondHandle;
                if (element) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, {
                        'aria-valuemin': range[0], 'aria-valuemax': range[1]
                    });
                }
            });
        }
    };
    Slider.prototype.createSecondHandle = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.secondHandle = this.element.querySelector('.e-handle-second');
        }
        else {
            this.secondHandle = this.createElement('div', {
                attrs: {
                    class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
                }
            });
            this.secondHandle.classList.add(classNames.sliderSecondHandle);
            this.element.appendChild(this.secondHandle);
        }
    };
    Slider.prototype.createFirstHandle = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.firstHandle = this.element.querySelector('.e-handle-first');
        }
        else {
            this.firstHandle = this.createElement('div', {
                attrs: {
                    class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
                }
            });
            this.firstHandle.classList.add(classNames.sliderFirstHandle);
            this.element.appendChild(this.firstHandle);
        }
        if (this.isMaterialTooltip) {
            this.materialHandle = this.createElement('div', {
                attrs: {
                    class: classNames.sliderHandle + ' ' +
                        classNames.sliderMaterialHandle
                }
            });
            this.element.appendChild(this.materialHandle);
        }
    };
    Slider.prototype.wireFirstHandleEvt = function (destroy) {
        if (!destroy) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstHandle, 'mousedown touchstart', this.handleFocus, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstHandle, 'transitionend', this.transitionEnd, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstHandle, 'mouseenter touchenter', this.handleOver, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstHandle, 'mouseleave touchend', this.handleLeave, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstHandle, 'mousedown touchstart', this.handleFocus);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstHandle, 'transitionend', this.transitionEnd);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstHandle, 'mouseenter touchenter', this.handleOver);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstHandle, 'mouseleave touchend', this.handleLeave);
        }
    };
    Slider.prototype.wireSecondHandleEvt = function (destroy) {
        if (!destroy) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondHandle, 'mousedown touchstart', this.handleFocus, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondHandle, 'transitionend', this.transitionEnd, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondHandle, 'mouseenter touchenter', this.handleOver, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondHandle, 'mouseleave touchend', this.handleLeave, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondHandle, 'mousedown touchstart', this.handleFocus);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondHandle, 'transitionend', this.transitionEnd);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondHandle, 'mouseenter touchenter', this.handleOver);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondHandle, 'mouseleave touchend', this.handleLeave);
        }
    };
    Slider.prototype.handleStart = function () {
        if (this.type !== 'Range') {
            this.firstHandle.classList[this.handlePos1 === 0 ? 'add' : 'remove'](classNames.sliderHandleStart);
            if (this.isMaterialTooltip) {
                this.materialHandle.classList[this.handlePos1 === 0 ? 'add' : 'remove'](classNames.sliderHandleStart);
                if (this.tooltipElement) {
                    this.tooltipElement.classList[this.handlePos1 === 0 ? 'add' : 'remove'](classNames.sliderTooltipStart);
                }
            }
        }
    };
    Slider.prototype.transitionEnd = function (e) {
        if (e.propertyName !== 'transform') {
            this.handleStart();
            this.getHandle().style.transition = 'none';
            if (this.type !== 'Default') {
                this.rangeBar.style.transition = 'none';
            }
            if (this.isMaterial && this.tooltip.isVisible && this.type === 'Default') {
                this.tooltipElement.style.transition = this.transition.handle;
            }
            this.tooltipToggle(this.getHandle());
            this.closeTooltip();
        }
    };
    Slider.prototype.handleFocusOut = function () {
        if (this.firstHandle.classList.contains(classNames.sliderHandleFocused)) {
            this.firstHandle.classList.remove(classNames.sliderHandleFocused);
        }
        if (this.type === 'Range') {
            if (this.secondHandle.classList.contains(classNames.sliderHandleFocused)) {
                this.secondHandle.classList.remove(classNames.sliderHandleFocused);
            }
        }
    };
    Slider.prototype.handleFocus = function (e) {
        this.focusSliderElement();
        this.sliderBarClick(e);
        if (e.currentTarget === this.firstHandle) {
            this.firstHandle.classList.add(classNames.sliderHandleFocused);
        }
        else {
            this.secondHandle.classList.add(classNames.sliderHandleFocused);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousemove touchmove', this.sliderBarMove, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup touchend', this.sliderBarUp, this);
    };
    Slider.prototype.handleOver = function (e) {
        if (this.tooltip.isVisible && this.tooltip.showOn === 'Hover') {
            this.tooltipToggle(e.currentTarget);
        }
    };
    Slider.prototype.handleLeave = function (e) {
        if (this.tooltip.isVisible && this.tooltip.showOn === 'Hover' &&
            !e.currentTarget.classList.contains(classNames.sliderHandleFocused) &&
            !e.currentTarget.classList.contains(classNames.sliderTabHandle)) {
            this.closeTooltip();
        }
    };
    Slider.prototype.setHandler = function () {
        if (this.min > this.max) {
            this.min = this.max;
        }
        this.createFirstHandle();
        if (this.type === 'Range') {
            this.createSecondHandle();
        }
    };
    Slider.prototype.setEnableRTL = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.enableRtl && this.orientation !== 'Vertical' ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.sliderContainer], classNames.rtl) :
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.sliderContainer], classNames.rtl);
            var preDir = (this.orientation !== 'Vertical') ? this.horDir : this.verDir;
            if (this.enableRtl) {
                this.horDir = 'right';
                this.verDir = 'bottom';
            }
            else {
                this.horDir = 'left';
                this.verDir = 'bottom';
            }
            var currDir = (this.orientation !== 'Vertical') ? this.horDir : this.verDir;
            if (preDir !== currDir) {
                if (this.orientation === 'Horizontal') {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.firstHandle, { 'right': '', 'left': 'auto' });
                    if (this.type === 'Range') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.secondHandle, { 'top': '', 'left': 'auto' });
                    }
                }
            }
        }
        this.setBarColor();
    };
    Slider.prototype.tooltipValue = function () {
        var _this = this;
        var text;
        var args = {
            value: this.value,
            text: ''
        };
        if (this.initialTooltip) {
            this.initialTooltip = false;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                args.text = this.formatContent(this.tooltipFormatInfo, false);
            }
            else {
                this.setTooltipContent();
                args.text = text = this.tooltipObj.content;
            }
            this.trigger('tooltipChange', args, function (observedArgs) {
                _this.addTooltipClass(observedArgs.text);
                if (text !== observedArgs.text) {
                    _this.customAriaText = observedArgs.text;
                    _this.tooltipObj.content = observedArgs.text;
                    _this.setAriaAttrValue(_this.firstHandle);
                    if (_this.type === 'Range') {
                        _this.setAriaAttrValue(_this.secondHandle);
                    }
                }
            });
            if (this.isMaterialTooltip) {
                this.setPreviousVal('change', this.value);
            }
        }
    };
    Slider.prototype.setTooltipContent = function () {
        var content;
        content = this.formatContent(this.tooltipFormatInfo, false);
        this.tooltipObj.content = content;
    };
    Slider.prototype.formatContent = function (formatInfo, ariaContent) {
        var content = '';
        var handle1 = this.handleVal1;
        var handle2 = this.handleVal2;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0) {
            handle1 = this.customValues[this.handleVal1];
            handle2 = this.customValues[this.handleVal2];
        }
        if (!ariaContent) {
            if (this.type === 'Range') {
                if (this.enableRtl && this.orientation !== 'Vertical') {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(formatInfo.format)) ? (this.formatString(handle2, formatInfo)
                        .formatString + ' - ' + this.formatString(handle1, formatInfo).formatString) :
                        (handle2.toString() + ' - ' + handle1.toString());
                }
                else {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(formatInfo.format)) ? (this.formatString(handle1, formatInfo)
                        .formatString + ' - ' + this.formatString(handle2, formatInfo).formatString) :
                        (handle1.toString() + ' - ' + handle2.toString());
                }
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(handle1)) {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(formatInfo.format)) ?
                        this.formatString(handle1, formatInfo).formatString : handle1.toString();
                }
            }
            return content;
        }
        else {
            if (this.type === 'Range') {
                if (this.enableRtl && this.orientation !== 'Vertical') {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip.format)) ?
                        (this.formatString(handle2, formatInfo).elementVal + ' - ' +
                            this.formatString(handle1, formatInfo).elementVal) :
                        (handle2.toString() + ' - ' + handle1.toString());
                }
                else {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip.format)) ?
                        (this.formatString(handle1, formatInfo).elementVal + ' - ' +
                            this.formatString(handle2, formatInfo).elementVal) :
                        (handle1.toString() + ' - ' + handle2.toString());
                }
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(handle1)) {
                    content = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltip.format)) ?
                        this.formatString(handle1, formatInfo).elementVal : handle1.toString();
                }
            }
            return content;
        }
    };
    Slider.prototype.addTooltipClass = function (content) {
        if (this.isMaterialTooltip) {
            var count = content.toString().length;
            if (!this.tooltipElement) {
                var cssClass = count > 4 ? classNames.sliderMaterialRange : classNames.sliderMaterialDefault;
                this.tooltipObj.cssClass = classNames.sliderTooltip + ' ' + cssClass;
            }
            else {
                var cssClass = count > 4 ?
                    { oldCss: classNames.sliderMaterialDefault, newCss: classNames.sliderMaterialRange } :
                    { oldCss: classNames.sliderMaterialRange, newCss: classNames.sliderMaterialDefault };
                this.tooltipElement.classList.remove(cssClass.oldCss);
                if (!this.tooltipElement.classList.contains(cssClass.newCss)) {
                    this.tooltipElement.classList.add(cssClass.newCss);
                    this.tooltipElement.style.transform = count > 4 ? 'scale(1)' :
                        this.getTooltipTransformProperties(this.previousTooltipClass).rotate;
                }
            }
        }
    };
    Slider.prototype.tooltipPlacement = function () {
        return this.orientation === 'Horizontal' ? (this.tooltip.placement === 'Before' ? 'TopCenter' : 'BottomCenter') :
            (this.tooltip.placement === 'Before' ? 'LeftCenter' : 'RightCenter');
    };
    Slider.prototype.tooltipBeforeOpen = function (args) {
        this.tooltipElement = args.element;
        if (this.tooltip.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipElement], this.tooltip.cssClass.split(' ').filter(function (css) { return css; }));
        }
        args.target.removeAttribute('aria-describedby');
        if (this.isMaterialTooltip) {
            this.tooltipElement.firstElementChild.classList.add(classNames.materialTooltipHide);
            this.handleStart();
            this.setTooltipTransform();
        }
    };
    Slider.prototype.tooltipCollision = function (position) {
        if (this.isBootstrap || this.isBootstrap4 || (this.isMaterial && !this.isMaterialTooltip)) {
            var tooltipOffsetValue = this.isBootstrap4 ? bootstrap4TooltipOffset : bootstrapTooltipOffset;
            switch (position) {
                case 'TopCenter':
                    this.tooltipObj.setProperties({ 'offsetY': -(tooltipOffsetValue) }, false);
                    break;
                case 'BottomCenter':
                    this.tooltipObj.setProperties({ 'offsetY': tooltipOffsetValue }, false);
                    break;
                case 'LeftCenter':
                    this.tooltipObj.setProperties({ 'offsetX': -(tooltipOffsetValue) }, false);
                    break;
                case 'RightCenter':
                    this.tooltipObj.setProperties({ 'offsetX': tooltipOffsetValue }, false);
                    break;
            }
        }
    };
    Slider.prototype.materialTooltipEventCallBack = function (event) {
        this.sliderBarClick(event);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousemove touchmove', this.sliderBarMove, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup touchend', this.sliderBarUp, this);
    };
    Slider.prototype.wireMaterialTooltipEvent = function (destroy) {
        if (this.isMaterialTooltip) {
            if (!destroy) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.tooltipElement, 'mousedown touchstart', this.materialTooltipEventCallBack, this);
            }
            else {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.tooltipElement, 'mousedown touchstart', this.materialTooltipEventCallBack);
            }
        }
    };
    Slider.prototype.tooltipPositionCalculation = function (position) {
        var cssClass;
        switch (position) {
            case 'TopCenter':
                cssClass = classNames.horizontalTooltipBefore;
                break;
            case 'BottomCenter':
                cssClass = classNames.horizontalTooltipAfter;
                break;
            case 'LeftCenter':
                cssClass = classNames.verticalTooltipBefore;
                break;
            case 'RightCenter':
                cssClass = classNames.verticalTooltipAfter;
                break;
        }
        return cssClass;
    };
    Slider.prototype.getTooltipTransformProperties = function (className) {
        var transformProperties;
        if (this.tooltipElement) {
            var position = this.orientation === 'Horizontal' ?
                ((this.tooltipElement.clientHeight + 14) - (this.tooltipElement.clientHeight / 2)) :
                ((this.tooltipElement.clientWidth + 14) - (this.tooltipElement.clientWidth / 2));
            transformProperties = this.orientation === 'Horizontal' ?
                (className === classNames.horizontalTooltipBefore ? { rotate: 'rotate(45deg)', translate: "translateY(" + position + "px)" } :
                    { rotate: 'rotate(225deg)', translate: "translateY(" + -(position) + "px)" }) :
                (className === classNames.verticalTooltipBefore ? { rotate: 'rotate(-45deg)', translate: "translateX(" + position + "px)" } :
                    { rotate: 'rotate(-225deg)', translate: "translateX(" + (-position) + "px)" });
        }
        return transformProperties;
    };
    Slider.prototype.openMaterialTooltip = function () {
        var _this = this;
        if (this.isMaterialTooltip) {
            this.refreshTooltip(this.firstHandle);
            var tooltipContentElement = this.tooltipElement.firstElementChild;
            tooltipContentElement.classList.remove(classNames.materialTooltipHide);
            tooltipContentElement.classList.add(classNames.materialTooltipShow);
            this.firstHandle.style.cursor = 'default';
            this.tooltipElement.style.transition = this.scaleTransform;
            this.tooltipElement.classList.add(classNames.materialTooltipOpen);
            this.materialHandle.style.transform = 'scale(0)';
            if (tooltipContentElement.innerText.length > 4) {
                this.tooltipElement.style.transform = 'scale(1)';
            }
            else {
                this.tooltipElement.style.transform = this.getTooltipTransformProperties(this.previousTooltipClass).rotate;
            }
            if (this.type === 'Default') {
                setTimeout(function () { _this.tooltipElement.style.transition = _this.transition.handle; }, 2500);
            }
            else {
                setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
            }
        }
    };
    Slider.prototype.closeMaterialTooltip = function () {
        var _this = this;
        if (this.isMaterialTooltip) {
            var tooltipContentElement = this.tooltipElement.firstElementChild;
            this.tooltipElement.style.transition = this.scaleTransform;
            tooltipContentElement.classList.remove(classNames.materialTooltipShow);
            tooltipContentElement.classList.add(classNames.materialTooltipHide);
            this.firstHandle.style.cursor = '-webkit-grab';
            this.firstHandle.style.cursor = 'grab';
            if (this.materialHandle) {
                this.materialHandle.style.transform = 'scale(1)';
            }
            this.tooltipElement.classList.remove(classNames.materialTooltipOpen);
            this.setTooltipTransform();
            this.tooltipTarget = undefined;
            setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
        }
    };
    Slider.prototype.checkTooltipPosition = function (args) {
        var tooltipClass = this.tooltipPositionCalculation(args.collidedPosition);
        if (this.tooltipCollidedPosition === undefined ||
            this.tooltipCollidedPosition !== args.collidedPosition || !args.element.classList.contains(tooltipClass)) {
            if (this.isMaterialTooltip) {
                if (tooltipClass !== undefined) {
                    args.element.classList.remove(this.previousTooltipClass);
                    args.element.classList.add(tooltipClass);
                    this.previousTooltipClass = tooltipClass;
                }
                if (args.element.style.transform && args.element.classList.contains(classNames.materialTooltipOpen) &&
                    args.element.firstElementChild.innerText.length <= 4) {
                    args.element.style.transform = this.getTooltipTransformProperties(this.previousTooltipClass).rotate;
                }
            }
            this.tooltipCollidedPosition = args.collidedPosition;
        }
        if (this.isMaterialTooltip && this.tooltipElement && this.tooltipElement.style.transform.indexOf('translate') !== -1) {
            this.setTooltipTransform();
        }
    };
    Slider.prototype.setTooltipTransform = function () {
        var transformProperties = this.getTooltipTransformProperties(this.previousTooltipClass);
        if (this.tooltipElement.firstElementChild.innerText.length > 4) {
            this.tooltipElement.style.transform = transformProperties.translate + " scale(0.01)";
        }
        else {
            this.tooltipElement.style.transform = transformProperties.translate + " " + transformProperties.rotate + " scale(0.01)";
        }
    };
    Slider.prototype.renderTooltip = function () {
        this.tooltipObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Tooltip"]({
            showTipPointer: this.isBootstrap || this.isMaterial || this.isBootstrap4,
            cssClass: classNames.sliderTooltip,
            height: this.isMaterial ? 30 : 'auto',
            animation: { open: { effect: 'None' }, close: { effect: 'FadeOut', duration: 500 } },
            opensOn: 'Custom',
            beforeOpen: this.tooltipBeforeOpen.bind(this),
            beforeCollision: this.checkTooltipPosition.bind(this),
            beforeClose: this.tooltipBeforeClose.bind(this),
            enableHtmlSanitizer: this.enableHtmlSanitizer
        });
        this.tooltipObj.appendTo(this.firstHandle);
        this.initializeTooltipProps();
    };
    Slider.prototype.initializeTooltipProps = function () {
        var tooltipShowOn = this.isMaterialTooltip ? 'Always' : (this.tooltip.showOn === 'Auto' ? 'Hover' : this.tooltip.showOn);
        this.setProperties({ tooltip: { showOn: tooltipShowOn } }, true);
        this.tooltipObj.position = this.tooltipPlacement();
        this.tooltipCollision(this.tooltipObj.position);
        [this.firstHandle, this.rangeBar, this.secondHandle].forEach(function (handle) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(handle)) {
                handle.style.transition = 'none';
            }
        });
        if (this.isMaterialTooltip) {
            this.sliderContainer.classList.add(classNames.materialSlider);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.tooltipValue();
            }
            this.tooltipObj.animation.close.effect = 'None';
            this.tooltipObj.open(this.firstHandle);
        }
    };
    Slider.prototype.tooltipBeforeClose = function () {
        this.tooltipElement = undefined;
        this.tooltipCollidedPosition = undefined;
    };
    Slider.prototype.setButtons = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.firstBtn = this.element.parentElement.querySelector('.e-slider-button.e-first-button');
            this.secondBtn = this.element.parentElement.querySelector('.e-slider-button.e-second-button');
        }
        else {
            this.firstBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.firstButton });
            this.firstBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
            this.firstBtn.tabIndex = -1;
            this.secondBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.secondButton });
            this.secondBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
            this.secondBtn.tabIndex = -1;
            this.sliderContainer.classList.add(classNames.sliderButtonClass);
            this.sliderContainer.appendChild(this.firstBtn);
            this.sliderContainer.appendChild(this.secondBtn);
            this.sliderContainer.appendChild(this.element);
            this.buttonTitle();
        }
    };
    Slider.prototype.buttonTitle = function () {
        var enabledRTL = this.enableRtl && this.orientation !== 'Vertical';
        this.l10n.setLocale(this.locale);
        var decrementTitle = this.l10n.getConstant('decrementTitle');
        var incrementTitle = this.l10n.getConstant('incrementTitle');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(enabledRTL ? this.secondBtn : this.firstBtn, { 'aria-label': decrementTitle, title: decrementTitle });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(enabledRTL ? this.firstBtn : this.secondBtn, { 'aria-label': incrementTitle, title: incrementTitle });
    };
    Slider.prototype.buttonFocusOut = function () {
        if (this.isMaterial) {
            this.getHandle().classList.remove('e-large-thumb-size');
        }
    };
    Slider.prototype.repeatButton = function (args) {
        var hVal = this.handleValueUpdate();
        var enabledRTL = this.enableRtl && this.orientation !== 'Vertical';
        var value;
        if (args.target.parentElement.classList.contains(classNames.firstButton)
            || args.target.classList.contains(classNames.firstButton)) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.step.toString()), true)) :
                (value = this.add(hVal, parseFloat(this.step.toString()), false));
        }
        else if (args.target.parentElement.classList.contains(classNames.secondButton)
            || (args.target.classList.contains(classNames.secondButton))) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.step.toString()), false)) :
                (value = this.add(hVal, parseFloat(this.step.toString()), true));
        }
        if (this.limits.enabled) {
            value = this.getLimitCorrectedValues(value);
        }
        if (value >= this.min && value <= this.max) {
            this.changeHandleValue(value);
            this.tooltipToggle(this.getHandle());
        }
    };
    Slider.prototype.repeatHandlerMouse = function (args) {
        args.preventDefault();
        if (args.type === ('mousedown') || args.type === ('touchstart')) {
            this.buttonClick(args);
            this.repeatInterval = setInterval(this.repeatButton.bind(this), 180, args);
        }
    };
    Slider.prototype.materialChange = function () {
        if (!this.getHandle().classList.contains('e-large-thumb-size')) {
            this.getHandle().classList.add('e-large-thumb-size');
        }
    };
    Slider.prototype.repeatHandlerUp = function (e) {
        this.changeEvent('changed', e);
        this.closeTooltip();
        clearInterval(this.repeatInterval);
        this.getHandle().focus();
    };
    Slider.prototype.customTickCounter = function (bigNum) {
        var tickCount = 4;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0) {
            if (bigNum > 4) {
                tickCount = 3;
            }
            if (bigNum > 7) {
                tickCount = 2;
            }
            if (bigNum > 14) {
                tickCount = 1;
            }
            if (bigNum > 28) {
                tickCount = 0;
            }
        }
        return tickCount;
    };
    // tslint:disable-next-line:max-func-body-length
    Slider.prototype.renderScale = function () {
        var liElementPosition = 0;
        var orien = this.orientation === 'Vertical' ? 'v' : 'h';
        var spanText;
        this.noOfDecimals = this.numberOfDecimals(this.step);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            this.ul = this.element.querySelector('ul');
        }
        else {
            this.ul = this.createElement('ul', {
                className: classNames.scale + ' ' + 'e-' + orien + '-scale ' + classNames.tick + '-' + this.ticks.placement.toLowerCase(),
                attrs: { role: 'presentation', tabIndex: '-1', 'aria-hidden': 'true' }
            });
        }
        this.ul.style.zIndex = '-1';
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isAndroid && orien === 'h') {
            this.ul.classList.add(classNames.sliderTickPosition);
        }
        var smallStep = this.ticks.smallStep;
        if (!this.ticks.showSmallTicks) {
            this.ticks.largeStep > 0 ? (smallStep = this.ticks.largeStep) :
                (smallStep = (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))) - (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min))));
        }
        else if (smallStep <= 0) {
            smallStep = parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.step));
        }
        var min = this.fractionalToInteger(this.min);
        var max = this.fractionalToInteger(this.max);
        var steps = this.fractionalToInteger(smallStep);
        var bigNum = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0 && this.customValues.length - 1;
        var customStep = this.customTickCounter(bigNum);
        var count = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0 ?
            (bigNum * customStep) + bigNum : Math.abs((max - min) / steps);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.element.appendChild(this.ul);
        }
        var li;
        var start = parseFloat(this.min.toString());
        if (orien === 'v') {
            start = parseFloat(this.max.toString());
        }
        var left = 0;
        var islargeTick;
        var tickWidth = 100 / count;
        if (tickWidth === Infinity) {
            tickWidth = 5;
        }
        for (var i = 0, y = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0 ?
            this.customValues.length - 1 : 0, k = 0; i <= count; i++) {
            li = (this.createElement('li', {
                attrs: {
                    class: classNames.tick, role: 'presentation', tabIndex: '-1',
                    'aria-hidden': 'true'
                }
            }));
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0) {
                islargeTick = i % (customStep + 1) === 0;
                if (islargeTick) {
                    if (orien === 'h') {
                        start = this.customValues[k];
                        k++;
                    }
                    else {
                        start = this.customValues[y];
                        y--;
                    }
                    li.setAttribute('title', start.toString());
                }
            }
            else {
                li.setAttribute('title', start.toString());
                if (this.numberOfDecimals(this.max) === 0 && this.numberOfDecimals(this.min) === 0 &&
                    this.numberOfDecimals(this.step) === 0) {
                    if (orien === 'h') {
                        islargeTick = ((start - parseFloat(this.min.toString())) % this.ticks.largeStep === 0) ? true : false;
                    }
                    else {
                        islargeTick = (Math.abs(start - parseFloat(this.max.toString())) % this.ticks.largeStep === 0) ? true : false;
                    }
                }
                else {
                    var largestep = this.fractionalToInteger(this.ticks.largeStep);
                    var startValue = this.fractionalToInteger(start);
                    if (orien === 'h') {
                        islargeTick = ((startValue - min) % largestep === 0) ? true : false;
                    }
                    else {
                        islargeTick = (Math.abs(startValue - parseFloat(max.toString())) % largestep === 0) ? true : false;
                    }
                }
            }
            if (islargeTick) {
                li.classList.add(classNames.large);
            }
            (orien === 'h') ? (li.style.width = tickWidth + '%') : (li.style.height = tickWidth + '%');
            var repeat = islargeTick ? (this.ticks.placement === 'Both' ? 2 : 1) : 0;
            if (islargeTick) {
                for (var j = 0; j < repeat; j++) {
                    this.createTick(li, start, tickWidth);
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
                    this.updateTicksValues(start, this.ul.children[liElementPosition]);
                    liElementPosition++;
                }
            }
            else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
                this.formatTicksValue(li, start);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
                    this.updateTicksValues(start, this.ul.children[liElementPosition]);
                    liElementPosition++;
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                this.ul.appendChild(li);
            }
            this.tickElementCollection.push(li);
            var decimalPoints = void 0;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
                if (this.numberOfDecimals(smallStep) > this.numberOfDecimals(start)) {
                    decimalPoints = this.numberOfDecimals(smallStep);
                }
                else {
                    decimalPoints = this.numberOfDecimals(start);
                }
                if (orien === 'h') {
                    start = this.makeRoundNumber(start + smallStep, decimalPoints);
                }
                else {
                    start = this.makeRoundNumber(start - smallStep, decimalPoints);
                }
                left = this.makeRoundNumber(left + smallStep, decimalPoints);
            }
        }
        this.ticksAlignment(orien, tickWidth);
    };
    Slider.prototype.updateTicksValues = function (start, liElement) {
        if (liElement.childElementCount > 0) {
            for (var i = 0; i < liElement.childElementCount; i++) {
                this.blazortTicksValue(liElement, start, liElement.children[i]);
            }
        }
        else {
            this.blazortTicksValue(liElement, start, null);
        }
    };
    Slider.prototype.blazortTicksValue = function (li, start, span) {
        var _this = this;
        var tickText = this.formatNumber(start);
        var text = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks.format) ?
            this.formatString(start, this.ticksFormatInfo).formatString : tickText;
        var eventArgs = { value: start, text: text, tickElement: li };
        this.trigger('renderingTicks', eventArgs, function (observedArgs) {
            li.setAttribute('title', observedArgs.text.toString());
            if (span) {
                if (_this.enableHtmlSanitizer) {
                    span.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(observedArgs.text.toString());
                }
                else {
                    span.innerHTML = observedArgs.text.toString();
                }
            }
        });
    };
    Slider.prototype.ticksAlignment = function (orien, tickWidth, triggerEvent) {
        if (triggerEvent === void 0) { triggerEvent = true; }
        this.firstChild = this.ul.firstElementChild;
        this.lastChild = this.ul.lastElementChild;
        this.firstChild.classList.add(classNames.sliderFirstTick);
        this.lastChild.classList.add(classNames.sliderLastTick);
        this.sliderContainer.classList.add(classNames.scale + '-' + this.ticks.placement.toLowerCase());
        if (orien === 'h') {
            this.firstChild.style.width = tickWidth / 2 + '%';
            this.lastChild.style.width = tickWidth / 2 + '%';
        }
        else {
            this.firstChild.style.height = tickWidth / 2 + '%';
            this.lastChild.style.height = tickWidth / 2 + '%';
        }
        var eventArgs = { ticksWrapper: this.ul, tickElements: this.tickElementCollection };
        if (triggerEvent) {
            this.trigger('renderedTicks', eventArgs);
        }
        this.scaleAlignment();
    };
    Slider.prototype.createTick = function (li, start, tickWidth) {
        var span = this.createElement('span', {
            className: classNames.tickValue + ' ' + classNames.tick + '-' + this.ticks.placement.toLowerCase(),
            attrs: { role: 'presentation', tabIndex: '-1', 'aria-hidden': 'true' }
        });
        li.appendChild(span);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
            this.formatTicksValue(li, start, span, tickWidth);
        }
        else {
            if (this.enableHtmlSanitizer) {
                span.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(start.toString());
            }
            else {
                span.innerHTML = start.toString();
            }
        }
    };
    Slider.prototype.formatTicksValue = function (li, start, spanElement, tickWidth) {
        var _this = this;
        var tickText = this.formatNumber(start);
        var text = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks.format) ?
            this.formatString(start, this.ticksFormatInfo).formatString : tickText;
        var eventArgs = { value: start, text: text, tickElement: li };
        this.trigger('renderingTicks', eventArgs, function (observedArgs) {
            li.setAttribute('title', observedArgs.text.toString());
            if (spanElement) {
                if (_this.enableHtmlSanitizer) {
                    spanElement.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(observedArgs.text.toString());
                }
                else {
                    spanElement.innerHTML = observedArgs.text.toString();
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.renderingTicks) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                var orien = _this.orientation === 'Horizontal' ? 'h' : 'v';
                _this.ticksAlignment(orien, tickWidth, false);
            }
        });
    };
    Slider.prototype.scaleAlignment = function () {
        this.tickValuePosition();
        var smallTick = 12;
        var largeTick = 20;
        var half = largeTick / 2;
        var orien = this.orientation === 'Vertical' ? 'v' : 'h';
        if (this.orientation === 'Vertical') {
            (this.element.getBoundingClientRect().width <= 15) ?
                this.sliderContainer.classList.add(classNames.sliderSmallSize) :
                this.sliderContainer.classList.remove(classNames.sliderSmallSize);
        }
        else {
            (this.element.getBoundingClientRect().height <= 15) ?
                this.sliderContainer.classList.add(classNames.sliderSmallSize) :
                this.sliderContainer.classList.remove(classNames.sliderSmallSize);
        }
    };
    Slider.prototype.tickValuePosition = function () {
        this.firstChild = this.element.querySelector('ul').children[0];
        var first = this.firstChild.getBoundingClientRect();
        var firstChild;
        var otherChild;
        var smallStep = this.ticks.smallStep;
        var count = Math.abs((parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))) - (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min)))) / smallStep;
        if (this.firstChild.children.length > 0) {
            firstChild = this.firstChild.children[0].getBoundingClientRect();
        }
        var tickElements = [this.sliderContainer.querySelectorAll('.' + classNames.tick + '.' +
                classNames.large + ' .' + classNames.tickValue)];
        var other;
        if (this.ticks.placement === 'Both') {
            other = [].slice.call(tickElements[0], 2);
        }
        else {
            other = [].slice.call(tickElements[0], 1);
        }
        var tickWidth = this.orientation === 'Vertical' ?
            (first.height * 2) : (first.width * 2);
        for (var i = 0; i < this.firstChild.children.length; i++) {
            if (this.orientation === 'Vertical') {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                    this.firstChild.children[i].style.top = -(firstChild.height / 2) + 'px';
                }
            }
            else {
                if (!this.enableRtl) {
                    this.firstChild.children[i].style.left = -(firstChild.width / 2) + 'px';
                }
                else {
                    this.firstChild.children[i].style.left = (tickWidth -
                        this.firstChild.children[i].getBoundingClientRect().width) / 2 + 'px';
                }
            }
        }
        for (var i = 0; i < other.length; i++) {
            otherChild = other[i].getBoundingClientRect();
            if (this.orientation === 'Vertical') {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(other[i], { top: (tickWidth - otherChild.height) / 2 + 'px' });
                }
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(other[i], { left: (tickWidth - otherChild.width) / 2 + 'px' });
            }
        }
        if (this.enableRtl && this.lastChild.children.length && count !== 0) {
            this.lastChild.children[0].style.left = -(this.lastChild.getBoundingClientRect().width / 2) + 'px';
            if (this.ticks.placement === 'Both') {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                    this.lastChild.children[1].style.left = -(this.lastChild.getBoundingClientRect().width / 2) + 'px';
                }
            }
        }
        if (count === 0) {
            if (this.orientation === 'Horizontal') {
                if (!this.enableRtl) {
                    this.firstChild.classList.remove(classNames.sliderLastTick);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                        this.firstChild.style.left = this.firstHandle.style.left;
                    }
                }
                else {
                    this.firstChild.classList.remove(classNames.sliderLastTick);
                    this.firstChild.style.right = this.firstHandle.style.right;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                        this.firstChild.children[0].style.left =
                            (this.firstChild.getBoundingClientRect().width / 2) + 2 + 'px';
                        if (this.ticks.placement === 'Both') {
                            this.firstChild.children[1].style.left =
                                (this.firstChild.getBoundingClientRect().width / 2) + 2 + 'px';
                        }
                    }
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                if (this.orientation === 'Vertical') {
                    this.firstChild.classList.remove(classNames.sliderLastTick);
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            var args = void 0;
            if (this.firstChild != null) {
                if (this.orientation === 'Horizontal') {
                    args = { firstTickPostion: this.firstChild.children[0].style.left };
                }
                else {
                    args = { firstTickPostion: -(firstChild.height / 2) + 'px' };
                }
            }
            if (other[0] != null) {
                if (this.orientation === 'Horizontal') {
                    args = { otherTicksPosition: other[0].style.left };
                }
                else {
                    args = { otherTicksPosition: (tickWidth - otherChild.height) / 2 + 'px' };
                }
            }
            if (this.firstChild != null && other[0] != null) {
                if (this.orientation === 'Horizontal') {
                    args = {
                        firstTickPostion: this.firstChild.children[0].style.left,
                        otherTicksPosition: other[0].style.left
                    };
                }
                else {
                    args = {
                        firstTickPostion: -(firstChild.height / 2) + 'px',
                        otherTicksPosition: (tickWidth - otherChild.height) / 2 + 'px'
                    };
                }
            }
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('SliderTicksData', args);
            // tslint:enable
        }
    };
    Slider.prototype.setAriaAttrValue = function (element) {
        var ariaValueText;
        var isTickFormatted = ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks.format))) ? true : false;
        var text = !isTickFormatted ?
            this.formatContent(this.ticksFormatInfo, false) : this.formatContent(this.tooltipFormatInfo, false);
        var valuenow = isTickFormatted ? this.formatContent(this.ticksFormatInfo, true) :
            this.formatContent(this.tooltipFormatInfo, true);
        text = (!this.customAriaText) ? (text) : (this.customAriaText);
        if (text.split(' - ').length === 2) {
            ariaValueText = text.split(' - ');
        }
        else {
            ariaValueText = [text, text];
        }
        this.setAriaAttributes(element);
        if (this.type !== 'Range') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-valuenow': valuenow, 'aria-valuetext': text });
        }
        else {
            (!this.enableRtl) ? ((element === this.firstHandle) ?
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-valuenow': valuenow.split(' - ')[0], 'aria-valuetext': ariaValueText[0] }) :
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-valuenow': valuenow.split(' - ')[1], 'aria-valuetext': ariaValueText[1] })) :
                ((element === this.firstHandle) ?
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-valuenow': valuenow.split(' - ')[1], 'aria-valuetext': ariaValueText[1] }) :
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, { 'aria-valuenow': valuenow.split(' - ')[0], 'aria-valuetext': ariaValueText[0] }));
        }
    };
    Slider.prototype.handleValueUpdate = function () {
        var hVal;
        if (this.type === 'Range') {
            if (this.activeHandle === 1) {
                hVal = this.handleVal1;
            }
            else {
                hVal = this.handleVal2;
            }
        }
        else {
            hVal = this.handleVal1;
        }
        return hVal;
    };
    Slider.prototype.getLimitCorrectedValues = function (value) {
        if (this.type === 'MinRange' || this.type === 'Default') {
            value = (this.getLimitValueAndPosition(value, this.limits.minStart, this.limits.minEnd))[0];
        }
        else {
            if (this.activeHandle === 1) {
                value = (this.getLimitValueAndPosition(value, this.limits.minStart, this.limits.minEnd))[0];
            }
            else {
                value = (this.getLimitValueAndPosition(value, this.limits.maxStart, this.limits.maxEnd))[0];
            }
        }
        return value;
    };
    Slider.prototype.focusSliderElement = function () {
        if (!this.isElementFocused) {
            this.element.focus();
            this.isElementFocused = true;
        }
    };
    Slider.prototype.buttonClick = function (args) {
        this.focusSliderElement();
        var value;
        var enabledRTL = this.enableRtl && this.orientation !== 'Vertical';
        var hVal = this.handleValueUpdate();
        if ((args.keyCode === 40) || (args.keyCode === 37)
            || args.currentTarget.classList.contains(classNames.firstButton)) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.step.toString()), true)) :
                (value = this.add(hVal, parseFloat(this.step.toString()), false));
        }
        else if ((args.keyCode === 38) || (args.keyCode === 39) ||
            args.currentTarget.classList.contains(classNames.secondButton)) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.step.toString()), false)) :
                (value = this.add(hVal, parseFloat(this.step.toString()), true));
        }
        else if ((args.keyCode === 33
            || args.currentTarget.classList.contains(classNames.firstButton))) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.ticks.largeStep.toString()), false)) :
                (value = this.add(hVal, parseFloat(this.ticks.largeStep.toString()), true));
        }
        else if ((args.keyCode === 34) ||
            args.currentTarget.classList.contains(classNames.secondButton)) {
            enabledRTL ? (value = this.add(hVal, parseFloat(this.ticks.largeStep.toString()), true)) :
                (value = this.add(hVal, parseFloat(this.ticks.largeStep.toString()), false));
        }
        else if ((args.keyCode === 36)) {
            value = parseFloat(this.min.toString());
        }
        else if ((args.keyCode === 35)) {
            value = parseFloat(this.max.toString());
        }
        if (this.limits.enabled) {
            value = this.getLimitCorrectedValues(value);
        }
        this.changeHandleValue(value);
        if (this.isMaterial && !this.tooltip.isVisible &&
            !this.getHandle().classList.contains(classNames.sliderTabHandle)) {
            this.materialChange();
        }
        this.tooltipToggle(this.getHandle());
        this.getHandle().focus();
        if (args.currentTarget.classList.contains(classNames.firstButton)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstBtn, 'mouseup touchend', this.buttonUp, this);
        }
        if (args.currentTarget.classList.contains(classNames.secondButton)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondBtn, 'mouseup touchend', this.buttonUp, this);
        }
    };
    Slider.prototype.tooltipToggle = function (target) {
        if (this.isMaterialTooltip) {
            !this.tooltipElement.classList.contains(classNames.materialTooltipOpen) ?
                this.openMaterialTooltip() : this.refreshTooltip(this.firstHandle);
        }
        else {
            !this.tooltipElement ? this.openTooltip(target) : this.refreshTooltip(target);
        }
    };
    Slider.prototype.buttonUp = function (args) {
        if (args.currentTarget.classList.contains(classNames.firstButton)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstBtn, 'mouseup touchend', this.buttonUp);
        }
        if (args.currentTarget.classList.contains(classNames.secondButton)) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondBtn, 'mouseup touchend', this.buttonUp);
        }
    };
    Slider.prototype.setRangeBar = function () {
        if (this.orientation === 'Horizontal') {
            if (this.type === 'MinRange') {
                this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
            }
            else {
                this.enableRtl ? (this.rangeBar.style.right =
                    this.handlePos1 + 'px') : (this.rangeBar.style.left = this.handlePos1 + 'px');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'width': this.handlePos2 - this.handlePos1 + 'px' });
            }
        }
        else {
            if (this.type === 'MinRange') {
                this.rangeBar.style.bottom = '0px';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
            }
            else {
                this.rangeBar.style.bottom = this.handlePos1 + 'px';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'height': this.handlePos2 - this.handlePos1 + 'px' });
            }
        }
    };
    Slider.prototype.checkValidValueAndPos = function (value) {
        value = this.checkHandleValue(value);
        value = this.checkHandlePosition(value);
        return value;
    };
    Slider.prototype.setLimitBarPositions = function (fromMinPostion, fromMaxpostion, toMinPostion, toMaxpostion) {
        if (this.orientation === 'Horizontal') {
            if (!this.enableRtl) {
                this.limitBarFirst.style.left = fromMinPostion + 'px';
                this.limitBarFirst.style.width = (fromMaxpostion - fromMinPostion) + 'px';
            }
            else {
                this.limitBarFirst.style.right = fromMinPostion + 'px';
                this.limitBarFirst.style.width = (fromMaxpostion - fromMinPostion) + 'px';
            }
        }
        else {
            this.limitBarFirst.style.bottom = fromMinPostion + 'px';
            this.limitBarFirst.style.height = (fromMaxpostion - fromMinPostion) + 'px';
        }
        if (this.type === 'Range') {
            if (this.orientation === 'Horizontal') {
                if (!this.enableRtl) {
                    this.limitBarSecond.style.left = toMinPostion + 'px';
                    this.limitBarSecond.style.width = (toMaxpostion - toMinPostion) + 'px';
                }
                else {
                    this.limitBarSecond.style.right = toMinPostion + 'px';
                    this.limitBarSecond.style.width = (toMaxpostion - toMinPostion) + 'px';
                }
            }
            else {
                this.limitBarSecond.style.bottom = toMinPostion + 'px';
                this.limitBarSecond.style.height = (toMaxpostion - toMinPostion) + 'px';
            }
        }
    };
    Slider.prototype.setLimitBar = function () {
        if (this.type === 'Default' || this.type === 'MinRange') {
            var fromPosition = (this.getLimitValueAndPosition(this.limits.minStart, this.limits.minStart, this.limits.minEnd, true))[0];
            fromPosition = this.checkValidValueAndPos(fromPosition);
            var toPosition = (this.getLimitValueAndPosition(this.limits.minEnd, this.limits.minStart, this.limits.minEnd, true))[0];
            toPosition = this.checkValidValueAndPos(toPosition);
            this.setLimitBarPositions(fromPosition, toPosition);
        }
        else if (this.type === 'Range') {
            var fromMinPostion = (this.getLimitValueAndPosition(this.limits.minStart, this.limits.minStart, this.limits.minEnd, true))[0];
            fromMinPostion = this.checkValidValueAndPos(fromMinPostion);
            var fromMaxpostion = (this.getLimitValueAndPosition(this.limits.minEnd, this.limits.minStart, this.limits.minEnd, true))[0];
            fromMaxpostion = this.checkValidValueAndPos(fromMaxpostion);
            var toMinPostion = (this.getLimitValueAndPosition(this.limits.maxStart, this.limits.maxStart, this.limits.maxEnd, true))[0];
            toMinPostion = this.checkValidValueAndPos(toMinPostion);
            var toMaxpostion = (this.getLimitValueAndPosition(this.limits.maxEnd, this.limits.maxStart, this.limits.maxEnd, true))[0];
            toMaxpostion = this.checkValidValueAndPos(toMaxpostion);
            this.setLimitBarPositions(fromMinPostion, fromMaxpostion, toMinPostion, toMaxpostion);
        }
    };
    Slider.prototype.getLimitValueAndPosition = function (currentValue, minValue, maxValue, limitBar) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(minValue)) {
            minValue = this.min;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currentValue) && limitBar) {
                currentValue = minValue;
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(maxValue)) {
            maxValue = this.max;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currentValue) && limitBar) {
                currentValue = maxValue;
            }
        }
        if (currentValue < minValue) {
            currentValue = minValue;
        }
        if (currentValue > maxValue) {
            currentValue = maxValue;
        }
        return [currentValue, this.checkHandlePosition(currentValue)];
    };
    Slider.prototype.setValue = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues) && this.customValues.length > 0) {
            this.min = 0;
            this.max = this.customValues.length - 1;
            this.setBarColor();
        }
        this.setAriaAttributes(this.firstHandle);
        this.handleVal1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) ? this.checkHandleValue(parseFloat(this.min.toString())) :
            this.checkHandleValue(parseFloat(this.value.toString()));
        this.handlePos1 = this.checkHandlePosition(this.handleVal1);
        this.preHandlePos1 = this.handlePos1;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeHandle) ? (this.type === 'Range' ? this.activeHandle = 2 : this.activeHandle = 1) :
            this.activeHandle = this.activeHandle;
        if (this.type === 'Default' || this.type === 'MinRange') {
            if (this.limits.enabled) {
                var values = this.getLimitValueAndPosition(this.handleVal1, this.limits.minStart, this.limits.minEnd);
                this.handleVal1 = values[0];
                this.handlePos1 = values[1];
                this.preHandlePos1 = this.handlePos1;
            }
            this.setHandlePosition(null);
            this.handleStart();
            this.value = this.handleVal1;
            this.setAriaAttrValue(this.firstHandle);
            this.changeEvent('changed', null);
        }
        else {
            this.validateRangeValue();
        }
        if (this.type !== 'Default') {
            this.setRangeBar();
        }
        if (this.limits.enabled) {
            this.setLimitBar();
        }
    };
    Slider.prototype.rangeValueUpdate = function () {
        if (this.value === null || typeof (this.value) !== 'object') {
            this.value = [parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min)), parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))];
        }
    };
    Slider.prototype.validateRangeValue = function () {
        this.rangeValueUpdate();
        this.setRangeValue();
    };
    Slider.prototype.modifyZindex = function () {
        if (this.type === 'Range') {
            if (this.activeHandle === 1) {
                this.firstHandle.style.zIndex = (this.zIndex + 4) + '';
                this.secondHandle.style.zIndex = (this.zIndex + 3) + '';
            }
            else {
                this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
                this.secondHandle.style.zIndex = (this.zIndex + 4) + '';
            }
        }
        else if (this.isMaterialTooltip && this.tooltipElement) {
            this.tooltipElement.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["getZindexPartial"])(this.element) + '';
        }
    };
    Slider.prototype.setHandlePosition = function (event) {
        var _this = this;
        var handle;
        var pos = (this.activeHandle === 1) ? this.handlePos1 : this.handlePos2;
        if (this.isMaterialTooltip) {
            handle = [this.firstHandle, this.materialHandle];
        }
        else {
            handle = [this.getHandle()];
        }
        this.handleStart();
        handle.forEach(function (handle) {
            if (_this.orientation === 'Horizontal') {
                _this.enableRtl ? (handle.style.right =
                    pos + "px") : (handle.style.left = pos + "px");
            }
            else {
                handle.style.bottom = pos + "px";
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && _this.isServerRendered) {
                handle.style.removeProperty('visibility');
            }
        });
        this.changeEvent('change', event);
    };
    Slider.prototype.getHandle = function () {
        return (this.activeHandle === 1) ? this.firstHandle : this.secondHandle;
    };
    Slider.prototype.setRangeValue = function () {
        this.updateRangeValue();
        this.activeHandle = 1;
        this.setHandlePosition(null);
        this.activeHandle = 2;
        this.setHandlePosition(null);
        this.activeHandle = 1;
    };
    Slider.prototype.changeEvent = function (eventName, e) {
        var previous = eventName === 'change' ? this.previousVal : this.previousChanged;
        if (this.type !== 'Range') {
            this.setProperties({ 'value': this.handleVal1 }, true);
            if (previous !== this.value && (!this.isMaterialTooltip || !this.initialTooltip)) {
                this.trigger(eventName, this.changeEventArgs(eventName, e));
                this.initialTooltip = true;
                this.setPreviousVal(eventName, this.value);
            }
            this.setAriaAttrValue(this.firstHandle);
        }
        else {
            var value = this.value = [this.handleVal1, this.handleVal2];
            this.setProperties({ 'value': value }, true);
            if (previous.length === this.value.length
                && this.value[0] !== previous[0] || this.value[1] !== previous[1]) {
                this.initialTooltip = false;
                this.trigger(eventName, this.changeEventArgs(eventName, e));
                this.initialTooltip = true;
                this.setPreviousVal(eventName, this.value);
            }
            this.setAriaAttrValue(this.getHandle());
        }
        this.hiddenInput.value = this.value.toString();
    };
    Slider.prototype.changeEventArgs = function (eventName, e) {
        var eventArgs;
        if (this.tooltip.isVisible && this.tooltipObj && this.initialTooltip) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                this.tooltipValue();
            }
            eventArgs = {
                value: this.value,
                previousValue: eventName === 'change' ? this.previousVal : this.previousChanged,
                action: eventName, text: this.tooltipObj.content, isInteracted: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? false : true
            };
        }
        else {
            eventArgs = {
                value: this.value,
                previousValue: eventName === 'change' ? this.previousVal : this.previousChanged,
                action: eventName, text: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticksFormatInfo.format) ? this.value.toString() :
                    (this.type !== 'Range' ? this.formatString(this.value, this.ticksFormatInfo).formatString :
                        (this.formatString(this.value[0], this.ticksFormatInfo).formatString + ' - ' +
                            this.formatString(this.value[1], this.ticksFormatInfo).formatString)),
                isInteracted: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? false : true
            };
        }
        return eventArgs;
    };
    Slider.prototype.setPreviousVal = function (eventName, value) {
        if (eventName === 'change') {
            this.previousVal = value;
        }
        else {
            this.previousChanged = value;
        }
    };
    Slider.prototype.updateRangeValue = function () {
        var values = this.value.toString().split(',').map(Number);
        if ((this.enableRtl && this.orientation !== 'Vertical') || this.rtl) {
            this.value = [values[1], values[0]];
        }
        else {
            this.value = [values[0], values[1]];
        }
        if (this.enableRtl && this.orientation !== 'Vertical') {
            this.handleVal1 = this.checkHandleValue(this.value[1]);
            this.handleVal2 = this.checkHandleValue(this.value[0]);
        }
        else {
            this.handleVal1 = this.checkHandleValue(this.value[0]);
            this.handleVal2 = this.checkHandleValue(this.value[1]);
        }
        this.handlePos1 = this.checkHandlePosition(this.handleVal1);
        this.handlePos2 = this.checkHandlePosition(this.handleVal2);
        if (this.handlePos1 > this.handlePos2) {
            this.handlePos1 = this.handlePos2;
            this.handleVal1 = this.handleVal2;
        }
        this.preHandlePos1 = this.handlePos1;
        this.preHandlePos2 = this.handlePos2;
        if (this.limits.enabled) {
            this.activeHandle = 1;
            var values_1 = this.getLimitValueAndPosition(this.handleVal1, this.limits.minStart, this.limits.minEnd);
            this.handleVal1 = values_1[0];
            this.handlePos1 = values_1[1];
            this.preHandlePos1 = this.handlePos1;
            this.activeHandle = 2;
            values_1 = this.getLimitValueAndPosition(this.handleVal2, this.limits.maxStart, this.limits.maxEnd);
            this.handleVal2 = values_1[0];
            this.handlePos2 = values_1[1];
            this.preHandlePos2 = this.handlePos2;
        }
    };
    Slider.prototype.checkHandlePosition = function (value) {
        var pos;
        value = (100 *
            (value - (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min))))) / ((parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))) - (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min))));
        if (this.orientation === 'Horizontal') {
            pos = this.element.getBoundingClientRect().width * (value / 100);
        }
        else {
            pos = this.element.getBoundingClientRect().height * (value / 100);
        }
        if (((parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max))) === (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min))))) {
            if (this.orientation === 'Horizontal') {
                pos = this.element.getBoundingClientRect().width;
            }
            else {
                pos = this.element.getBoundingClientRect().height;
            }
        }
        return pos;
    };
    Slider.prototype.checkHandleValue = function (value) {
        if (this.min > this.max) {
            this.min = this.max;
        }
        if (this.min === this.max) {
            return (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max)));
        }
        var handle = this.tempStartEnd();
        if (value < handle.start) {
            value = handle.start;
        }
        else if (value > handle.end) {
            value = handle.end;
        }
        return value;
    };
    /**
     * It is used to reposition slider.
     * @returns void
     */
    Slider.prototype.reposition = function () {
        var _this = this;
        this.firstHandle.style.transition = 'none';
        if (this.type !== 'Default') {
            this.rangeBar.style.transition = 'none';
        }
        if (this.type === 'Range') {
            this.secondHandle.style.transition = 'none';
        }
        this.handlePos1 = this.checkHandlePosition(this.handleVal1);
        if (this.handleVal2) {
            this.handlePos2 = this.checkHandlePosition(this.handleVal2);
        }
        if (this.orientation === 'Horizontal') {
            this.enableRtl ? this.firstHandle.style.right =
                this.handlePos1 + "px" : this.firstHandle.style.left = this.handlePos1 + "px";
            if (this.isMaterialTooltip) {
                this.enableRtl ? this.materialHandle.style.right =
                    this.handlePos1 + "px" : this.materialHandle.style.left = this.handlePos1 + "px";
            }
            if (this.type === 'MinRange') {
                this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
            }
            else if (this.type === 'Range') {
                this.enableRtl ? this.secondHandle.style.right =
                    this.handlePos2 + "px" : this.secondHandle.style.left = this.handlePos2 + "px";
                this.enableRtl ? (this.rangeBar.style.right =
                    this.handlePos1 + 'px') : (this.rangeBar.style.left = this.handlePos1 + 'px');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'width': this.handlePos2 - this.handlePos1 + 'px' });
            }
        }
        else {
            this.firstHandle.style.bottom = this.handlePos1 + "px";
            if (this.isMaterialTooltip) {
                this.materialHandle.style.bottom = this.handlePos1 + "px";
            }
            if (this.type === 'MinRange') {
                this.rangeBar.style.bottom = '0px';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
            }
            else if (this.type === 'Range') {
                this.secondHandle.style.bottom = this.handlePos2 + "px";
                this.rangeBar.style.bottom = this.handlePos1 + 'px';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.rangeBar, { 'height': this.handlePos2 - this.handlePos1 + 'px' });
            }
        }
        if (this.limits.enabled) {
            this.setLimitBar();
        }
        if (this.ticks.placement !== 'None' && this.ul) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.removeElement(this.ul);
                this.ul = undefined;
            }
            this.renderScale();
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.tickValuePosition();
            }
        }
        this.handleStart();
        if (!this.tooltip.isVisible) {
            setTimeout(function () {
                _this.firstHandle.style.transition = _this.scaleTransform;
                if (_this.type === 'Range') {
                    _this.secondHandle.style.transition = _this.scaleTransform;
                }
            });
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.refreshTooltip(this.tooltipTarget);
        }
        this.setBarColor();
    };
    Slider.prototype.changeHandleValue = function (value) {
        var position = null;
        if (this.activeHandle === 1) {
            if (!(this.limits.enabled && this.limits.startHandleFixed)) {
                this.handleVal1 = this.checkHandleValue(value);
                this.handlePos1 = this.checkHandlePosition(this.handleVal1);
                if (this.type === 'Range' && this.handlePos1 > this.handlePos2) {
                    this.handlePos1 = this.handlePos2;
                    this.handleVal1 = this.handleVal2;
                }
                if (this.handlePos1 !== this.preHandlePos1) {
                    position = this.preHandlePos1 = this.handlePos1;
                }
            }
            this.modifyZindex();
        }
        else {
            if (!(this.limits.enabled && this.limits.endHandleFixed)) {
                this.handleVal2 = this.checkHandleValue(value);
                this.handlePos2 = this.checkHandlePosition(this.handleVal2);
                if (this.type === 'Range' && this.handlePos2 < this.handlePos1) {
                    this.handlePos2 = this.handlePos1;
                    this.handleVal2 = this.handleVal1;
                }
                if (this.handlePos2 !== this.preHandlePos2) {
                    position = this.preHandlePos2 = this.handlePos2;
                }
            }
            this.modifyZindex();
        }
        if (position !== null) {
            if (this.type !== 'Default') {
                this.setRangeBar();
            }
            this.setHandlePosition(null);
        }
    };
    Slider.prototype.tempStartEnd = function () {
        if (this.min > this.max) {
            return {
                start: this.max,
                end: this.min
            };
        }
        else {
            return {
                start: this.min,
                end: this.max
            };
        }
    };
    Slider.prototype.xyToPosition = function (position) {
        var pos;
        if (this.min === this.max) {
            return 100;
        }
        if (this.orientation === 'Horizontal') {
            var left = position.x - this.element.getBoundingClientRect().left;
            var num = this.element.offsetWidth / 100;
            this.val = (left / num);
        }
        else {
            var top_1 = position.y - this.element.getBoundingClientRect().top;
            var num = this.element.offsetHeight / 100;
            this.val = 100 - (top_1 / num);
        }
        var val = this.stepValueCalculation(this.val);
        if (val < 0) {
            val = 0;
        }
        else if (val > 100) {
            val = 100;
        }
        if (this.enableRtl && this.orientation !== 'Vertical') {
            val = 100 - val;
        }
        if (this.orientation === 'Horizontal') {
            pos = this.element.getBoundingClientRect().width * (val / 100);
        }
        else {
            pos = this.element.getBoundingClientRect().height * (val / 100);
        }
        return pos;
    };
    Slider.prototype.stepValueCalculation = function (value) {
        if (this.step === 0) {
            this.step = 1;
        }
        var percentStep = (parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.step))) / ((parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max)) - parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min))) / 100);
        var remain = value % Math.abs(percentStep);
        if (remain !== 0) {
            if ((percentStep / 2) > remain) {
                value -= remain;
            }
            else {
                value += Math.abs(percentStep) - remain;
            }
        }
        return value;
    };
    Slider.prototype.add = function (a, b, addition) {
        var precision;
        var x = Math.pow(10, precision || 3);
        var val;
        if (addition) {
            val = (Math.round(a * x) + Math.round(b * x)) / x;
        }
        else {
            val = (Math.round(a * x) - Math.round(b * x)) / x;
        }
        return val;
    };
    Slider.prototype.positionToValue = function (pos) {
        var val;
        var diff = parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.max)) - parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.min));
        if (this.orientation === 'Horizontal') {
            val = (pos / this.element.getBoundingClientRect().width) * diff;
        }
        else {
            val = (pos / this.element.getBoundingClientRect().height) * diff;
        }
        var total = this.add(val, parseFloat(this.min.toString()), true);
        return (total);
    };
    Slider.prototype.sliderBarClick = function (evt) {
        evt.preventDefault();
        var pos;
        if (evt.type === 'mousedown' || evt.type === 'mouseup' || evt.type === 'click') {
            pos = { x: evt.clientX, y: evt.clientY };
        }
        else if (evt.type === 'touchend' || evt.type === 'touchstart') {
            pos = { x: evt.changedTouches[0].clientX, y: evt.changedTouches[0].clientY };
        }
        var handlepos = this.xyToPosition(pos);
        var handleVal = this.positionToValue(handlepos);
        if (this.type === 'Range' && (this.handlePos2 - handlepos) < (handlepos - this.handlePos1)) {
            this.activeHandle = 2;
            if (!(this.limits.enabled && this.limits.endHandleFixed)) {
                if (this.limits.enabled) {
                    var value = this.getLimitValueAndPosition(handleVal, this.limits.maxStart, this.limits.maxEnd);
                    handleVal = value[0];
                    handlepos = value[1];
                }
                this.secondHandle.classList.add(classNames.sliderActiveHandle);
                this.handlePos2 = this.preHandlePos2 = handlepos;
                this.handleVal2 = handleVal;
            }
            this.modifyZindex();
            this.secondHandle.focus();
        }
        else {
            this.activeHandle = 1;
            if (!(this.limits.enabled && this.limits.startHandleFixed)) {
                if (this.limits.enabled) {
                    var value = this.getLimitValueAndPosition(handleVal, this.limits.minStart, this.limits.minEnd);
                    handleVal = value[0];
                    handlepos = value[1];
                }
                this.firstHandle.classList.add(classNames.sliderActiveHandle);
                this.handlePos1 = this.preHandlePos1 = handlepos;
                this.handleVal1 = handleVal;
            }
            this.modifyZindex();
            this.firstHandle.focus();
        }
        if (this.isMaterialTooltip) {
            this.tooltipElement.classList.add(classNames.materialTooltipActive);
        }
        var focusedElement = this.element.querySelector('.' + classNames.sliderTabHandle);
        if (focusedElement && this.getHandle() !== focusedElement) {
            focusedElement.classList.remove(classNames.sliderTabHandle);
        }
        var handle = this.activeHandle === 1 ? this.firstHandle : this.secondHandle;
        if (evt.target === handle) {
            if (this.isMaterial && !this.tooltip.isVisible &&
                !this.getHandle().classList.contains(classNames.sliderTabHandle)) {
                this.materialChange();
            }
            this.sliderBarUp(evt);
            this.tooltipToggle(this.getHandle());
            return;
        }
        if (!this.checkRepeatedValue(handleVal)) {
            return;
        }
        var transition = this.isMaterial && this.tooltip.isVisible ?
            this.transitionOnMaterialTooltip : this.transition;
        this.getHandle().style.transition = transition.handle;
        if (this.type !== 'Default') {
            this.rangeBar.style.transition = transition.rangeBar;
        }
        this.setHandlePosition(evt);
        if (this.isMaterialTooltip) {
            this.initialTooltip = false;
        }
        this.changeEvent('changed', evt);
        if (this.type !== 'Default') {
            this.setRangeBar();
        }
    };
    Slider.prototype.handleValueAdjust = function (handleValue, assignValue, handleNumber) {
        if (handleNumber === 1) {
            this.handleVal1 = assignValue;
            this.handleVal2 = this.handleVal1 + this.minDiff;
        }
        else if (handleNumber === 2) {
            this.handleVal2 = assignValue;
            this.handleVal1 = this.handleVal2 - this.minDiff;
        }
        this.handlePos1 = this.checkHandlePosition(this.handleVal1);
        this.handlePos2 = this.checkHandlePosition(this.handleVal2);
    };
    Slider.prototype.dragRangeBarMove = function (event) {
        var _a, _b;
        if (event.type !== 'touchmove') {
            event.preventDefault();
        }
        this.rangeBarDragged = true;
        var pos;
        this.rangeBar.style.transition = 'none';
        this.firstHandle.style.transition = 'none';
        this.secondHandle.style.transition = 'none';
        var xPostion;
        var yPostion;
        if (event.type === 'mousemove') {
            _a = [event.clientX, event.clientY], xPostion = _a[0], yPostion = _a[1];
        }
        else {
            _b = [event.changedTouches[0].clientX, event.changedTouches[0].clientY], xPostion = _b[0], yPostion = _b[1];
        }
        if (!(this.limits.enabled && this.limits.startHandleFixed) && !(this.limits.enabled && this.limits.endHandleFixed)) {
            if (!this.enableRtl) {
                pos = { x: xPostion - this.firstPartRemain, y: yPostion + this.secondPartRemain };
            }
            else {
                pos = { x: xPostion + this.secondPartRemain, y: yPostion + this.secondPartRemain };
            }
            this.handlePos1 = this.xyToPosition(pos);
            this.handleVal1 = this.positionToValue(this.handlePos1);
            if (!this.enableRtl) {
                pos = { x: xPostion + this.secondPartRemain, y: yPostion - this.firstPartRemain };
            }
            else {
                pos = { x: xPostion - this.firstPartRemain, y: yPostion - this.firstPartRemain };
            }
            this.handlePos2 = this.xyToPosition(pos);
            this.handleVal2 = this.positionToValue(this.handlePos2);
            if (this.limits.enabled) {
                var value = this.getLimitValueAndPosition(this.handleVal1, this.limits.minStart, this.limits.minEnd);
                this.handleVal1 = value[0];
                this.handlePos1 = value[1];
                if (this.handleVal1 === this.limits.minEnd) {
                    this.handleValueAdjust(this.handleVal1, this.limits.minEnd, 1);
                }
                if (this.handleVal1 === this.limits.minStart) {
                    this.handleValueAdjust(this.handleVal1, this.limits.minStart, 1);
                }
                value = this.getLimitValueAndPosition(this.handleVal2, this.limits.maxStart, this.limits.maxEnd);
                this.handleVal2 = value[0];
                this.handlePos2 = value[1];
                if (this.handleVal2 === this.limits.maxStart) {
                    this.handleValueAdjust(this.handleVal2, this.limits.maxStart, 2);
                }
                if (this.handleVal2 === this.limits.maxEnd) {
                    this.handleValueAdjust(this.handleVal2, this.limits.maxEnd, 2);
                }
            }
            if (this.handleVal2 === this.max) {
                this.handleValueAdjust(this.handleVal2, this.max, 2);
            }
            if (this.handleVal1 === this.min) {
                this.handleValueAdjust(this.handleVal1, this.min, 1);
            }
        }
        this.activeHandle = 1;
        this.setHandlePosition(event);
        this.activeHandle = 2;
        this.setHandlePosition(event);
        this.tooltipToggle(this.rangeBar);
        this.setRangeBar();
    };
    Slider.prototype.sliderBarUp = function (event) {
        this.changeEvent('changed', event);
        this.handleFocusOut();
        this.firstHandle.classList.remove(classNames.sliderActiveHandle);
        if (this.type === 'Range') {
            this.initialTooltip = false;
            this.secondHandle.classList.remove(classNames.sliderActiveHandle);
        }
        this.closeTooltip();
        if (this.isMaterial) {
            this.getHandle().classList.remove('e-large-thumb-size');
            if (this.isMaterialTooltip) {
                this.tooltipElement.classList.remove(classNames.materialTooltipActive);
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousemove touchmove', this.sliderBarMove);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mouseup touchend', this.sliderBarUp);
    };
    Slider.prototype.sliderBarMove = function (evt) {
        if (evt.type !== 'touchmove') {
            evt.preventDefault();
        }
        var pos;
        if (evt.type === 'mousemove') {
            pos = { x: evt.clientX, y: evt.clientY };
        }
        else {
            pos = { x: evt.changedTouches[0].clientX, y: evt.changedTouches[0].clientY };
        }
        var handlepos = this.xyToPosition(pos);
        var handleVal = this.positionToValue(handlepos);
        handlepos = Math.round(handlepos);
        if (this.type !== 'Range' && this.activeHandle === 1) {
            if (!(this.limits.enabled && this.limits.startHandleFixed)) {
                if (this.limits.enabled) {
                    var valueAndPostion = this.getLimitValueAndPosition(handleVal, this.limits.minStart, this.limits.minEnd);
                    handlepos = valueAndPostion[1];
                    handleVal = valueAndPostion[0];
                }
                this.handlePos1 = handlepos;
                this.handleVal1 = handleVal;
            }
            this.firstHandle.classList.add(classNames.sliderActiveHandle);
        }
        if (this.type === 'Range') {
            if (this.activeHandle === 1) {
                this.firstHandle.classList.add(classNames.sliderActiveHandle);
                if (!(this.limits.enabled && this.limits.startHandleFixed)) {
                    if (handlepos > this.handlePos2) {
                        handlepos = this.handlePos2;
                        handleVal = this.handleVal2;
                    }
                    if (handlepos !== this.preHandlePos1) {
                        if (this.limits.enabled) {
                            var value = this.getLimitValueAndPosition(handleVal, this.limits.minStart, this.limits.minEnd);
                            handleVal = value[0];
                            handlepos = value[1];
                        }
                        this.handlePos1 = this.preHandlePos1 = handlepos;
                        this.handleVal1 = handleVal;
                        this.activeHandle = 1;
                    }
                }
            }
            else if (this.activeHandle === 2) {
                this.secondHandle.classList.add(classNames.sliderActiveHandle);
                if (!(this.limits.enabled && this.limits.endHandleFixed)) {
                    if (handlepos < this.handlePos1) {
                        handlepos = this.handlePos1;
                        handleVal = this.handleVal1;
                    }
                    if (handlepos !== this.preHandlePos2) {
                        if (this.limits.enabled) {
                            var value = this.getLimitValueAndPosition(handleVal, this.limits.maxStart, this.limits.maxEnd);
                            handleVal = value[0];
                            handlepos = value[1];
                        }
                        this.handlePos2 = this.preHandlePos2 = handlepos;
                        this.handleVal2 = handleVal;
                        this.activeHandle = 2;
                    }
                }
            }
        }
        if (!this.checkRepeatedValue(handleVal)) {
            return;
        }
        this.getHandle().style.transition = this.scaleTransform;
        if (this.type !== 'Default') {
            this.rangeBar.style.transition = 'none';
        }
        this.setHandlePosition(evt);
        if (this.isMaterial && !this.tooltip.isVisible &&
            !this.getHandle().classList.contains(classNames.sliderTabHandle)) {
            this.materialChange();
        }
        this.tooltipToggle(this.getHandle());
        if (this.type !== 'Default') {
            this.setRangeBar();
        }
    };
    Slider.prototype.dragRangeBarUp = function (event) {
        if (!this.rangeBarDragged) {
            this.focusSliderElement();
            this.sliderBarClick(event);
        }
        this.changeEvent('changed', event);
        this.closeTooltip();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousemove touchmove', this.dragRangeBarMove);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mouseup touchend', this.dragRangeBarUp);
        this.rangeBarDragged = false;
    };
    Slider.prototype.checkRepeatedValue = function (currentValue) {
        if (this.type === 'Range') {
            var previousVal = this.enableRtl && this.orientation !== 'Vertical' ? (this.activeHandle === 1 ?
                this.previousVal[1] : this.previousVal[0]) :
                (this.activeHandle === 1 ? this.previousVal[0] : this.previousVal[1]);
            if (currentValue === previousVal) {
                return 0;
            }
        }
        else {
            if (currentValue === this.previousVal) {
                return 0;
            }
        }
        return 1;
    };
    Slider.prototype.refreshTooltip = function (target) {
        if (this.tooltip.isVisible && this.tooltipObj) {
            this.tooltipValue();
            if (target) {
                this.tooltipObj.refresh(target);
                this.tooltipTarget = target;
            }
        }
    };
    Slider.prototype.openTooltip = function (target) {
        if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
            this.tooltipValue();
            this.tooltipObj.open(target);
            this.tooltipTarget = target;
        }
    };
    Slider.prototype.closeTooltip = function () {
        if (this.tooltip.isVisible && this.tooltipObj && this.tooltip.showOn !== 'Always' && !this.isMaterialTooltip) {
            this.tooltipValue();
            this.tooltipObj.close();
            this.tooltipTarget = undefined;
        }
    };
    Slider.prototype.keyDown = function (event) {
        switch (event.keyCode) {
            case 37:
            case 38:
            case 39:
            case 40:
            case 33:
            case 34:
            case 36:
            case 35:
                event.preventDefault();
                this.buttonClick(event);
                break;
        }
    };
    Slider.prototype.wireButtonEvt = function (destroy) {
        if (!destroy) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstBtn, 'mouseleave touchleave', this.buttonFocusOut, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondBtn, 'mouseleave touchleave', this.buttonFocusOut, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstBtn, 'mousedown touchstart', this.repeatHandlerMouse, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstBtn, 'mouseup mouseleave touchup touchend', this.repeatHandlerUp, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondBtn, 'mousedown touchstart', this.repeatHandlerMouse, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondBtn, 'mouseup mouseleave touchup touchend', this.repeatHandlerUp, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.firstBtn, 'focusout', this.sliderFocusOut, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.secondBtn, 'focusout', this.sliderFocusOut, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstBtn, 'mouseleave touchleave', this.buttonFocusOut);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondBtn, 'mouseleave touchleave', this.buttonFocusOut);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstBtn, 'mousedown touchstart', this.repeatHandlerMouse);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstBtn, 'mouseup mouseleave touchup touchend', this.repeatHandlerUp);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondBtn, 'mousedown touchstart', this.repeatHandlerMouse);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondBtn, 'mouseup mouseleave touchup touchend', this.repeatHandlerUp);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.firstBtn, 'focusout', this.sliderFocusOut);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.secondBtn, 'focusout', this.sliderFocusOut);
        }
    };
    Slider.prototype.rangeBarMousedown = function (event) {
        var _a, _b;
        event.preventDefault();
        this.focusSliderElement();
        if (this.type === 'Range' && this.drag && event.target === this.rangeBar) {
            var xPostion = void 0;
            var yPostion = void 0;
            if (event.type === 'mousedown') {
                _a = [event.clientX, event.clientY], xPostion = _a[0], yPostion = _a[1];
            }
            else if (event.type === 'touchstart') {
                _b = [event.changedTouches[0].clientX, event.changedTouches[0].clientY], xPostion = _b[0], yPostion = _b[1];
            }
            if (this.orientation === 'Horizontal') {
                this.firstPartRemain = xPostion - this.rangeBar.getBoundingClientRect().left;
                this.secondPartRemain = this.rangeBar.getBoundingClientRect().right - xPostion;
            }
            else {
                this.firstPartRemain = yPostion - this.rangeBar.getBoundingClientRect().top;
                this.secondPartRemain = this.rangeBar.getBoundingClientRect().bottom - yPostion;
            }
            this.minDiff = this.handleVal2 - this.handleVal1;
            this.tooltipToggle(this.rangeBar);
            var focusedElement = this.element.querySelector('.' + classNames.sliderTabHandle);
            if (focusedElement) {
                focusedElement.classList.remove(classNames.sliderTabHandle);
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousemove touchmove', this.dragRangeBarMove, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup touchend', this.dragRangeBarUp, this);
        }
    };
    Slider.prototype.elementClick = function (event) {
        event.preventDefault();
        this.focusSliderElement();
        this.sliderBarClick(event);
    };
    Slider.prototype.wireEvents = function () {
        this.onresize = this.reposition.bind(this);
        window.addEventListener('resize', this.onresize);
        if (this.enabled && !this.readonly) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.elementClick, this);
            if (this.type === 'Range' && this.drag) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.rangeBar, 'mousedown touchstart', this.rangeBarMousedown, this);
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.sliderContainer, 'keydown', this.keyDown, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.sliderContainer, 'keyup', this.keyUp, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.sliderFocusOut, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.sliderContainer, 'mouseover mouseout touchstart touchend', this.hover, this);
            this.wireFirstHandleEvt(false);
            if (this.type === 'Range') {
                this.wireSecondHandleEvt(false);
            }
            if (this.showButtons) {
                this.wireButtonEvt(false);
            }
            this.wireMaterialTooltipEvent(false);
            if (this.isForm) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.formResetHandler, this);
            }
        }
    };
    Slider.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.elementClick);
        if (this.type === 'Range' && this.drag) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.rangeBar, 'mousedown touchstart', this.rangeBarMousedown);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.sliderContainer, 'keydown', this.keyDown);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.sliderContainer, 'keyup', this.keyUp);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focusout', this.sliderFocusOut);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.sliderContainer, 'mouseover mouseout touchstart touchend', this.hover);
        this.wireFirstHandleEvt(true);
        if (this.type === 'Range') {
            this.wireSecondHandleEvt(true);
        }
        if (this.showButtons) {
            this.wireButtonEvt(true);
        }
        this.wireMaterialTooltipEvent(true);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'reset', this.formResetHandler);
    };
    Slider.prototype.formResetHandler = function () {
        this.setProperties({ 'value': this.formResetValue }, true);
        this.setValue();
    };
    Slider.prototype.keyUp = function (event) {
        if (event.keyCode === 9 && event.target.classList.contains(classNames.sliderHandle)) {
            this.focusSliderElement();
            if (!event.target.classList.contains(classNames.sliderTabHandle)) {
                if (this.element.querySelector('.' + classNames.sliderTabHandle)) {
                    this.element.querySelector('.' + classNames.sliderTabHandle).classList.remove(classNames.sliderTabHandle);
                }
                event.target.classList.add(classNames.sliderTabHandle);
                var parentElement = event.target.parentElement;
                if (parentElement === this.element) {
                    parentElement.querySelector('.' + classNames.sliderTrack).classList.add(classNames.sliderTabTrack);
                    if (this.type === 'Range' || this.type === 'MinRange') {
                        parentElement.querySelector('.' + classNames.rangeBar).classList.add(classNames.sliderTabRange);
                    }
                }
                if (this.type === 'Range') {
                    (event.target.previousSibling).classList.contains(classNames.sliderHandle) ?
                        this.activeHandle = 2 : this.activeHandle = 1;
                }
                this.getHandle().focus();
                this.tooltipToggle(this.getHandle());
            }
        }
        this.closeTooltip();
        this.changeEvent('changed', event);
    };
    Slider.prototype.hover = function (event) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event)) {
            if (event.type === 'mouseover' || event.type === 'touchmove' || event.type === 'mousemove' ||
                event.type === 'pointermove' || event.type === 'touchstart') {
                this.sliderContainer.classList.add(classNames.sliderHover);
            }
            else {
                this.sliderContainer.classList.remove(classNames.sliderHover);
            }
        }
    };
    Slider.prototype.sliderFocusOut = function (event) {
        if (event.relatedTarget !== this.secondHandle && event.relatedTarget !== this.firstHandle &&
            event.relatedTarget !== this.element && event.relatedTarget !== this.firstBtn && event.relatedTarget !== this.secondBtn) {
            this.closeMaterialTooltip();
            if (this.element.querySelector('.' + classNames.sliderTabHandle)) {
                this.element.querySelector('.' + classNames.sliderTabHandle).classList.remove(classNames.sliderTabHandle);
            }
            if (this.element.querySelector('.' + classNames.sliderTabTrack)) {
                this.element.querySelector('.' + classNames.sliderTabTrack).classList.remove(classNames.sliderTabTrack);
                if ((this.type === 'Range' || this.type === 'MinRange') &&
                    this.element.querySelector('.' + classNames.sliderTabRange)) {
                    this.element.querySelector('.' + classNames.sliderTabRange).classList.remove(classNames.sliderTabRange);
                }
            }
            this.hiddenInput.focus();
            this.hiddenInput.blur();
            this.isElementFocused = false;
        }
    };
    Slider.prototype.removeElement = function (element) {
        if (element.parentNode) {
            element.parentNode.removeChild(element);
        }
    };
    Slider.prototype.changeSliderType = function (type, args) {
        if (this.isMaterialTooltip && this.materialHandle) {
            this.sliderContainer.classList.remove(classNames.materialSlider);
            this.removeElement(this.materialHandle);
            this.materialHandle = undefined;
        }
        this.removeElement(this.firstHandle);
        this.firstHandle = undefined;
        if (type !== 'Default') {
            if (type === 'Range') {
                this.removeElement(this.secondHandle);
                this.secondHandle = undefined;
            }
            this.removeElement(this.rangeBar);
            this.rangeBar = undefined;
        }
        if (this.tooltip.isVisible && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltipObj)) {
            this.tooltipObj.destroy();
            this.tooltipElement = undefined;
            this.tooltipCollidedPosition = undefined;
        }
        if (this.limits.enabled) {
            if (type === 'MinRange' || type === 'Default') {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarFirst)) {
                    this.removeElement(this.limitBarFirst);
                    this.limitBarFirst = undefined;
                }
            }
            else {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarSecond)) {
                    this.removeElement(this.limitBarSecond);
                    this.limitBarSecond = undefined;
                }
            }
        }
        this.activeHandle = 1;
        this.getThemeInitialization();
        if (this.type === 'Range') {
            this.rangeValueUpdate();
        }
        this.createRangeBar();
        if (this.limits.enabled) {
            this.createLimitBar();
        }
        this.setHandler();
        this.setOrientClass();
        this.wireFirstHandleEvt(false);
        if (this.type === 'Range') {
            this.wireSecondHandleEvt(false);
        }
        this.setValue();
        if (this.tooltip.isVisible) {
            this.renderTooltip();
            this.wireMaterialTooltipEvent(false);
        }
        this.setBarColor();
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) || args !== 'tooltip') {
            this.updateConfig();
        }
    };
    Slider.prototype.changeRtl = function () {
        if (!this.enableRtl && this.type === 'Range') {
            this.value = [this.handleVal2, this.handleVal1];
        }
        this.updateConfig();
        if (this.tooltip.isVisible) {
            this.tooltipObj.refresh(this.firstHandle);
        }
        if (this.showButtons) {
            var enabledRTL = this.enableRtl && this.orientation !== 'Vertical';
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(enabledRTL ? this.secondBtn : this.firstBtn, { 'aria-label': 'Decrease', title: 'Decrease' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(enabledRTL ? this.firstBtn : this.secondBtn, { 'aria-label': 'Increase', title: 'Increase' });
        }
    };
    Slider.prototype.changeOrientation = function () {
        this.changeSliderType(this.type, 'null');
    };
    Slider.prototype.updateConfig = function () {
        this.setEnableRTL();
        this.setValue();
        if (this.tooltip.isVisible) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.refreshTooltip(this.tooltipTarget);
            }
        }
        if (this.ticks.placement !== 'None') {
            if (this.ul) {
                this.removeElement(this.ul);
                this.ul = undefined;
                this.renderScale();
            }
        }
        this.limitsPropertyChange();
    };
    Slider.prototype.limitsPropertyChange = function () {
        if (this.limits.enabled) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarFirst) && this.type !== 'Range') {
                this.createLimitBar();
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarFirst) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarSecond) && this.type === 'Range') {
                this.createLimitBar();
            }
            this.setLimitBar();
            this.setValue();
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarFirst)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.limitBarFirst);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.limitBarSecond)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.limitBarSecond);
            }
        }
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @private
     */
    Slider.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers.
     * Also it removes the attributes and classes.
     * @method destroy
     * @return {void}
     */
    Slider.prototype.destroy = function () {
        _super.prototype.destroy.call(this);
        this.unwireEvents();
        window.removeEventListener('resize', this.onresize);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.sliderContainer], [classNames.sliderDisabled]);
        this.firstHandle.removeAttribute('aria-orientation');
        if (this.type === 'Range') {
            this.secondHandle.removeAttribute('aria-orientation');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
            this.sliderContainer.parentNode.insertBefore(this.element, this.sliderContainer);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.sliderContainer);
        }
        if (this.tooltip.isVisible) {
            this.tooltipObj.destroy();
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isMaterialTooltip && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.materialHandle)) {
            this.materialHandle.remove();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
            this.element.innerHTML = '';
        }
    };
    /**
     * Calls internally if any of the property value is changed.
     * @private
     */
    // tslint:disable-next-line
    Slider.prototype.onPropertyChanged = function (newProp, oldProp) {
        var _this = this;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'cssClass':
                    this.setCSSClass(oldProp.cssClass);
                    break;
                case 'value':
                    if (newProp && oldProp) {
                        var value = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value) ?
                            (this.type === 'Range' ? [this.min, this.max] : this.min) : newProp.value;
                        this.setProperties({ 'value': value }, true);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.value) && oldProp.value.toString() !== value.toString()) {
                            this.setValue();
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                                this.refreshTooltip(this.tooltipTarget);
                            }
                            if (this.type === 'Range') {
                                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.value) || oldProp.value[1] === value[1]) {
                                    this.activeHandle = 1;
                                }
                                else {
                                    this.activeHandle = 2;
                                }
                            }
                        }
                    }
                    break;
                case 'min':
                case 'step':
                case 'max':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    this.setMinMaxValue();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'tooltip':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.tooltip) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.tooltip)) {
                        this.setTooltip(prop);
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'type':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp) && Object.keys(oldProp).length
                        && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.type)) {
                        this.changeSliderType(oldProp.type, prop);
                        this.setZindex();
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'enableRtl':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        if (this.isMaterialTooltip) {
                            this.sliderContainer.classList.add(classNames.materialSlider);
                        }
                        this.isServerRendered = false;
                    }
                    if (oldProp.enableRtl !== newProp.enableRtl && this.orientation !== 'Vertical') {
                        this.rtl = oldProp.enableRtl;
                        this.changeRtl();
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'limits':
                    this.limitsPropertyChange();
                    break;
                case 'orientation':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    this.changeOrientation();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'ticks':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.sliderContainer.querySelector('.' + classNames.scale))) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.ul);
                        }
                        Array.prototype.forEach.call(this.sliderContainer.classList, function (className) {
                            if (className.match(/e-scale-/)) {
                                _this.sliderContainer.classList.remove(className);
                            }
                        });
                    }
                    if (this.ticks.placement !== 'None') {
                        this.renderScale();
                        this.setZindex();
                    }
                    break;
                case 'locale':
                    if (this.showButtons) {
                        this.buttonTitle();
                    }
                    break;
                case 'showButtons':
                    if (newProp.showButtons) {
                        this.setButtons();
                        this.reposition();
                        if (this.enabled && !this.readonly) {
                            this.wireButtonEvt(false);
                        }
                    }
                    else {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                            if (this.firstBtn && this.secondBtn) {
                                this.sliderContainer.removeChild(this.firstBtn);
                                this.sliderContainer.removeChild(this.secondBtn);
                                this.sliderContainer.classList.remove(classNames.sliderButtonClass);
                                this.firstBtn = undefined;
                                this.secondBtn = undefined;
                                this.reposition();
                            }
                        }
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        if (this.isMaterialTooltip) {
                            this.sliderContainer.classList.add(classNames.materialSlider);
                        }
                    }
                    break;
                case 'enabled':
                    this.setEnabled();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        if (this.isMaterialTooltip) {
                            this.sliderContainer.classList.add(classNames.materialSlider);
                        }
                    }
                    break;
                case 'readonly':
                    this.setReadOnly();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        if (this.isMaterialTooltip) {
                            this.sliderContainer.classList.add(classNames.materialSlider);
                        }
                    }
                    break;
                case 'customValues':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    this.setValue();
                    this.reposition();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'colorRange':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        this.isServerRendered = false;
                    }
                    this.reposition();
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isServerRendered) {
                        this.isServerRendered = true;
                    }
                    break;
                case 'width':
                    this.setElementWidth(newProp.width);
                    this.setMinMaxValue();
                    if (this.limits) {
                        this.limitsPropertyChange();
                    }
                    break;
            }
        }
    };
    Slider.prototype.setReadOnly = function () {
        if (this.readonly) {
            this.unwireEvents();
            this.sliderContainer.classList.add(classNames.readonly);
        }
        else {
            this.wireEvents();
            this.sliderContainer.classList.remove(classNames.readonly);
        }
    };
    Slider.prototype.setMinMaxValue = function () {
        var _this = this;
        this.setValue();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            this.refreshTooltip(this.tooltipTarget);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.sliderContainer.querySelector('.' + classNames.scale))) {
            if (this.ul) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.ul);
                Array.prototype.forEach.call(this.sliderContainer.classList, function (className) {
                    if (className.match(/e-scale-/)) {
                        _this.sliderContainer.classList.remove(className);
                    }
                });
            }
        }
        if (this.ticks.placement !== 'None') {
            this.renderScale();
            this.setZindex();
        }
    };
    Slider.prototype.setZindex = function () {
        this.zIndex = 6;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks) && this.ticks.placement !== 'None') {
            this.ul.style.zIndex = (this.zIndex + -7) + '';
            this.element.style.zIndex = (this.zIndex + 2) + '';
        }
        if (!this.isMaterial && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ticks) && this.ticks.placement === 'Both') {
            this.element.style.zIndex = (this.zIndex + 2) + '';
        }
        this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
        if (this.type === 'Range') {
            this.secondHandle.style.zIndex = (this.zIndex + 4) + '';
        }
    };
    Slider.prototype.setTooltip = function (args) {
        this.changeSliderType(this.type, args);
    };
    Slider.prototype.setBarColor = function () {
        var trackPosition;
        var trackClassName;
        var child = this.sliderTrack.lastElementChild;
        while (child) {
            this.sliderTrack.removeChild(child);
            child = this.sliderTrack.lastElementChild;
        }
        for (var i = 0; i < this.colorRange.length; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.colorRange[i].start) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.colorRange[i].end)) {
                if (this.colorRange[i].end > this.colorRange[i].start) {
                    if (this.colorRange[i].start < this.min) {
                        this.colorRange[i].start = this.min;
                    }
                    if (this.colorRange[i].end > this.max) {
                        this.colorRange[i].end = this.max;
                    }
                    var startingPosition = this.checkHandlePosition(this.colorRange[i].start);
                    var endPosition = this.checkHandlePosition(this.colorRange[i].end);
                    var trackContainer = this.createElement('div');
                    trackContainer.style.backgroundColor = this.colorRange[i].color;
                    trackContainer.style.border = '1px solid ' + this.colorRange[i].color;
                    if (this.orientation === 'Horizontal') {
                        trackClassName = classNames.sliderHorizantalColor;
                        if (this.enableRtl) {
                            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.customValues)) {
                                trackPosition = this.checkHandlePosition(this.max) - this.checkHandlePosition(this.colorRange[i].end);
                            }
                            else {
                                trackPosition = this.checkHandlePosition(this.customValues.length - this.colorRange[i].end - 1);
                            }
                        }
                        else {
                            trackPosition = this.checkHandlePosition(this.colorRange[i].start);
                        }
                        trackContainer.style.width = endPosition - startingPosition + 'px';
                        trackContainer.style.left = trackPosition + 'px';
                    }
                    else {
                        trackClassName = classNames.sliderVerticalColor;
                        trackPosition = this.checkHandlePosition(this.colorRange[i].start);
                        trackContainer.style.height = endPosition - startingPosition + 'px';
                        trackContainer.style.bottom = trackPosition + 'px';
                    }
                    trackContainer.classList.add(trackClassName);
                    this.sliderTrack.appendChild(trackContainer);
                }
            }
        }
    };
    /**
     * Gets the component name
     * @private
     */
    Slider.prototype.getModuleName = function () {
        return 'slider';
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Slider.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Slider.prototype, "customValues", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1)
    ], Slider.prototype, "step", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Slider.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Slider.prototype, "min", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(100)
    ], Slider.prototype, "max", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Slider.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Default')
    ], Slider.prototype, "type", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([{}], ColorRangeData)
    ], Slider.prototype, "colorRange", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, TicksData)
    ], Slider.prototype, "ticks", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, LimitData)
    ], Slider.prototype, "limits", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Slider.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, TooltipData)
    ], Slider.prototype, "tooltip", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Slider.prototype, "showButtons", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Slider.prototype, "enableAnimation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Horizontal')
    ], Slider.prototype, "orientation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Slider.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Slider.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "changed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "renderingTicks", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "renderedTicks", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Slider.prototype, "tooltipChange", void 0);
    Slider = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Slider);
    return Slider;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/index.js ***!
  \*******************************************************************/
/*! exports provided: TextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _textbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./textbox */ "./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/textbox.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextBox", function() { return _textbox__WEBPACK_IMPORTED_MODULE_0__["TextBox"]; });

/**
 * Uploader modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/textbox.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/textbox/textbox.js ***!
  \*********************************************************************/
/*! exports provided: TextBox */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextBox", function() { return TextBox; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _input_input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../input/input */ "./ej2-resources/18.4.46/scripts/ej2-inputs/input/input.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};




var ROOT = 'e-textbox';
var CONTROL = 'e-control';
var HIDE_CLEAR = 'e-clear-icon-hide';
var TEXTBOX_FOCUS = 'e-input-focus';
var containerAttr = ['title', 'style', 'class'];
/**
 * Represents the TextBox component that allows the user to enter the values based on it's type.
 * ```html
 * <input name='images' id='textbox'/>
 * ```
 * ```typescript
 * <script>
 *   var textboxObj = new TextBox();
 *   textboxObj.appendTo('#textbox');
 * </script>
 * ```
 */
var TextBox = /** @__PURE__ @class */ (function (_super) {
    __extends(TextBox, _super);
    function TextBox(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.previousValue = null;
        _this.isAngular = false;
        _this.isHiddenInput = false;
        _this.isForm = false;
        _this.inputPreviousValue = null;
        _this.isVue = false;
        _this.textboxOptions = options;
        return _this;
    }
    /**
     * Calls internally if any of the property value is changed.
     * @private
     */
    TextBox.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'floatLabelType':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].removeFloating(this.textboxWrapper);
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].addFloating(this.respectiveElement, this.floatLabelType, this.placeholder);
                    break;
                case 'enabled':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnabled(this.enabled, this.respectiveElement, this.floatLabelType, this.textboxWrapper.container);
                    this.bindClearEvent();
                    break;
                case 'width':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setWidth(newProp.width, this.textboxWrapper.container);
                    break;
                case 'value':
                    var prevOnChange = this.isProtectedOnChange;
                    this.isProtectedOnChange = true;
                    if (!this.isBlank(this.value)) {
                        this.value = this.value.toString();
                    }
                    this.isProtectedOnChange = prevOnChange;
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue(this.value, this.respectiveElement, this.floatLabelType, this.showClearButton);
                    if (this.isHiddenInput) {
                        this.element.value = this.respectiveElement.value;
                    }
                    this.inputPreviousValue = this.respectiveElement.value;
                    /* istanbul ignore next */
                    if ((this.isAngular || this.isVue) && this.preventChange === true) {
                        this.previousValue = this.isAngular ? this.value : this.previousValue;
                        this.preventChange = false;
                    }
                    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.isAngular) || !this.isAngular
                        || (this.isAngular && !this.preventChange) || (this.isAngular && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.preventChange))) {
                        this.raiseChangeEvent();
                    }
                    break;
                case 'htmlAttributes':
                    this.updateHTMLAttrToElement();
                    this.updateHTMLAttrToWrapper();
                    var attributes = this.element.attributes;
                    this.checkAttributes(true);
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].validateInputType(this.textboxWrapper.container, this.element);
                    break;
                case 'readonly':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setReadonly(this.readonly, this.respectiveElement);
                    break;
                case 'type':
                    if (this.respectiveElement.tagName !== 'TEXTAREA') {
                        this.respectiveElement.setAttribute('type', this.type);
                        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].validateInputType(this.textboxWrapper.container, this.element);
                        this.raiseChangeEvent();
                    }
                    break;
                case 'showClearButton':
                    if (this.respectiveElement.tagName !== 'TEXTAREA') {
                        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setClearButton(this.showClearButton, this.respectiveElement, this.textboxWrapper);
                        this.bindClearEvent();
                    }
                    break;
                case 'enableRtl':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnableRtl(this.enableRtl, [this.textboxWrapper.container]);
                    break;
                case 'placeholder':
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.respectiveElement);
                    break;
                case 'autocomplete':
                    if (this.autocomplete !== 'on' && this.autocomplete !== '') {
                        this.respectiveElement.autocomplete = this.autocomplete;
                    }
                    else {
                        this.removeAttributes(['autocomplete']);
                    }
                    break;
                case 'cssClass':
                    this.updateCssClass(newProp.cssClass, oldProp.cssClass);
                    break;
                case 'locale':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.l10n.setLocale(this.locale);
                    this.setProperties({ placeholder: this.l10n.getConstant('placeholder') }, true);
                    _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.respectiveElement);
                    break;
            }
        }
    };
    /**
     * Gets the component name
     * @private
     */
    TextBox.prototype.getModuleName = function () {
        return 'textbox';
    };
    TextBox.prototype.isBlank = function (str) {
        return (!str || /^\s*$/.test(str));
    };
    TextBox.prototype.preRender = function () {
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            this.cloneElement = this.element.cloneNode(true);
            this.formElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.formElement)) {
                this.isForm = true;
            }
            /* istanbul ignore next */
            if (this.element.tagName === 'EJS-TEXTBOX') {
                var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
                var inputElement = this.multiline ?
                    this.createElement('textarea') :
                    this.createElement('input');
                var index = 0;
                for (index; index < this.element.attributes.length; index++) {
                    var attributeName = this.element.attributes[index].nodeName;
                    if (attributeName !== 'id') {
                        inputElement.setAttribute(attributeName, this.element.attributes[index].nodeValue);
                        inputElement.innerHTML = this.element.innerHTML;
                        if (attributeName === 'name') {
                            this.element.removeAttribute('name');
                        }
                    }
                }
                this.element.appendChild(inputElement);
                this.element = inputElement;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, this.element);
            }
            this.updateHTMLAttrToElement();
            this.checkAttributes(false);
            if (this.element.tagName !== 'TEXTAREA') {
                this.element.setAttribute('type', this.type);
            }
            this.element.setAttribute('role', 'textbox');
            this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
            var localeText = { placeholder: this.placeholder };
            this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('textbox', localeText, this.locale);
            if (this.l10n.getConstant('placeholder') !== '') {
                this.setProperties({ placeholder: this.placeholder || this.l10n.getConstant('placeholder') }, true);
            }
            if (!this.element.hasAttribute('id')) {
                this.element.setAttribute('id', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('textbox'));
            }
            if (!this.element.hasAttribute('name')) {
                this.element.setAttribute('name', this.element.getAttribute('id'));
            }
            if (this.element.tagName === 'INPUT' && this.multiline) {
                this.isHiddenInput = true;
                this.textarea = this.createElement('textarea');
                this.element.parentNode.insertBefore(this.textarea, this.element);
                this.element.setAttribute('type', 'hidden');
                this.textarea.setAttribute('name', this.element.getAttribute('name'));
                this.element.removeAttribute('name');
                this.textarea.setAttribute('role', this.element.getAttribute('role'));
                this.element.removeAttribute('role');
                this.textarea.setAttribute('id', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('textarea'));
                var apiAttributes = ['placeholder', 'disabled', 'value', 'readonly', 'type', 'autocomplete'];
                for (var index = 0; index < this.element.attributes.length; index++) {
                    var attributeName = this.element.attributes[index].nodeName;
                    if (this.element.hasAttribute(attributeName) && containerAttr.indexOf(attributeName) < 0 &&
                        !(attributeName === 'id' || attributeName === 'type' || attributeName === 'e-mappinguid')) {
                        // e-mappinguid attribute is handled for Grid component.
                        this.textarea.setAttribute(attributeName, this.element.attributes[index].nodeValue);
                        if (apiAttributes.indexOf(attributeName) < 0) {
                            this.element.removeAttribute(attributeName);
                            index--;
                        }
                    }
                }
            }
        }
    };
    TextBox.prototype.checkAttributes = function (isDynamic) {
        var attrs = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['placeholder', 'disabled', 'value', 'readonly', 'type', 'autocomplete'];
        for (var _i = 0, attrs_1 = attrs; _i < attrs_1.length; _i++) {
            var key = attrs_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute(key))) {
                switch (key) {
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['enabled'] === undefined)) || isDynamic) {
                            var enabled = this.element.getAttribute(key) === 'disabled' || this.element.getAttribute(key) === '' ||
                                this.element.getAttribute(key) === 'true' ? false : true;
                            this.setProperties({ enabled: enabled }, !isDynamic);
                        }
                        break;
                    case 'readonly':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['readonly'] === undefined)) || isDynamic) {
                            var readonly = this.element.getAttribute(key) === 'readonly' || this.element.getAttribute(key) === ''
                                || this.element.getAttribute(key) === 'true' ? true : false;
                            this.setProperties({ readonly: readonly }, !isDynamic);
                        }
                        break;
                    case 'placeholder':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['placeholder'] === undefined)) || isDynamic) {
                            this.setProperties({ placeholder: this.element.placeholder }, !isDynamic);
                        }
                        break;
                    case 'autocomplete':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['autocomplete'] === undefined)) || isDynamic) {
                            var autoCompleteTxt = this.element.autocomplete === 'off' ? 'off' : 'on';
                            this.setProperties({ autocomplete: autoCompleteTxt }, !isDynamic);
                        }
                        break;
                    case 'value':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['value'] === undefined)) || isDynamic) {
                            this.setProperties({ value: this.element.value }, !isDynamic);
                        }
                        break;
                    case 'type':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) || (this.textboxOptions['type'] === undefined)) || isDynamic) {
                            this.setProperties({ type: this.element.type }, !isDynamic);
                        }
                        break;
                }
            }
        }
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    TextBox.prototype.render = function () {
        var updatedCssClassValue = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValue = this.getInputValidClassList(this.cssClass);
        }
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            this.respectiveElement = (this.isHiddenInput) ? this.textarea : this.element;
            this.textboxWrapper = _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].createInput({
                element: this.respectiveElement,
                floatLabelType: this.floatLabelType,
                properties: {
                    enabled: this.enabled,
                    enableRtl: this.enableRtl,
                    cssClass: updatedCssClassValue,
                    readonly: this.readonly,
                    placeholder: this.placeholder,
                    showClearButton: this.showClearButton
                }
            });
            this.updateHTMLAttrToWrapper();
            if (this.isHiddenInput) {
                this.respectiveElement.parentNode.insertBefore(this.element, this.respectiveElement);
            }
        }
        else {
            this.respectiveElement = this.element;
            this.textboxWrapper = { container: this.element.parentElement };
            if (this.showClearButton && !this.multiline) {
                this.textboxWrapper.clearButton = this.textboxWrapper.container.querySelector('.e-clear-icon');
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].wireClearBtnEvents(this.respectiveElement, this.textboxWrapper.clearButton, this.textboxWrapper.container);
            }
            if (this.floatLabelType === 'Auto') {
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].wireFloatingEvents(this.respectiveElement);
            }
            // tslint:disable-next-line
            _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].bindInitialEvent({ element: this.respectiveElement, buttons: null, customTag: null, floatLabelType: this.floatLabelType, properties: this.properties });
        }
        this.wireEvents();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue(this.value, this.respectiveElement, this.floatLabelType, this.showClearButton);
            if (this.isHiddenInput) {
                this.element.value = this.respectiveElement.value;
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value)) {
            this.initialValue = this.value;
            this.setInitialValue();
        }
        if (this.autocomplete !== 'on' && this.autocomplete !== '') {
            this.respectiveElement.autocomplete = this.autocomplete;
            // tslint:disable-next-line
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxOptions) && (this.textboxOptions['autocomplete'] !== undefined)) {
            this.removeAttributes(['autocomplete']);
        }
        this.previousValue = this.value;
        this.inputPreviousValue = this.value;
        this.respectiveElement.defaultValue = this.respectiveElement.value;
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setWidth(this.width, this.textboxWrapper.container);
        this.renderComplete();
    };
    TextBox.prototype.updateHTMLAttrToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (containerAttr.indexOf(key) > -1) {
                    if (key === 'class') {
                        var updatedClassValues = this.getInputValidClassList(this.htmlAttributes[key]);
                        if (updatedClassValues !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.textboxWrapper.container], updatedClassValues.split(' '));
                        }
                    }
                    else if (key === 'style') {
                        var setStyle = this.textboxWrapper.container.getAttribute(key);
                        setStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(setStyle) ? (setStyle + this.htmlAttributes[key]) :
                            this.htmlAttributes[key];
                        this.textboxWrapper.container.setAttribute(key, setStyle);
                    }
                    else {
                        this.textboxWrapper.container.setAttribute(key, this.htmlAttributes[key]);
                    }
                }
            }
        }
    };
    TextBox.prototype.updateHTMLAttrToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var key = _a[_i];
                if (containerAttr.indexOf(key) < 0) {
                    this.element.setAttribute(key, this.htmlAttributes[key]);
                }
            }
        }
    };
    TextBox.prototype.updateCssClass = function (newClass, oldClass) {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setCssClass(this.getInputValidClassList(newClass), [this.textboxWrapper.container], this.getInputValidClassList(oldClass));
    };
    TextBox.prototype.getInputValidClassList = function (inputClassName) {
        var result = inputClassName;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(inputClassName) && inputClassName !== '') {
            result = (inputClassName.replace(/\s+/g, ' ')).trim();
        }
        return result;
    };
    TextBox.prototype.setInitialValue = function () {
        if (!this.isAngular) {
            this.respectiveElement.setAttribute('value', this.initialValue);
        }
    };
    TextBox.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.respectiveElement, 'focus', this.focusHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.respectiveElement, 'blur', this.focusOutHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.respectiveElement, 'input', this.inputHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.respectiveElement, 'change', this.changeHandler, this);
        if (this.isForm) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.resetForm, this);
        }
        this.bindClearEvent();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxWrapper.container.querySelector('.e-float-text')) && this.floatLabelType === 'Auto'
            && this.textboxWrapper.container.classList.contains('e-autofill') &&
            this.textboxWrapper.container.classList.contains('e-outline')) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add((this.textboxWrapper.container.querySelector('.e-float-text')), 'animationstart', this.animationHandler, this);
        }
    };
    TextBox.prototype.animationHandler = function () {
        this.textboxWrapper.container.classList.add('e-valid-input');
        var label = this.textboxWrapper.container.querySelector('.e-float-text');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
            label.classList.add('e-label-top');
            if (label.classList.contains('e-label-bottom')) {
                label.classList.remove('e-label-bottom');
            }
        }
    };
    TextBox.prototype.resetValue = function (value) {
        var prevOnChange = this.isProtectedOnChange;
        this.isProtectedOnChange = true;
        this.value = value;
        this.isProtectedOnChange = prevOnChange;
    };
    TextBox.prototype.resetForm = function () {
        if (this.isAngular) {
            this.resetValue('');
        }
        else {
            this.resetValue(this.initialValue);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxWrapper)) {
            var label = this.textboxWrapper.container.querySelector('.e-float-text');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(label)) {
                if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initialValue) || this.initialValue === '')) {
                    label.classList.add('e-label-bottom');
                    label.classList.remove('e-label-top');
                }
                else if (this.initialValue !== '') {
                    label.classList.add('e-label-top');
                    label.classList.remove('e-label-bottom');
                }
            }
        }
    };
    TextBox.prototype.focusHandler = function (args) {
        var eventArgs = {
            container: this.textboxWrapper.container,
            event: args,
            value: this.value
        };
        this.trigger('focus', eventArgs);
    };
    TextBox.prototype.focusOutHandler = function (args) {
        if (!(this.previousValue === null && this.value === null && this.respectiveElement.value === '') &&
            (this.previousValue !== this.respectiveElement.value)) {
            this.raiseChangeEvent(args, true);
        }
        var eventArgs = {
            container: this.textboxWrapper.container,
            event: args,
            value: this.value
        };
        this.trigger('blur', eventArgs);
    };
    TextBox.prototype.inputHandler = function (args) {
        // tslint:disable-next-line
        var textboxObj = this;
        var eventArgs = {
            event: args,
            value: this.respectiveElement.value,
            previousValue: this.inputPreviousValue,
            container: this.textboxWrapper.container
        };
        this.inputPreviousValue = this.respectiveElement.value;
        /* istanbul ignore next */
        if (this.isAngular) {
            textboxObj.localChange({ value: this.respectiveElement.value });
            this.preventChange = true;
        }
        if (this.isVue) {
            this.preventChange = true;
        }
        this.trigger('input', eventArgs);
        args.stopPropagation();
    };
    TextBox.prototype.changeHandler = function (args) {
        this.setProperties({ value: this.respectiveElement.value }, true);
        this.raiseChangeEvent(args, true);
        args.stopPropagation();
    };
    TextBox.prototype.raiseChangeEvent = function (event, interaction) {
        var eventArgs = {
            event: event,
            value: this.value,
            previousValue: this.previousValue,
            container: this.textboxWrapper.container,
            isInteraction: interaction ? interaction : false,
            isInteracted: interaction ? interaction : false
        };
        this.preventChange = false;
        this.trigger('change', eventArgs);
        this.previousValue = this.value;
    };
    TextBox.prototype.bindClearEvent = function () {
        if (this.showClearButton && this.respectiveElement.tagName !== 'TEXTAREA') {
            if (this.enabled) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.textboxWrapper.clearButton, 'mousedown touchstart', this.resetInputHandler, this);
            }
            else {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.textboxWrapper.clearButton, 'mousedown touchstart', this.resetInputHandler);
            }
        }
    };
    TextBox.prototype.resetInputHandler = function (event) {
        event.preventDefault();
        if (!(this.textboxWrapper.clearButton.classList.contains(HIDE_CLEAR))) {
            var previousValue = this.value;
            _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setValue('', this.respectiveElement, this.floatLabelType, this.showClearButton);
            if (this.isHiddenInput) {
                this.element.value = this.respectiveElement.value;
            }
            this.setProperties({ value: this.respectiveElement.value }, true);
            var eventArgs = {
                event: event,
                value: this.respectiveElement.value,
                previousValue: this.inputPreviousValue,
                container: this.textboxWrapper.container
            };
            this.trigger('input', eventArgs);
            this.inputPreviousValue = this.respectiveElement.value;
            this.raiseChangeEvent(event, true);
        }
    };
    TextBox.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.respectiveElement, 'focus', this.focusHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.respectiveElement, 'blur', this.focusOutHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.respectiveElement, 'input', this.inputHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.respectiveElement, 'change', this.changeHandler);
        if (this.isForm) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.resetForm);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxWrapper.container.querySelector('.e-float-text')) && this.floatLabelType === 'Auto'
            && this.textboxWrapper.container.classList.contains('e-outline') &&
            this.textboxWrapper.container.classList.contains('e-autofill')) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove((this.textboxWrapper.container.querySelector('.e-float-text')), 'animationstart', this.animationHandler);
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers.
     * Also, it maintains the initial TextBox element from the DOM.
     * @method destroy
     * @return {void}
     */
    TextBox.prototype.destroy = function () {
        this.unWireEvents();
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            if (this.element.tagName === 'INPUT' && this.multiline) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.textboxWrapper.container.getElementsByTagName('textarea')[0]);
                this.respectiveElement = this.element;
                this.element.removeAttribute('type');
            }
            this.respectiveElement.value = this.respectiveElement.defaultValue;
            this.respectiveElement.classList.remove('e-input');
            this.removeAttributes(['aria-placeholder', 'aria-disabled', 'aria-readonly', 'aria-labelledby']);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.textboxWrapper)) {
                this.textboxWrapper.container.insertAdjacentElement('afterend', this.respectiveElement);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.textboxWrapper.container);
            }
            this.textboxWrapper = null;
            _super.prototype.destroy.call(this);
        }
        else {
            this.textboxWrapper = null;
        }
    };
    /**
     * Adding the icons to the TextBox component.
     * @param { string } position - Specify the icon placement on the TextBox. Possible values are append and prepend.
     * @param { string | string[] } iconClass - Icon classes which are need to add to the span element which is going to created.
     * Span element acts as icon or button element for TextBox.
     * @return {void}
     */
    TextBox.prototype.addIcon = function (position, icons) {
        _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].addIcon(position, icons, this.textboxWrapper.container, this.respectiveElement, this.createElement);
    };
    /**
     * Gets the properties to be maintained in the persisted state.
     * @return {string}
     */
    TextBox.prototype.getPersistData = function () {
        var keyEntity = ['value'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Adding the multiple attributes as key-value pair to the TextBox element.
     * @param { { [key: string]: string } } attributes - Specifies the attributes to be add to TextBox element.
     * @return {void}
     */
    TextBox.prototype.addAttributes = function (attributes) {
        for (var _i = 0, _a = Object.keys(attributes); _i < _a.length; _i++) {
            var key = _a[_i];
            if (key === 'disabled') {
                this.setProperties({ enabled: false }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnabled(this.enabled, this.respectiveElement, this.floatLabelType, this.textboxWrapper.container);
            }
            else if (key === 'readonly') {
                this.setProperties({ readonly: true }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setReadonly(this.readonly, this.respectiveElement);
            }
            else if (key === 'class') {
                this.respectiveElement.classList.add(attributes[key]);
            }
            else if (key === 'placeholder') {
                this.setProperties({ placeholder: attributes[key] }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.respectiveElement);
            }
            else if (key === 'rows' && this.respectiveElement.tagName === 'TEXTAREA') {
                this.respectiveElement.setAttribute(key, attributes[key]);
            }
            else {
                this.respectiveElement.setAttribute(key, attributes[key]);
            }
        }
    };
    /**
     * Removing the multiple attributes as key-value pair to the TextBox element.
     * @param { string[] } attributes - Specifies the attributes name to be removed from TextBox element.
     * @return {void}
     */
    TextBox.prototype.removeAttributes = function (attributes) {
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var key = attributes_1[_i];
            if (key === 'disabled') {
                this.setProperties({ enabled: true }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setEnabled(this.enabled, this.respectiveElement, this.floatLabelType, this.textboxWrapper.container);
            }
            else if (key === 'readonly') {
                this.setProperties({ readonly: false }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setReadonly(this.readonly, this.respectiveElement);
            }
            else if (key === 'placeholder') {
                this.setProperties({ placeholder: null }, true);
                _input_input__WEBPACK_IMPORTED_MODULE_1__["Input"].setPlaceholder(this.placeholder, this.respectiveElement);
            }
            else {
                this.respectiveElement.removeAttribute(key);
            }
        }
    };
    /**
     * Sets the focus to widget for interaction.
     * @returns void
     */
    TextBox.prototype.focusIn = function () {
        if (document.activeElement !== this.respectiveElement && this.enabled) {
            this.respectiveElement.focus();
            if (this.textboxWrapper.container.classList.contains('e-input-group')
                || this.textboxWrapper.container.classList.contains('e-outline')
                || this.textboxWrapper.container.classList.contains('e-filled')) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.textboxWrapper.container], [TEXTBOX_FOCUS]);
            }
        }
    };
    /**
     * Remove the focus from widget, if the widget is in focus state.
     * @returns void
     */
    TextBox.prototype.focusOut = function () {
        if (document.activeElement === this.respectiveElement && this.enabled) {
            this.respectiveElement.blur();
            if (this.textboxWrapper.container.classList.contains('e-input-group')
                || this.textboxWrapper.container.classList.contains('e-outline')
                || this.textboxWrapper.container.classList.contains('e-filled')) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.textboxWrapper.container], [TEXTBOX_FOCUS]);
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('text')
    ], TextBox.prototype, "type", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TextBox.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TextBox.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Never')
    ], TextBox.prototype, "floatLabelType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], TextBox.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TextBox.prototype, "placeholder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('on')
    ], TextBox.prototype, "autocomplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], TextBox.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TextBox.prototype, "multiline", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TextBox.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TextBox.prototype, "showClearButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TextBox.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TextBox.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "blur", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "focus", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TextBox.prototype, "input", void 0);
    TextBox = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], TextBox);
    return TextBox;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/index.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/index.js ***!
  \********************************************************************/
/*! exports provided: FilesProp, ButtonsProps, AsyncSettings, Uploader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _uploader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uploader */ "./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/uploader.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FilesProp", function() { return _uploader__WEBPACK_IMPORTED_MODULE_0__["FilesProp"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonsProps", function() { return _uploader__WEBPACK_IMPORTED_MODULE_0__["ButtonsProps"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSettings", function() { return _uploader__WEBPACK_IMPORTED_MODULE_0__["AsyncSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Uploader", function() { return _uploader__WEBPACK_IMPORTED_MODULE_0__["Uploader"]; });

/**
 * Uploader modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/uploader.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-inputs/uploader/uploader.js ***!
  \***********************************************************************/
/*! exports provided: FilesProp, ButtonsProps, AsyncSettings, Uploader */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilesProp", function() { return FilesProp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonsProps", function() { return ButtonsProps; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSettings", function() { return AsyncSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uploader", function() { return Uploader; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






var ROOT = 'e-uploader';
var CONTROL_WRAPPER = 'e-upload e-control-wrapper';
var INPUT_WRAPPER = 'e-file-select';
var DROP_AREA = 'e-file-drop';
var DROP_WRAPPER = 'e-file-select-wrap';
var LIST_PARENT = 'e-upload-files';
var FILE = 'e-upload-file-list';
var STATUS = 'e-file-status';
var ACTION_BUTTONS = 'e-upload-actions';
var UPLOAD_BUTTONS = 'e-file-upload-btn e-css e-btn e-flat e-primary';
var CLEAR_BUTTONS = 'e-file-clear-btn e-css e-btn e-flat';
var FILE_NAME = 'e-file-name';
var FILE_TYPE = 'e-file-type';
var FILE_SIZE = 'e-file-size';
var REMOVE_ICON = 'e-file-remove-btn';
var DELETE_ICON = 'e-file-delete-btn';
var SPINNER_PANE = 'e-spinner-pane';
var ABORT_ICON = 'e-file-abort-btn';
var RETRY_ICON = 'e-file-reload-btn';
var DRAG_HOVER = 'e-upload-drag-hover';
var PROGRESS_WRAPPER = 'e-upload-progress-wrap';
var PROGRESSBAR = 'e-upload-progress-bar';
var PROGRESSBAR_TEXT = 'e-progress-bar-text';
var UPLOAD_INPROGRESS = 'e-upload-progress';
var UPLOAD_SUCCESS = 'e-upload-success';
var UPLOAD_FAILED = 'e-upload-fails';
var TEXT_CONTAINER = 'e-file-container';
var VALIDATION_FAILS = 'e-validation-fails';
var RTL = 'e-rtl';
var DISABLED = 'e-disabled';
var RTL_CONTAINER = 'e-rtl-container';
var ICON_FOCUSED = 'e-clear-icon-focus';
var PROGRESS_INNER_WRAPPER = 'e-progress-inner-wrap';
var PAUSE_UPLOAD = 'e-file-pause-btn';
var RESUME_UPLOAD = 'e-file-play-btn';
var RESTRICT_RETRY = 'e-restrict-retry';
var wrapperAttr = ['title', 'style', 'class'];
var FORM_UPLOAD = 'e-form-upload';
var HIDDEN_INPUT = 'e-hidden-file-input';
var INVALID_FILE = 'e-file-invalid';
var INFORMATION = 'e-file-information';
var FilesProp = /** @__PURE__ @class */ (function (_super) {
    __extends(FilesProp, _super);
    function FilesProp() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], FilesProp.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], FilesProp.prototype, "size", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], FilesProp.prototype, "type", void 0);
    return FilesProp;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

var ButtonsProps = /** @__PURE__ @class */ (function (_super) {
    __extends(ButtonsProps, _super);
    function ButtonsProps() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Browse...')
    ], ButtonsProps.prototype, "browse", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Upload')
    ], ButtonsProps.prototype, "upload", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Clear')
    ], ButtonsProps.prototype, "clear", void 0);
    return ButtonsProps;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

var AsyncSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(AsyncSettings, _super);
    function AsyncSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], AsyncSettings.prototype, "saveUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], AsyncSettings.prototype, "removeUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], AsyncSettings.prototype, "chunkSize", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(3)
    ], AsyncSettings.prototype, "retryCount", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(500)
    ], AsyncSettings.prototype, "retryAfterDelay", void 0);
    return AsyncSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * The uploader component allows to upload images, documents, and other files from local to server.
 * ```html
 * <input type='file' name='images[]' id='upload'/>
 * ```
 * ```typescript
 * <script>
 *   var uploadObj = new Uploader();
 *   uploadObj.appendTo('#upload');
 * </script>
 * ```
 */
var Uploader = /** @__PURE__ @class */ (function (_super) {
    __extends(Uploader, _super);
    /**
     * Triggers when change the Uploader value.
     */
    function Uploader(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.initialAttr = { accept: null, multiple: false, disabled: false };
        _this.uploadedFilesData = [];
        _this.base64String = [];
        _this.isForm = false;
        _this.allTypes = false;
        _this.pausedData = [];
        _this.uploadMetaData = [];
        _this.tabIndex = '0';
        _this.btnTabIndex = '0';
        _this.disableKeyboardNavigation = false;
        _this.count = -1;
        _this.actionCompleteCount = 0;
        _this.flag = true;
        _this.selectedFiles = [];
        _this.uploaderName = 'UploadFiles';
        _this.fileStreams = [];
        _this.newFileRef = 0;
        _this.isFirstFileOnSelection = false;
        _this.dragCounter = 0;
        /**
         * Get the file item(li) which are shown in file list.
         * @private
         */
        _this.fileList = [];
        /**
         * Get the data of files which are shown in file list.
         * @private
         */
        _this.filesData = [];
        _this.uploaderOptions = options;
        return _this;
    }
    /**
     * Calls internally if any of the property value is changed.
     * @private
     */
    Uploader.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'allowedExtensions':
                    this.setExtensions(this.allowedExtensions);
                    this.clearAll();
                    break;
                case 'enabled':
                    this.setControlStatus();
                    break;
                case 'multiple':
                    this.setMultipleSelection();
                    break;
                case 'enableRtl':
                    this.setRTL();
                    this.reRenderFileList();
                    break;
                case 'buttons':
                    this.buttons.browse = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons.browse) ? '' : this.buttons.browse;
                    this.buttons.clear = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons.clear) ? '' : this.buttons.clear;
                    this.buttons.upload = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons.upload) ? '' : this.buttons.upload;
                    this.renderButtonTemplates();
                    break;
                case 'dropArea':
                    this.unBindDropEvents();
                    this.updateDropArea();
                    break;
                case 'htmlAttributes':
                    this.updateHTMLAttrToElement();
                    this.updateHTMLAttrToWrapper();
                    this.checkHTMLAttributes(true);
                    break;
                case 'files':
                    this.renderPreLoadFiles();
                    break;
                case 'directoryUpload':
                    this.updateDirectoryAttributes();
                    break;
                case 'template':
                    if (!this.isServerBlazor) {
                        this.clearAll();
                    }
                    break;
                case 'minFileSize':
                case 'maxFileSize':
                case 'autoUpload':
                    this.clearAll();
                    break;
                case 'sequentialUpload':
                    this.clearAll();
                    break;
                case 'locale':
                    this.l10n.setLocale(this.locale);
                    this.setLocalizedTexts();
                    this.preLocaleObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('currentLocale', this.l10n);
                    break;
                case 'cssClass':
                    this.setCSSClass(oldProp.cssClass);
                    break;
            }
        }
    };
    Uploader.prototype.setLocalizedTexts = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template)) {
            if (typeof (this.buttons.browse) === 'string') {
                this.browseButton.innerText = (this.buttons.browse === 'Browse...') ?
                    this.localizedTexts('Browse') : this.buttons.browse;
                this.browseButton.setAttribute('title', this.browseButton.innerText);
                if (this.uploadWrapper && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploadWrapper.querySelector('.' + DROP_AREA))) {
                    this.uploadWrapper.querySelector('.' + DROP_AREA).innerHTML = this.localizedTexts('dropFilesHint');
                }
            }
            this.updateFileList();
        }
    };
    Uploader.prototype.getKeyValue = function (val) {
        var keyValue;
        for (var _i = 0, _a = Object.keys(this.preLocaleObj); _i < _a.length; _i++) {
            var key = _a[_i];
            if (this.preLocaleObj[key] === val) {
                keyValue = key;
            }
        }
        return keyValue;
    };
    Uploader.prototype.updateFileList = function () {
        var element;
        /* istanbul ignore next */
        if (this.fileList.length > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploadWrapper.querySelector('.' + LIST_PARENT))) {
            for (var i = 0; i < this.fileList.length; i++) {
                element = this.fileList[i].querySelector('.e-file-status');
                element.innerHTML = this.localizedTexts(this.getKeyValue(this.filesData[i].status));
                this.filesData[i].status = this.localizedTexts(this.getKeyValue(this.filesData[i].status));
                if (this.fileList[i].classList.contains(UPLOAD_SUCCESS)) {
                    this.fileList[i].querySelector('.e-icons').setAttribute('title', this.localizedTexts('delete'));
                }
                if (this.fileList[i].querySelector('.e-file-play-btn')) {
                    this.fileList[i].querySelector('.e-icons').setAttribute('title', this.localizedTexts('resume'));
                }
                if (this.fileList[i].querySelector('.e-file-remove-btn')) {
                    this.fileList[i].querySelector('.e-icons').setAttribute('title', this.localizedTexts('remove'));
                }
                if (this.fileList[i].querySelector('.e-file-reload-btn')) {
                    this.fileList[i].querySelector('.e-icons').setAttribute('title', this.localizedTexts('retry'));
                }
                if (!this.autoUpload) {
                    this.uploadButton.innerText = (this.buttons.upload === 'Upload') ?
                        this.localizedTexts('Upload') : this.buttons.upload;
                    this.uploadButton.setAttribute('title', this.localizedTexts('Upload'));
                    this.clearButton.innerText = (this.buttons.clear === 'Clear') ?
                        this.localizedTexts('Clear') : this.buttons.clear;
                    this.clearButton.setAttribute('title', this.localizedTexts('Clear'));
                }
            }
        }
    };
    Uploader.prototype.reRenderFileList = function () {
        if (this.listParent) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.listParent);
            this.listParent = null;
            this.fileList = [];
            this.createFileList(this.filesData);
            if (this.actionButtons) {
                this.removeActionButtons();
                this.renderActionButtons();
                this.checkActionButtonStatus();
            }
        }
    };
    Uploader.prototype.preRender = function () {
        this.localeText = { Browse: 'Browse...', Clear: 'Clear', Upload: 'Upload',
            dropFilesHint: 'Or drop files here', invalidMaxFileSize: 'File size is too large',
            invalidMinFileSize: 'File size is too small', invalidFileType: 'File type is not allowed',
            uploadFailedMessage: 'File failed to upload', uploadSuccessMessage: 'File uploaded successfully',
            removedSuccessMessage: 'File removed successfully', removedFailedMessage: 'Unable to remove file', inProgress: 'Uploading',
            readyToUploadMessage: 'Ready to upload', abort: 'Abort', remove: 'Remove', cancel: 'Cancel', delete: 'Delete file',
            pauseUpload: 'File upload paused', pause: 'Pause', resume: 'Resume', retry: 'Retry',
            fileUploadCancel: 'File upload canceled', invalidFileSelection: 'Invalid files selected', totalFiles: 'Total files',
            size: 'Size'
        };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('uploader', this.localeText, this.locale);
        this.preLocaleObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('currentLocale', this.l10n);
        this.isServerBlazor = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) ? true : false;
        this.isBlazorTemplate = this.isServerBlazor && this.template !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) ? true : false;
        this.isBlazorSaveUrl = (this.isServerRendered &&
            (this.asyncSettings.saveUrl === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.saveUrl))) ? true : false;
        if (this.isBlazorSaveUrl && this.sequentialUpload) {
            this.sequentialUpload = false;
        }
        if (!this.isBlazorSaveUrl) {
            this.formRendered();
        }
        if (!this.isServerBlazor) {
            this.updateHTMLAttrToElement();
            this.checkHTMLAttributes(false);
            // tslint:disable-next-line
            var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
            /* istanbul ignore next */
            if (this.element.tagName === 'EJS-UPLOADER') {
                var inputElement = this.createElement('input', { attrs: { type: 'file' } });
                var index = 0;
                for (index; index < this.element.attributes.length; index++) {
                    inputElement.setAttribute(this.element.attributes[index].nodeName, this.element.attributes[index].nodeValue);
                    inputElement.innerHTML = this.element.innerHTML;
                }
                if (!inputElement.hasAttribute('name')) {
                    inputElement.setAttribute('name', 'UploadFiles');
                }
                this.element.appendChild(inputElement);
                this.element = inputElement;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, this.element);
            }
            /* istanbul ignore next */
            if (ejInstance[0].isPureReactComponent) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ejInstance[0].props.name)) {
                    this.element.setAttribute('name', ejInstance[0].props.name);
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ejInstance[0].props.id) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ejInstance[0].props.name)) {
                    this.element.setAttribute('name', ejInstance[0].props.id);
                }
                else {
                    this.element.setAttribute('name', 'UploadFiles');
                }
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute('name'))) {
                this.element.setAttribute('name', this.element.getAttribute('id'));
            }
            if (!this.element.hasAttribute('type')) {
                this.element.setAttribute('type', 'file');
            }
            this.updateDirectoryAttributes();
        }
        this.keyConfigs = {
            enter: 'enter'
        };
        if (this.element.hasAttribute('tabindex')) {
            this.tabIndex = this.element.getAttribute('tabindex');
        }
        this.browserName = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name;
        this.uploaderName = this.element.getAttribute('name');
    };
    Uploader.prototype.formRendered = function () {
        var parentEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, 'form');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentEle)) {
            for (; parentEle && parentEle !== document.documentElement; parentEle = parentEle.parentElement) {
                if (parentEle.tagName === 'FORM') {
                    this.isForm = true;
                    this.formElement = parentEle;
                    parentEle.setAttribute('enctype', 'multipart/form-data');
                    parentEle.setAttribute('encoding', 'multipart/form-data');
                }
            }
        }
    };
    Uploader.prototype.getPersistData = function () {
        return this.addOnPersist(['filesData']);
    };
    /**
     * Return the module name of the component.
     */
    Uploader.prototype.getModuleName = function () {
        return 'uploader';
    };
    Uploader.prototype.updateDirectoryAttributes = function () {
        if (this.directoryUpload) {
            this.element.setAttribute('directory', 'true');
            this.element.setAttribute('webkitdirectory', 'true');
        }
        else {
            this.element.removeAttribute('directory');
            this.element.removeAttribute('webkitdirectory');
        }
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    Uploader.prototype.render = function () {
        if (!this.isServerBlazor) {
            this.renderBrowseButton();
            this.initializeUpload();
            this.updateHTMLAttrToWrapper();
            this.wireEvents();
            this.setMultipleSelection();
            this.setExtensions(this.allowedExtensions);
            this.setRTL();
            this.renderPreLoadFiles();
            this.setControlStatus();
            this.setCSSClass();
        }
        else {
            this.dropAreaWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.' + DROP_WRAPPER);
            this.uploadWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.e-upload.e-control-wrapper');
            this.browseButton = this.dropAreaWrapper.querySelector('button.e-upload-browse-btn');
            this.setDropArea();
            this.renderPreLoadFiles();
            this.wireEvents();
        }
        if (this.isServerBlazor) {
            this.renderComplete();
        }
    };
    Uploader.prototype.renderBrowseButton = function () {
        this.browseButton = this.createElement('button', { className: 'e-css e-btn', attrs: { 'type': 'button' } });
        this.browseButton.setAttribute('tabindex', this.tabIndex);
        if (typeof (this.buttons.browse) === 'string') {
            this.browseButton.textContent = (this.buttons.browse === 'Browse...') ?
                this.localizedTexts('Browse') : this.buttons.browse;
            this.browseButton.setAttribute('title', this.browseButton.innerText);
        }
        else {
            this.browseButton.appendChild(this.buttons.browse);
        }
        this.element.setAttribute('aria-label', 'Uploader');
    };
    Uploader.prototype.renderActionButtons = function () {
        this.element.setAttribute('tabindex', '-1');
        if (!(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
            this.actionButtons = this.createElement('div', { className: ACTION_BUTTONS });
            this.uploadButton = this.createElement('button', { className: UPLOAD_BUTTONS,
                attrs: { 'type': 'button', 'tabindex': this.btnTabIndex } });
            this.clearButton = this.createElement('button', { className: CLEAR_BUTTONS,
                attrs: { 'type': 'button', 'tabindex': this.btnTabIndex } });
            this.actionButtons.appendChild(this.clearButton);
            this.actionButtons.appendChild(this.uploadButton);
            this.renderButtonTemplates();
            this.uploadWrapper.appendChild(this.actionButtons);
            this.browseButton.blur();
            this.uploadButton.focus();
            this.wireActionButtonEvents();
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.serverActionButtonsEventBind = function (element) {
        if (element && !this.isForm) {
            this.browseButton.blur();
            this.actionButtons = element;
            this.uploadButton = this.actionButtons.querySelector('.e-file-upload-btn');
            this.clearButton = this.actionButtons.querySelector('.e-file-clear-btn');
            this.uploadButton.focus();
            this.unwireActionButtonEvents();
            this.wireActionButtonEvents();
            this.checkActionButtonStatus();
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.serverUlElement = function (element) {
        if (element) {
            if (this.isBlazorSaveUrl || this.isBlazorTemplate) {
                this.listParent = element;
                this.fileList = [].slice.call(this.listParent.querySelectorAll('li'));
                this.serverRemoveIconBindEvent();
                if (!this.isForm) {
                    this.checkAutoUpload(this.filesData);
                }
            }
        }
    };
    Uploader.prototype.wireActionButtonEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.uploadButton, 'click', this.uploadButtonClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.clearButton, 'click', this.clearButtonClick, this);
    };
    Uploader.prototype.unwireActionButtonEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.uploadButton, 'click', this.uploadButtonClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.clearButton, 'click', this.clearButtonClick);
    };
    Uploader.prototype.removeActionButtons = function () {
        if (this.actionButtons) {
            this.unwireActionButtonEvents();
            if (!(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.actionButtons);
            }
            this.actionButtons = null;
        }
    };
    Uploader.prototype.renderButtonTemplates = function () {
        if (typeof (this.buttons.browse) === 'string') {
            this.browseButton.textContent = (this.buttons.browse === 'Browse...') ?
                this.localizedTexts('Browse') : this.buttons.browse;
            this.browseButton.setAttribute('title', this.browseButton.textContent);
        }
        else {
            this.browseButton.innerHTML = '';
            this.browseButton.appendChild(this.buttons.browse);
        }
        if (this.uploadButton) {
            var uploadText = void 0;
            uploadText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons.upload) ? 'Upload' : this.buttons.upload;
            this.buttons.upload = uploadText;
            if (typeof (this.buttons.upload) === 'string') {
                this.uploadButton.textContent = (this.buttons.upload === 'Upload') ?
                    this.localizedTexts('Upload') : this.buttons.upload;
                this.uploadButton.setAttribute('title', this.uploadButton.textContent);
            }
            else {
                this.uploadButton.innerHTML = '';
                this.uploadButton.appendChild(this.buttons.upload);
            }
        }
        if (this.clearButton) {
            var clearText = void 0;
            clearText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons.clear) ? 'Clear' : this.buttons.clear;
            this.buttons.clear = clearText;
            if (typeof (this.buttons.clear) === 'string') {
                this.clearButton.textContent = (this.buttons.clear === 'Clear') ?
                    this.localizedTexts('Clear') : this.buttons.clear;
                this.clearButton.setAttribute('title', this.clearButton.textContent);
            }
            else {
                this.clearButton.innerHTML = '';
                this.clearButton.appendChild(this.buttons.clear);
            }
        }
    };
    Uploader.prototype.initializeUpload = function () {
        this.element.setAttribute('tabindex', '-1');
        var inputWrapper = this.createElement('span', { className: INPUT_WRAPPER });
        this.element.parentElement.insertBefore(inputWrapper, this.element);
        this.dropAreaWrapper = this.createElement('div', { className: DROP_WRAPPER });
        this.element.parentElement.insertBefore(this.dropAreaWrapper, this.element);
        inputWrapper.appendChild(this.element);
        this.dropAreaWrapper.appendChild(this.browseButton);
        this.dropAreaWrapper.appendChild(inputWrapper);
        this.uploadWrapper = this.createElement('div', { className: CONTROL_WRAPPER });
        this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper, this.dropAreaWrapper);
        this.uploadWrapper.appendChild(this.dropAreaWrapper);
        this.setDropArea();
    };
    Uploader.prototype.renderPreLoadFiles = function () {
        if (this.files.length) {
            if (this.enablePersistence && this.filesData.length) {
                this.createFileList(this.filesData);
                return;
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.files[0].size)) {
                return;
            }
            var files = [].slice.call(this.files);
            var filesData = [];
            if (!this.multiple) {
                this.clearData();
                files = [files[0]];
            }
            for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
                var data = files_1[_i];
                var fileData = {
                    name: data.name + '.' + data.type.split('.')[data.type.split('.').length - 1],
                    rawFile: '',
                    size: data.size,
                    status: this.localizedTexts('uploadSuccessMessage'),
                    type: data.type,
                    validationMessages: { minSize: '', maxSize: '' },
                    statusCode: '2'
                };
                filesData.push(fileData);
                this.filesData.push(fileData);
            }
            this.createFileList(filesData);
            if (!this.autoUpload && this.listParent && !this.actionButtons && (!this.isForm || this.allowUpload()) && this.showFileList) {
                this.renderActionButtons();
            }
            this.checkActionButtonStatus();
            if (this.sequentialUpload) {
                this.count = this.filesData.length - 1;
            }
        }
    };
    Uploader.prototype.checkActionButtonStatus = function () {
        if (this.actionButtons) {
            var length_1 = this.uploadWrapper.querySelectorAll('.' + VALIDATION_FAILS).length +
                this.uploadWrapper.querySelectorAll('.e-upload-fails:not(.e-upload-progress)').length +
                this.uploadWrapper.querySelectorAll('span.' + UPLOAD_SUCCESS).length +
                this.uploadWrapper.querySelectorAll('span.' + UPLOAD_INPROGRESS).length;
            if (length_1 > 0 && length_1 === this.uploadWrapper.querySelectorAll('li').length) {
                this.uploadButton.setAttribute('disabled', 'disabled');
            }
            else {
                this.uploadButton.removeAttribute('disabled');
            }
        }
    };
    Uploader.prototype.setDropArea = function () {
        var dropTextArea = this.dropAreaWrapper.querySelector('.e-file-drop');
        if (this.dropArea) {
            this.dropZoneElement = (typeof (this.dropArea) !== 'string') ? this.dropArea :
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.dropArea, document);
            var element = this.element;
            var enableDropText = false;
            while (element.parentNode) {
                element = element.parentNode;
                if (element === this.dropZoneElement) {
                    enableDropText = true;
                    if (!dropTextArea) {
                        this.createDropTextHint();
                    }
                    else if (!this.isServerBlazor) {
                        dropTextArea.innerHTML = this.localizedTexts('dropFilesHint');
                    }
                }
            }
            if (!enableDropText && dropTextArea) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(dropTextArea);
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploaderOptions) && this.uploaderOptions.dropArea === undefined) {
            this.createDropTextHint();
            this.dropZoneElement = this.uploadWrapper;
            this.setProperties({ dropArea: this.uploadWrapper }, true);
        }
        this.bindDropEvents();
    };
    Uploader.prototype.updateDropArea = function () {
        if (this.dropArea) {
            this.setDropArea();
        }
        else {
            this.dropZoneElement = null;
            var dropTextArea = this.dropAreaWrapper.querySelector('.e-file-drop');
            if (dropTextArea) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(dropTextArea);
            }
        }
    };
    Uploader.prototype.createDropTextHint = function () {
        if (!this.isServerBlazor) {
            var fileDropArea = this.createElement('span', { className: DROP_AREA });
            fileDropArea.innerHTML = this.localizedTexts('dropFilesHint');
            this.dropAreaWrapper.appendChild(fileDropArea);
        }
    };
    Uploader.prototype.updateHTMLAttrToElement = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var pro = _a[_i];
                if (wrapperAttr.indexOf(pro) < 0) {
                    this.element.setAttribute(pro, this.htmlAttributes[pro]);
                }
            }
        }
    };
    Uploader.prototype.updateHTMLAttrToWrapper = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes)) {
            for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
                var pro = _a[_i];
                if (wrapperAttr.indexOf(pro) > -1) {
                    if (pro === 'class') {
                        var updatedClassValues = (this.htmlAttributes[pro].replace(/\s+/g, ' ')).trim();
                        if (updatedClassValues !== '') {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.uploadWrapper], updatedClassValues.split(' '));
                        }
                    }
                    else if (pro === 'style') {
                        var uploadStyle = this.uploadWrapper.getAttribute(pro);
                        uploadStyle = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(uploadStyle) ? (uploadStyle + this.htmlAttributes[pro]) :
                            this.htmlAttributes[pro];
                        this.uploadWrapper.setAttribute(pro, uploadStyle);
                    }
                    else {
                        this.uploadWrapper.setAttribute(pro, this.htmlAttributes[pro]);
                    }
                }
            }
        }
    };
    Uploader.prototype.setMultipleSelection = function () {
        if (this.multiple && !this.element.hasAttribute('multiple')) {
            var newAttr = document.createAttribute('multiple');
            newAttr.value = 'multiple';
            this.element.setAttributeNode(newAttr);
        }
        else if (!this.multiple) {
            this.element.removeAttribute('multiple');
        }
    };
    Uploader.prototype.checkAutoUpload = function (fileData) {
        if (this.autoUpload) {
            if (this.sequentialUpload) {
                /* istanbul ignore next */
                this.sequenceUpload(fileData);
            }
            else {
                this.upload(fileData);
            }
            this.removeActionButtons();
        }
        else if (!this.actionButtons) {
            this.renderActionButtons();
        }
        this.checkActionButtonStatus();
    };
    Uploader.prototype.sequenceUpload = function (fileData) {
        if (this.filesData.length - fileData.length === 0 ||
            this.filesData[(this.filesData.length - fileData.length - 1)].statusCode !== '1') {
            ++this.count;
            var isFileListCreated = this.showFileList ? false : true;
            if (typeof this.filesData[this.count] === 'object') {
                this.isFirstFileOnSelection = false;
                this.upload(this.filesData[this.count], isFileListCreated);
                if (this.filesData[this.count].statusCode === '0') {
                    this.sequenceUpload(fileData);
                }
            }
            else {
                --this.count;
            }
        }
    };
    Uploader.prototype.setCSSClass = function (oldCSSClass) {
        var updatedCssClassValue = this.cssClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            updatedCssClassValue = (this.cssClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && updatedCssClassValue !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.uploadWrapper], updatedCssClassValue.split(updatedCssClassValue.indexOf(',') > -1 ? ',' : ' '));
        }
        var updatedOldCssClass = oldCSSClass;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCSSClass)) {
            updatedOldCssClass = (oldCSSClass.replace(/\s+/g, ' ')).trim();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCSSClass) && updatedOldCssClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.uploadWrapper], updatedOldCssClass.split(' '));
        }
    };
    Uploader.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.browseButton, 'click', this.browseButtonClick, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'change', this.onSelectFiles, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'click', this.removeFocus, this);
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.uploadWrapper, {
            keyAction: this.keyActionHandler.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown',
        });
        if (this.isForm) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.formElement, 'reset', this.resetForm, this);
        }
    };
    Uploader.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.browseButton, 'click', this.browseButtonClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'change', this.onSelectFiles);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'click', this.removeFocus);
        if (this.isForm) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.formElement, 'reset', this.resetForm);
        }
        if (this.keyboardModule) {
            this.keyboardModule.destroy();
        }
    };
    Uploader.prototype.resetForm = function () {
        this.clearAll();
    };
    Uploader.prototype.keyActionHandler = function (e) {
        var targetElement = e.target;
        switch (e.action) {
            case 'enter':
                if (e.target === this.clearButton) {
                    this.clearButtonClick();
                }
                else if (e.target === this.uploadButton) {
                    this.uploadButtonClick();
                }
                else if (e.target === this.browseButton) {
                    this.browseButtonClick();
                }
                else if (targetElement.classList.contains(PAUSE_UPLOAD)) {
                    var metaData = this.getCurrentMetaData(null, e);
                    metaData.file.statusCode = '4';
                    metaData.file.status = this.localizedTexts('pauseUpload');
                    this.abortUpload(metaData, false);
                }
                else if (targetElement.classList.contains(RESUME_UPLOAD)) {
                    this.resumeUpload(this.getCurrentMetaData(null, e), e);
                }
                else if (targetElement.classList.contains(RETRY_ICON)) {
                    var metaData = this.getCurrentMetaData(null, e);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(metaData)) {
                        metaData.file.statusCode = '1';
                        metaData.file.status = this.localizedTexts('readyToUploadMessage');
                        this.chunkUpload(metaData.file);
                    }
                    else {
                        var target = e.target.parentElement;
                        var fileData = this.filesData[this.fileList.indexOf(target)];
                        this.retry(fileData);
                    }
                }
                else {
                    this.removeFiles(e);
                    if (!targetElement.classList.contains(ABORT_ICON)) {
                        this.browseButton.focus();
                    }
                }
                e.preventDefault();
                e.stopPropagation();
                break;
        }
    };
    Uploader.prototype.getCurrentMetaData = function (fileInfo, e) {
        var fileData;
        var targetMetaData;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fileInfo)) {
            var target = e.target.parentElement;
            fileData = this.filesData[this.fileList.indexOf(target)];
        }
        else {
            fileData = fileInfo;
        }
        for (var i = 0; i < this.uploadMetaData.length; i++) {
            if (this.uploadMetaData[i].file.name === fileData.name) {
                targetMetaData = this.uploadMetaData[i];
            }
        }
        return targetMetaData;
    };
    Uploader.prototype.removeFocus = function () {
        if (this.uploadWrapper && this.listParent && this.listParent.querySelector('.' + ICON_FOCUSED)) {
            document.activeElement.blur();
            this.listParent.querySelector('.' + ICON_FOCUSED).classList.remove(ICON_FOCUSED);
        }
    };
    Uploader.prototype.browseButtonClick = function () {
        this.element.click();
    };
    Uploader.prototype.uploadButtonClick = function () {
        if (this.sequentialUpload) {
            this.sequenceUpload(this.filesData);
        }
        else {
            this.upload(this.filesData);
        }
    };
    Uploader.prototype.clearButtonClick = function () {
        this.clearAll();
        /* istanbul ignore next */
        if (this.sequentialUpload) {
            this.count = -1;
        }
        this.actionCompleteCount = 0;
    };
    Uploader.prototype.bindDropEvents = function () {
        if (this.dropZoneElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dropZoneElement, 'drop', this.dropElement, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dropZoneElement, 'dragover', this.dragHover, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dropZoneElement, 'dragleave', this.onDragLeave, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dropZoneElement, 'paste', this.onPasteFile, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dropZoneElement, 'dragenter', this.onDragEnter, this);
        }
    };
    Uploader.prototype.unBindDropEvents = function () {
        if (this.dropZoneElement) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.dropZoneElement, 'drop', this.dropElement);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.dropZoneElement, 'dragover', this.dragHover);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.dropZoneElement, 'dragleave', this.onDragLeave);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.dropZoneElement, 'dragenter', this.onDragEnter);
        }
    };
    Uploader.prototype.onDragEnter = function (e) {
        if (!this.enabled) {
            return;
        }
        this.dropZoneElement.classList.add(DRAG_HOVER);
        this.dragCounter = this.dragCounter + 1;
        e.preventDefault();
        e.stopPropagation();
    };
    Uploader.prototype.onDragLeave = function (e) {
        if (!this.enabled) {
            return;
        }
        this.dragCounter = this.dragCounter - 1;
        if (!this.dragCounter) {
            this.dropZoneElement.classList.remove(DRAG_HOVER);
        }
    };
    Uploader.prototype.dragHover = function (e) {
        if (!this.enabled) {
            return;
        }
        if (this.dropEffect !== 'Default') {
            e.dataTransfer.dropEffect = this.dropEffect.toLowerCase();
        }
        e.preventDefault();
        e.stopPropagation();
    };
    /* istanbul ignore next */
    Uploader.prototype.dropElement = function (e) {
        this.dragCounter = 0;
        this.dropZoneElement.classList.remove(DRAG_HOVER);
        this.onSelectFiles(e);
        e.preventDefault();
        e.stopPropagation();
    };
    /* istanbul ignore next */
    Uploader.prototype.onPasteFile = function (event) {
        var item = event.clipboardData.items;
        if (item.length !== 1) {
            return;
        }
        var pasteFile = [].slice.call(item)[0];
        if ((pasteFile.kind === 'file') && pasteFile.type.match('^image/')) {
            this.renderSelectedFiles(event, [pasteFile.getAsFile()], false, true);
        }
    };
    Uploader.prototype.getSelectedFiles = function (index) {
        var data = [];
        var liElement = this.fileList[index];
        var allFiles = this.getFilesData();
        var nameElements = +liElement.getAttribute('data-files-count');
        var startIndex = 0;
        for (var i = 0; i < index; i++) {
            startIndex += (+this.fileList[i].getAttribute('data-files-count'));
        }
        for (var j = startIndex; j < (startIndex + nameElements); j++) {
            data.push(allFiles[j]);
        }
        return data;
    };
    Uploader.prototype.removeFiles = function (args) {
        if (!this.enabled) {
            return;
        }
        var selectedElement = args.target.parentElement;
        if (this.isBlazorSaveUrl) {
            this.fileList = [].slice.call(this.uploadWrapper.querySelectorAll('li'));
        }
        var index = this.fileList.indexOf(selectedElement);
        var liElement = this.fileList[index];
        var formUpload = this.isFormUpload();
        var fileData = formUpload ? this.getSelectedFiles(index) : this.getFilesInArray(this.filesData[index]);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fileData)) {
            return;
        }
        if (args.target.classList.contains(ABORT_ICON) && !formUpload) {
            fileData[0].statusCode = '5';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
                var spinnerTarget = liElement.querySelector('.' + ABORT_ICON);
                Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({ target: spinnerTarget, width: '20px' });
                Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(spinnerTarget);
            }
            if (this.sequentialUpload) {
                /* istanbul ignore next */
                this.uploadSequential();
            }
            if (!(liElement.classList.contains(RESTRICT_RETRY))) {
                this.checkActionComplete(true);
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(args.target, '.' + SPINNER_PANE)) {
            this.remove(fileData, false, false, true, args);
        }
        this.element.value = '';
        this.checkActionButtonStatus();
    };
    Uploader.prototype.removeFilesData = function (file, customTemplate) {
        var index;
        if (customTemplate) {
            if (!this.showFileList) {
                index = this.filesData.indexOf(file);
                this.filesData.splice(index, 1);
            }
            return;
        }
        var selectedElement = this.getLiElement(file);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedElement)) {
            return;
        }
        if (!this.isBlazorSaveUrl) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(selectedElement);
        }
        index = this.fileList.indexOf(selectedElement);
        this.fileList.splice(index, 1);
        this.filesData.splice(index, 1);
        if (!this.isBlazorSaveUrl) {
            if (this.fileList.length === 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listParent)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.listParent);
                this.listParent = null;
                this.removeActionButtons();
            }
            if (this.sequentialUpload) {
                /* istanbul ignore next */
                if (index <= this.count) {
                    --this.count;
                }
            }
        }
        else {
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('removeFileData', index);
        }
    };
    Uploader.prototype.removeUploadedFile = function (file, eventArgs, removeDirectly, custom) {
        var _this = this;
        var selectedFiles = file;
        var ajax = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](this.asyncSettings.removeUrl, 'POST', true, null);
        ajax.emitError = false;
        var formData = new FormData();
        ajax.beforeSend = function (e) {
            eventArgs.currentRequest = ajax.httpRequest;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                if (_this.currentRequestHeader) {
                    _this.updateCustomheader(ajax.httpRequest, _this.currentRequestHeader);
                }
                if (_this.customFormDatas) {
                    _this.updateFormData(formData, _this.customFormDatas);
                }
            }
            if (!removeDirectly) {
                _this.trigger('removing', eventArgs, function (eventArgs) {
                    if (eventArgs.cancel) {
                        e.cancel = true;
                    }
                    else {
                        _this.removingEventCallback(eventArgs, formData, selectedFiles, file);
                    }
                });
            }
            else {
                _this.removingEventCallback(eventArgs, formData, selectedFiles, file);
            }
        };
        if (this.isServerBlazor) {
            var name_1 = this.element.getAttribute('name');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedFiles.rawFile) && selectedFiles.rawFile !== '') {
                formData.append(name_1, selectedFiles.rawFile, selectedFiles.name);
            }
            else {
                formData.append(name_1, selectedFiles.name);
            }
        }
        ajax.onLoad = function (e) { _this.removeCompleted(e, selectedFiles, custom); return {}; };
        /* istanbul ignore next */
        ajax.onError = function (e) { _this.removeFailed(e, selectedFiles, custom); return {}; };
        ajax.send(formData);
    };
    Uploader.prototype.removingEventCallback = function (eventArgs, formData, selectedFiles, file) {
        /* istanbul ignore next */
        var name = this.element.getAttribute('name');
        var liElement = this.getLiElement(file);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + DELETE_ICON)) ||
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + REMOVE_ICON)))) {
            var spinnerTarget = void 0;
            spinnerTarget = liElement.querySelector('.' + DELETE_ICON) ? liElement.querySelector('.' + DELETE_ICON) :
                liElement.querySelector('.' + REMOVE_ICON);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({ target: spinnerTarget, width: '20px' });
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(spinnerTarget);
        }
        if (!this.isServerBlazor) {
            if (eventArgs.postRawFile && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedFiles.rawFile) && selectedFiles.rawFile !== '') {
                formData.append(name, selectedFiles.rawFile, selectedFiles.name);
            }
            else {
                formData.append(name, selectedFiles.name);
            }
            this.updateFormData(formData, eventArgs.customFormData);
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.updateFormData = function (formData, customData) {
        if (customData.length > 0 && customData[0]) {
            var _loop_1 = function (i) {
                var data = customData[i];
                // tslint:disable-next-line
                var value = Object.keys(data).map(function (e) {
                    return data[e];
                });
                formData.append(Object.keys(data)[0], value);
            };
            for (var i = 0; i < customData.length; i++) {
                _loop_1(i);
            }
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.updateCustomheader = function (request, currentRequest) {
        if (currentRequest.length > 0 && currentRequest[0]) {
            var _loop_2 = function (i) {
                var data = currentRequest[i];
                // tslint:disable-next-line
                var value = Object.keys(data).map(function (e) {
                    return data[e];
                });
                request.setRequestHeader(Object.keys(data)[0], value);
            };
            for (var i = 0; i < currentRequest.length; i++) {
                _loop_2(i);
            }
        }
    };
    Uploader.prototype.removeCompleted = function (e, files, customTemplate) {
        var response = e && e.currentTarget ? this.getResponse(e) : null;
        var status = e.target;
        if (status.readyState === 4 && status.status >= 200 && status.status <= 299) {
            var args = {
                e: e, response: response, operation: 'remove', file: this.updateStatus(files, this.localizedTexts('removedSuccessMessage'), '2')
            };
            this.trigger('success', args);
            this.removeFilesData(files, customTemplate);
            var index = this.uploadedFilesData.indexOf(files);
            this.uploadedFilesData.splice(index, 1);
            this.trigger('change', { files: this.uploadedFilesData });
        }
        else {
            this.removeFailed(e, files, customTemplate);
        }
    };
    Uploader.prototype.removeFailed = function (e, files, customTemplate) {
        var response = e && e.currentTarget ? this.getResponse(e) : null;
        var args = {
            e: e, response: response, operation: 'remove', file: this.updateStatus(files, this.localizedTexts('removedFailedMessage'), '0')
        };
        if (!customTemplate) {
            var index = this.filesData.indexOf(files);
            var rootElement = this.fileList[index];
            if (rootElement) {
                rootElement.classList.remove(UPLOAD_SUCCESS);
                rootElement.classList.add(UPLOAD_FAILED);
                var statusElement = rootElement.querySelector('.' + STATUS);
                if (statusElement) {
                    statusElement.classList.remove(UPLOAD_SUCCESS);
                    statusElement.classList.add(UPLOAD_FAILED);
                }
            }
            this.checkActionButtonStatus();
        }
        this.trigger('failure', args);
        var liElement = this.getLiElement(files);
        /* istanbul ignore next */
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + DELETE_ICON))) {
            var spinnerTarget = liElement.querySelector('.' + DELETE_ICON);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(spinnerTarget);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.e-spinner-pane'));
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.getFilesFromFolder = function (event) {
        this.filesEntries = [];
        var items;
        items = this.multiple ? event.dataTransfer.items : [event.dataTransfer.items[0]];
        var validDirectoryUpload = this.checkDirectoryUpload(items);
        if (!validDirectoryUpload) {
            return;
        }
        var _loop_3 = function (i) {
            // tslint:disable-next-line
            var item = items[i].webkitGetAsEntry();
            if (item.isFile) {
                var files_2 = [];
                // tslint:disable-next-line
                (item).file(function (fileObj) {
                    var path = item.fullPath;
                    files_2.push({ 'path': path, 'file': fileObj });
                });
                this_1.renderSelectedFiles(event, files_2, true);
            }
            else if (item.isDirectory) {
                this_1.traverseFileTree(item, event);
            }
        };
        var this_1 = this;
        for (var i = 0; i < items.length; i++) {
            _loop_3(i);
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.checkDirectoryUpload = function (items) {
        for (var i = 0; items && i < items.length; i++) {
            // tslint:disable-next-line
            var item = items[i].webkitGetAsEntry();
            if (item.isDirectory) {
                return true;
            }
        }
        return false;
    };
    // tslint:disable
    /* istanbul ignore next */
    Uploader.prototype.traverseFileTree = function (item, event) {
        if (item.isFile) {
            this.filesEntries.push(item);
        }
        else if (item.isDirectory) {
            // tslint:disable-next-line
            var directoryReader = item.createReader();
            // tslint:disable-next-line
            this.readFileFromDirectory(directoryReader, event);
        }
    };
    // tslint:disable
    /* istanbul ignore next */
    Uploader.prototype.readFileFromDirectory = function (directoryReader, event) {
        var _this = this;
        // tslint:disable-next-line
        directoryReader.readEntries(function (entries) {
            for (var i = 0; i < entries.length; i++) {
                _this.traverseFileTree(entries[i]);
                // tslint:disable-next-line
            }
            ;
            _this.pushFilesEntries(event);
            if (entries.length) {
                _this.readFileFromDirectory(directoryReader);
            }
        });
    };
    Uploader.prototype.pushFilesEntries = function (event) {
        var _this = this;
        var files = [];
        var _loop_4 = function (i) {
            // tslint:disable-next-line
            this_2.filesEntries[i].file(function (fileObj) {
                if (_this.filesEntries.length) {
                    var path = _this.filesEntries[i].fullPath;
                    files.push({ 'path': path, 'file': fileObj });
                    if (i === _this.filesEntries.length - 1) {
                        _this.filesEntries = [];
                        _this.renderSelectedFiles(event, files, true);
                    }
                }
            });
        };
        var this_2 = this;
        for (var i = 0; i < this.filesEntries.length; i++) {
            _loop_4(i);
        }
    };
    // tslint:enable
    Uploader.prototype.onSelectFiles = function (args) {
        if (!this.enabled) {
            return;
        }
        var targetFiles;
        /* istanbul ignore next */
        if (args.type === 'drop') {
            if (this.directoryUpload) {
                this.getFilesFromFolder(args);
            }
            else {
                var files = this.sortFilesList = args.dataTransfer.files;
                if (this.browserName !== 'msie' && this.browserName !== 'edge') {
                    this.element.files = files;
                }
                if (files.length > 0) {
                    targetFiles = this.multiple ? this.sortFileList(files) : [files[0]];
                    this.renderSelectedFiles(args, targetFiles);
                }
            }
        }
        else {
            targetFiles = [].slice.call(args.target.files);
            this.renderSelectedFiles(args, targetFiles);
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.getBase64 = function (file) {
        return new Promise(function (resolve, reject) {
            var fileReader = new FileReader();
            fileReader.readAsDataURL(file);
            fileReader.onload = function () { return resolve(fileReader.result); };
            fileReader.onerror = function (error) { return reject(error); };
        });
    };
    /* istanbul ignore next */
    /* tslint:ignore */
    Uploader.prototype.renderSelectedFiles = function (args, 
    // tslint:disable-next-line
    targetFiles, directory, paste) {
        var _this = this;
        this.base64String = [];
        // tslint:disable-next-line
        var eventArgs = {
            event: args,
            cancel: false,
            filesData: [],
            isModified: false,
            modifiedFilesData: [],
            progressInterval: '',
            isCanceled: false,
            currentRequest: null,
            customFormData: null
        };
        /* istanbul ignore next */
        if (targetFiles.length < 1) {
            eventArgs.isCanceled = true;
            this.trigger('selected', eventArgs);
            return;
        }
        this.flag = true;
        var fileData = [];
        if (!this.multiple) {
            this.clearData(true);
            targetFiles = [targetFiles[0]];
        }
        for (var i = 0; i < targetFiles.length; i++) {
            var file = directory ? targetFiles[i].file : targetFiles[i];
            this.updateInitialFileDetails(args, targetFiles, file, i, fileData, directory, paste);
        }
        eventArgs.filesData = fileData;
        if (this.allowedExtensions.indexOf('*') > -1) {
            this.allTypes = true;
        }
        if (!this.allTypes) {
            fileData = this.checkExtension(fileData);
        }
        this.trigger('selected', eventArgs, function (eventArgs) {
            _this._internalRenderSelect(eventArgs, fileData);
        });
    };
    Uploader.prototype.updateInitialFileDetails = function (args, 
    // tslint:disable-next-line
    targetFiles, file, i, fileData, directory, paste) {
        var fileName = directory ? targetFiles[i].path.substring(1, targetFiles[i].path.length) : paste ?
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(file.name.substring(0, file.name.lastIndexOf('.'))) + '.' + this.getFileType(file.name) :
            this.directoryUpload ? targetFiles[i].webkitRelativePath : file.name;
        var fileDetails = {
            name: fileName,
            rawFile: file,
            size: file.size,
            status: this.localizedTexts('readyToUploadMessage'),
            type: this.getFileType(file.name),
            validationMessages: this.validatedFileSize(file.size),
            statusCode: '1',
            id: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(file.name.substring(0, file.name.lastIndexOf('.'))) + '.' + this.getFileType(file.name)
        };
        /* istanbul ignore next */
        if (paste) {
            fileDetails.fileSource = 'paste';
        }
        fileDetails.status = fileDetails.validationMessages.minSize !== '' ? this.localizedTexts('invalidMinFileSize') :
            fileDetails.validationMessages.maxSize !== '' ? this.localizedTexts('invalidMaxFileSize') : fileDetails.status;
        if (fileDetails.validationMessages.minSize !== '' || fileDetails.validationMessages.maxSize !== '') {
            fileDetails.statusCode = '0';
        }
        fileData.push(fileDetails);
    };
    Uploader.prototype._internalRenderSelect = function (eventArgs, fileData) {
        if (!eventArgs.cancel) {
            /* istanbul ignore next */
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.currentRequestHeader = eventArgs.currentRequest;
                this.customFormDatas = eventArgs.customFormData;
            }
            this.selectedFiles = this.selectedFiles.concat(fileData);
            this.btnTabIndex = this.disableKeyboardNavigation ? '-1' : '0';
            if (this.showFileList) {
                if (eventArgs.isModified && eventArgs.modifiedFilesData.length > 0) {
                    for (var j = 0; j < eventArgs.modifiedFilesData.length; j++) {
                        for (var k = 0; k < fileData.length; k++) {
                            if (eventArgs.modifiedFilesData[j].id === fileData[k].id) {
                                eventArgs.modifiedFilesData[j].rawFile = fileData[k].rawFile;
                            }
                        }
                    }
                    var dataFiles = this.allTypes ? eventArgs.modifiedFilesData :
                        this.checkExtension(eventArgs.modifiedFilesData);
                    this.updateSortedFileList(dataFiles);
                    this.filesData = dataFiles;
                    if (!this.isForm || this.allowUpload()) {
                        this.checkAutoUpload(dataFiles);
                    }
                }
                else {
                    this.createFileList(fileData, true);
                    if (!(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
                        this.filesData = this.filesData.concat(fileData);
                    }
                    if (!this.isForm || this.allowUpload()) {
                        if (!(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
                            this.checkAutoUpload(fileData);
                        }
                    }
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventArgs.progressInterval) && eventArgs.progressInterval !== '') {
                    this.progressInterval = eventArgs.progressInterval;
                }
            }
            else {
                this.filesData = this.filesData.concat(fileData);
                if (this.isBlazorSaveUrl) {
                    // tslint:disable-next-line
                    this.interopAdaptor.invokeMethodAsync('updateServerFileData', this.filesData, this.isForm);
                }
                if (this.autoUpload) {
                    this.upload(this.filesData, true);
                }
            }
            this.raiseActionComplete();
            this.isFirstFileOnSelection = true;
        }
    };
    Uploader.prototype.allowUpload = function () {
        var allowFormUpload = false;
        if (this.isForm && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.saveUrl) && this.asyncSettings.saveUrl !== '')) {
            allowFormUpload = true;
        }
        return allowFormUpload;
    };
    Uploader.prototype.isFormUpload = function () {
        var isFormUpload = false;
        if (this.isForm && ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.saveUrl) || this.asyncSettings.saveUrl === '')
            && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.removeUrl) || this.asyncSettings.removeUrl === ''))) {
            isFormUpload = true;
        }
        return isFormUpload;
    };
    Uploader.prototype.clearData = function (singleUpload) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listParent) && !(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.listParent);
            this.listParent = null;
        }
        if (this.browserName !== 'msie' && !singleUpload) {
            this.element.value = '';
        }
        this.fileList = [];
        this.filesData = [];
        if (this.isBlazorSaveUrl || this.isBlazorTemplate) {
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('clearAll');
        }
        else {
            this.removeActionButtons();
        }
    };
    Uploader.prototype.updateSortedFileList = function (filesData) {
        var previousListClone = this.createElement('div', { id: 'clonewrapper' });
        var added = -1;
        var removedList;
        if (this.listParent) {
            for (var i = 0; i < this.listParent.querySelectorAll('li').length; i++) {
                var liElement = this.listParent.querySelectorAll('li')[i];
                previousListClone.appendChild(liElement.cloneNode(true));
            }
            removedList = this.listParent.querySelectorAll('li');
            for (var _i = 0, removedList_1 = removedList; _i < removedList_1.length; _i++) {
                var item = removedList_1[_i];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(item);
            }
            this.removeActionButtons();
            var oldList = [].slice.call(previousListClone.childNodes);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.listParent);
            this.listParent = null;
            this.fileList = [];
            this.createParentUL();
            for (var index = 0; index < filesData.length; index++) {
                for (var j = 0; j < this.filesData.length; j++) {
                    if (this.filesData[j].name === filesData[index].name) {
                        this.listParent.appendChild(oldList[j]);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(oldList[j].querySelector('.e-icons'), 'click', this.removeFiles, this);
                        this.fileList.push(oldList[j]);
                        added = index;
                    }
                }
                if (added !== index) {
                    this.createFileList([filesData[index]]);
                }
            }
        }
        else {
            this.createFileList(filesData);
        }
    };
    Uploader.prototype.isBlank = function (str) {
        return (!str || /^\s*$/.test(str));
    };
    Uploader.prototype.checkExtension = function (files) {
        var dropFiles = files;
        if (!this.isBlank(this.allowedExtensions)) {
            var allowedExtensions = [];
            var extensions = this.allowedExtensions.split(',');
            for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
                var extension = extensions_1[_i];
                allowedExtensions.push(extension.trim().toLocaleLowerCase());
            }
            for (var i = 0; i < files.length; i++) {
                if (allowedExtensions.indexOf(('.' + files[i].type).toLocaleLowerCase()) === -1) {
                    files[i].status = this.localizedTexts('invalidFileType');
                    files[i].statusCode = '0';
                }
            }
        }
        return dropFiles;
    };
    Uploader.prototype.validatedFileSize = function (fileSize) {
        var minSizeError = '';
        var maxSizeError = '';
        if (fileSize < this.minFileSize) {
            minSizeError = this.localizedTexts('invalidMinFileSize');
        }
        else if (fileSize > this.maxFileSize) {
            maxSizeError = this.localizedTexts('invalidMaxFileSize');
        }
        else {
            minSizeError = '';
            maxSizeError = '';
        }
        var errorMessage = { minSize: minSizeError, maxSize: maxSizeError };
        return errorMessage;
    };
    Uploader.prototype.isPreLoadFile = function (fileData) {
        var isPreload = false;
        for (var i = 0; i < this.files.length; i++) {
            if (this.files[i].name === fileData.name.slice(0, fileData.name.lastIndexOf('.')) && this.files[i].type === fileData.type) {
                isPreload = true;
            }
        }
        return isPreload;
    };
    Uploader.prototype.createCustomfileList = function (fileData) {
        this.createParentUL();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.element.id + 'Template', 'Template');
        for (var _i = 0, fileData_1 = fileData; _i < fileData_1.length; _i++) {
            var listItem = fileData_1[_i];
            var liElement = this.createElement('li', { className: FILE, attrs: { 'data-file-name': listItem.name } });
            this.uploadTemplateFn = this.templateComplier(this.template);
            // tslint:disable-next-line
            var liTempCompiler = this.uploadTemplateFn(listItem, this, 'template', this.element.id + 'Template', this.isStringTemplate, null, liElement);
            if (liTempCompiler) {
                var fromElements = [].slice.call(liTempCompiler);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(fromElements, liElement);
            }
            var index = fileData.indexOf(listItem);
            var eventArgs = {
                element: liElement,
                fileInfo: listItem,
                index: index,
                isPreload: this.isPreLoadFile(listItem)
            };
            var eventsArgs = {
                element: liElement,
                fileInfo: listItem,
                index: index,
                isPreload: this.isPreLoadFile(listItem)
            };
            this.trigger('rendering', eventArgs);
            this.trigger('fileListRendering', eventsArgs);
            this.listParent.appendChild(liElement);
            this.fileList.push(liElement);
        }
        this.renderReactTemplates();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.element.id + 'Template', 'Template', this, false);
    };
    Uploader.prototype.createParentUL = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listParent)) {
            this.listParent = this.createElement('ul', { className: LIST_PARENT });
            this.uploadWrapper.appendChild(this.listParent);
        }
    };
    Uploader.prototype.formFileList = function (fileData, files) {
        var fileList = this.createElement('li', { className: FILE });
        fileList.setAttribute('data-files-count', fileData.length + '');
        var fileContainer = this.createElement('span', { className: TEXT_CONTAINER });
        var statusMessage;
        for (var _i = 0, fileData_2 = fileData; _i < fileData_2.length; _i++) {
            var listItem = fileData_2[_i];
            var fileNameEle = this.createElement('span', { className: FILE_NAME });
            fileNameEle.innerHTML = this.getFileNameOnly(listItem.name);
            var fileTypeEle = this.createElement('span', { className: FILE_TYPE });
            var fileType = this.getFileType(listItem.name);
            fileTypeEle.innerHTML = '.' + fileType;
            if (!fileType) {
                fileTypeEle.classList.add('e-hidden');
            }
            if (!this.enableRtl) {
                fileContainer.appendChild(fileNameEle);
                fileContainer.appendChild(fileTypeEle);
            }
            else {
                var rtlContainer = this.createElement('span', { className: RTL_CONTAINER });
                rtlContainer.appendChild(fileTypeEle);
                rtlContainer.appendChild(fileNameEle);
                fileContainer.appendChild(rtlContainer);
            }
            this.truncateName(fileNameEle);
            statusMessage = this.formValidateFileInfo(listItem, fileList);
        }
        fileList.appendChild(fileContainer);
        this.setListToFileInfo(fileData, fileList);
        var index = this.listParent.querySelectorAll('li').length;
        var infoEle = this.createElement('span');
        if (fileList.classList.contains(INVALID_FILE)) {
            infoEle.classList.add(STATUS);
            infoEle.classList.add(INVALID_FILE);
            infoEle.innerText = fileData.length > 1 ? this.localizedTexts('invalidFileSelection') : statusMessage;
        }
        else {
            infoEle.classList.add(fileData.length > 1 ? INFORMATION : FILE_SIZE);
            infoEle.innerText = fileData.length > 1 ? this.localizedTexts('totalFiles') + ': ' + fileData.length + ' , '
                + this.localizedTexts('size') + ': ' +
                this.bytesToSize(this.getFileSize(fileData)) : this.bytesToSize(fileData[0].size);
            this.createFormInput(fileData);
        }
        fileContainer.appendChild(infoEle);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fileList.querySelector('.e-icons'))) {
            var iconElement = this.createElement('span', { className: 'e-icons', attrs: { 'tabindex': this.btnTabIndex } });
            /* istanbul ignore next */
            if (this.browserName === 'msie') {
                iconElement.classList.add('e-msie');
            }
            iconElement.setAttribute('title', this.localizedTexts('remove'));
            fileList.appendChild(fileContainer);
            fileList.appendChild(iconElement);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(iconElement, 'click', this.removeFiles, this);
            iconElement.classList.add(REMOVE_ICON);
        }
        var eventArgs = {
            element: fileList,
            fileInfo: this.mergeFileInfo(fileData, fileList),
            index: index,
            isPreload: this.isPreLoadFile(this.mergeFileInfo(fileData, fileList))
        };
        var eventsArgs = {
            element: fileList,
            fileInfo: this.mergeFileInfo(fileData, fileList),
            index: index,
            isPreload: this.isPreLoadFile(this.mergeFileInfo(fileData, fileList))
        };
        this.trigger('rendering', eventArgs);
        this.trigger('fileListRendering', eventsArgs);
        this.listParent.appendChild(fileList);
        this.fileList.push(fileList);
    };
    Uploader.prototype.formValidateFileInfo = function (listItem, fileList) {
        var statusMessage = listItem.status;
        var validationMessages = this.validatedFileSize(listItem.size);
        if (validationMessages.minSize !== '' || validationMessages.maxSize !== '') {
            this.addInvalidClass(fileList);
            statusMessage = validationMessages.minSize !== '' ? this.localizedTexts('invalidMinFileSize') :
                validationMessages.maxSize !== '' ? this.localizedTexts('invalidMaxFileSize') : statusMessage;
        }
        var typeValidationMessage = this.checkExtension(this.getFilesInArray(listItem))[0].status;
        if (typeValidationMessage === this.localizedTexts('invalidFileType')) {
            this.addInvalidClass(fileList);
            statusMessage = typeValidationMessage;
        }
        return statusMessage;
    };
    Uploader.prototype.addInvalidClass = function (fileList) {
        fileList.classList.add(INVALID_FILE);
    };
    Uploader.prototype.createFormInput = function (fileData) {
        var inputElement = this.element.cloneNode(true);
        inputElement.classList.add(HIDDEN_INPUT);
        for (var _i = 0, fileData_3 = fileData; _i < fileData_3.length; _i++) {
            var listItem = fileData_3[_i];
            listItem.input = inputElement;
        }
        inputElement.setAttribute('name', this.uploaderName);
        this.uploadWrapper.querySelector('.' + INPUT_WRAPPER).appendChild(inputElement);
        if (this.browserName !== 'msie' && this.browserName !== 'edge') {
            this.element.value = '';
        }
    };
    Uploader.prototype.getFileSize = function (fileData) {
        var fileSize = 0;
        for (var _i = 0, fileData_4 = fileData; _i < fileData_4.length; _i++) {
            var file = fileData_4[_i];
            fileSize += file.size;
        }
        return fileSize;
    };
    Uploader.prototype.mergeFileInfo = function (fileData, fileList) {
        var result = {
            name: '',
            rawFile: '',
            size: 0,
            status: '',
            type: '',
            validationMessages: { minSize: '', maxSize: '' },
            statusCode: '1',
            list: fileList
        };
        var fileNames = [];
        var type = '';
        for (var _i = 0, fileData_5 = fileData; _i < fileData_5.length; _i++) {
            var listItem = fileData_5[_i];
            fileNames.push(listItem.name);
            type = listItem.type;
        }
        result.name = fileNames.join(', ');
        result.size = this.getFileSize(fileData);
        result.type = type;
        result.status = this.statusForFormUpload(fileData, fileList);
        return result;
    };
    Uploader.prototype.statusForFormUpload = function (fileData, fileList) {
        var isValid = true;
        var statusMessage;
        for (var _i = 0, fileData_6 = fileData; _i < fileData_6.length; _i++) {
            var listItem = fileData_6[_i];
            statusMessage = listItem.status;
            var validationMessages = this.validatedFileSize(listItem.size);
            if (validationMessages.minSize !== '' || validationMessages.maxSize !== '') {
                isValid = false;
                statusMessage = validationMessages.minSize !== '' ? this.localizedTexts('invalidMinFileSize') :
                    validationMessages.maxSize !== '' ? this.localizedTexts('invalidMaxFileSize') : statusMessage;
            }
            var typeValidationMessage = this.checkExtension(this.getFilesInArray(listItem))[0].status;
            if (typeValidationMessage === this.localizedTexts('invalidFileType')) {
                isValid = false;
                statusMessage = typeValidationMessage;
            }
        }
        if (!isValid) {
            fileList.classList.add(INVALID_FILE);
            statusMessage = fileData.length > 1 ? this.localizedTexts('invalidFileSelection') : statusMessage;
        }
        else {
            statusMessage = this.localizedTexts('totalFiles') + ': ' + fileData.length + ' , '
                + this.localizedTexts('size') + ': ' +
                this.bytesToSize(this.getFileSize(fileData));
        }
        return statusMessage;
    };
    Uploader.prototype.formCustomFileList = function (fileData, files) {
        this.createParentUL();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.element.id + 'Template', 'Template');
        var fileList = this.createElement('li', { className: FILE });
        fileList.setAttribute('data-files-count', fileData.length + '');
        this.setListToFileInfo(fileData, fileList);
        var result = this.mergeFileInfo(fileData, fileList);
        fileList.setAttribute('data-file-name', result.name);
        this.uploadTemplateFn = this.templateComplier(this.template);
        // tslint:disable-next-line
        var liTempCompiler = this.uploadTemplateFn(result, this, 'template', this.element.id + 'Template', this.isStringTemplate, null, fileList);
        if (liTempCompiler) {
            var fromElements = [].slice.call(liTempCompiler);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(fromElements, fileList);
        }
        var index = this.listParent.querySelectorAll('li').length;
        if (!fileList.classList.contains(INVALID_FILE)) {
            this.createFormInput(fileData);
        }
        var eventArgs = {
            element: fileList,
            fileInfo: result,
            index: index,
            isPreload: this.isPreLoadFile(result)
        };
        var eventsArgs = {
            element: fileList,
            fileInfo: result,
            index: index,
            isPreload: this.isPreLoadFile(result)
        };
        this.trigger('rendering', eventArgs);
        this.trigger('fileListRendering', eventsArgs);
        this.listParent.appendChild(fileList);
        this.fileList.push(fileList);
        this.renderReactTemplates();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.element.id + 'Template', 'Template', this, false);
    };
    /**
     * Create the file list for specified files data.
     * @param { FileInfo[] } fileData - specifies the files data for file list creation.
     * @returns void
     */
    Uploader.prototype.createFileList = function (fileData, isSelectedFile) {
        if (this.isBlazorSaveUrl || this.isBlazorTemplate) {
            var fileListData = (isSelectedFile) ? this.filesData = this.filesData.concat(fileData) : fileData;
            // tslint:disable-next-line
            this.interopAdaptor.invokeMethodAsync('createFileList', fileListData, this.isForm);
        }
        else {
            this.createParentUL();
            if (this.template !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template)) {
                if (this.isFormUpload()) {
                    this.uploadWrapper.classList.add(FORM_UPLOAD);
                    this.formCustomFileList(fileData, this.element.files);
                }
                else {
                    this.createCustomfileList(fileData);
                }
            }
            else if (this.isFormUpload()) {
                this.uploadWrapper.classList.add(FORM_UPLOAD);
                this.formFileList(fileData, this.element.files);
            }
            else {
                for (var _i = 0, fileData_7 = fileData; _i < fileData_7.length; _i++) {
                    var listItem = fileData_7[_i];
                    var liElement = this.createElement('li', {
                        className: FILE,
                        attrs: { 'data-file-name': listItem.name, 'data-files-count': '1' }
                    });
                    var textContainer = this.createElement('span', { className: TEXT_CONTAINER });
                    var textElement = this.createElement('span', { className: FILE_NAME, attrs: { 'title': listItem.name } });
                    textElement.innerHTML = this.getFileNameOnly(listItem.name);
                    var fileExtension = this.createElement('span', { className: FILE_TYPE });
                    var fileType = this.getFileType(listItem.name);
                    fileExtension.innerHTML = '.' + fileType;
                    if (!fileType) {
                        fileExtension.classList.add('e-hidden');
                    }
                    if (!this.enableRtl) {
                        textContainer.appendChild(textElement);
                        textContainer.appendChild(fileExtension);
                    }
                    else {
                        var rtlContainer = this.createElement('span', { className: RTL_CONTAINER });
                        rtlContainer.appendChild(fileExtension);
                        rtlContainer.appendChild(textElement);
                        textContainer.appendChild(rtlContainer);
                    }
                    var fileSize = this.createElement('span', { className: FILE_SIZE });
                    fileSize.innerHTML = this.bytesToSize(listItem.size);
                    textContainer.appendChild(fileSize);
                    var statusElement = this.createElement('span', { className: STATUS });
                    textContainer.appendChild(statusElement);
                    statusElement.innerHTML = listItem.status;
                    liElement.appendChild(textContainer);
                    var iconElement = this.createElement('span', { className: ' e-icons',
                        attrs: { 'tabindex': this.btnTabIndex } });
                    /* istanbul ignore next */
                    if (this.browserName === 'msie') {
                        iconElement.classList.add('e-msie');
                    }
                    iconElement.setAttribute('title', this.localizedTexts('remove'));
                    liElement.appendChild(iconElement);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(iconElement, 'click', this.removeFiles, this);
                    if (listItem.statusCode === '2') {
                        statusElement.classList.add(UPLOAD_SUCCESS);
                        iconElement.classList.add(DELETE_ICON);
                        iconElement.setAttribute('title', this.localizedTexts('delete'));
                    }
                    else if (listItem.statusCode !== '1') {
                        statusElement.classList.remove(UPLOAD_SUCCESS);
                        statusElement.classList.add(VALIDATION_FAILS);
                    }
                    if (this.autoUpload && listItem.statusCode === '1' && this.asyncSettings.saveUrl !== '') {
                        statusElement.innerHTML = '';
                    }
                    if (!iconElement.classList.contains(DELETE_ICON)) {
                        iconElement.classList.add(REMOVE_ICON);
                    }
                    var index = fileData.indexOf(listItem);
                    var eventArgs = {
                        element: liElement,
                        fileInfo: listItem,
                        index: index,
                        isPreload: this.isPreLoadFile(listItem)
                    };
                    var eventsArgs = {
                        element: liElement,
                        fileInfo: listItem,
                        index: index,
                        isPreload: this.isPreLoadFile(listItem)
                    };
                    this.trigger('rendering', eventArgs);
                    this.trigger('fileListRendering', eventsArgs);
                    this.listParent.appendChild(liElement);
                    this.fileList.push(liElement);
                    this.truncateName(textElement);
                    var preventActionComplete = this.flag;
                    if (this.isPreLoadFile(listItem)) {
                        this.flag = false;
                        this.checkActionComplete(true);
                        this.flag = preventActionComplete;
                    }
                }
            }
        }
    };
    Uploader.prototype.getSlicedName = function (nameElement) {
        var text;
        text = nameElement.textContent;
        nameElement.dataset.tail = text.slice(text.length - 10);
    };
    Uploader.prototype.setListToFileInfo = function (fileData, fileList) {
        for (var _i = 0, fileData_8 = fileData; _i < fileData_8.length; _i++) {
            var listItem = fileData_8[_i];
            listItem.list = fileList;
        }
    };
    Uploader.prototype.truncateName = function (name) {
        var nameElement = name;
        if (this.browserName !== 'edge' && nameElement.offsetWidth < nameElement.scrollWidth) {
            this.getSlicedName(nameElement);
            /* istanbul ignore next */
        }
        else if (nameElement.offsetWidth + 1 < nameElement.scrollWidth) {
            this.getSlicedName(nameElement);
        }
    };
    Uploader.prototype.getFileType = function (name) {
        var extension;
        var index = name.lastIndexOf('.');
        if (index >= 0) {
            extension = name.substring(index + 1);
        }
        return extension ? extension : '';
    };
    Uploader.prototype.getFileNameOnly = function (name) {
        var type = this.getFileType(name);
        var names = name.split('.' + type);
        return type = names[0];
    };
    Uploader.prototype.setInitialAttributes = function () {
        if (this.initialAttr.accept) {
            this.element.setAttribute('accept', this.initialAttr.accept);
        }
        if (this.initialAttr.disabled) {
            this.element.setAttribute('disabled', 'disabled');
        }
        if (this.initialAttr.multiple) {
            var newAttr = document.createAttribute('multiple');
            this.element.setAttributeNode(newAttr);
        }
    };
    Uploader.prototype.filterfileList = function (files) {
        var filterFiles = [];
        var li;
        for (var i = 0; i < files.length; i++) {
            li = this.getLiElement(files[i]);
            if (!li.classList.contains(UPLOAD_SUCCESS)) {
                filterFiles.push(files[i]);
            }
        }
        return filterFiles;
    };
    Uploader.prototype.updateStatus = function (files, status, statusCode, updateLiStatus) {
        if (updateLiStatus === void 0) { updateLiStatus = true; }
        if (!(status === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(status)) && !(statusCode === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(statusCode))) {
            if (this.isBlazorSaveUrl) {
                for (var i = 0; i < this.filesData.length; i++) {
                    if (this.filesData[i].name === files.name) {
                        this.filesData[i].status = status;
                        this.filesData[i].statusCode = statusCode;
                    }
                }
            }
            else {
                files.status = status;
                files.statusCode = statusCode;
            }
        }
        if (updateLiStatus) {
            var li = this.getLiElement(files);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + STATUS)) && !((status === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(status)))) {
                    li.querySelector('.' + STATUS).textContent = status;
                }
            }
        }
        return files;
    };
    Uploader.prototype.getLiElement = function (files) {
        var index;
        for (var i = 0; i < this.filesData.length; i++) {
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.filesData[i].id) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(files.id)) ? (this.filesData[i].name === files.name &&
                this.filesData[i].id === files.id) : this.filesData[i].name === files.name) {
                index = i;
            }
        }
        return this.fileList[index];
    };
    Uploader.prototype.createProgressBar = function (liElement) {
        var progressbarWrapper = this.createElement('span', { className: PROGRESS_WRAPPER });
        var progressBar = this.createElement('progressbar', { className: PROGRESSBAR, attrs: { value: '0', max: '100' } });
        var progressbarInnerWrapper = this.createElement('span', { className: PROGRESS_INNER_WRAPPER });
        progressBar.setAttribute('style', 'width: 0%');
        var progressbarText = this.createElement('span', { className: PROGRESSBAR_TEXT });
        progressbarText.textContent = '0%';
        progressbarInnerWrapper.appendChild(progressBar);
        progressbarWrapper.appendChild(progressbarInnerWrapper);
        progressbarWrapper.appendChild(progressbarText);
        liElement.querySelector('.' + TEXT_CONTAINER).appendChild(progressbarWrapper);
    };
    /* istanbul ignore next */
    Uploader.prototype.updateProgressbar = function (e, li) {
        if (!isNaN(Math.round((e.loaded / e.total) * 100)) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + PROGRESSBAR))) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.progressInterval) && this.progressInterval !== '') {
                var value = (Math.round((e.loaded / e.total) * 100)) % parseInt(this.progressInterval, 10);
                if (value === 0 || value === 100) {
                    this.changeProgressValue(li, Math.round((e.loaded / e.total) * 100).toString() + '%');
                }
            }
            else {
                this.changeProgressValue(li, Math.round((e.loaded / e.total) * 100).toString() + '%');
            }
        }
    };
    Uploader.prototype.changeProgressValue = function (li, progressValue) {
        li.querySelector('.' + PROGRESSBAR).setAttribute('style', 'width:' + progressValue);
        li.querySelector('.' + PROGRESSBAR_TEXT).textContent = progressValue;
    };
    Uploader.prototype.uploadInProgress = function (e, files, customUI, request) {
        var li = this.getLiElement(files);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && (!customUI)) {
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
            /* istanbul ignore next */
            if (files.statusCode === '5') {
                this.cancelUploadingFile(files, e, request, li);
            }
            if (!(li.querySelectorAll('.' + PROGRESS_WRAPPER).length > 0) && li.querySelector('.' + STATUS)) {
                li.querySelector('.' + STATUS).classList.add(UPLOAD_INPROGRESS);
                this.createProgressBar(li);
                this.updateProgressBarClasses(li, UPLOAD_INPROGRESS);
                li.querySelector('.' + STATUS).classList.remove(UPLOAD_FAILED);
            }
            this.updateProgressbar(e, li);
            var iconEle = li.querySelector('.' + REMOVE_ICON);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconEle)) {
                iconEle.classList.add(ABORT_ICON, UPLOAD_INPROGRESS);
                iconEle.setAttribute('title', this.localizedTexts('abort'));
                iconEle.classList.remove(REMOVE_ICON);
            }
        }
        else {
            this.cancelUploadingFile(files, e, request);
        }
        var args = { e: e, operation: 'upload', file: this.updateStatus(files, this.localizedTexts('inProgress'), '3') };
        this.trigger('progress', args);
    };
    /* istanbul ignore next */
    Uploader.prototype.cancelUploadingFile = function (files, e, request, li) {
        var _this = this;
        if (files.statusCode === '5') {
            var eventArgs = {
                event: e,
                fileData: files,
                cancel: false,
                customFormData: []
            };
            this.trigger('canceling', eventArgs, function (eventArgs) {
                if (eventArgs.cancel) {
                    files.statusCode = '3';
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
                        var spinnerTarget = li.querySelector('.' + ABORT_ICON);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(spinnerTarget)) {
                            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(spinnerTarget);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(li.querySelector('.e-spinner-pane'));
                        }
                    }
                }
                else {
                    request.emitError = false;
                    request.httpRequest.abort();
                    var formData = new FormData();
                    if (files.statusCode === '5') {
                        var name_2 = _this.element.getAttribute('name');
                        formData.append(name_2, files.name);
                        formData.append('cancel-uploading', files.name);
                        _this.updateFormData(formData, eventArgs.customFormData);
                        var ajax = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](_this.asyncSettings.removeUrl, 'POST', true, null);
                        ajax.emitError = false;
                        ajax.onLoad = function (e) { _this.removecanceledFile(e, files); return {}; };
                        ajax.send(formData);
                    }
                }
            });
        }
    };
    Uploader.prototype.removecanceledFile = function (e, file) {
        var liElement = this.getLiElement(file);
        if (liElement.querySelector('.' + RETRY_ICON) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + ABORT_ICON))) {
            return;
        }
        this.updateStatus(file, this.localizedTexts('fileUploadCancel'), '5');
        this.renderFailureState(e, file, liElement);
        var spinnerTarget = liElement.querySelector('.' + REMOVE_ICON);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(spinnerTarget);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.e-spinner-pane'));
        }
        var requestResponse = e && e.currentTarget ? this.getResponse(e) : null;
        var args = { event: e, response: requestResponse, operation: 'cancel', file: file };
        this.trigger('success', args);
    };
    Uploader.prototype.renderFailureState = function (e, file, liElement) {
        var _this = this;
        this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
        this.removeProgressbar(liElement, 'failure');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.e-file-status'))) {
            liElement.querySelector('.e-file-status').classList.add(UPLOAD_FAILED);
        }
        var deleteIcon = liElement.querySelector('.' + ABORT_ICON);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(deleteIcon)) {
            return;
        }
        deleteIcon.classList.remove(ABORT_ICON, UPLOAD_INPROGRESS);
        deleteIcon.classList.add(REMOVE_ICON);
        deleteIcon.setAttribute('title', this.localizedTexts('remove'));
        this.pauseButton = this.createElement('span', { className: 'e-icons e-file-reload-btn', attrs: { 'tabindex': this.btnTabIndex } });
        deleteIcon.parentElement.insertBefore(this.pauseButton, deleteIcon);
        this.pauseButton.setAttribute('title', this.localizedTexts('retry'));
        var retryElement = liElement.querySelector('.' + RETRY_ICON);
        /* istanbul ignore next */
        retryElement.addEventListener('click', function (e) { _this.reloadcanceledFile(e, file, liElement, false); }, false);
    };
    Uploader.prototype.reloadcanceledFile = function (e, file, liElement, custom) {
        file.statusCode = '1';
        file.status = this.localizedTexts('readyToUploadMessage');
        if (!custom) {
            liElement.querySelector('.' + STATUS).classList.remove(UPLOAD_FAILED);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + RETRY_ICON))) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.' + RETRY_ICON));
            }
            this.pauseButton = null;
        }
        /* istanbul ignore next */
        liElement.classList.add(RESTRICT_RETRY);
        this.upload([file]);
    };
    /* istanbul ignore next */
    Uploader.prototype.uploadComplete = function (e, file, customUI) {
        var status = e.target;
        if (status.readyState === 4 && status.status >= 200 && status.status <= 299) {
            var li = this.getLiElement(file);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && (!customUI || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(customUI))) {
                return;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
                this.updateProgressBarClasses(li, UPLOAD_SUCCESS);
                this.removeProgressbar(li, 'success');
                var iconEle = li.querySelector('.' + ABORT_ICON);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(iconEle)) {
                    iconEle.classList.add(DELETE_ICON);
                    iconEle.setAttribute('title', this.localizedTexts('delete'));
                    iconEle.classList.remove(ABORT_ICON);
                    iconEle.classList.remove(UPLOAD_INPROGRESS);
                }
            }
            this.raiseSuccessEvent(e, file);
        }
        else {
            this.uploadFailed(e, file);
        }
    };
    Uploader.prototype.getResponse = function (e) {
        // tslint:disable-next-line
        var target = e.currentTarget;
        var response = {
            readyState: target.readyState,
            statusCode: target.status,
            statusText: target.statusText,
            headers: target.getAllResponseHeaders(),
            withCredentials: target.withCredentials
        };
        return response;
    };
    /* istanbul ignore next */
    Uploader.prototype.serverRemoveIconBindEvent = function () {
        if (this.uploadWrapper && this.isBlazorSaveUrl) {
            var iconElement = [].slice.call(this.uploadWrapper.querySelectorAll('ul li'));
            for (var i = 0; i < iconElement.length; i++) {
                var removeIconEle = (iconElement[i]) ? iconElement[i].querySelector('.e-icons') : null;
                if (removeIconEle) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(removeIconEle, 'click', this.removeFiles);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(removeIconEle, 'click', this.removeFiles, this);
                }
            }
        }
    };
    Uploader.prototype.raiseSuccessEvent = function (e, file) {
        var _this = this;
        var response = e && e.currentTarget ? this.getResponse(e) : null;
        var statusMessage = this.localizedTexts('uploadSuccessMessage');
        var args = {
            e: e, response: response, operation: 'upload', file: this.updateStatus(file, statusMessage, '2', false), statusText: statusMessage
        };
        if (!this.isBlazorSaveUrl) {
            var liElement = this.getLiElement(file);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
                var spinnerEle = liElement.querySelector('.' + SPINNER_PANE);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(spinnerEle)) {
                    Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(liElement);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(spinnerEle);
                }
            }
        }
        this.trigger('success', args, function (args) {
            // tslint:disable-next-line
            _this.updateStatus(file, args.statusText, '2');
            _this.uploadedFilesData.push(file);
            if (!_this.isBlazorSaveUrl) {
                _this.trigger('change', { file: _this.uploadedFilesData });
            }
            _this.checkActionButtonStatus();
            if (_this.fileList.length > 0) {
                if ((!(_this.getLiElement(file)).classList.contains(RESTRICT_RETRY))) {
                    _this.uploadSequential();
                    _this.checkActionComplete(true);
                }
                else {
                    /* istanbul ignore next */
                    (_this.getLiElement(file)).classList.remove(RESTRICT_RETRY);
                }
            }
        });
    };
    Uploader.prototype.uploadFailed = function (e, file) {
        var _this = this;
        var li = this.getLiElement(file);
        var response = e && e.currentTarget ? this.getResponse(e) : null;
        var statusMessage = this.localizedTexts('uploadFailedMessage');
        var args = {
            e: e, response: response, operation: 'upload', file: this.updateStatus(file, statusMessage, '0', false), statusText: statusMessage
        };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
            this.renderFailureState(e, file, li);
        }
        this.trigger('failure', args, function (args) {
            // tslint:disable-next-line
            _this.updateStatus(file, args.statusText, '0');
            _this.checkActionButtonStatus();
            _this.uploadSequential();
            _this.checkActionComplete(true);
        });
    };
    Uploader.prototype.uploadSequential = function () {
        if (this.sequentialUpload) {
            if (this.autoUpload) {
                /* istanbul ignore next */
                this.checkAutoUpload(this.filesData);
            }
            else {
                this.uploadButtonClick();
            }
        }
    };
    Uploader.prototype.checkActionComplete = function (increment) {
        increment ? ++this.actionCompleteCount : --this.actionCompleteCount;
        this.raiseActionComplete();
    };
    Uploader.prototype.raiseActionComplete = function () {
        if ((this.filesData.length === this.actionCompleteCount) && this.flag) {
            this.flag = false;
            var eventArgs = {
                fileData: []
            };
            eventArgs.fileData = this.getSelectedFileStatus(this.selectedFiles);
            this.trigger('actionComplete', eventArgs);
        }
    };
    Uploader.prototype.getSelectedFileStatus = function (selectedFiles) {
        var matchFiles = [];
        var matchFilesIndex = 0;
        for (var selectFileIndex = 0; selectFileIndex < selectedFiles.length; selectFileIndex++) {
            var selectedFileData = selectedFiles[selectFileIndex];
            for (var fileDataIndex = 0; fileDataIndex < this.filesData.length; fileDataIndex++) {
                if (this.filesData[fileDataIndex].name === selectedFileData.name) {
                    matchFiles[matchFilesIndex] = this.filesData[fileDataIndex];
                    ++matchFilesIndex;
                }
            }
        }
        return matchFiles;
    };
    Uploader.prototype.updateProgressBarClasses = function (li, className) {
        var progressBar = li.querySelector('.' + PROGRESSBAR);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(progressBar)) {
            progressBar.classList.add(className);
        }
    };
    Uploader.prototype.removeProgressbar = function (li, callType) {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + PROGRESS_WRAPPER))) {
            this.progressAnimation = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"]({ duration: 1250 });
            this.progressAnimation.animate(li.querySelector('.' + PROGRESS_WRAPPER), { name: 'FadeOut' });
            this.progressAnimation.animate(li.querySelector('.' + PROGRESSBAR_TEXT), { name: 'FadeOut' });
            setTimeout(function () { _this.animateProgressBar(li, callType); }, 750);
        }
    };
    /* istanbul ignore next */
    Uploader.prototype.animateProgressBar = function (li, callType) {
        if (callType === 'success') {
            li.classList.add(UPLOAD_SUCCESS);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + STATUS))) {
                li.querySelector('.' + STATUS).classList.remove(UPLOAD_INPROGRESS);
                this.progressAnimation.animate(li.querySelector('.' + STATUS), { name: 'FadeIn' });
                li.querySelector('.' + STATUS).classList.add(UPLOAD_SUCCESS);
            }
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + STATUS))) {
                li.querySelector('.' + STATUS).classList.remove(UPLOAD_INPROGRESS);
                this.progressAnimation.animate(li.querySelector('.' + STATUS), { name: 'FadeIn' });
                li.querySelector('.' + STATUS).classList.add(UPLOAD_FAILED);
            }
        }
        if (li.querySelector('.' + PROGRESS_WRAPPER)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(li.querySelector('.' + PROGRESS_WRAPPER));
        }
    };
    Uploader.prototype.setExtensions = function (extensions) {
        if (extensions !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(extensions)) {
            this.element.setAttribute('accept', extensions);
        }
        else {
            this.element.removeAttribute('accept');
        }
    };
    Uploader.prototype.templateComplier = function (uploadTemplate) {
        if (uploadTemplate) {
            var exception = void 0;
            try {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(uploadTemplate, document).length) {
                    return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(uploadTemplate, document).innerHTML.trim());
                }
            }
            catch (exception) {
                return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(uploadTemplate);
            }
        }
        return undefined;
    };
    Uploader.prototype.setRTL = function () {
        this.enableRtl ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.uploadWrapper], RTL) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.uploadWrapper], RTL);
    };
    Uploader.prototype.localizedTexts = function (localeText) {
        this.l10n.setLocale(this.locale);
        return this.l10n.getConstant(localeText);
    };
    Uploader.prototype.setControlStatus = function () {
        if (!this.enabled) {
            this.uploadWrapper.classList.add(DISABLED);
            this.element.setAttribute('disabled', 'disabled');
            this.browseButton.setAttribute('disabled', 'disabled');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.clearButton)) {
                this.clearButton.setAttribute('disabled', 'disabled');
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploadButton)) {
                this.uploadButton.setAttribute('disabled', 'disabled');
            }
        }
        else {
            if (this.uploadWrapper.classList.contains(DISABLED)) {
                this.uploadWrapper.classList.remove(DISABLED);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.browseButton) && this.element.hasAttribute('disabled')) {
                this.element.removeAttribute('disabled');
                this.browseButton.removeAttribute('disabled');
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.clearButton) && this.clearButton.hasAttribute('disabled')) {
                this.clearButton.removeAttribute('disabled');
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploadButton) && this.uploadButton.hasAttribute('disabled')) {
                this.uploadButton.hasAttribute('disabled');
            }
        }
    };
    Uploader.prototype.checkHTMLAttributes = function (isDynamic) {
        var attributes = isDynamic ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.htmlAttributes) ? [] : Object.keys(this.htmlAttributes) :
            ['accept', 'multiple', 'disabled'];
        for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
            var prop = attributes_1[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute(prop))) {
                switch (prop) {
                    case 'accept':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploaderOptions) || (this.uploaderOptions['allowedExtensions'] === undefined))
                            || isDynamic) {
                            this.setProperties({ allowedExtensions: this.element.getAttribute('accept') }, !isDynamic);
                            this.initialAttr.accept = this.allowedExtensions;
                        }
                        break;
                    case 'multiple':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploaderOptions) || (this.uploaderOptions['multiple'] === undefined)) || isDynamic) {
                            var isMutiple = this.element.getAttribute(prop) === 'multiple' ||
                                this.element.getAttribute(prop) === '' || this.element.getAttribute(prop) === 'true' ? true : false;
                            this.setProperties({ multiple: isMutiple }, !isDynamic);
                            this.initialAttr.multiple = true;
                        }
                        break;
                    case 'disabled':
                        // tslint:disable-next-line
                        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploaderOptions) || (this.uploaderOptions['enabled'] === undefined)) || isDynamic) {
                            var isDisabled = this.element.getAttribute(prop) === 'disabled' ||
                                this.element.getAttribute(prop) === '' || this.element.getAttribute(prop) === 'true' ? false : true;
                            this.setProperties({ enabled: isDisabled }, !isDynamic);
                            this.initialAttr.disabled = true;
                        }
                }
            }
        }
    };
    Uploader.prototype.chunkUpload = function (file, custom, fileIndex) {
        var start = 0;
        var end = Math.min(this.asyncSettings.chunkSize, file.size);
        var index = 0;
        var blob = file.rawFile.slice(start, end);
        var metaData = { chunkIndex: index, blob: blob, file: file, start: start, end: end, retryCount: 0, request: null };
        this.sendRequest(file, metaData, custom, fileIndex);
    };
    Uploader.prototype.sendRequest = function (file, metaData, custom, fileIndex) {
        var _this = this;
        var formData = new FormData();
        var cloneFile;
        var blob = file.rawFile.slice(metaData.start, metaData.end);
        formData.append('chunkFile', blob, file.name);
        formData.append(this.uploaderName, blob, file.name);
        formData.append('chunk-index', metaData.chunkIndex.toString());
        formData.append('chunkIndex', metaData.chunkIndex.toString());
        var totalChunk = Math.max(Math.ceil(file.size / this.asyncSettings.chunkSize), 1);
        formData.append('total-chunk', totalChunk.toString());
        formData.append('totalChunk', totalChunk.toString());
        var ajax = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"]({ url: this.asyncSettings.saveUrl, type: 'POST', async: true, contentType: null });
        ajax.emitError = false;
        ajax.onLoad = function (e) { _this.chunkUploadComplete(e, metaData, custom); return {}; };
        ajax.onUploadProgress = function (e) {
            _this.chunkUploadInProgress(e, metaData, custom);
            return {};
        };
        var eventArgs = {
            fileData: file,
            customFormData: [],
            cancel: false,
            chunkSize: this.asyncSettings.chunkSize === 0 ? null : this.asyncSettings.chunkSize
        };
        ajax.beforeSend = function (e) {
            eventArgs.currentRequest = ajax.httpRequest;
            eventArgs.currentChunkIndex = metaData.chunkIndex;
            /* istanbul ignore next */
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                if (_this.currentRequestHeader) {
                    _this.updateCustomheader(ajax.httpRequest, _this.currentRequestHeader);
                }
                if (_this.customFormDatas) {
                    _this.updateFormData(formData, _this.customFormDatas);
                }
            }
            if (eventArgs.currentChunkIndex === 0) {
                // This event is currently not required but to avoid breaking changes for previous customer, we have included.
                _this.trigger('uploading', eventArgs, function (eventArgs) {
                    _this.uploadingEventCallback(formData, eventArgs, e, file);
                });
            }
            else {
                _this.trigger('chunkUploading', eventArgs, function (eventArgs) {
                    _this.uploadingEventCallback(formData, eventArgs, e, file);
                });
            }
        };
        /* istanbul ignore next */
        ajax.onError = function (e) { _this.chunkUploadFailed(e, metaData, custom); return {}; };
        ajax.send(formData);
        metaData.request = ajax;
    };
    Uploader.prototype.uploadingEventCallback = function (formData, eventArgs, e, file) {
        if (eventArgs.cancel) {
            this.eventCancelByArgs(e, eventArgs, file);
        }
        else {
            this.updateFormData(formData, eventArgs.customFormData);
        }
    };
    Uploader.prototype.eventCancelByArgs = function (e, eventArgs, file) {
        var _this = this;
        e.cancel = true;
        if (eventArgs.fileData.statusCode === '5') {
            return;
        }
        eventArgs.fileData.statusCode = '5';
        eventArgs.fileData.status = this.localizedTexts('fileUploadCancel');
        var liElement = this.getLiElement(eventArgs.fileData);
        if (liElement) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + STATUS))) {
                liElement.querySelector('.' + STATUS).innerHTML = this.localizedTexts('fileUploadCancel');
                liElement.querySelector('.' + STATUS).classList.add(UPLOAD_FAILED);
            }
            this.pauseButton = this.createElement('span', { className: 'e-icons e-file-reload-btn', attrs: { 'tabindex': this.btnTabIndex } });
            var removeIcon = liElement.querySelector('.' + REMOVE_ICON);
            if (removeIcon) {
                removeIcon.parentElement.insertBefore(this.pauseButton, removeIcon);
            }
            this.pauseButton.setAttribute('title', this.localizedTexts('retry'));
            /* istanbul ignore next */
            this.pauseButton.addEventListener('click', function (e) { _this.reloadcanceledFile(e, file, liElement); }, false);
            this.checkActionButtonStatus();
        }
    };
    Uploader.prototype.checkChunkUpload = function () {
        return (this.asyncSettings.chunkSize <= 0 || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.chunkSize)) ? false : true;
    };
    Uploader.prototype.chunkUploadComplete = function (e, metaData, custom) {
        var _this = this;
        var response = e.target;
        var liElement;
        if (response.readyState === 4 && response.status >= 200 && response.status < 300) {
            var requestResponse = e && e.currentTarget ? this.getResponse(e) : null;
            var totalChunk = Math.max(Math.ceil(metaData.file.size / this.asyncSettings.chunkSize), 1);
            var eventArgs = {
                event: e,
                file: metaData.file,
                chunkIndex: metaData.chunkIndex,
                totalChunk: totalChunk,
                chunkSize: this.asyncSettings.chunkSize,
                response: requestResponse
            };
            this.trigger('chunkSuccess', eventArgs);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom) {
                liElement = this.getLiElement(metaData.file);
            }
            this.updateMetaData(metaData);
            if (metaData.end === metaData.file.size) {
                metaData.file.statusCode = '3';
            }
            if (metaData.file.statusCode === '5') {
                var eventArgs_1 = { event: e, fileData: metaData.file, cancel: false, customFormData: [] };
                this.trigger('canceling', eventArgs_1, function (eventArgs) {
                    /* istanbul ignore next */
                    if (eventArgs.cancel) {
                        metaData.file.statusCode = '3';
                        var spinnerTarget = liElement.querySelector('.' + ABORT_ICON);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(spinnerTarget)) {
                            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(spinnerTarget);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.e-spinner-pane'));
                        }
                        _this.sendNextRequest(metaData);
                    }
                    else {
                        metaData.request.emitError = false;
                        response.abort();
                        var formData = new FormData();
                        var name_3 = _this.element.getAttribute('name');
                        formData.append(name_3, metaData.file.name);
                        formData.append('cancel-uploading', metaData.file.name);
                        formData.append('cancelUploading', metaData.file.name);
                        _this.updateFormData(formData, eventArgs.customFormData);
                        var ajax = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](_this.asyncSettings.removeUrl, 'POST', true, null);
                        ajax.emitError = false;
                        ajax.onLoad = function (e) { _this.removeChunkFile(e, metaData, custom); return {}; };
                        ajax.send(formData);
                    }
                });
            }
            else {
                if ((totalChunk - 1) === metaData.chunkIndex && totalChunk > metaData.chunkIndex) {
                    var index = this.pausedData.indexOf(metaData);
                    if (index >= 0) {
                        this.pausedData.splice(index, 1);
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom) && liElement) {
                        if (liElement) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.' + PAUSE_UPLOAD));
                        }
                        this.removeChunkProgressBar(metaData);
                    }
                    this.raiseSuccessEvent(e, metaData.file);
                    return;
                }
                if (metaData.file.statusCode !== '4') {
                    this.sendNextRequest(metaData);
                }
            }
        }
        else {
            this.chunkUploadFailed(e, metaData);
        }
    };
    Uploader.prototype.sendNextRequest = function (metaData) {
        metaData.start = metaData.end;
        metaData.end += this.asyncSettings.chunkSize;
        metaData.end = Math.min(metaData.end, metaData.file.size);
        metaData.chunkIndex += 1;
        this.sendRequest(metaData.file, metaData);
    };
    Uploader.prototype.removeChunkFile = function (e, metaData, custom) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) && !custom)) {
            var liElement = this.getLiElement(metaData.file);
            var deleteIcon = liElement.querySelector('.' + ABORT_ICON);
            var spinnerTarget = deleteIcon;
            this.updateStatus(metaData.file, this.localizedTexts('fileUploadCancel'), '5');
            this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
            this.removeProgressbar(liElement, 'failure');
            deleteIcon.classList.remove(ABORT_ICON);
            deleteIcon.classList.add(REMOVE_ICON);
            deleteIcon.setAttribute('title', this.localizedTexts('remove'));
            var pauseIcon = liElement.querySelector('.' + PAUSE_UPLOAD);
            pauseIcon.classList.add(RETRY_ICON);
            pauseIcon.classList.remove(PAUSE_UPLOAD);
            pauseIcon.setAttribute('title', this.localizedTexts('retry'));
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(deleteIcon)) {
                Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(spinnerTarget);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.e-spinner-pane'));
            }
        }
    };
    Uploader.prototype.pauseUpload = function (metaData, e, custom) {
        metaData.file.statusCode = '4';
        metaData.file.status = this.localizedTexts('pause');
        this.updateMetaData(metaData);
        var eventArgs = {
            event: e ? e : null,
            file: metaData.file,
            chunkIndex: metaData.chunkIndex,
            chunkCount: Math.round(metaData.file.size / this.asyncSettings.chunkSize),
            chunkSize: this.asyncSettings.chunkSize
        };
        this.abortUpload(metaData, custom, eventArgs);
    };
    Uploader.prototype.abortUpload = function (metaData, custom, eventArgs) {
        if (metaData.file.statusCode !== '4') {
            metaData.request.emitError = false;
            metaData.request.httpRequest.abort();
        }
        var liElement = this.getLiElement(metaData.file);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom)) {
            var targetElement = liElement.querySelector('.' + PAUSE_UPLOAD);
            targetElement.classList.remove(PAUSE_UPLOAD);
            targetElement.classList.add(RESUME_UPLOAD);
            targetElement.setAttribute('title', this.localizedTexts('resume'));
            targetElement.nextElementSibling.classList.add(REMOVE_ICON);
            targetElement.nextElementSibling.classList.remove(ABORT_ICON);
            targetElement.nextElementSibling.setAttribute('title', this.localizedTexts('remove'));
        }
        for (var i = 0; i < this.pausedData.length; i++) {
            if (this.pausedData[i].file.name === metaData.file.name) {
                this.pausedData.splice(i, 1);
            }
        }
        this.pausedData.push(metaData);
        this.trigger('pausing', eventArgs);
    };
    Uploader.prototype.resumeUpload = function (metaData, e, custom) {
        var liElement = this.getLiElement(metaData.file);
        var targetElement;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
            targetElement = liElement.querySelector('.' + RESUME_UPLOAD);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(targetElement) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom)) {
            targetElement.classList.remove(RESUME_UPLOAD);
            targetElement.classList.add(PAUSE_UPLOAD);
            targetElement.setAttribute('title', this.localizedTexts('pause'));
            targetElement.nextElementSibling.classList.remove(REMOVE_ICON);
            targetElement.nextElementSibling.classList.add(ABORT_ICON);
            targetElement.nextElementSibling.setAttribute('title', this.localizedTexts('abort'));
        }
        metaData.file.status = this.localizedTexts('inProgress');
        metaData.file.statusCode = '3';
        this.updateMetaData(metaData);
        var eventArgs = {
            event: e ? e : null,
            file: metaData.file,
            chunkIndex: metaData.chunkIndex,
            chunkCount: Math.round(metaData.file.size / this.asyncSettings.chunkSize),
            chunkSize: this.asyncSettings.chunkSize
        };
        this.trigger('resuming', eventArgs);
        for (var i = 0; i < this.pausedData.length; i++) {
            if (this.pausedData[i].end === this.pausedData[i].file.size) {
                this.chunkUploadComplete(e, metaData, custom);
            }
            else {
                if (this.pausedData[i].file.name === metaData.file.name) {
                    this.pausedData[i].start = this.pausedData[i].end;
                    this.pausedData[i].end = this.pausedData[i].end + this.asyncSettings.chunkSize;
                    this.pausedData[i].end = Math.min(this.pausedData[i].end, this.pausedData[i].file.size);
                    this.pausedData[i].chunkIndex = this.pausedData[i].chunkIndex + 1;
                    this.sendRequest(this.pausedData[i].file, this.pausedData[i], custom);
                }
            }
        }
    };
    Uploader.prototype.updateMetaData = function (metaData) {
        if (this.uploadMetaData.indexOf(metaData) === -1) {
            this.uploadMetaData.push(metaData);
        }
        else {
            this.uploadMetaData.splice(this.uploadMetaData.indexOf(metaData), 1);
            this.uploadMetaData.push(metaData);
        }
    };
    Uploader.prototype.removeChunkProgressBar = function (metaData) {
        var liElement = this.getLiElement(metaData.file);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
            this.updateProgressBarClasses(liElement, UPLOAD_SUCCESS);
            this.removeProgressbar(liElement, 'success');
            var cancelButton = liElement.querySelector('.' + ABORT_ICON);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cancelButton)) {
                cancelButton.classList.add(DELETE_ICON);
                cancelButton.setAttribute('title', this.localizedTexts('delete'));
                cancelButton.classList.remove(ABORT_ICON, UPLOAD_INPROGRESS);
            }
        }
    };
    Uploader.prototype.chunkUploadFailed = function (e, metaData, custom) {
        var _this = this;
        var chunkCount = Math.max(Math.ceil(metaData.file.size / this.asyncSettings.chunkSize), 1);
        var liElement;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom)) {
            liElement = this.getLiElement(metaData.file);
        }
        var requestResponse = e && e.currentTarget ? this.getResponse(e) : null;
        var eventArgs = {
            event: e,
            file: metaData.file,
            chunkIndex: metaData.chunkIndex,
            totalChunk: chunkCount,
            chunkSize: this.asyncSettings.chunkSize,
            cancel: false,
            response: requestResponse
        };
        this.trigger('chunkFailure', eventArgs, function (eventArgs) {
            // To prevent triggering of failure event
            // tslint:disable-next-line
            if (!eventArgs.cancel) {
                if (metaData.retryCount < _this.asyncSettings.retryCount) {
                    setTimeout(function () { _this.retryRequest(liElement, metaData, custom); }, _this.asyncSettings.retryAfterDelay);
                }
                else {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
                        var pauseButton = liElement.querySelector('.' + PAUSE_UPLOAD) ?
                            liElement.querySelector('.' + PAUSE_UPLOAD) : liElement.querySelector('.' + RESUME_UPLOAD);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(pauseButton)) {
                            pauseButton.classList.add(RETRY_ICON);
                            pauseButton.classList.remove(PAUSE_UPLOAD, RESUME_UPLOAD);
                        }
                        _this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
                        _this.removeProgressbar(liElement, 'failure');
                        liElement.querySelector('.e-icons').classList.remove(UPLOAD_INPROGRESS);
                        var iconElement = liElement.querySelector('.' + ABORT_ICON) ?
                            liElement.querySelector('.' + ABORT_ICON) : liElement.querySelector('.' + REMOVE_ICON);
                        iconElement.classList.remove(ABORT_ICON);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + PAUSE_UPLOAD))) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(liElement.querySelector('.' + PAUSE_UPLOAD));
                        }
                        if (metaData.start > 0) {
                            iconElement.classList.add(DELETE_ICON);
                            iconElement.setAttribute('title', _this.localizedTexts('delete'));
                        }
                        else {
                            iconElement.classList.add(REMOVE_ICON);
                            iconElement.setAttribute('title', _this.localizedTexts('remove'));
                        }
                    }
                    metaData.retryCount = 0;
                    var file_1 = metaData.file;
                    var failureMessage = _this.localizedTexts('uploadFailedMessage');
                    var args = {
                        e: e, response: requestResponse,
                        operation: 'upload',
                        file: _this.updateStatus(file_1, failureMessage, '0', false),
                        statusText: failureMessage
                    };
                    _this.trigger('failure', args, function (args) {
                        // tslint:disable-next-line
                        _this.updateStatus(file_1, args.statusText, '0');
                        _this.uploadSequential();
                        _this.checkActionComplete(true);
                    });
                }
            }
        });
    };
    Uploader.prototype.retryRequest = function (liElement, metaData, custom) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom) || !custom) && liElement) {
            this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
        }
        metaData.retryCount += 1;
        this.sendRequest(metaData.file, metaData);
    };
    Uploader.prototype.checkPausePlayAction = function (e) {
        var targetElement = e.target;
        var selectedElement = e.target.parentElement;
        var index = this.fileList.indexOf(selectedElement);
        var fileData = this.filesData[index];
        var metaData = this.getCurrentMetaData(fileData);
        if (targetElement.classList.contains(PAUSE_UPLOAD)) {
            /* istanbul ignore next */
            this.pauseUpload(metaData, e);
        }
        else if (targetElement.classList.contains(RESUME_UPLOAD)) {
            /* istanbul ignore next */
            this.resumeUpload(metaData, e);
        }
        else if (targetElement.classList.contains(RETRY_ICON)) {
            if (metaData.file.status === this.localizedTexts('fileUploadCancel')) {
                this.retryUpload(metaData, false);
            }
            else {
                this.retryUpload(metaData, true);
            }
        }
    };
    Uploader.prototype.retryUpload = function (metaData, fromcanceledStage) {
        if (fromcanceledStage) {
            metaData.end = metaData.end + this.asyncSettings.chunkSize;
            metaData.start = metaData.start + this.asyncSettings.chunkSize;
            this.sendRequest(metaData.file, metaData);
        }
        else {
            metaData.file.statusCode = '1';
            metaData.file.status = this.localizedTexts('readyToUploadMessage');
            this.chunkUpload(metaData.file);
        }
        /* istanbul ignore next */
        (this.getLiElement(metaData.file)).classList.add(RESTRICT_RETRY);
    };
    Uploader.prototype.chunkUploadInProgress = function (e, metaData, custom) {
        var _this = this;
        if (metaData.file.statusCode === '4') {
            return;
        }
        if (metaData.file.statusCode !== '4' && metaData.file.statusCode !== '5') {
            metaData.file.statusCode = '3';
            metaData.file.status = this.localizedTexts('inProgress');
        }
        this.updateMetaData(metaData);
        var liElement = this.getLiElement(metaData.file);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
            return;
        }
        var target;
        var retryElement = liElement.querySelector('.' + RETRY_ICON);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(retryElement)) {
            retryElement.classList.add(PAUSE_UPLOAD);
            retryElement.setAttribute('title', this.localizedTexts('pause'));
            retryElement.classList.remove(RETRY_ICON);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
            if (!(liElement.querySelectorAll('.' + PROGRESS_WRAPPER).length > 0)) {
                var statusElement = liElement.querySelector('.' + STATUS);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template)) {
                    statusElement.classList.add(UPLOAD_INPROGRESS);
                    statusElement.classList.remove(UPLOAD_FAILED);
                    this.createProgressBar(liElement);
                    this.updateProgressBarClasses(liElement, UPLOAD_INPROGRESS);
                }
                var clearIcon = liElement.querySelector('.' + REMOVE_ICON) ? liElement.querySelector('.' + REMOVE_ICON) :
                    liElement.querySelector('.' + DELETE_ICON);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(clearIcon)) {
                    clearIcon.classList.add(ABORT_ICON);
                    clearIcon.setAttribute('title', this.localizedTexts('abort'));
                    clearIcon.classList.remove(REMOVE_ICON);
                }
            }
            if (!isNaN(Math.round((e.loaded / e.total) * 100)) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template) && metaData.file.statusCode !== '4') {
                var loadedSize = (metaData.chunkIndex * this.asyncSettings.chunkSize);
                var currentLoaded = e.loaded;
                if (currentLoaded > this.asyncSettings.chunkSize) {
                    currentLoaded = this.asyncSettings.chunkSize;
                }
                var value = Math.min((((loadedSize + currentLoaded) / metaData.file.size) * 100), 100);
                this.changeProgressValue(liElement, Math.round(value).toString() + '%');
            }
            if (metaData.chunkIndex === 0) {
                this.checkActionButtonStatus();
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement.querySelector('.' + PAUSE_UPLOAD)) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template)) {
            this.pauseButton = this.createElement('span', { className: 'e-icons e-file-pause-btn', attrs: { 'tabindex': this.btnTabIndex } });
            if (this.browserName === 'msie') {
                this.pauseButton.classList.add('e-msie');
            }
            var abortIcon = liElement.querySelector('.' + ABORT_ICON);
            abortIcon.parentElement.insertBefore(this.pauseButton, abortIcon);
            this.pauseButton.setAttribute('title', this.localizedTexts('pause'));
            this.pauseButton.addEventListener('click', function (e) { _this.checkPausePlayAction(e); }, false);
        }
    };
    /**
     * It is used to convert bytes value into kilobytes or megabytes depending on the size based
     * on [binary prefix](https://en.wikipedia.org/wiki/Binary_prefix).
     * @param { number } bytes - specifies the file size in bytes.
     * @returns string
     */
    Uploader.prototype.bytesToSize = function (bytes) {
        var i = -1;
        var size;
        if (!bytes) {
            return '0.0 KB';
        }
        do {
            bytes = bytes / 1024;
            i++;
        } while (bytes > 99);
        if (i >= 2) {
            bytes = bytes * 1024;
            i = 1;
        }
        return Math.max(bytes, 0).toFixed(1) + ' ' + ['KB', 'MB'][i];
    };
    /**
     * Allows you to sort the file data alphabetically based on its file name clearly.
     * @param { FileList } filesData - specifies the files data for upload.
     * @returns File[]
     */
    /* istanbul ignore next */
    Uploader.prototype.sortFileList = function (filesData) {
        filesData = filesData ? filesData : this.sortFilesList;
        var files = filesData;
        var fileNames = [];
        for (var i = 0; i < files.length; i++) {
            fileNames.push(files[i].name);
        }
        var sortedFileNames = fileNames.sort();
        var sortedFilesData = [];
        var index = 0;
        for (var _i = 0, sortedFileNames_1 = sortedFileNames; _i < sortedFileNames_1.length; _i++) {
            var name_4 = sortedFileNames_1[_i];
            for (var i = 0; i < files.length; i++) {
                if (name_4 === files[i].name) {
                    sortedFilesData.push(files[i]);
                }
            }
        }
        return sortedFilesData;
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
     * @method destroy
     * @return {void}.
     */
    Uploader.prototype.destroy = function () {
        this.element.value = null;
        this.clearTemplate();
        if (!(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
            this.clearAll();
        }
        this.unWireEvents();
        this.unBindDropEvents();
        if (this.multiple) {
            this.element.removeAttribute('multiple');
        }
        if (!this.enabled) {
            this.element.removeAttribute('disabled');
        }
        this.element.removeAttribute('accept');
        this.setInitialAttributes();
        var attributes = ['aria-label', 'directory', 'webkitdirectory', 'tabindex'];
        for (var _i = 0, attributes_2 = attributes; _i < attributes_2.length; _i++) {
            var key = attributes_2[_i];
            this.element.removeAttribute(key);
        }
        if (!this.isServerBlazor) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uploadWrapper)) {
                this.uploadWrapper.parentElement.appendChild(this.element);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.uploadWrapper);
            }
            this.uploadWrapper = null;
            _super.prototype.destroy.call(this);
        }
        else {
            this.uploadWrapper = null;
        }
    };
    /**
     * Allows you to call the upload process manually by calling save URL action.
     * To process the selected files (added in upload queue), pass an empty argument otherwise
     * upload the specific file based on its argument.
     * @param { FileInfo | FileInfo[] } files - specifies the files data for upload.
     * @returns void
     */
    Uploader.prototype.upload = function (files, custom) {
        var _this = this;
        files = files ? files : this.filesData;
        if (this.sequentialUpload && (this.isFirstFileOnSelection || custom)) {
            this.sequenceUpload(files);
        }
        else {
            var uploadFiles_1 = this.getFilesInArray(files);
            var eventArgs = {
                customFormData: [],
                currentRequest: null,
                cancel: false
            };
            this.trigger('beforeUpload', eventArgs, function (eventArgs) {
                if (!eventArgs.cancel) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                        _this.currentRequestHeader = eventArgs.currentRequest ? eventArgs.currentRequest : _this.currentRequestHeader;
                        _this.customFormDatas = (eventArgs.customFormData && eventArgs.customFormData.length > 0) ?
                            eventArgs.customFormData : _this.customFormDatas;
                    }
                    _this.uploadFiles(uploadFiles_1, custom);
                }
            });
        }
    };
    Uploader.prototype.getFilesInArray = function (files) {
        var uploadFiles = [];
        if (files instanceof Array) {
            uploadFiles = files;
        }
        else {
            uploadFiles.push(files);
        }
        return uploadFiles;
    };
    /* istanbul ignore next */
    Uploader.prototype.serverReadFileBase64 = function (fileIndex, position, totalCount) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            var file = _this.fileStreams[fileIndex].rawFile;
            try {
                var reader = new FileReader();
                // tslint:disable-next-line
                reader.onload = (function (args) {
                    return function () {
                        try {
                            var contents = args.result;
                            var data = contents ? contents.split(';base64,')[1] : null;
                            resolve(data);
                        }
                        catch (e) {
                            reject(e);
                        }
                    };
                })(reader);
                reader.readAsDataURL(file.slice(position, position + totalCount));
            }
            catch (e) {
                reject(e);
            }
        });
    };
    /* istanbul ignore next */
    Uploader.prototype.uploadFileCount = function (ele) {
        var files = this.filesData;
        if (!files || files.length === 0) {
            return -1;
        }
        var result = files.length;
        return result;
    };
    /* istanbul ignore next */
    Uploader.prototype.getFileRead = function (index, ele) {
        var files = this.filesData;
        if (!files || files.length === 0) {
            return -1;
        }
        var file = files[index];
        var fileCount = this.newFileRef++;
        this.fileStreams[fileCount] = file;
        return fileCount;
    };
    /* istanbul ignore next */
    Uploader.prototype.getFileInfo = function (index, ele) {
        var files = this.filesData;
        if (!files || files.length === 0) {
            return null;
        }
        var file = files[index];
        if (!file) {
            return null;
        }
        return this.filesData[index];
    };
    Uploader.prototype.uploadFiles = function (files, custom) {
        var _this = this;
        var selectedFiles = [];
        if (this.asyncSettings.saveUrl === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.asyncSettings.saveUrl)) {
            if (this.isServerBlazor) {
                // tslint:disable-next-line
                this.interopAdaptor.invokeMethodAsync('GetFileDetails', files);
            }
            return;
        }
        if (!custom || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(custom)) {
            if (!this.multiple) {
                var file = [];
                file.push(files[0]);
                selectedFiles = this.filterfileList(file);
            }
            else {
                selectedFiles = this.filterfileList(files);
            }
        }
        else {
            selectedFiles = files;
        }
        var _loop_5 = function (i) {
            if (this_3.isServerBlazor && !this_3.checkChunkUpload()) {
                /* istanbul ignore next */
                /* tslint:disable */
                if (selectedFiles[i] && selectedFiles[i].rawFile instanceof File) {
                    this_3.getBase64(selectedFiles[i].rawFile).then(function (data) {
                        _this.base64String.push(data);
                        _this.uploadFilesRequest(selectedFiles, i, custom);
                    });
                }
                /* tslint:disable */
            }
            else {
                this_3.uploadFilesRequest(selectedFiles, i, custom);
            }
        };
        var this_3 = this;
        for (var i = 0; i < selectedFiles.length; i++) {
            _loop_5(i);
        }
    };
    Uploader.prototype.uploadFilesRequest = function (selectedFiles, i, custom) {
        var _this = this;
        var cloneFiles = [];
        var chunkEnabled = this.checkChunkUpload();
        var ajax = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Ajax"](this.asyncSettings.saveUrl, 'POST', true, null);
        ajax.emitError = false;
        var getFileData;
        /* istanbul ignore next */
        if (this.isServerBlazor) {
            getFileData = selectedFiles.slice(0);
            cloneFiles.push(getFileData[i].rawFile);
        }
        var eventArgs = {
            fileData: (this.isServerBlazor) ? getFileData[i] : selectedFiles[i],
            customFormData: [],
            cancel: false
        };
        var formData = new FormData();
        ajax.beforeSend = function (e) {
            eventArgs.currentRequest = ajax.httpRequest;
            /* istanbul ignore next */
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                eventArgs.fileData.rawFile = !chunkEnabled ? _this.base64String[i] : eventArgs.fileData.rawFile;
                if (_this.currentRequestHeader) {
                    _this.updateCustomheader(ajax.httpRequest, _this.currentRequestHeader);
                }
                if (_this.customFormDatas) {
                    _this.updateFormData(formData, _this.customFormDatas);
                }
            }
            _this.trigger('uploading', eventArgs, function (eventArgs) {
                /* istanbul ignore next */
                if (_this.isServerBlazor && !chunkEnabled) {
                    selectedFiles[i].rawFile = eventArgs.fileData.rawFile = cloneFiles[i];
                }
                if (eventArgs.cancel) {
                    _this.eventCancelByArgs(e, eventArgs, selectedFiles[i]);
                }
                _this.updateFormData(formData, eventArgs.customFormData);
            });
        };
        if (selectedFiles[i].statusCode === '1') {
            var name_5 = this.element.getAttribute('name');
            formData.append(name_5, selectedFiles[i].rawFile, selectedFiles[i].name);
            if (chunkEnabled && selectedFiles[i].size > this.asyncSettings.chunkSize) {
                this.chunkUpload(selectedFiles[i], custom, i);
            }
            else {
                ajax.onLoad = function (e) {
                    if (eventArgs.cancel && _this.isServerBlazor) {
                        return {};
                    }
                    else {
                        _this.uploadComplete(e, selectedFiles[i], custom);
                        return {};
                    }
                };
                ajax.onUploadProgress = function (e) {
                    if (eventArgs.cancel && _this.isServerBlazor) {
                        return {};
                    }
                    else {
                        _this.uploadInProgress(e, selectedFiles[i], custom, ajax);
                        return {};
                    }
                };
                /* istanbul ignore next */
                ajax.onError = function (e) { _this.uploadFailed(e, selectedFiles[i]); return {}; };
                ajax.send(formData);
            }
        }
    };
    Uploader.prototype.spliceFiles = function (liIndex) {
        var liElement = this.fileList[liIndex];
        var allFiles = this.getFilesData();
        var nameElements = +liElement.getAttribute('data-files-count');
        var startIndex = 0;
        for (var i = 0; i < liIndex; i++) {
            startIndex += (+this.fileList[i].getAttribute('data-files-count'));
        }
        var endIndex = (startIndex + nameElements) - 1;
        for (var j = endIndex; j >= startIndex; j--) {
            allFiles.splice(j, 1);
        }
    };
    /**
     * Remove the uploaded file from server manually by calling the remove URL action.
     * If you pass an empty argument to this method, the complete file list can be cleared,
     * otherwise remove the specific file based on its argument (“file_data”).
     * @param { FileInfo | FileInfo[] } fileData - specifies the files data to remove from file list/server.
     * @param { boolean } customTemplate - Set true if the component rendering with customize template.
     * @param { boolean } removeDirectly - Set true if files remove without removing event.
     * @param { boolean } postRawFile - Set false, to post file name only to the remove action.
     * @returns void
     */
    Uploader.prototype.remove = function (fileData, customTemplate, removeDirectly, postRawFile, args) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(postRawFile)) {
            postRawFile = true;
        }
        var eventArgs = {
            event: args,
            cancel: false,
            filesData: [],
            customFormData: [],
            postRawFile: postRawFile,
            currentRequest: null
        };
        var beforeEventArgs = {
            cancel: false,
            customFormData: [],
            currentRequest: null
        };
        this.trigger('beforeRemove', beforeEventArgs, function (beforeEventArgs) {
            if (!beforeEventArgs.cancel) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                    _this.currentRequestHeader = beforeEventArgs.currentRequest;
                    _this.customFormDatas = beforeEventArgs.customFormData;
                }
                var index = void 0;
                if (_this.isFormUpload() && !_this.isBlazorSaveUrl) {
                    eventArgs.filesData = fileData;
                    _this.trigger('removing', eventArgs, function (eventArgs) {
                        if (!eventArgs.cancel) {
                            var removingFiles = _this.getFilesInArray(fileData);
                            var isLiRemoved = false;
                            var liIndex = void 0;
                            for (var _i = 0, removingFiles_1 = removingFiles; _i < removingFiles_1.length; _i++) {
                                var data = removingFiles_1[_i];
                                if (!isLiRemoved) {
                                    liIndex = _this.fileList.indexOf(data.list);
                                }
                                if (liIndex > -1) {
                                    var inputElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.input) ? data.input : null;
                                    if (inputElement) {
                                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(inputElement);
                                    }
                                    _this.spliceFiles(liIndex);
                                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(_this.fileList[liIndex]);
                                    _this.fileList.splice(liIndex, 1);
                                    isLiRemoved = true;
                                    liIndex = -1;
                                }
                            }
                        }
                    });
                }
                else if (_this.isForm && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.asyncSettings.removeUrl) || _this.asyncSettings.removeUrl === '')
                    && !_this.isBlazorSaveUrl) {
                    eventArgs.filesData = _this.getFilesData();
                    _this.trigger('removing', eventArgs, function (eventArgs) {
                        if (!eventArgs.cancel) {
                            _this.clearAll();
                        }
                    });
                }
                else {
                    var removeFiles = [];
                    fileData = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fileData) ? fileData : _this.filesData;
                    if (fileData instanceof Array) {
                        removeFiles = fileData;
                    }
                    else {
                        removeFiles.push(fileData);
                    }
                    eventArgs.filesData = removeFiles;
                    var removeUrl = _this.asyncSettings.removeUrl;
                    var validUrl = (removeUrl === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(removeUrl)) ? false : true;
                    var _loop_6 = function (files) {
                        index = _this.filesData.indexOf(files);
                        var fileUploadedIndex = _this.uploadedFilesData.indexOf(files);
                        if ((files.statusCode === '2' || files.statusCode === '4' || (files.statusCode === '0' &&
                            fileUploadedIndex !== -1)) && validUrl) {
                            _this.removeUploadedFile(files, eventArgs, removeDirectly, customTemplate);
                        }
                        else {
                            if (!removeDirectly) {
                                _this.trigger('removing', eventArgs, function (eventArgs) {
                                    if (!eventArgs.cancel) {
                                        _this.removeFilesData(files, customTemplate);
                                    }
                                });
                            }
                            else {
                                _this.removeFilesData(files, customTemplate);
                            }
                        }
                        if (args && !args.target.classList.contains(REMOVE_ICON)) {
                            _this.checkActionComplete(false);
                        }
                    };
                    for (var _i = 0, removeFiles_1 = removeFiles; _i < removeFiles_1.length; _i++) {
                        var files = removeFiles_1[_i];
                        _loop_6(files);
                    }
                }
            }
        });
    };
    /**
     * Clear all the file entries from list that can be uploaded files or added in upload queue.
     * @returns void
     */
    Uploader.prototype.clearAll = function () {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.listParent) && !(this.isBlazorSaveUrl || this.isBlazorTemplate)) {
            if (this.browserName !== 'msie') {
                this.element.value = '';
            }
            this.filesData = [];
            return;
        }
        var eventArgs = {
            cancel: false,
            filesData: this.filesData
        };
        this.trigger('clearing', eventArgs, function (eventArgs) {
            if (!eventArgs.cancel) {
                _this.clearData();
                _this.actionCompleteCount = 0;
                _this.count = -1;
            }
        });
    };
    /**
     * Get the data of files which are shown in file list.
     * @param { number } index - specifies the file list item(li) index.
     * @returns FileInfo[]
     */
    Uploader.prototype.getFilesData = function (index) {
        if (!this.isServerBlazor) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
                return this.filesData;
            }
            else {
                return this.getSelectedFiles(index);
            }
        }
        else {
            for (var i = 0; i < this.filesData.length; i++) {
                this.filesData[i].rawFile = this.base64String[i];
            }
            return this.filesData;
        }
    };
    /**
     * Pauses the in-progress chunked upload based on the file data.
     * @param { FileInfo | FileInfo[] } fileData - specifies the files data to pause from uploading.
     * @param { boolean } custom - Set true if used custom UI.
     * @returns void
     */
    Uploader.prototype.pause = function (fileData, custom) {
        fileData = fileData ? fileData : this.filesData;
        var fileDataFiles = this.getFilesInArray(fileData);
        this.pauseUploading(fileDataFiles, custom);
    };
    Uploader.prototype.pauseUploading = function (fileData, custom) {
        var files = this.getFiles(fileData);
        for (var i = 0; i < files.length; i++) {
            if (files[i].statusCode === '3') {
                this.pauseUpload(this.getCurrentMetaData(files[i], null), null, custom);
            }
        }
    };
    Uploader.prototype.getFiles = function (fileData) {
        var files = [];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fileData) && !(fileData instanceof Array)) {
            files.push(fileData);
        }
        else {
            files = fileData;
        }
        return files;
    };
    /**
     * Resumes the chunked upload that is previously paused based on the file data.
     * @param { FileInfo | FileInfo[] } fileData - specifies the files data to resume the paused file.
     * @param { boolean } custom - Set true if used custom UI.
     * @returns void
     */
    Uploader.prototype.resume = function (fileData, custom) {
        fileData = fileData ? fileData : this.filesData;
        var fileDataFiles = this.getFilesInArray(fileData);
        this.resumeFiles(fileDataFiles, custom);
    };
    Uploader.prototype.resumeFiles = function (fileData, custom) {
        var files = this.getFiles(fileData);
        for (var i = 0; i < files.length; i++) {
            if (files[i].statusCode === '4') {
                this.resumeUpload(this.getCurrentMetaData(files[i], null), null, custom);
            }
        }
    };
    /**
     * Retries the canceled or failed file upload based on the file data.
     * @param { FileInfo | FileInfo[] } fileData - specifies the files data to retry the canceled or failed file.
     * @param { boolean } fromcanceledStage - Set true to retry from canceled stage and set false to retry from initial stage.
     * @returns void
     */
    Uploader.prototype.retry = function (fileData, fromcanceledStage, custom) {
        fileData = fileData ? fileData : this.filesData;
        var fileDataFiles = this.getFilesInArray(fileData);
        this.retryFailedFiles(fileDataFiles, fromcanceledStage, custom);
    };
    Uploader.prototype.retryFailedFiles = function (fileData, fromcanceledStage, custom) {
        var files = this.getFiles(fileData);
        for (var i = 0; i < files.length; i++) {
            if (files[i].statusCode === '5' || files[i].statusCode === '0') {
                if (this.asyncSettings.chunkSize > 0) {
                    this.retryUpload(this.getCurrentMetaData(files[i], null), fromcanceledStage);
                }
                else {
                    var liElement = void 0;
                    if (!custom) {
                        liElement = this.fileList[this.filesData.indexOf(files[i])];
                    }
                    this.reloadcanceledFile(null, files[i], liElement, custom);
                }
            }
        }
    };
    /**
     * Stops the in-progress chunked upload based on the file data.
     * When the file upload is canceled, the partially uploaded file is removed from server.
     * @param { FileInfo | FileInfo[] } fileData - specifies the files data to cancel the progressing file.
     * @returns void
     */
    Uploader.prototype.cancel = function (fileData) {
        fileData = fileData ? fileData : this.filesData;
        var cancelingFiles = this.getFilesInArray(fileData);
        this.cancelUpload(cancelingFiles);
    };
    Uploader.prototype.cancelUpload = function (fileData) {
        var files = this.getFiles(fileData);
        if (this.asyncSettings.chunkSize > 0) {
            for (var i = 0; i < files.length; i++) {
                if (files[i].statusCode === '3') {
                    var metaData = this.getCurrentMetaData(files[i], null);
                    metaData.file.statusCode = '5';
                    metaData.file.status = this.localizedTexts('fileUploadCancel');
                    this.updateMetaData(metaData);
                    this.showHideUploadSpinner(files[i]);
                }
            }
        }
        else {
            for (var i = 0; i < files.length; i++) {
                if (files[i].statusCode === '3') {
                    files[i].statusCode = '5';
                    files[i].status = this.localizedTexts('fileUploadCancel');
                    this.showHideUploadSpinner(files[i]);
                }
            }
        }
    };
    Uploader.prototype.showHideUploadSpinner = function (files) {
        var liElement = this.getLiElement(files);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.template)) {
            var spinnerTarget = liElement.querySelector('.' + ABORT_ICON);
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({ target: spinnerTarget, width: '20px' });
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(spinnerTarget);
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ saveUrl: '', removeUrl: '' }, AsyncSettings)
    ], Uploader.prototype, "asyncSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Uploader.prototype, "sequentialUpload", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], Uploader.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Uploader.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Uploader.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Uploader.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Uploader.prototype, "multiple", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Uploader.prototype, "autoUpload", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, ButtonsProps)
    ], Uploader.prototype, "buttons", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Uploader.prototype, "allowedExtensions", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Uploader.prototype, "minFileSize", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(30000000)
    ], Uploader.prototype, "maxFileSize", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Uploader.prototype, "dropArea", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([{}], FilesProp)
    ], Uploader.prototype, "files", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Uploader.prototype, "showFileList", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Uploader.prototype, "directoryUpload", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Default')
    ], Uploader.prototype, "dropEffect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "actionComplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "rendering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "beforeUpload", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "fileListRendering", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "selected", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "uploading", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "success", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "failure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "removing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "beforeRemove", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "clearing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "progress", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "chunkSuccess", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "chunkFailure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "chunkUploading", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "canceling", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "pausing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Uploader.prototype, "resuming", void 0);
    Uploader = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Uploader);
    return Uploader;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/common/index.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/common/index.js ***!
  \*****************************************************************/
/*! exports provided: cssClass, ListBase, getFieldValues */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _list_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list-base */ "./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cssClass", function() { return _list_base__WEBPACK_IMPORTED_MODULE_0__["cssClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListBase", function() { return _list_base__WEBPACK_IMPORTED_MODULE_0__["ListBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFieldValues", function() { return _list_base__WEBPACK_IMPORTED_MODULE_0__["getFieldValues"]; });

/**
 * Listview Component
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js ***!
  \*********************************************************************/
/*! exports provided: cssClass, ListBase, getFieldValues */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssClass", function() { return cssClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListBase", function() { return ListBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFieldValues", function() { return getFieldValues; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");




var cssClass = {
    li: 'e-list-item',
    ul: 'e-list-parent e-ul',
    group: 'e-list-group-item',
    icon: 'e-list-icon',
    text: 'e-list-text',
    check: 'e-list-check',
    checked: 'e-checked',
    selected: 'e-selected',
    expanded: 'e-expanded',
    textContent: 'e-text-content',
    hasChild: 'e-has-child',
    level: 'e-level',
    url: 'e-list-url',
    collapsible: 'e-icon-collapsible',
    disabled: 'e-disabled',
    image: 'e-list-img',
    iconWrapper: 'e-icon-wrapper',
    anchorWrap: 'e-anchor-wrap',
    navigable: 'e-navigable'
};
/**
 * Base List Generator
 */
var ListBase;
(function (ListBase) {
    /**
     * Default mapped fields.
     */
    ListBase.defaultMappedFields = {
        id: 'id',
        text: 'text',
        url: 'url',
        value: 'value',
        isChecked: 'isChecked',
        enabled: 'enabled',
        expanded: 'expanded',
        selected: 'selected',
        iconCss: 'iconCss',
        child: 'child',
        isVisible: 'isVisible',
        hasChildren: 'hasChildren',
        tooltip: 'tooltip',
        htmlAttributes: 'htmlAttributes',
        urlAttributes: 'urlAttributes',
        imageAttributes: 'imageAttributes',
        imageUrl: 'imageUrl',
        groupBy: null
    };
    var defaultAriaAttributes = {
        level: 1,
        listRole: 'presentation',
        itemRole: 'presentation',
        groupItemRole: 'group',
        itemText: 'list-item',
        wrapperRole: 'presentation'
    };
    var defaultListBaseOptions = {
        showCheckBox: false,
        showIcon: false,
        enableHtmlSanitizer: false,
        expandCollapse: false,
        fields: ListBase.defaultMappedFields,
        ariaAttributes: defaultAriaAttributes,
        listClass: '',
        itemClass: '',
        processSubChild: false,
        sortOrder: 'None',
        template: null,
        groupTemplate: null,
        headerTemplate: null,
        expandIconClass: 'e-icon-collapsible',
        moduleName: 'list',
        expandIconPosition: 'Right',
        itemNavigable: false
    };
    /**
     * Function helps to created and return the UL Li element based on your data.
     * @param  {{[key:string]:Object}[]|string[]} dataSource - Specifies an array of JSON or String data.
     * @param  {ListBaseOptions} options? - Specifies the list options that need to provide.
     */
    function createList(createElement, dataSource, 
    // tslint:disable-next-line
    options, isSingleLevel, componentInstance) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var ariaAttributes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultAriaAttributes, curOpt.ariaAttributes);
        var type = typeofData(dataSource).typeof;
        if (type === 'string' || type === 'number') {
            return createListFromArray(createElement, dataSource, isSingleLevel, options, componentInstance);
        }
        else {
            // tslint:disable-next-line
            return createListFromJson(createElement, dataSource, options, 
            // tslint:disable-next-line
            ariaAttributes.level, isSingleLevel, componentInstance);
        }
    }
    ListBase.createList = createList;
    /**
     * Function helps to created an element list based on string array input .
     * @param  {string[]} dataSource - Specifies an array of string data
     */
    function createListFromArray(createElement, dataSource, 
    // tslint:disable-next-line
    isSingleLevel, options, componentInstance) {
        var subChild = createListItemFromArray(createElement, dataSource, isSingleLevel, options, componentInstance);
        return generateUL(createElement, subChild, null, options);
    }
    ListBase.createListFromArray = createListFromArray;
    /**
     * Function helps to created an element list based on string array input .
     * @param  {string[]} dataSource - Specifies an array of string data
     */
    function createListItemFromArray(createElement, dataSource, 
    // tslint:disable-next-line
    isSingleLevel, options, componentInstance) {
        var subChild = [];
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        cssClass = getModuleClass(curOpt.moduleName);
        var id = generateId(); // generate id for drop-down-list option.
        for (var i = 0; i < dataSource.length; i++) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataSource[i])) {
                continue;
            }
            var li = void 0;
            if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: dataSource[i],
                    text: dataSource[i],
                    options: curOpt
                };
                curOpt.itemCreating(curData);
            }
            if (isSingleLevel) {
                li = generateSingleLevelLI(createElement, dataSource[i], undefined, null, null, [], null, id, i, options);
            }
            else {
                li = generateLI(createElement, dataSource[i], undefined, null, null, options, componentInstance);
            }
            if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: dataSource[i],
                    text: dataSource[i],
                    item: li,
                    options: curOpt
                };
                curOpt.itemCreated(curData);
            }
            subChild.push(li);
        }
        return subChild;
    }
    ListBase.createListItemFromArray = createListItemFromArray;
    /**
     * Function helps to created an element list based on array of JSON input .
     * @param  {{[key:string]:Object}[]} dataSource - Specifies an array of JSON data.
     * @param  {ListBaseOptions} options? - Specifies the list options that need to provide.
     */
    // tslint:disable-next-line:max-func-body-length
    // tslint:disable-next-line
    function createListItemFromJson(createElement, dataSource, 
    // tslint:disable-next-line
    options, level, isSingleLevel, componentInstance) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        cssClass = getModuleClass(curOpt.moduleName);
        var fields = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, ListBase.defaultMappedFields, curOpt.fields);
        var ariaAttributes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultAriaAttributes, curOpt.ariaAttributes);
        var id;
        var checkboxElement = [];
        if (level) {
            ariaAttributes.level = level;
        }
        var child = [];
        var li;
        var anchorElement;
        if (dataSource && dataSource.length && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(typeofData(dataSource).item) &&
            !typeofData(dataSource).item.hasOwnProperty(fields.id)) {
            id = generateId(); // generate id for drop-down-list option.
        }
        for (var i = 0; i < dataSource.length; i++) {
            var fieldData = getFieldValues(dataSource[i], fields);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataSource[i])) {
                continue;
            }
            if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: dataSource[i],
                    text: fieldData[fields.text],
                    options: curOpt,
                    fields: fields
                };
                curOpt.itemCreating(curData);
            }
            var curItem = dataSource[i];
            if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {
                fieldData = getFieldValues(dataSource[i], fields);
            }
            if (fieldData.hasOwnProperty(fields.id) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[fields.id])) {
                id = fieldData[fields.id];
            }
            var innerEle = [];
            if (curOpt.showCheckBox) {
                if (curOpt.itemNavigable && (fieldData[fields.url] || fieldData[fields.urlAttributes])) {
                    checkboxElement.push(createElement('input', { className: cssClass.check, attrs: { type: 'checkbox' } }));
                }
                else {
                    innerEle.push(createElement('input', { className: cssClass.check, attrs: { type: 'checkbox' } }));
                }
            }
            if (isSingleLevel === true) {
                if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[fields.iconCss])) {
                    innerEle.push(createElement('span', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] }));
                }
                li = generateSingleLevelLI(createElement, curItem, fieldData, fields, curOpt.itemClass, innerEle, (curItem.hasOwnProperty('isHeader') &&
                    curItem.isHeader) ? true : false, id, i, options);
                anchorElement = li.querySelector('.' + cssClass.anchorWrap);
                if (curOpt.itemNavigable && checkboxElement.length) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])(checkboxElement, li.firstElementChild);
                }
            }
            else {
                li = generateLI(createElement, curItem, fieldData, fields, curOpt.itemClass, options, componentInstance);
                li.classList.add(cssClass.level + '-' + ariaAttributes.level);
                li.setAttribute('aria-level', ariaAttributes.level.toString());
                anchorElement = li.querySelector('.' + cssClass.anchorWrap);
                if (fieldData.hasOwnProperty(fields.tooltip)) {
                    li.setAttribute('title', fieldData[fields.tooltip]);
                }
                if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {
                    setAttribute(li, fieldData[fields.htmlAttributes]);
                }
                if (fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled] === false) {
                    li.classList.add(cssClass.disabled);
                }
                if (fieldData.hasOwnProperty(fields.isVisible) && fieldData[fields.isVisible] === false) {
                    li.style.display = 'none';
                }
                if (fieldData.hasOwnProperty(fields.imageUrl) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[fields.imageUrl])
                    && !curOpt.template) {
                    var attr = { src: fieldData[fields.imageUrl] };
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(attr, fieldData[fields.imageAttributes]);
                    var imageElemnt = createElement('img', { className: cssClass.image, attrs: attr });
                    if (anchorElement) {
                        anchorElement.insertAdjacentElement('afterbegin', imageElemnt);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([imageElemnt], li.firstElementChild);
                    }
                }
                if (curOpt.showIcon && fieldData.hasOwnProperty(fields.iconCss) &&
                    !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[fields.iconCss]) && !curOpt.template) {
                    var iconElement = void 0;
                    iconElement = createElement('div', { className: cssClass.icon + ' ' + fieldData[fields.iconCss] });
                    if (anchorElement) {
                        anchorElement.insertAdjacentElement('afterbegin', iconElement);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([iconElement], li.firstElementChild);
                    }
                }
                if (innerEle.length) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])(innerEle, li.firstElementChild);
                }
                if (curOpt.itemNavigable && checkboxElement.length) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])(checkboxElement, li.firstElementChild);
                }
                processSubChild(createElement, fieldData, fields, dataSource, curOpt, li, ariaAttributes.level);
            }
            if (anchorElement) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], [cssClass.navigable]);
            }
            if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: dataSource[i],
                    text: fieldData[fields.text],
                    item: li,
                    options: curOpt,
                    fields: fields
                };
                curOpt.itemCreated(curData);
            }
            checkboxElement = [];
            child.push(li);
        }
        return child;
    }
    ListBase.createListItemFromJson = createListItemFromJson;
    /**
     * Function helps to created an element list based on array of JSON input .
     * @param  {{[key:string]:Object}[]} dataSource - Specifies an array of JSON data.
     * @param  {ListBaseOptions} options? - Specifies the list options that need to provide.
     */
    function createListFromJson(createElement, dataSource, 
    // tslint:disable-next-line
    options, level, isSingleLevel, componentInstance) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var li = createListItemFromJson(createElement, dataSource, options, level, isSingleLevel, componentInstance);
        return generateUL(createElement, li, curOpt.listClass, options);
    }
    ListBase.createListFromJson = createListFromJson;
    /**
     * Return the next or previous visible element.
     * @param  {Element[]|NodeList} elementArray - An element array to find next or previous element.
     * @param  {Element} li - An element to find next or previous after this element.
     * @param  {boolean} isPrevious? - Specify when the need get previous element from array.
     */
    function getSiblingLI(elementArray, element, isPrevious) {
        cssClass = getModuleClass(defaultListBaseOptions.moduleName);
        if (!elementArray || !elementArray.length) {
            return void 0;
        }
        var siblingLI;
        var liIndex;
        var liCollections = Array.prototype.slice.call(elementArray);
        if (element) {
            liIndex = indexOf(element, liCollections);
        }
        else {
            liIndex = (isPrevious === true ? liCollections.length : -1);
        }
        siblingLI = liCollections[liIndex + (isPrevious === true ? -1 : 1)];
        while (siblingLI && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(siblingLI) || siblingLI.classList.contains(cssClass.disabled))) {
            liIndex = liIndex + (isPrevious === true ? -1 : 1);
            siblingLI = liCollections[liIndex];
        }
        return siblingLI;
    }
    ListBase.getSiblingLI = getSiblingLI;
    /**
     * Return the index of the li element
     * @param  {Element} item - An element to find next or previous after this element.
     * @param  {Element[]|NodeList} elementArray - An element array to find index of given li.
     */
    function indexOf(item, elementArray) {
        if (!elementArray || !item) {
            return void 0;
        }
        else {
            var liCollections = elementArray;
            liCollections = Array.prototype.slice.call(elementArray);
            return liCollections.indexOf(item);
        }
    }
    ListBase.indexOf = indexOf;
    /**
     * Returns the grouped data from given dataSource.
     * @param  {{[key:string]:Object}[]} dataSource - The JSON data which is necessary to process.
     * @param  {FieldsMapping} fields - Fields that are mapped from the data source.
     * @param  {SortOrder='None'} sortOrder- Specifies final result sort order.
     */
    function groupDataSource(dataSource, fields, sortOrder) {
        if (sortOrder === void 0) { sortOrder = 'None'; }
        var curFields = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, ListBase.defaultMappedFields, fields);
        var cusQuery = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().group(curFields.groupBy);
        // need to remove once sorting issues fixed in DataManager
        cusQuery = addSorting(sortOrder, 'key', cusQuery);
        var ds = getDataSource(dataSource, cusQuery);
        dataSource = [];
        for (var j = 0; j < ds.length; j++) {
            var itemObj = ds[j].items;
            var grpItem = {};
            var hdr = 'isHeader';
            grpItem[curFields.text] = ds[j].key;
            grpItem[hdr] = true;
            var newtext = curFields.text;
            if (newtext === 'id') {
                newtext = 'text';
                grpItem[newtext] = ds[j].key;
            }
            grpItem._id = 'group-list-item-' + (ds[j].key ?
                ds[j].key.toString().trim() : 'undefined');
            grpItem.items = itemObj;
            dataSource.push(grpItem);
            for (var k = 0; k < itemObj.length; k++) {
                dataSource.push(itemObj[k]);
            }
        }
        return dataSource;
    }
    ListBase.groupDataSource = groupDataSource;
    /**
     * Returns a sorted query object.
     * @param  {SortOrder} sortOrder - Specifies that sort order.
     * @param  {string} sortBy - Specifies sortBy fields.
     * @param  {Query=new Query()} query - Pass if any existing query.
     */
    function addSorting(sortOrder, sortBy, query) {
        if (query === void 0) { query = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"](); }
        if (sortOrder === 'Ascending') {
            query.sortBy(sortBy, 'ascending', true);
        }
        else if (sortOrder === 'Descending') {
            query.sortBy(sortBy, 'descending', true);
        }
        else {
            for (var i = 0; i < query.queries.length; i++) {
                if (query.queries[i].fn === 'onSortBy') {
                    query.queries.splice(i, 1);
                }
            }
        }
        return query;
    }
    ListBase.addSorting = addSorting;
    /**
     * Return an array of JSON Data that processed based on queries.
     * @param  {{[key:string]:Object}[]} dataSource - Specifies local JSON data source.
     * @param  {Query} query - Specifies query that need to process.
     */
    function getDataSource(dataSource, query) {
        // tslint:disable-next-line
        return new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](dataSource)
            .executeLocal(query);
    }
    ListBase.getDataSource = getDataSource;
    /**
     * Created JSON data based the UL and LI element
     * @param  {HTMLElement|Element} element - UL element that need to convert as a JSON
     * @param  {ListBaseOptions} options? - Specifies listbase option for fields.
     */
    function createJsonFromElement(element, options) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var fields = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, ListBase.defaultMappedFields, curOpt.fields);
        var curEle = element.cloneNode(true);
        var jsonAr = [];
        curEle.classList.add('json-parent');
        var childs = curEle.querySelectorAll('.json-parent>li');
        curEle.classList.remove('json-parent');
        for (var i = 0; i < childs.length; i++) {
            var li = childs[i];
            var anchor = li.querySelector('a');
            var ul = li.querySelector('ul');
            var json = {};
            var childNodes = anchor ? anchor.childNodes : li.childNodes;
            var keys = Object.keys(childNodes);
            for (var i_1 = 0; i_1 < childNodes.length; i_1++) {
                if (!(childNodes[Number(keys[i_1])]).hasChildNodes()) {
                    json[fields.text] = childNodes[Number(keys[i_1])].textContent;
                }
            }
            var attributes_1 = getAllAttributes(li);
            if (attributes_1.id) {
                json[fields.id] = attributes_1.id;
                delete attributes_1.id;
            }
            else {
                json[fields.id] = generateId();
            }
            if (Object.keys(attributes_1).length) {
                json[fields.htmlAttributes] = attributes_1;
            }
            if (anchor) {
                attributes_1 = getAllAttributes(anchor);
                if (Object.keys(attributes_1).length) {
                    json[fields.urlAttributes] = attributes_1;
                }
            }
            if (ul) {
                json[fields.child] = createJsonFromElement(ul, options);
            }
            jsonAr.push(json);
        }
        return jsonAr;
    }
    ListBase.createJsonFromElement = createJsonFromElement;
    function typeofData(data) {
        var match = { typeof: null, item: null };
        for (var i = 0; i < data.length; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[i])) {
                return match = { typeof: typeof data[i], item: data[i] };
            }
        }
        return match;
    }
    function setAttribute(element, elementAttributes) {
        var attr = {};
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(attr, elementAttributes);
        if (attr.class) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], attr.class.split(' '));
            delete attr.class;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(element, attr);
    }
    function getAllAttributes(element) {
        var attributes = {};
        var attr = element.attributes;
        for (var index = 0; index < attr.length; index++) {
            attributes[attr[index].nodeName] = attr[index].nodeValue;
        }
        return attributes;
    }
    /**
     * Created UL element from content template.
     * @param  {string} template - that need to convert and generate li element.
     * @param  {{[key:string]:Object}[]} dataSource - Specifies local JSON data source.
     * @param  {ListBaseOptions} options? - Specifies listbase option for fields.
     */
    function renderContentTemplate(createElement, template, dataSource, 
    // tslint:disable-next-line
    fields, options, componentInstance) {
        cssClass = getModuleClass(defaultListBaseOptions.moduleName);
        var ulElement = createElement('ul', { className: cssClass.ul, attrs: { role: 'presentation' } });
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var curFields = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, ListBase.defaultMappedFields, fields);
        var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
        var liCollection = [];
        var value;
        var id = generateId(); // generate id for drop-down-list option.
        for (var i = 0; i < dataSource.length; i++) {
            var fieldData = getFieldValues(dataSource[i], curFields);
            var curItem = dataSource[i];
            var isHeader = curItem.isHeader;
            if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {
                value = curItem;
            }
            else {
                value = fieldData[curFields.value];
            }
            if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: curItem,
                    text: value,
                    options: curOpt,
                    fields: curFields
                };
                curOpt.itemCreating(curData);
            }
            if (curOpt.itemCreating && typeof curOpt.itemCreating === 'function') {
                fieldData = getFieldValues(dataSource[i], curFields);
                if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {
                    value = curItem;
                }
                else {
                    value = fieldData[curFields.value];
                }
            }
            var li = createElement('li', {
                id: id + '-' + i,
                className: isHeader ? cssClass.group : cssClass.li, attrs: { role: 'presentation' }
            });
            if (isHeader) {
                if (typeof dataSource[i] === 'string' || typeof dataSource[i] === 'number') {
                    li.innerText = curItem;
                }
                else {
                    li.innerText = fieldData[curFields.text];
                }
            }
            else {
                var currentID = isHeader ? curOpt.groupTemplateID : curOpt.templateID;
                if (isHeader) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledString(curItem, componentInstance, 'headerTemplate', currentID, !!curOpt.isStringTemplate), li);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledString(curItem, componentInstance, 'template', currentID, !!curOpt.isStringTemplate), li);
                }
                li.setAttribute('data-value', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? 'null' : value);
                li.setAttribute('role', 'option');
            }
            if (curOpt.itemCreated && typeof curOpt.itemCreated === 'function') {
                var curData = {
                    dataSource: dataSource,
                    curData: curItem,
                    text: value,
                    item: li,
                    options: curOpt,
                    fields: curFields
                };
                curOpt.itemCreated(curData);
            }
            liCollection.push(li);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(liCollection, ulElement);
        return ulElement;
    }
    ListBase.renderContentTemplate = renderContentTemplate;
    /**
     * Created header items from group template.
     * @param  {string} template - that need to convert and generate li element.
     * @param  {{[key:string]:Object}[]} dataSource - Specifies local JSON data source.
     * @param  {FieldsMapping} fields - Specifies fields for mapping the dataSource.
     * @param  {Element[]} headerItems? - Specifies listbase header items.
     */
    // tslint:disable-next-line
    function renderGroupTemplate(groupTemplate, groupDataSource, fields, 
    // tslint:disable-next-line
    headerItems, options, componentInstance) {
        var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(groupTemplate);
        var curFields = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, ListBase.defaultMappedFields, fields);
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var category = curFields.groupBy;
        for (var _i = 0, headerItems_1 = headerItems; _i < headerItems_1.length; _i++) {
            var header = headerItems_1[_i];
            var headerData = {};
            headerData[category] = header.textContent;
            header.innerHTML = '';
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledString(headerData, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), header);
        }
        return headerItems;
    }
    ListBase.renderGroupTemplate = renderGroupTemplate;
    function generateId() {
        return Math.floor((1 + Math.random()) * 0x10000)
            .toString(16)
            .substring(1);
    }
    ListBase.generateId = generateId;
    function processSubChild(createElement, fieldData, fields, ds, options, element, level) {
        // Get SubList
        var subDS = fieldData[fields.child] || [];
        var hasChildren = fieldData[fields.hasChildren];
        //Create Sub child
        if (subDS.length) {
            hasChildren = true;
            element.classList.add(cssClass.hasChild);
            if (options.processSubChild) {
                var subLi = createListFromJson(createElement, subDS, options, ++level);
                element.appendChild(subLi);
            }
        }
        // Create expand and collapse node
        if (!!options.expandCollapse && hasChildren && !options.template) {
            element.firstElementChild.classList.add(cssClass.iconWrapper);
            var expandElement = options.expandIconPosition === 'Left' ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"] : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"];
            expandElement([createElement('div', { className: 'e-icons ' + options.expandIconClass })], element.querySelector('.' + cssClass.textContent));
        }
    }
    function generateSingleLevelLI(createElement, item, fieldData, fields, className, innerElements, grpLI, id, index, options) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var ariaAttributes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultAriaAttributes, curOpt.ariaAttributes);
        var text = item;
        var value = item;
        var dataSource;
        if (typeof item !== 'string' && typeof item !== 'number' && typeof item !== 'boolean') {
            dataSource = item;
            text = (typeof fieldData[fields.text] === 'boolean' || typeof fieldData[fields.text] === 'number') ?
                fieldData[fields.text] : (fieldData[fields.text] || '');
            value = fieldData[fields.value];
        }
        var elementID;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataSource) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[fields.id])
            && fieldData[fields.id] !== '') {
            elementID = id;
        }
        else {
            elementID = id + '-' + index;
        }
        var li = createElement('li', {
            className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(className) ? '' : className),
            id: elementID, attrs: (ariaAttributes.groupItemRole !== '' && ariaAttributes.itemRole !== '' ?
                { role: (grpLI === true ? ariaAttributes.groupItemRole : ariaAttributes.itemRole) } : {})
        });
        if (dataSource && fieldData.hasOwnProperty(fields.enabled) && fieldData[fields.enabled].toString() === 'false') {
            li.classList.add(cssClass.disabled);
        }
        if (grpLI) {
            li.innerText = text;
        }
        else {
            li.setAttribute('data-value', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) ? 'null' : value);
            li.setAttribute('role', 'option');
            if (dataSource && fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {
                setAttribute(li, fieldData[fields.htmlAttributes]);
            }
            if (innerElements.length && !curOpt.itemNavigable) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(innerElements, li);
            }
            if (dataSource && (fieldData[fields.url] || (fieldData[fields.urlAttributes] &&
                fieldData[fields.urlAttributes].href))) {
                li.appendChild(anchorTag(createElement, dataSource, fields, text, innerElements, curOpt.itemNavigable));
            }
            else {
                if (innerElements.length && curOpt.itemNavigable) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(innerElements, li);
                }
                li.appendChild(document.createTextNode(text));
            }
        }
        return li;
    }
    function getModuleClass(moduleName) {
        var moduleClass;
        return moduleClass = {
            li: "e-" + moduleName + "-item",
            ul: "e-" + moduleName + "-parent e-ul",
            group: "e-" + moduleName + "-group-item",
            icon: "e-" + moduleName + "-icon",
            text: "e-" + moduleName + "-text",
            check: "e-" + moduleName + "-check",
            checked: 'e-checked',
            selected: 'e-selected',
            expanded: 'e-expanded',
            textContent: 'e-text-content',
            hasChild: 'e-has-child',
            level: 'e-level',
            url: "e-" + moduleName + "-url",
            collapsible: 'e-icon-collapsible',
            disabled: 'e-disabled',
            image: "e-" + moduleName + "-img",
            iconWrapper: 'e-icon-wrapper',
            anchorWrap: 'e-anchor-wrap',
            navigable: 'e-navigable',
        };
    }
    function anchorTag(createElement, dataSource, fields, text, innerElements, isFullNavigation) {
        var fieldData = getFieldValues(dataSource, fields);
        var attr = { href: fieldData[fields.url] };
        if (fieldData.hasOwnProperty(fields.urlAttributes) && fieldData[fields.urlAttributes]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(attr, fieldData[fields.urlAttributes]);
            attr.href = fieldData[fields.url] ? fieldData[fields.url] :
                fieldData[fields.urlAttributes].href;
        }
        var anchorTag;
        if (!isFullNavigation) {
            anchorTag = createElement('a', { className: cssClass.text + ' ' + cssClass.url, innerHTML: text });
        }
        else {
            anchorTag = createElement('a', { className: cssClass.text + ' ' + cssClass.url });
            var anchorWrapper = createElement('div', { className: cssClass.anchorWrap });
            if (innerElements && innerElements.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(innerElements, anchorWrapper);
            }
            anchorWrapper.appendChild(document.createTextNode(text));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([anchorWrapper], anchorTag);
        }
        setAttribute(anchorTag, attr);
        return anchorTag;
    }
    // tslint:disable-next-line
    /* tslint:disable:align */
    function generateLI(createElement, item, fieldData, 
    // tslint:disable-next-line
    fields, className, options, componentInstance) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var ariaAttributes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultAriaAttributes, curOpt.ariaAttributes);
        var text = item;
        var uID;
        var grpLI;
        var dataSource;
        if (typeof item !== 'string' && typeof item !== 'number') {
            dataSource = item;
            text = fieldData[fields.text] || '';
            // tslint:disable-next-line
            uID = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData['_id'])) ? fieldData[fields.id] : fieldData['_id'];
            grpLI = (item.hasOwnProperty('isHeader') && item.isHeader)
                ? true : false;
        }
        if (options && options.enableHtmlSanitizer) {
            text = text;
        }
        var li = createElement('li', {
            className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(className) ? '' : className),
            attrs: (ariaAttributes.groupItemRole !== '' && ariaAttributes.itemRole !== '' ?
                { role: (grpLI === true ? ariaAttributes.groupItemRole : ariaAttributes.itemRole) } : {})
        });
        !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(uID) ? li.setAttribute('data-uid', uID) : li.setAttribute('data-uid', generateId());
        var blazId = 'BlazId';
        if (options && !!options.removeBlazorID
            && typeof item === 'object'
            && item.hasOwnProperty(blazId)) {
            delete item[blazId];
        }
        if (grpLI && options && options.groupTemplate) {
            var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(options.groupTemplate);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledString(item, componentInstance, 'groupTemplate', curOpt.groupTemplateID, !!curOpt.isStringTemplate), li);
        }
        else if (!grpLI && options && options.template) {
            var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(options.template);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledString(item, componentInstance, 'template', curOpt.templateID, !!curOpt.isStringTemplate), li);
        }
        else {
            var innerDiv = createElement('div', {
                className: cssClass.textContent,
                attrs: (ariaAttributes.wrapperRole !== '' ? { role: ariaAttributes.wrapperRole } : {})
            });
            if (dataSource && (fieldData[fields.url] || (fieldData[fields.urlAttributes] &&
                fieldData[fields.urlAttributes].href))) {
                innerDiv.appendChild(anchorTag(createElement, dataSource, fields, text, null, curOpt.itemNavigable));
            }
            else {
                var element = createElement('span', {
                    className: cssClass.text,
                    attrs: (ariaAttributes.itemText !== '' ? { role: ariaAttributes.itemText } : {})
                });
                if (options && options.enableHtmlSanitizer) {
                    element.innerText = text;
                }
                else {
                    element.innerHTML = text;
                }
                innerDiv.appendChild(element);
            }
            li.appendChild(innerDiv);
        }
        return li;
    }
    /**
     * Returns UL element based on the given LI element.
     * @param  {HTMLElement[]} liElement - Specifies array of LI element.
     * @param  {string} className? - Specifies class name that need to be added in UL element.
     * @param  {ListBaseOptions} options? - Specifies ListBase options.
     */
    function generateUL(createElement, liElement, className, options) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        var ariaAttributes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultAriaAttributes, curOpt.ariaAttributes);
        cssClass = getModuleClass(curOpt.moduleName);
        var ulElement = createElement('ul', {
            className: cssClass.ul + ' ' + (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(className) ? '' : className),
            attrs: (ariaAttributes.listRole !== '' ? { role: ariaAttributes.listRole } : {})
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(liElement, ulElement);
        return ulElement;
    }
    ListBase.generateUL = generateUL;
    /**
     * Returns LI element with additional DIV tag based on the given LI element.
     * @param  {liElement} liElement - Specifies LI element.
     * @param  {string} className? - Specifies class name that need to be added in created DIV element.
     * @param  {ListBaseOptions} options? - Specifies ListBase options.
     */
    function generateIcon(createElement, liElement, className, options) {
        var curOpt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, defaultListBaseOptions, options);
        cssClass = getModuleClass(curOpt.moduleName);
        var expandElement = curOpt.expandIconPosition === 'Left' ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"] : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"];
        expandElement([createElement('div', {
                className: 'e-icons ' + curOpt.expandIconClass + ' ' +
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(className) ? '' : className)
            })], liElement.querySelector('.' + cssClass.textContent));
        return liElement;
    }
    ListBase.generateIcon = generateIcon;
})(ListBase || (ListBase = {}));
/**
 * Used to get dataSource item from complex data using fields.
 * @param {{[key:string]:Object}|string[]|string} dataSource - Specifies an  JSON or String data.
 * @param {FieldsMapping} fields - Fields that are mapped from the dataSource.
 */
function getFieldValues(dataItem, fields) {
    var fieldData = {};
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem) || typeof (dataItem) === 'string' || typeof (dataItem) === 'number'
        || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataItem.isHeader)) {
        return dataItem;
    }
    else {
        for (var _i = 0, _a = Object.keys(fields); _i < _a.length; _i++) {
            var field = _a[_i];
            var dataField = fields[field];
            var value = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataField) &&
                typeof (dataField) === 'string' ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(dataField, dataItem) : undefined;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
                fieldData[dataField] = value;
            }
        }
    }
    return fieldData;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js":
/*!**********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/index.js ***!
  \**********************************************************/
/*! exports provided: cssClass, ListBase, getFieldValues, classNames, FieldSettings, ListView, Virtualization, Sortable, moveTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _list_view_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list-view/index */ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return _list_view_index__WEBPACK_IMPORTED_MODULE_0__["classNames"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return _list_view_index__WEBPACK_IMPORTED_MODULE_0__["FieldSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _list_view_index__WEBPACK_IMPORTED_MODULE_0__["ListView"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Virtualization", function() { return _list_view_index__WEBPACK_IMPORTED_MODULE_0__["Virtualization"]; });

/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-lists/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cssClass", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["cssClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListBase", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["ListBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getFieldValues", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["getFieldValues"]; });

/* harmony import */ var _sortable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sortable */ "./ej2-resources/18.4.46/scripts/ej2-lists/sortable/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return _sortable__WEBPACK_IMPORTED_MODULE_2__["Sortable"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "moveTo", function() { return _sortable__WEBPACK_IMPORTED_MODULE_2__["moveTo"]; });

/**
 * List Components
 */





/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/index.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/list-view/index.js ***!
  \********************************************************************/
/*! exports provided: classNames, FieldSettings, ListView, Virtualization */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _list_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list-view */ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/list-view.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return _list_view__WEBPACK_IMPORTED_MODULE_0__["FieldSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return _list_view__WEBPACK_IMPORTED_MODULE_0__["ListView"]; });

/* harmony import */ var _virtualization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./virtualization */ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/virtualization.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Virtualization", function() { return _virtualization__WEBPACK_IMPORTED_MODULE_1__["Virtualization"]; });

/**
 * Listview Component
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/list-view.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/list-view/list-view.js ***!
  \************************************************************************/
/*! exports provided: classNames, FieldSettings, ListView */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classNames", function() { return classNames; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return FieldSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return ListView; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _common_list_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/list-base */ "./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};










// Effect Configuration Effect[] =  [fromViewBackward,fromViewForward,toViewBackward,toviewForward];
var effectsConfig = {
    'None': [],
    'SlideLeft': ['SlideRightOut', 'SlideLeftOut', 'SlideLeftIn', 'SlideRightIn'],
    'SlideDown': ['SlideTopOut', 'SlideBottomOut', 'SlideBottomIn', 'SlideTopIn'],
    'Zoom': ['FadeOut', 'FadeZoomOut', 'FadeZoomIn', 'FadeIn'],
    'Fade': ['FadeOut', 'FadeOut', 'FadeIn', 'FadeIn']
};
var effectsRTLConfig = {
    'None': [],
    'SlideLeft': ['SlideLeftOut', 'SlideRightOut', 'SlideRightIn', 'SlideLeftIn'],
    'SlideDown': ['SlideBottomOut', 'SlideTopOut', 'SlideTopIn', 'SlideBottomIn'],
    'Zoom': ['FadeZoomOut', 'FadeOut', 'FadeIn', 'FadeZoomIn'],
    'Fade': ['FadeOut', 'FadeOut', 'FadeIn', 'FadeIn']
};
// don't use space in classnames.
var classNames = {
    root: 'e-listview',
    hover: 'e-hover',
    selected: 'e-active',
    focused: 'e-focused',
    parentItem: 'e-list-parent',
    listItem: 'e-list-item',
    listIcon: 'e-list-icon',
    textContent: 'e-text-content',
    listItemText: 'e-list-text',
    groupListItem: 'e-list-group-item',
    hasChild: 'e-has-child',
    view: 'e-view',
    header: 'e-list-header',
    headerText: 'e-headertext',
    headerTemplateText: 'e-headertemplate-text',
    text: 'e-text',
    disable: 'e-disabled',
    content: 'e-content',
    icon: 'e-icons',
    backIcon: 'e-icon-back',
    checkboxWrapper: 'e-checkbox-wrapper',
    checkbox: 'e-checkbox',
    checked: 'e-check',
    checklist: 'e-checklist',
    checkboxIcon: 'e-frame',
    checkboxRight: 'e-checkbox-right',
    checkboxLeft: 'e-checkbox-left',
    listviewCheckbox: 'e-listview-checkbox',
    itemCheckList: 'e-checklist',
    virtualElementContainer: 'e-list-virtualcontainer'
};
var LISTVIEW_TEMPLATE_PROPERTY = 'Template';
var LISTVIEW_GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
var LISTVIEW_HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
var swipeVelocity = 0.5;
/**
 * Represents the field settings of the ListView.
 */
var FieldSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(FieldSettings, _super);
    function FieldSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('id')
    ], FieldSettings.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('text')
    ], FieldSettings.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('isChecked')
    ], FieldSettings.prototype, "isChecked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('isVisible')
    ], FieldSettings.prototype, "isVisible", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('enabled')
    ], FieldSettings.prototype, "enabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('iconCss')
    ], FieldSettings.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('child')
    ], FieldSettings.prototype, "child", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('tooltip')
    ], FieldSettings.prototype, "tooltip", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('groupBy')
    ], FieldSettings.prototype, "groupBy", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('text')
    ], FieldSettings.prototype, "sortBy", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('htmlAttributes')
    ], FieldSettings.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('tableName')
    ], FieldSettings.prototype, "tableName", void 0);
    return FieldSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Represents the EJ2 ListView control.
 * ```html
 * <div id="listview">
 * <ul>
 * <li>Favorite</li>
 * <li>Documents</li>
 * <li>Downloads</li>
 * </ul>
 * </div>
 * ```
 * ```typescript
 *   var listviewObject = new ListView({});
 *   listviewObject.appendTo("#listview");
 * ```
 */
var ListView = /** @__PURE__ @class */ (function (_super) {
    __extends(ListView, _super);
    /**
     * Constructor for creating the widget
     */
    function ListView(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.itemReRender = false;
        _this.previousSelectedItems = [];
        _this.hiddenItems = [];
        _this.enabledItems = [];
        _this.disabledItems = [];
        return _this;
    }
    /**
     * @private
     */
    ListView.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'htmlAttributes':
                    this.setHTMLAttribute();
                    break;
                case 'cssClass':
                    this.setCSSClass(oldProp.cssClass);
                    break;
                case 'enable':
                    this.setEnable();
                    break;
                case 'width':
                case 'height':
                    this.setSize();
                    break;
                case 'enableRtl':
                    this.setEnableRTL();
                    break;
                case 'fields':
                    this.listBaseOption.fields = this.fields.properties;
                    if (this.enableVirtualization) {
                        if (!(this.isServerRendered && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])())) {
                            this.virtualizationModule.reRenderUiVirtualization();
                        }
                    }
                    else {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && !this.enableVirtualization) {
                            this.itemReRender = true;
                        }
                        this.reRender();
                    }
                    break;
                case 'headerTitle':
                    if (!this.curDSLevel.length) {
                        this.header(this.headerTitle, false, 'header');
                    }
                    break;
                case 'query':
                    if (this.enableVirtualization) {
                        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                            this.virtualizationModule.reRenderUiVirtualization();
                        }
                    }
                    else {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && !this.enableVirtualization) {
                            this.itemReRender = true;
                        }
                        this.reRender();
                    }
                    break;
                case 'showHeader':
                    this.header(this.headerTitle, false, 'header');
                    break;
                case 'enableVirtualization':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentContainer)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.contentContainer);
                    }
                    this.refresh();
                    break;
                case 'showCheckBox':
                case 'checkBoxPosition':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
                        if (this.enableVirtualization) {
                            this.virtualizationModule.reRenderUiVirtualization();
                        }
                        else {
                            this.setCheckbox();
                        }
                    }
                    break;
                case 'dataSource':
                    if (this.enableVirtualization) {
                        if (!(this.isServerRendered && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])())) {
                            this.virtualizationModule.reRenderUiVirtualization();
                        }
                    }
                    else {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && !this.enableVirtualization) {
                            this.itemReRender = true;
                        }
                        this.reRender();
                    }
                    break;
                case 'sortOrder':
                case 'showIcon':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                        // tslint:disable
                        this.interopAdaptor.invokeMethodAsync('ItemSorting');
                        //tslint:enable
                    }
                    else {
                        if (this.enableVirtualization) {
                            this.virtualizationModule.reRenderUiVirtualization();
                        }
                        else {
                            this.listBaseOption.showIcon = this.showIcon;
                            this.curViewDS = this.getSubDS();
                            this.resetCurrentList();
                        }
                    }
                    break;
                default:
                    break;
            }
        }
    };
    // Model Changes
    ListView.prototype.setHTMLAttribute = function () {
        if (Object.keys(this.htmlAttributes).length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, this.htmlAttributes);
        }
    };
    ListView.prototype.setCSSClass = function (oldCSSClass) {
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.cssClass.split(' ').filter(function (css) { return css; }));
        }
        if (oldCSSClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldCSSClass.split(' ').filter(function (css) { return css; }));
        }
    };
    ListView.prototype.setSize = function () {
        this.element.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height);
        this.element.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        this.isWindow = this.element.clientHeight ? false : true;
    };
    ListView.prototype.setEnable = function () {
        this.enableElement(this.element, this.enable);
    };
    ListView.prototype.setEnableRTL = function () {
        if (this.enableRtl) {
            this.element.classList.add('e-rtl');
        }
        else {
            this.element.classList.remove('e-rtl');
        }
    };
    ListView.prototype.enableElement = function (element, isEnabled) {
        if (isEnabled) {
            element.classList.remove(classNames.disable);
        }
        else {
            element.classList.add(classNames.disable);
        }
    };
    // Support Component Functions
    ListView.prototype.header = function (text, showBack, prop) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
            var args = { HeaderText: text, BackButton: showBack };
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('HeaderTitle', args);
            // tslint:disable
        }
        else {
            if (this.headerEle === undefined && this.showHeader) {
                if (this.enableHtmlSanitizer) {
                    this.setProperties({ headerTitle: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.headerTitle) }, true);
                }
                this.headerEle = this.createElement('div', { className: classNames.header });
                var innerHeaderEle = this.createElement('span', { className: classNames.headerText, innerHTML: this.headerTitle });
                var textEle = this.createElement('div', { className: classNames.text, innerHTML: innerHeaderEle.outerHTML });
                var hedBackButton = this.createElement('div', {
                    className: classNames.icon + ' ' + classNames.backIcon + ' e-but-back',
                    attrs: { style: 'display:none;' }
                });
                this.headerEle.appendChild(hedBackButton);
                this.headerEle.appendChild(textEle);
                if (this.headerTemplate) {
                    var compiledString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.headerTemplate);
                    var headerTemplateEle = this.createElement('div', { className: classNames.headerTemplateText });
                    // tslint:disable-next-line
                    var compiledElement = compiledString({}, this, prop, this.LISTVIEW_HEADERTEMPLATE_ID, null, null, this.headerEle);
                    if (compiledElement) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(compiledElement, headerTemplateEle);
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([headerTemplateEle], this.headerEle);
                    this.updateBlazorTemplates(false, true, true);
                    // tslint:disable-next-line
                    if (this.isReact) {
                        this.renderReactTemplates();
                    }
                }
                if (this.headerTemplate && this.headerTitle) {
                    textEle.classList.add('header');
                }
                this.element.classList.add('e-has-header');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.headerEle], this.element);
            }
            else if (this.headerEle) {
                if (this.showHeader) {
                    this.headerEle.style.display = '';
                    var textEle = this.headerEle.querySelector('.' + classNames.headerText);
                    var hedBackButton = this.headerEle.querySelector('.' + classNames.backIcon);
                    if (this.enableHtmlSanitizer) {
                        text = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(text);
                    }
                    textEle.innerHTML = text;
                    if (this.headerTemplate && showBack) {
                        textEle.parentElement.classList.remove('header');
                        this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('nested-header');
                    }
                    if (this.headerTemplate && !showBack) {
                        textEle.parentElement.classList.add('header');
                        this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.remove('nested-header');
                        this.headerEle.querySelector('.' + classNames.headerTemplateText).classList.add('header');
                    }
                    if (showBack === true) {
                        hedBackButton.style.display = '';
                    }
                    else {
                        hedBackButton.style.display = 'none';
                    }
                }
                else {
                    this.headerEle.style.display = 'none';
                }
            }
        }
    };
    // Animation Related Functions
    ListView.prototype.switchView = function (fromView, toView, reverse) {
        var _this = this;
        if (fromView && toView) {
            this.trigger('actionBegin', { startList: fromView, endList: toView, isReverse: reverse });
            var fPos_1 = fromView.style.position;
            var overflow_1 = (this.element.style.overflow !== 'hidden') ? this.element.style.overflow : '';
            fromView.style.position = 'absolute';
            fromView.classList.add('e-view');
            var anim = void 0;
            var duration = this.animation.duration;
            if (this.animation.effect) {
                anim = (this.enableRtl ? effectsRTLConfig[this.animation.effect] : effectsConfig[this.animation.effect]);
            }
            else {
                var slideLeft = 'SlideLeft';
                anim = effectsConfig[slideLeft];
                reverse = this.enableRtl;
                duration = 0;
            }
            this.element.style.overflow = 'hidden';
            this.aniObj.animate(fromView, {
                name: (reverse === true ? anim[0] : anim[1]),
                duration: duration,
                timingFunction: this.animation.easing,
                end: function (model) {
                    fromView.style.display = 'none';
                    _this.element.style.overflow = overflow_1;
                    fromView.style.position = fPos_1;
                    fromView.classList.remove('e-view');
                }
            });
            toView.style.display = '';
            this.aniObj.animate(toView, {
                name: (reverse === true ? anim[2] : anim[3]),
                duration: duration,
                timingFunction: this.animation.easing,
                end: function () {
                    _this.trigger('actionComplete');
                }
            });
            this.curUL = toView;
        }
    };
    ListView.prototype.preRender = function () {
        if (this.template) {
            try {
                if (document.querySelectorAll(this.template).length) {
                    this.template = document.querySelector(this.template).innerHTML.trim();
                }
            }
            catch (e) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.template);
                // tslint:disable-next-line
                if (this.isReact) {
                    this.renderReactTemplates();
                }
            }
        }
        this.listBaseOption = {
            template: this.template,
            headerTemplate: this.headerTemplate,
            groupTemplate: this.groupTemplate, expandCollapse: true, listClass: '',
            ariaAttributes: {
                itemRole: 'option', listRole: 'presentation', itemText: '',
                groupItemRole: 'group', wrapperRole: 'presentation'
            },
            fields: this.fields.properties, sortOrder: this.sortOrder, showIcon: this.showIcon,
            itemCreated: this.renderCheckbox.bind(this),
            templateID: "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY,
            groupTemplateID: "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY,
            enableHtmlSanitizer: this.enableHtmlSanitizer,
            removeBlazorID: true
        };
        this.initialization();
    };
    ListView.prototype.updateLiElementHeight = function () {
        var liContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
        if (liContainer.children[0]) {
            this.liElementHeight = liContainer.children[0].getBoundingClientRect().height;
            // tslint:disable
            this.interopAdaptor.invokeMethodAsync('LiElementHeight', this.liElementHeight);
            // tslint:enable
        }
    };
    ListView.prototype.initialization = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.enableVirtualization) {
            var ulContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
            if (ulContainer !== null) {
                if (this.height === '') {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('SetComponentHeight', window.innerHeight);
                    // tslint:enable
                    this.isWindow = true;
                    ulContainer.scrollIntoView();
                }
                if (this.height.toString().indexOf('%') !== -1) {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('SetContainerHeight', this.element.getBoundingClientRect().height.toString());
                    // tslint:enable
                }
                if (ulContainer.children[0]) {
                    this.liElementHeight = ulContainer.children[0].getBoundingClientRect().height;
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('LiElementHeight', this.liElementHeight);
                    // tslint:enable
                }
            }
        }
        this.curDSLevel = [];
        this.animateOptions = {};
        this.curViewDS = [];
        this.currentLiElements = [];
        this.isNestedList = false;
        this.selectedData = [];
        this.selectedId = [];
        this.LISTVIEW_TEMPLATE_ID = "" + this.element.id + LISTVIEW_TEMPLATE_PROPERTY;
        this.LISTVIEW_GROUPTEMPLATE_ID = "" + this.element.id + LISTVIEW_GROUPTEMPLATE_PROPERTY;
        this.LISTVIEW_HEADERTEMPLATE_ID = "" + this.element.id + LISTVIEW_HEADERTEMPLATE_PROPERTY;
        this.aniObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](this.animateOptions);
        this.removeElement(this.curUL);
        this.removeElement(this.ulElement);
        this.removeElement(this.headerEle);
        this.removeElement(this.contentContainer);
        // tslint:disable-next-line
        if (this.isReact) {
            this.clearTemplate();
        }
        this.curUL = this.ulElement = this.liCollection = this.headerEle = this.contentContainer = undefined;
    };
    ListView.prototype.renderCheckbox = function (args) {
        if (args.item.classList.contains(classNames.hasChild)) {
            this.isNestedList = true;
        }
        if (this.showCheckBox && this.isValidLI(args.item)) {
            var checkboxElement = void 0;
            var fieldData = void 0;
            checkboxElement = Object(_ej2_buttons__WEBPACK_IMPORTED_MODULE_2__["createCheckBox"])(this.createElement, false, {
                checked: false, enableRtl: this.enableRtl,
                cssClass: classNames.listviewCheckbox
            });
            checkboxElement.setAttribute('role', 'checkbox');
            var frameElement_1 = checkboxElement.querySelector('.' + classNames.checkboxIcon);
            args.item.classList.add(classNames.itemCheckList);
            args.item.firstElementChild.classList.add(classNames.checkbox);
            if (typeof this.dataSource[0] !== 'string' && typeof this.dataSource[0] !== 'number') {
                fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(args.curData, this.listBaseOption.fields);
                if (fieldData[this.listBaseOption.fields.isChecked]) {
                    this.checkInternally(args, checkboxElement);
                }
            }
            else if (((typeof this.dataSource[0] === 'string' ||
                typeof this.dataSource[0] === 'number') && this.selectedData.indexOf(args.text) !== -1)) {
                this.checkInternally(args, checkboxElement);
            }
            checkboxElement.setAttribute('aria-checked', frameElement_1.classList.contains(classNames.checked) ? 'true' : 'false');
            if (this.checkBoxPosition === 'Left') {
                checkboxElement.classList.add(classNames.checkboxLeft);
                args.item.firstElementChild.classList.add(classNames.checkboxLeft);
                args.item.firstElementChild.insertBefore(checkboxElement, args.item.firstElementChild.childNodes[0]);
            }
            else {
                checkboxElement.classList.add(classNames.checkboxRight);
                args.item.firstElementChild.classList.add(classNames.checkboxRight);
                args.item.firstElementChild.appendChild(checkboxElement);
            }
            this.currentLiElements.push(args.item);
            this.checkBoxPosition === 'Left' ? this.virtualCheckBox = args.item.firstElementChild.children[0] :
                this.virtualCheckBox = args.item.firstElementChild.lastElementChild;
        }
    };
    ListView.prototype.checkInternally = function (args, checkboxElement) {
        args.item.classList.add(classNames.selected);
        args.item.setAttribute('aria-selected', 'true');
        checkboxElement.querySelector('.' + classNames.checkboxIcon).classList.add(classNames.checked);
        checkboxElement.setAttribute('aria-checked', 'true');
    };
    /**
     * Checks the specific list item by passing the unchecked fields as an argument to this method.
     * @param  {Fields | HTMLElement | Element} item - It accepts Fields or HTML list element as an argument.
     */
    ListView.prototype.checkItem = function (item) {
        this.toggleCheckBase(item, true);
    };
    ListView.prototype.toggleCheckBase = function (item, checked) {
        if (this.showCheckBox) {
            var liElement = item;
            if (item instanceof Object && item.constructor !== HTMLLIElement) {
                liElement = this.getLiFromObjOrElement(item);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
                var checkboxIcon = liElement.querySelector('.' + classNames.checkboxIcon);
                checked ? liElement.classList.add(classNames.selected) : liElement.classList.remove(classNames.selected);
                liElement.setAttribute('aria-selected', checked ? 'true' : 'false');
                checked ? checkboxIcon.classList.add(classNames.checked) : checkboxIcon.classList.remove(classNames.checked);
                checkboxIcon.parentElement.setAttribute('aria-checked', checked ? 'true' : 'false');
            }
            this.setSelectedItemData(liElement);
        }
    };
    /**
     * Uncheck the specific list item by passing the checked fields as an argument to this method.
     * @param  {Fields | HTMLElement | Element} item - It accepts Fields or HTML list element as an argument.
     */
    ListView.prototype.uncheckItem = function (item) {
        this.toggleCheckBase(item, false);
    };
    /**
     * Checks all the unchecked items in the ListView.
     */
    ListView.prototype.checkAllItems = function () {
        this.toggleAllCheckBase(true);
    };
    /**
     * Uncheck all the checked items in ListView.
     */
    ListView.prototype.uncheckAllItems = function () {
        this.toggleAllCheckBase(false);
    };
    ListView.prototype.toggleAllCheckBase = function (checked) {
        if (this.showCheckBox) {
            for (var i = 0; i < this.liCollection.length; i++) {
                var checkIcon = this.liCollection[i].querySelector('.' + classNames.checkboxIcon);
                if (checkIcon) {
                    if (checked) {
                        if (!checkIcon.classList.contains(classNames.checked)) {
                            this.checkItem(this.liCollection[i]);
                        }
                    }
                    else {
                        if (checkIcon.classList.contains(classNames.checked)) {
                            this.uncheckItem(this.liCollection[i]);
                        }
                    }
                }
            }
            if (this.enableVirtualization) {
                this.virtualizationModule.checkedItem(checked);
            }
        }
    };
    ListView.prototype.setCheckbox = function () {
        if (this.showCheckBox) {
            var liCollection = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.listItem));
            var args = {
                item: undefined, curData: undefined, dataSource: undefined, fields: undefined,
                options: undefined, text: ''
            };
            for (var i = 0; i < liCollection.length; i++) {
                var element = liCollection[i];
                args.item = element;
                args.curData = this.getItemData(element);
                if (element.querySelector('.' + classNames.checkboxWrapper)) {
                    this.removeElement(element.querySelector('.' + classNames.checkboxWrapper));
                }
                this.renderCheckbox(args);
                if (args.item.classList.contains(classNames.selected)) {
                    this.checkInternally(args, args.item.querySelector('.' + classNames.checkboxWrapper));
                }
            }
        }
        else {
            var liCollection = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.itemCheckList));
            for (var i = 0; i < liCollection.length; i++) {
                var element = liCollection[i];
                element.classList.remove(classNames.selected);
                element.firstElementChild.classList.remove(classNames.checkbox);
                this.removeElement(element.querySelector('.' + classNames.checkboxWrapper));
            }
            if (this.selectedItems) {
                this.selectedItems.item.classList.add(classNames.selected);
            }
        }
    };
    /**
     * Refresh the height of the list item.
     */
    ListView.prototype.refreshItemHeight = function () {
        this.virtualizationModule.refreshItemHeight();
    };
    ListView.prototype.clickHandler = function (e) {
        var target = e.target;
        var classList = target.classList;
        var closestElement;
        if (classList.contains(classNames.backIcon) || classList.contains(classNames.headerText)) {
            if (this.showCheckBox && this.curDSLevel[this.curDSLevel.length - 1]) {
                this.uncheckAllItems();
            }
            this.back();
        }
        else {
            var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target.parentNode, '.' + classNames.listItem);
            if (li === null) {
                li = target;
            }
            this.removeFocus();
            if (this.enable && this.showCheckBox && this.isValidLI(li)) {
                if (e.target.classList.contains(classNames.checkboxIcon)) {
                    li.classList.add(classNames.focused);
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + classNames.checked))) {
                        var args = {
                            curData: undefined, dataSource: undefined, fields: undefined, options: undefined,
                            text: undefined, item: li
                        };
                        this.checkInternally(args, args.item.querySelector('.' + classNames.checkboxWrapper));
                    }
                    else {
                        this.uncheckItem(li);
                        li.classList.add(classNames.focused);
                    }
                    if (this.enableVirtualization) {
                        this.virtualizationModule.setCheckboxLI(li, e);
                    }
                    if (e) {
                        var eventArgs = this.selectEventData(li, e);
                        var checkIcon = li.querySelector('.' + classNames.checkboxIcon);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, { isChecked: checkIcon.classList.contains(classNames.checked) });
                        this.trigger('select', eventArgs);
                    }
                }
                else if (li.classList.contains(classNames.hasChild)) {
                    this.removeHover();
                    this.removeSelect();
                    this.removeSelect(li);
                    this.setSelectLI(li, e);
                    li.classList.remove(classNames.selected);
                }
                else {
                    this.setCheckboxLI(li, e);
                }
            }
            else {
                this.setSelectLI(li, e);
            }
            closestElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, 'li');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(closestElement)) {
                if (closestElement.classList.contains('e-has-child') &&
                    !e.target.parentElement.classList.contains('e-listview-checkbox')) {
                    closestElement.classList.add(classNames.disable);
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.enableVirtualization) {
            var ulElementContainer = this.element.querySelector('.' + classNames.virtualElementContainer);
            if (ulElementContainer.querySelector('.e-active')) {
                // tslint:disable-next-line:no-any
                var selectedElements = ulElementContainer.querySelectorAll('.e-active');
                // tslint:enable-next-line:no-any
                if (this.showCheckBox) {
                    for (var i = 0; i < selectedElements.length; i++) {
                        // tslint:disable-next-line:no-any
                        if (!this.previousSelectedItems.includes(selectedElements[i].getAttribute('data-uid'))) {
                            this.previousSelectedItems.push(selectedElements[i].getAttribute('data-uid'));
                        }
                        // tslint:enable-next-line:no-any
                    }
                }
                else {
                    this.previousSelectedItems[0] = (ulElementContainer.querySelector('.e-active').getAttribute('data-uid'));
                }
            }
            if (ulElementContainer.querySelector('.e-focused')) {
                // tslint:disable-next-line:no-any
                var focusElement = ulElementContainer.querySelector('.e-focused');
                // tslint:enable-next-line:no-any
                if (!focusElement.classList.contains('e-active')) {
                    var focusElementId = focusElement.getAttribute('data-uid');
                    // tslint:disable-next-line:no-any
                    if (this.previousSelectedItems.includes(focusElementId)) {
                        var selectedElement1 = this.previousSelectedItems.slice(0, this.previousSelectedItems.indexOf(focusElementId));
                        var selectedElement2 = this.previousSelectedItems.
                            slice(this.previousSelectedItems.indexOf(focusElementId) + 1, this.previousSelectedItems.length);
                        this.previousSelectedItems = selectedElement1.concat(selectedElement2);
                    }
                    // tslint:enable-next-line:no-any
                }
            }
        }
    };
    ListView.prototype.removeElement = function (element) {
        return element && element.parentNode && element.parentNode.removeChild(element);
    };
    ListView.prototype.hoverHandler = function (e) {
        var curLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target.parentNode, '.' + classNames.listItem);
        this.setHoverLI(curLi);
    };
    ListView.prototype.leaveHandler = function (e) {
        this.removeHover();
    };
    ;
    ListView.prototype.homeKeyHandler = function (e, end) {
        if (Object.keys(this.dataSource).length && this.curUL) {
            if (this.selectedItems) {
                (this.selectedItems.item).setAttribute('aria-selected', 'false');
            }
            var li = this.curUL.querySelectorAll('.' + classNames.listItem);
            var focusedElement = this.curUL.querySelector('.' + classNames.focused) ||
                this.curUL.querySelector('.' + classNames.selected);
            if (focusedElement) {
                focusedElement.classList.remove(classNames.focused);
                if (!this.showCheckBox) {
                    focusedElement.classList.remove(classNames.selected);
                }
            }
            var index = !end ? 0 : li.length - 1;
            if (li[index].classList.contains(classNames.hasChild) || this.showCheckBox) {
                li[index].classList.add(classNames.focused);
            }
            else {
                this.setSelectLI(li[index], e);
            }
            if (li[index]) {
                this.element.setAttribute('aria-activedescendant', li[index].id.toString());
            }
            else {
                this.element.removeAttribute('aria-activedescendant');
            }
        }
    };
    ListView.prototype.onArrowKeyDown = function (e, prev) {
        var siblingLI;
        var li;
        var hasChild = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.curUL.querySelector('.' + classNames.hasChild)) ? true : false;
        if (hasChild || this.showCheckBox) {
            li = this.curUL.querySelector('.' + classNames.focused) || this.curUL.querySelector('.' + classNames.selected);
            siblingLI = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].getSiblingLI(this.curUL.querySelectorAll('.' + classNames.listItem), li, prev);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(siblingLI)) {
                if (li) {
                    li.classList.remove(classNames.focused);
                    if (!this.showCheckBox) {
                        li.classList.remove(classNames.selected);
                    }
                }
                if (siblingLI.classList.contains(classNames.hasChild) || this.showCheckBox) {
                    siblingLI.classList.add(classNames.focused);
                }
                else {
                    this.setSelectLI(siblingLI, e);
                }
            }
        }
        else {
            li = this.curUL.querySelector('.' + classNames.selected);
            siblingLI = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].getSiblingLI(this.curUL.querySelectorAll('.' + classNames.listItem), li, prev);
            this.setSelectLI(siblingLI, e);
        }
        if (siblingLI) {
            this.element.setAttribute('aria-activedescendant', siblingLI.id.toString());
        }
        else {
            this.element.removeAttribute('aria-activedescendant');
        }
        return siblingLI;
    };
    ListView.prototype.arrowKeyHandler = function (e, prev) {
        var _this = this;
        e.preventDefault();
        if (Object.keys(this.dataSource).length && this.curUL) {
            var siblingLI = this.onArrowKeyDown(e, prev);
            var elementTop = this.element.getBoundingClientRect().top;
            var elementHeight = this.element.getBoundingClientRect().height;
            var firstItemBounds = this.curUL.querySelector('.' + classNames.listItem).getBoundingClientRect();
            var heightDiff = void 0;
            var groupItemBounds = void 0;
            if (this.fields.groupBy) {
                groupItemBounds = this.curUL.querySelector('.' + classNames.groupListItem).getBoundingClientRect();
            }
            if (siblingLI) {
                var siblingTop = siblingLI.getBoundingClientRect().top;
                var siblingHeight = siblingLI.getBoundingClientRect().height;
                if (!prev) {
                    var height = this.isWindow ? window.innerHeight : elementHeight;
                    heightDiff = this.isWindow ? (siblingTop + siblingHeight) :
                        ((siblingTop - elementTop) + siblingHeight);
                    if (heightDiff > height) {
                        this.isWindow ? window.scroll(0, pageYOffset + (heightDiff - height)) :
                            this.element.scrollTop = this.element.scrollTop + (heightDiff - height);
                    }
                }
                else {
                    heightDiff = this.isWindow ? siblingTop : (siblingTop - elementTop);
                    if (heightDiff < 0) {
                        this.isWindow ? window.scroll(0, pageYOffset + heightDiff) :
                            this.element.scrollTop = this.element.scrollTop + heightDiff;
                    }
                }
            }
            else if (this.enableVirtualization && prev && this.virtualizationModule.uiFirstIndex) {
                this.onUIScrolled = function () {
                    _this.onArrowKeyDown(e, prev);
                    _this.onUIScrolled = undefined;
                };
                heightDiff = this.virtualizationModule.listItemHeight;
                this.isWindow ? window.scroll(0, pageYOffset - heightDiff) :
                    this.element.scrollTop = this.element.scrollTop - heightDiff;
            }
            else if (prev) {
                if (this.showHeader && this.headerEle) {
                    var topHeight = groupItemBounds ? groupItemBounds.top : firstItemBounds.top;
                    var headerBounds = this.headerEle.getBoundingClientRect();
                    heightDiff = headerBounds.top < 0 ? (headerBounds.height - topHeight) : 0;
                    this.isWindow ? window.scroll(0, pageYOffset - heightDiff)
                        : this.element.scrollTop = 0;
                }
                else if (this.fields.groupBy) {
                    heightDiff = this.isWindow ? (groupItemBounds.top < 0 ? groupItemBounds.top : 0) :
                        (elementTop - firstItemBounds.top) + groupItemBounds.height;
                    this.isWindow ? window.scroll(0, pageYOffset + heightDiff) :
                        this.element.scrollTop = this.element.scrollTop - heightDiff;
                }
            }
        }
    };
    ListView.prototype.enterKeyHandler = function (e) {
        if (Object.keys(this.dataSource).length && this.curUL) {
            var hasChild = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.curUL.querySelector('.' + classNames.hasChild)) ? true : false;
            var li = this.curUL.querySelector('.' + classNames.focused);
            if (hasChild && li) {
                li.classList.remove(classNames.focused);
                if (this.showCheckBox) {
                    this.removeSelect();
                    this.removeSelect(li);
                    this.removeHover();
                }
                this.setSelectLI(li, e);
            }
        }
    };
    ListView.prototype.spaceKeyHandler = function (e) {
        if (this.enable && this.showCheckBox && Object.keys(this.dataSource).length && this.curUL) {
            var li = this.curUL.querySelector('.' + classNames.focused);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.querySelector('.' + classNames.checked))) {
                var args = {
                    curData: undefined, dataSource: undefined, fields: undefined, options: undefined,
                    text: undefined, item: li
                };
                this.checkInternally(args, args.item.querySelector('.' + classNames.checkboxWrapper));
            }
            else {
                this.uncheckItem(li);
            }
        }
    };
    ListView.prototype.keyActionHandler = function (e) {
        switch (e.keyCode) {
            case 36:
                this.homeKeyHandler(e);
                break;
            case 35:
                this.homeKeyHandler(e, true);
                break;
            case 40:
                this.arrowKeyHandler(e);
                break;
            case 38:
                this.arrowKeyHandler(e, true);
                break;
            case 13:
                this.enterKeyHandler(e);
                break;
            case 8:
                if (this.showCheckBox && this.curDSLevel[this.curDSLevel.length - 1]) {
                    this.uncheckAllItems();
                }
                this.back();
                break;
            case 32:
                this.spaceKeyHandler(e);
                break;
        }
    };
    ListView.prototype.swipeActionHandler = function (e) {
        if (e.swipeDirection === 'Right' && e.velocity > swipeVelocity && e.originalEvent.type === 'touchend') {
            if (this.showCheckBox && this.curDSLevel[this.curDSLevel.length - 1]) {
                this.uncheckAllItems();
            }
            this.back();
        }
    };
    ListView.prototype.focusout = function () {
        if (Object.keys(this.dataSource).length && this.curUL) {
            var focusedElement = this.curUL.querySelector('.' + classNames.focused);
            var activeElement = this.curUL.querySelector('[aria-selected = true]');
            if (focusedElement) {
                focusedElement.classList.remove(classNames.focused);
                if (activeElement && !this.showCheckBox) {
                    activeElement.classList.add(classNames.selected);
                }
            }
        }
    };
    ListView.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.keyActionHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseover', this.hoverHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseout', this.leaveHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focusout', this.focusout, this);
        this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, { swipe: this.swipeActionHandler.bind(this) });
    };
    ListView.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseover', this.hoverHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseout', this.leaveHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseover', this.hoverHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseout', this.leaveHandler);
        this.touchModule.destroy();
    };
    ListView.prototype.removeFocus = function () {
        var focusedLI = this.element.querySelectorAll('.' + classNames.focused);
        for (var _i = 0, focusedLI_1 = focusedLI; _i < focusedLI_1.length; _i++) {
            var ele = focusedLI_1[_i];
            ele.classList.remove(classNames.focused);
        }
    };
    ListView.prototype.removeHover = function () {
        var hoverLI = this.element.querySelector('.' + classNames.hover);
        if (hoverLI) {
            hoverLI.classList.remove(classNames.hover);
        }
    };
    ListView.prototype.removeSelect = function (li) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
            var selectedLI = this.element.querySelectorAll('.' + classNames.selected);
            for (var _i = 0, selectedLI_1 = selectedLI; _i < selectedLI_1.length; _i++) {
                var ele = selectedLI_1[_i];
                if (this.showCheckBox && ele.querySelector('.' + classNames.checked)) {
                    continue;
                }
                else {
                    ele.setAttribute('aria-selected', 'false');
                    ele.classList.remove(classNames.selected);
                }
            }
        }
        else {
            li.classList.remove(classNames.selected);
            li.setAttribute('aria-selected', 'false');
        }
    };
    ListView.prototype.isValidLI = function (li) {
        return (li && li.classList.contains(classNames.listItem)
            && !li.classList.contains(classNames.groupListItem)
            && !li.classList.contains(classNames.disable));
    };
    ListView.prototype.setCheckboxLI = function (li, e) {
        if (this.isValidLI(li) && this.enable && this.showCheckBox) {
            if (this.curUL.querySelector('.' + classNames.focused)) {
                this.curUL.querySelector('.' + classNames.focused).classList.remove(classNames.focused);
            }
            li.classList.add(classNames.focused);
            var checkboxElement = li.querySelector('.' + classNames.checkboxWrapper);
            var checkIcon = checkboxElement.querySelector('.' + classNames.checkboxIcon + '.' + classNames.icon);
            this.removeHover();
            if (!checkIcon.classList.contains(classNames.checked)) {
                checkIcon.classList.add(classNames.checked);
                li.classList.add(classNames.selected);
                li.setAttribute('aria-selected', 'true');
            }
            else {
                checkIcon.classList.remove(classNames.checked);
                li.classList.remove(classNames.selected);
                li.setAttribute('aria-selected', 'false');
            }
            checkboxElement.setAttribute('aria-checked', checkIcon.classList.contains(classNames.checked) ?
                'true' : 'false');
            var eventArgs = this.selectEventData(li, e);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, { isChecked: checkIcon.classList.contains(classNames.checked) });
            if (this.enableVirtualization) {
                this.virtualizationModule.setCheckboxLI(li, e);
            }
            this.trigger('select', eventArgs);
            this.setSelectedItemData(li);
            this.renderSubList(li);
        }
    };
    ListView.prototype.selectEventData = function (li, e) {
        var data = this.getItemData(li);
        var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(data, this.listBaseOption.fields);
        var selectedItem;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data)
            && typeof this.dataSource[0] === 'string' || typeof this.dataSource[0] === 'number') {
            selectedItem = { item: li, text: li && li.innerText.trim(), data: this.dataSource };
        }
        else {
            selectedItem = { item: li, text: fieldData && fieldData[this.listBaseOption.fields.text], data: data };
        }
        var eventArgs = {};
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, selectedItem);
        if (e) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(eventArgs, { isInteracted: true, event: e, index: this.curUL && Array.prototype.indexOf.call(this.curUL.children, li) });
        }
        return eventArgs;
    };
    ListView.prototype.setSelectedItemData = function (li) {
        var data = this.getItemData(li);
        var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(data, this.listBaseOption.fields);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data) && ((typeof this.dataSource[0] === 'string') ||
            (typeof this.dataSource[0] === 'number'))) {
            this.selectedItems = {
                item: li,
                text: li && li.innerText.trim(),
                data: this.dataSource
            };
        }
        else {
            this.selectedItems = {
                item: li,
                text: fieldData && fieldData[this.listBaseOption.fields.text],
                data: data
            };
        }
    };
    ListView.prototype.setSelectLI = function (li, e) {
        if (this.isValidLI(li) && !li.classList.contains(classNames.selected) && this.enable) {
            if (!this.showCheckBox) {
                this.removeSelect();
            }
            li.classList.add(classNames.selected);
            li.setAttribute('aria-selected', 'true');
            this.removeHover();
            this.setSelectedItemData(li);
            if (this.enableVirtualization) {
                this.virtualizationModule.setSelectLI(li, e);
            }
            var eventArgs = this.selectEventData(li, e);
            this.trigger('select', eventArgs);
            this.selectedLI = li;
            this.renderSubList(li);
        }
    };
    ListView.prototype.setHoverLI = function (li) {
        if (this.isValidLI(li) && !li.classList.contains(classNames.hover) && this.enable) {
            var lastLi = this.element.querySelectorAll('.' + classNames.hover);
            if (lastLi && lastLi.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(lastLi, classNames.hover);
            }
            if (!li.classList.contains(classNames.selected) || this.showCheckBox) {
                li.classList.add(classNames.hover);
            }
        }
    };
    //Data Source Related Functions
    ListView.prototype.getSubDS = function () {
        var levelKeys = this.curDSLevel;
        if (levelKeys.length) {
            var ds = this.localData;
            for (var _i = 0, levelKeys_1 = levelKeys; _i < levelKeys_1.length; _i++) {
                var key = levelKeys_1[_i];
                var field = {};
                field[this.fields.id] = key;
                this.curDSJSON = this.findItemFromDS(ds, field);
                var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(this.curDSJSON, this.listBaseOption.fields);
                ds = this.curDSJSON ? fieldData[this.fields.child] : ds;
            }
            return ds;
        }
        return this.localData;
    };
    ListView.prototype.getItemData = function (li) {
        var dataSource = this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] ?
            this.localData : this.dataSource;
        var fields = this.getElementUID(li);
        var curDS;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.' + classNames.hasChild)) && this.fields.groupBy) {
            curDS = this.curViewDS;
        }
        else {
            curDS = dataSource;
        }
        return this.findItemFromDS(curDS, fields);
    };
    ListView.prototype.findItemFromDS = function (dataSource, fields, parent) {
        var _this = this;
        var resultJSON;
        if (dataSource && dataSource.length && fields) {
            dataSource.some(function (data) {
                var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(data, _this.listBaseOption.fields);
                //(!(fid) || id === fid) && (!(ftext) || text === ftext) && (!!fid || !!ftext)
                if ((fields[_this.fields.id] || fields[_this.fields.text]) &&
                    (!fields[_this.fields.id] || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[_this.fields.id]) &&
                        fieldData[_this.fields.id].toString()) === fields[_this.fields.id].toString()) &&
                    (!fields[_this.fields.text] || fieldData[_this.fields.text] === fields[_this.fields.text])) {
                    resultJSON = (parent ? dataSource : data);
                }
                else if (typeof data !== 'object' && dataSource.indexOf(data) !== -1) {
                    resultJSON = (parent ? dataSource : data);
                }
                else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fields[_this.fields.id]) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData[_this.fields.id])) {
                    var li = _this.element.querySelector('[data-uid="'
                        + fields[_this.fields.id] + '"]');
                    if (li && li.innerText.trim() === fieldData[_this.fields.text]) {
                        resultJSON = data;
                    }
                }
                else if (fieldData.hasOwnProperty(_this.fields.child) && fieldData[_this.fields.child].length) {
                    resultJSON = _this.findItemFromDS(fieldData[_this.fields.child], fields, parent);
                }
                return !!resultJSON;
            });
        }
        else {
            resultJSON = dataSource;
        }
        return resultJSON;
    };
    ListView.prototype.getQuery = function () {
        var columns = [];
        var query = (this.query ? this.query : new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]());
        if (!this.query) {
            for (var _i = 0, _a = Object.keys(this.fields.properties); _i < _a.length; _i++) {
                var column = _a[_i];
                if (column !== 'tableName' && !!(this.fields[column]) &&
                    this.fields[column] !==
                        _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].defaultMappedFields[column]
                    && columns.indexOf(this.fields[column]) === -1) {
                    columns.push(this.fields[column]);
                }
            }
            query.select(columns);
            if (this.fields.properties.hasOwnProperty('tableName')) {
                query.from(this.fields.tableName);
            }
        }
        return query;
    };
    ListView.prototype.setViewDataSource = function (dataSource) {
        if (dataSource === void 0) { dataSource = this.localData; }
        if (dataSource && this.fields.groupBy) {
            if (this.sortOrder !== 'None') {
                this.curViewDS = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].groupDataSource(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].getDataSource(dataSource, _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].addSorting(this.sortOrder, this.fields.sortBy)), this.listBaseOption.fields, this.sortOrder);
            }
            else {
                this.curViewDS = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].groupDataSource(dataSource, this.listBaseOption.fields, this.sortOrder);
            }
        }
        else if (dataSource && this.sortOrder !== 'None') {
            this.curViewDS = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].getDataSource(dataSource, _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].addSorting(this.sortOrder, this.fields.sortBy));
        }
        else {
            this.curViewDS = dataSource;
        }
    };
    ListView.prototype.isInAnimation = function () {
        return this.curUL.classList.contains('.e-animate');
    };
    ListView.prototype.setLocalData = function () {
        var _this = this;
        this.trigger('actionBegin');
        var listViewComponent = this;
        if (this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]) {
            this.dataSource.executeQuery(this.getQuery()).then(function (e) {
                if (_this.isDestroyed) {
                    return;
                }
                _this.localData = e.result;
                if (!_this.isServerRendered || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])())) {
                    listViewComponent.removeElement(listViewComponent.contentContainer);
                    if (_this.isReact) {
                        _this.clearTemplate();
                    }
                }
                _this.renderList();
                _this.trigger('actionComplete', e);
            }).catch(function (e) {
                if (_this.isDestroyed) {
                    return;
                }
                _this.trigger('actionFailure', e);
            });
        }
        else if (!this.dataSource || !this.dataSource.length) {
            var ul = this.element.querySelector('ul');
            if (ul) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(ul);
                this.setProperties({ dataSource: _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createJsonFromElement(ul) }, true);
                this.localData = this.dataSource;
                this.renderList();
                this.trigger('actionComplete', { data: this.localData });
            }
        }
        else {
            this.localData = this.dataSource;
            this.renderList();
            this.trigger('actionComplete', { data: this.localData });
        }
    };
    ListView.prototype.reRender = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered || this.enableVirtualization) {
            this.resetBlazorTemplates();
            this.removeElement(this.headerEle);
            this.removeElement(this.ulElement);
            this.removeElement(this.contentContainer);
            if (this.isReact) {
                this.clearTemplate();
            }
            if (Object.keys(window).indexOf('ejsInterop') === -1) {
                this.element.innerHTML = '';
            }
            this.headerEle = this.ulElement = this.liCollection = undefined;
            this.header();
        }
        this.setLocalData();
    };
    ListView.prototype.resetCurrentList = function () {
        this.resetBlazorTemplates();
        this.setViewDataSource(this.curViewDS);
        this.contentContainer.innerHTML = '';
        this.createList();
        this.renderIntoDom(this.curUL);
    };
    ListView.prototype.setAttributes = function (liElements) {
        for (var i = 0; i < liElements.length; i++) {
            var element = liElements[i];
            if (element.classList.contains('e-list-item')) {
                element.setAttribute('id', this.element.id + '_' + element.getAttribute('data-uid'));
                element.setAttribute('aria-selected', 'false');
                element.setAttribute('tabindex', '-1');
            }
        }
    };
    ListView.prototype.createList = function () {
        this.currentLiElements = [];
        this.isNestedList = false;
        this.ulElement = this.curUL = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createList(this.createElement, this.curViewDS, this.listBaseOption, null, this);
        this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
        this.setAttributes(this.liCollection);
        this.updateBlazorTemplates(true);
    };
    ListView.prototype.resetBlazorTemplates = function () {
        // tslint:disable-next-line:no-any
        var templateCollection = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"];
        if (this.template) {
            templateCollection[this.LISTVIEW_TEMPLATE_ID] = [];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.LISTVIEW_TEMPLATE_ID, LISTVIEW_TEMPLATE_PROPERTY);
        }
        if (this.groupTemplate) {
            templateCollection[this.LISTVIEW_GROUPTEMPLATE_ID] = [];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.LISTVIEW_GROUPTEMPLATE_ID, LISTVIEW_GROUPTEMPLATE_PROPERTY);
        }
        if (this.headerTemplate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.LISTVIEW_HEADERTEMPLATE_ID, LISTVIEW_HEADERTEMPLATE_PROPERTY);
        }
    };
    ListView.prototype.updateBlazorTemplates = function (template, headerTemplate, resetExistingElements) {
        if (template === void 0) { template = false; }
        if (headerTemplate === void 0) { headerTemplate = false; }
        if (resetExistingElements === void 0) { resetExistingElements = false; }
        if (this.template && template && !this.enableVirtualization) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.LISTVIEW_TEMPLATE_ID, LISTVIEW_TEMPLATE_PROPERTY, this, resetExistingElements);
        }
        if (this.groupTemplate && template && !this.enableVirtualization) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.LISTVIEW_GROUPTEMPLATE_ID, LISTVIEW_GROUPTEMPLATE_PROPERTY, this, resetExistingElements);
        }
        if (this.headerTemplate && headerTemplate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.LISTVIEW_HEADERTEMPLATE_ID, LISTVIEW_HEADERTEMPLATE_PROPERTY, this, resetExistingElements);
        }
    };
    ListView.prototype.exceptionEvent = function (e) {
        this.trigger('actionFailure', e);
    };
    ListView.prototype.UpdateCurrentUL = function () {
        this.ulElement = this.curUL = this.element.querySelector('.' + classNames.parentItem);
        if (this.curUL) {
            // tslint:disable
            this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
            // tslint:enable
        }
    };
    ListView.prototype.removeActiveClass = function () {
        var listViewComponent = this;
        setTimeout(function () {
            var ulContainer = listViewComponent.element.querySelector('.' + classNames.virtualElementContainer);
            for (var i = 0; i < ulContainer.childElementCount; i++) {
                var selectedElement = ulContainer.children[i];
                var elementIndex = void 0;
                var hiddenElementIndex = void 0;
                if (listViewComponent.showCheckBox) {
                    if (listViewComponent.previousSelectedItems.length > 0) {
                        for (var j = 0; j < listViewComponent.previousSelectedItems.length; j++) {
                            if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[j]) {
                                selectedElement.classList.add('e-active');
                                selectedElement.setAttribute('aria-selected', 'true');
                                if (selectedElement.querySelector('.e-frame.e-icons')) {
                                    selectedElement.querySelector('.e-frame.e-icons').classList.add('e-check');
                                }
                                elementIndex = i;
                            }
                            else {
                                if (elementIndex !== i) {
                                    selectedElement.classList.remove('e-active');
                                    selectedElement.removeAttribute('aria-selected');
                                    if (selectedElement.querySelector('.e-check')) {
                                        selectedElement.querySelector('.e-check').classList.remove('e-check');
                                    }
                                }
                            }
                        }
                    }
                    else {
                        selectedElement.classList.remove('e-active');
                        selectedElement.removeAttribute('aria-selected');
                        if (selectedElement.querySelector('.e-check')) {
                            selectedElement.querySelector('.e-check').classList.remove('e-check');
                        }
                    }
                }
                else {
                    if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[0]) {
                        selectedElement.classList.add('e-active');
                        selectedElement.setAttribute('aria-selected', 'true');
                    }
                    else {
                        selectedElement.classList.remove('e-active');
                        selectedElement.removeAttribute('aria-selected');
                    }
                }
                if (listViewComponent.hiddenItems.length > 0) {
                    for (var k = 0; k < listViewComponent.hiddenItems.length; k++) {
                        if (selectedElement.getAttribute('data-uid') === listViewComponent.previousSelectedItems[k]) {
                            selectedElement.style.display = 'none';
                            hiddenElementIndex = i;
                        }
                        else {
                            if (hiddenElementIndex !== i) {
                                selectedElement.style.display = null;
                            }
                        }
                    }
                }
                if (listViewComponent.enabledItems.length > 0) {
                    for (var x = 0; x < listViewComponent.enabledItems.length; x++) {
                        if (selectedElement.getAttribute('data-uid') === listViewComponent.enabledItems[x]) {
                            if (selectedElement.classList.contains('e-disabled')) {
                                selectedElement.classList.remove('e-disabled');
                            }
                        }
                    }
                }
                if (listViewComponent.disabledItems.length > 0) {
                    for (var y = 0; y < listViewComponent.disabledItems.length; y++) {
                        if (selectedElement.getAttribute('data-uid') === listViewComponent.disabledItems[y]) {
                            if (!selectedElement.classList.contains('e-disabled')) {
                                selectedElement.classList.add('e-disabled');
                            }
                        }
                    }
                }
            }
        }, 200);
    };
    ListView.prototype.renderingNestedList = function () {
        var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.liElement.parentNode, '.' + classNames.parentItem);
        var ctrlId = this.element.id;
        var ulElement = document.getElementById(ctrlId);
        var currentListItem = ulElement.getElementsByTagName('UL')[ulElement.getElementsByTagName('UL').length - 1];
        this.switchView(ul, currentListItem);
        this.liElement = null;
    };
    ListView.prototype.renderSubList = function (li) {
        this.liElement = li;
        var uID = li.getAttribute('data-uid');
        if (li.classList.contains(classNames.hasChild) && uID) {
            var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(li.parentNode, '.' + classNames.parentItem);
            var ele = this.element.querySelector('[pid=\'' + uID + '\']');
            this.curDSLevel.push(uID);
            this.setViewDataSource(this.getSubDS());
            if (!ele) {
                var data = this.curViewDS;
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered) {
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('ListChildDataSource', data);
                    // tslint:enable
                }
                else {
                    ele = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createListFromJson(this.createElement, data, this.listBaseOption, this.curDSLevel.length, null, this);
                    // tslint:disable-next-line
                    if (this.isReact) {
                        this.renderReactTemplates();
                    }
                    var lists = ele.querySelectorAll('.' + classNames.listItem);
                    this.setAttributes(lists);
                    ele.setAttribute('pID', uID);
                    ele.style.display = 'none';
                    this.renderIntoDom(ele);
                    this.updateBlazorTemplates(true);
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered || this.enableVirtualization) {
                this.switchView(ul, ele, false);
            }
            this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
            if (this.selectedItems) {
                var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(this.selectedItems.data, this.listBaseOption.fields);
                this.header((fieldData[this.listBaseOption.fields.text]), true, 'header');
            }
            this.selectedLI = undefined;
        }
    };
    ListView.prototype.renderIntoDom = function (ele) {
        this.contentContainer.appendChild(ele);
    };
    ListView.prototype.renderList = function (data) {
        this.setViewDataSource(data);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered || this.enableVirtualization) {
            if (this.enableVirtualization) {
                if (Object.keys(this.dataSource).length) {
                    if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
                        if ((this.template || this.groupTemplate) && !this.virtualizationModule.isNgTemplate()) {
                            this.listBaseOption.template = null;
                            this.listBaseOption.groupTemplate = null;
                            this.listBaseOption.itemCreated = this.virtualizationModule.createUIItem.bind(this.virtualizationModule);
                        }
                    }
                }
                this.virtualizationModule.uiVirtualization();
            }
            else {
                this.createList();
                this.contentContainer = this.createElement('div', { className: classNames.content });
                this.element.appendChild(this.contentContainer);
                this.renderIntoDom(this.ulElement);
                // tslint:disable-next-line
                if (this.isReact) {
                    this.renderReactTemplates();
                }
            }
        }
    };
    ListView.prototype.getElementUID = function (obj) {
        var fields = {};
        if (obj instanceof Element) {
            fields[this.fields.id] = obj.getAttribute('data-uid');
        }
        else {
            fields = obj;
        }
        return fields;
    };
    /**
     * Initializes the ListView component rendering.
     */
    ListView.prototype.render = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || !this.isServerRendered) {
            this.element.classList.add(classNames.root);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { role: 'list', tabindex: '0' });
            this.setCSSClass();
            this.setEnableRTL();
            this.setEnable();
            this.setSize();
            this.wireEvents();
            this.header();
            this.setLocalData();
            this.setHTMLAttribute();
            // tslint:disable-next-line
            if (this.isReact) {
                this.renderReactTemplates();
            }
        }
        else {
            this.initBlazor(true);
        }
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, {
            selector: '.' + classNames.listItem
        });
        this.renderComplete();
    };
    ListView.prototype.initBlazor = function (firstRender) {
        if (firstRender === null) {
            firstRender = false;
        }
        this.setLocalData();
        this.setViewDataSource(this.localData);
        this.contentContainer = this.element.querySelector('.' + classNames.content);
        if (firstRender) {
            this.wireEvents();
        }
    };
    /**
     * It is used to destroy the ListView component.
     */
    ListView.prototype.destroy = function () {
        this.resetBlazorTemplates();
        // tslint:disable-next-line
        if (this.isReact) {
            this.clearTemplate();
        }
        this.unWireEvents();
        var classAr = [classNames.root, classNames.disable, 'e-rtl',
            'e-has-header', 'e-lib'].concat(this.cssClass.split(' ').filter(function (css) { return css; }));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], classAr);
        this.element.removeAttribute('role');
        this.element.removeAttribute('tabindex');
        this.curUL = this.ulElement = this.liCollection = this.headerEle = undefined;
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered)) {
            this.element.innerHTML = '';
            _super.prototype.destroy.call(this);
        }
        else {
            this.element.style.display = 'none';
        }
    };
    /**
     * Switches back from the navigated sub list item.
     */
    ListView.prototype.back = function () {
        var pID = this.curDSLevel[this.curDSLevel.length - 1];
        if (pID === undefined || this.isInAnimation()) {
            return;
        }
        this.curDSLevel.pop();
        this.setViewDataSource(this.getSubDS());
        var toUL = this.element.querySelector('[data-uid=\'' + pID + '\']');
        var fromUL = this.curUL;
        if (!toUL) {
            this.createList();
            this.renderIntoDom(this.ulElement);
            toUL = this.curUL;
        }
        else {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered && this.enableVirtualization) {
                toUL = toUL.parentElement.parentElement.parentElement;
            }
            else {
                toUL = toUL.parentElement;
            }
        }
        var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(this.curDSJSON, this.listBaseOption.fields);
        var text = fieldData[this.fields.text];
        this.switchView(fromUL, toUL, true);
        this.removeFocus();
        var li = this.element.querySelector('[data-uid=\'' + pID + '\']');
        li.classList.remove(classNames.disable);
        li.classList.add(classNames.focused);
        if (this.showCheckBox && li.querySelector('.' + classNames.checkboxIcon).classList.contains(classNames.checked)) {
            li.setAttribute('aria-selected', 'true');
        }
        else {
            li.classList.remove(classNames.selected);
            li.setAttribute('aria-selected', 'false');
        }
        this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
        if (this.enableHtmlSanitizer) {
            this.setProperties({ headerTitle: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.headerTitle) }, true);
        }
        this.header((this.curDSLevel.length ? text : this.headerTitle), (this.curDSLevel.length ? true : false), 'header');
    };
    /**
     * Selects the list item from the ListView by passing the elements or field object.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.selectItem = function (item) {
        if (this.enableVirtualization) {
            this.virtualizationModule.selectItem(item);
        }
        else if (this.showCheckBox) {
            this.setCheckboxLI(this.getLiFromObjOrElement(item));
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) ? this.removeSelect() : this.setSelectLI(this.getLiFromObjOrElement(item));
        }
    };
    ListView.prototype.getLiFromObjOrElement = function (obj) {
        var li;
        var dataSource = this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] ?
            this.localData : this.dataSource;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj)) {
            if (typeof dataSource[0] === 'string' || typeof dataSource[0] === 'number') {
                if (obj instanceof Element) {
                    var uid = obj.getAttribute('data-uid').toString();
                    for (var i = 0; i < this.liCollection.length; i++) {
                        if (this.liCollection[i].getAttribute('data-uid').toString() === uid) {
                            li = this.liCollection[i];
                            break;
                        }
                    }
                }
                else {
                    Array.prototype.some.call(this.curUL.querySelectorAll('.' + classNames.listItem), function (item) {
                        if (item.innerText.trim() === obj.toString()) {
                            li = item;
                            return true;
                        }
                        else {
                            return false;
                        }
                    });
                }
            }
            else {
                var resultJSON = this.getItemData(obj);
                var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(resultJSON, this.listBaseOption.fields);
                if (resultJSON) {
                    li = this.element.querySelector('[data-uid="'
                        + fieldData[this.fields.id] + '"]');
                    if (!this.enableVirtualization && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
                        var curLi = this.element.querySelectorAll('.' + classNames.listItem);
                        for (var i = 0; i < curLi.length; i++) {
                            if (curLi[i].innerText.trim() === fieldData[this.fields.text]) {
                                li = curLi[i];
                            }
                        }
                    }
                }
            }
        }
        return li;
    };
    /**
     * Selects multiple list items from the ListView.
     * @param  {Fields[] | HTMLElement[] | Element[]} item - We can pass array of
     *  elements or array of fields Object with ID and Text fields.
     */
    ListView.prototype.selectMultipleItems = function (item) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            for (var i = 0; i < item.length; i++) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item[i])) {
                    this.selectItem(item[i]);
                }
            }
        }
    };
    ListView.prototype.getParentId = function () {
        var parentId = [];
        if (this.isNestedList) {
            for (var i = this.curDSLevel.length - 1; i >= 0; i--) {
                parentId.push(this.curDSLevel[i]);
            }
        }
        return parentId;
    };
    /**
     * Gets the details of the currently selected item from the list items.
     * @blazorType ListSelectedItem<TValue>
     */
    ListView.prototype.getSelectedItems = function () {
        // tslint:disable-next-line:no-any
        var finalValue;
        var isCompleted = false;
        this.selectedId = [];
        var dataSource = this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] ?
            this.localData : this.dataSource;
        if (this.enableVirtualization && !isCompleted) {
            finalValue = this.virtualizationModule.getSelectedItems();
            isCompleted = true;
        }
        else if (this.showCheckBox && !isCompleted) {
            // tslint:disable-next-line:no-any
            var liCollection = this.curUL.getElementsByClassName(classNames.selected);
            var liTextCollection = [];
            var liDataCollection = [];
            this.selectedId = [];
            var dataParent = [];
            for (var i = 0; i < liCollection.length; i++) {
                if (typeof dataSource[0] === 'string' || typeof dataSource[0] === 'number') {
                    liTextCollection.push(liCollection[i].innerText.trim());
                }
                else {
                    var tempData = this.getItemData(liCollection[i]);
                    var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(tempData, this.listBaseOption.fields);
                    if (this.isNestedList) {
                        dataParent.push({ data: tempData, parentId: this.getParentId() });
                    }
                    else {
                        liDataCollection.push(tempData);
                    }
                    if (fieldData) {
                        liTextCollection.push(fieldData[this.listBaseOption.fields.text]);
                        this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
                    }
                    else {
                        liTextCollection.push(undefined);
                        this.selectedId.push(undefined);
                    }
                }
            }
            if ((typeof dataSource[0] === 'string'
                || typeof dataSource[0] === 'number')
                && !isCompleted) {
                finalValue = { item: liCollection, data: dataSource, text: liTextCollection };
                isCompleted = true;
            }
            if (this.isNestedList && !isCompleted) {
                finalValue = { item: liCollection, data: dataParent, text: liTextCollection };
                isCompleted = true;
            }
            else if (!isCompleted) {
                finalValue = { item: liCollection, data: liDataCollection, text: liTextCollection };
                isCompleted = true;
            }
        }
        else if (!isCompleted) {
            var liElement = this.element.getElementsByClassName(classNames.selected)[0];
            var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(this.getItemData(liElement), this.listBaseOption.fields);
            if ((typeof dataSource[0] === 'string'
                || typeof dataSource[0] === 'number')
                && !isCompleted) {
                finalValue = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) ? {
                    item: liElement, data: dataSource,
                    text: liElement.innerText.trim()
                } : undefined;
                isCompleted = true;
            }
            else if (!isCompleted) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fieldData) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liElement)) {
                    finalValue = undefined;
                    isCompleted = true;
                }
                else {
                    this.selectedId.push(fieldData[this.listBaseOption.fields.id]);
                    finalValue = {
                        text: fieldData[this.listBaseOption.fields.text], item: liElement,
                        data: this.getItemData(liElement)
                    };
                    isCompleted = true;
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            // tslint:disable-next-line:no-any
            return this.blazorGetSelectedItems(finalValue);
        }
        else {
            return finalValue;
        }
    };
    // tslint:disable-next-line:no-any
    ListView.prototype.blazorGetSelectedItems = function (finalGetSelectedItem) {
        var blazorSelectedItem = {
            data: [],
            index: [],
            parentId: [],
            text: []
        };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem.data)) {
                if (this.showCheckBox && this.isNestedList) {
                    for (var i = 0; i < finalGetSelectedItem.data.length; i++) {
                        blazorSelectedItem.data.push(finalGetSelectedItem.data[i].data);
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem.data[0])
                        && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem.data[0].parentId)) {
                        blazorSelectedItem.parentId = finalGetSelectedItem.data[0].parentId;
                    }
                }
                else {
                    blazorSelectedItem.data = this.convertItemsToArray(finalGetSelectedItem.data);
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem.text)) {
                blazorSelectedItem.text = this.convertItemsToArray(finalGetSelectedItem.text);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(finalGetSelectedItem.index)) {
                blazorSelectedItem.index = this.convertItemsToArray(finalGetSelectedItem.index);
            }
        }
        return blazorSelectedItem;
    };
    // tslint:disable-next-line:no-any
    ListView.prototype.convertItemsToArray = function (items) {
        return Array.isArray(items) ? items.slice() : [items];
    };
    /**
     * Finds out an item details from the current list.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     * @blazorType TValue
     */
    ListView.prototype.findItem = function (item) {
        return this.getItemData(item);
    };
    /**
     * Enables the disabled list items by passing the Id and text fields.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.enableItem = function (item) {
        this.setItemState(item, true);
        if (this.enableVirtualization) {
            this.virtualizationModule.enableItem(item);
        }
    };
    /**
     * Disables the list items by passing the Id and text fields.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.disableItem = function (item) {
        this.setItemState(item, false);
        if (this.enableVirtualization) {
            this.virtualizationModule.disableItem(item);
        }
    };
    //A function that used to set state of the list item like enable, disable.
    ListView.prototype.setItemState = function (item, isEnable) {
        var resultJSON = this.getItemData(item);
        var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(resultJSON, this.listBaseOption.fields);
        if (resultJSON) {
            var li = this.element.querySelector('[data-uid="' + fieldData[this.fields.id] + '"]');
            if (isEnable) {
                if (li) {
                    li.classList.remove(classNames.disable);
                }
                delete resultJSON[this.fields.enabled];
            }
            else if (!isEnable) {
                if (li) {
                    li.classList.add(classNames.disable);
                }
                resultJSON[this.fields.enabled] = false;
            }
        }
    };
    /**
     * Shows the hide list item from the ListView.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.showItem = function (item) {
        this.showHideItem(item, false, '');
        if (this.enableVirtualization) {
            this.virtualizationModule.showItem(item);
        }
    };
    /**
     * Hides an list item from the ListView.
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.hideItem = function (item) {
        this.showHideItem(item, true, 'none');
        if (this.enableVirtualization) {
            this.virtualizationModule.hideItem(item);
        }
    };
    ListView.prototype.showHideItem = function (obj, isHide, display) {
        var resultJSON = this.getItemData(obj);
        var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(resultJSON, this.listBaseOption.fields);
        if (resultJSON) {
            var li = this.element.querySelector('[data-uid="' + fieldData[this.fields.id] + '"]');
            if (li) {
                li.style.display = display;
            }
            if (isHide) {
                resultJSON[this.fields.isVisible] = false;
            }
            else {
                delete resultJSON[this.fields.isVisible];
            }
        }
    };
    /**
     * Adds the new list item(s) to the current ListView.
     * To add a new list item(s) in the ListView, we need to pass the `data` as an array of items that need
     * to be added and `fields` as the target item to which we need to add the given item(s) as its children.
     * For example fields: { text: 'Name', tooltip: 'Name', id:'id'}
     * @param  {{[key:string]:Object}[]} data - JSON Array Data that need to add.
     * @param  {Fields} fields - Target item to add the given data as its children (can be null).
     * @blazorArgsType data|object,fields|object
     */
    ListView.prototype.addItem = function (data, fields) {
        if (fields === void 0) { fields = undefined; }
        var dataSource = this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]
            ? this.localData : this.dataSource;
        this.addItemInternally(data, fields, dataSource);
    };
    ListView.prototype.addItemInternally = function (data, fields, dataSource) {
        if (data instanceof Array) {
            if (this.enableVirtualization) {
                this.virtualizationModule.addItem(data, fields, dataSource);
            }
            else {
                var ds = this.findItemFromDS(dataSource, fields);
                var child = void 0;
                if (ds) {
                    var fieldData = Object(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["getFieldValues"])(ds, this.listBaseOption.fields);
                    child = fieldData[this.fields.child];
                    if (!child) {
                        child = [];
                    }
                    child = child.concat(data);
                }
                // check for whether target is nested level or top level in list
                if (ds instanceof Array) {
                    for (var i = 0; i < data.length; i++) {
                        dataSource.push(data[i]);
                        this.setViewDataSource(dataSource);
                        // since it is top level target, get the content container's first child
                        // as it is always the top level UL
                        var targetUL = this.contentContainer
                            ? this.contentContainer.children[0]
                            : null;
                        // check for whether the list was previously empty or not, if it is
                        // proceed to call initial render
                        if (this.contentContainer && targetUL) {
                            this.addItemIntoDom(data[i], targetUL, this.curViewDS);
                        }
                        else {
                            this.reRender();
                        }
                    }
                    if (this.curUL) {
                        this.updateBlazorTemplates(true);
                    }
                    this.liCollection = this.curUL.querySelectorAll('.' + classNames.listItem);
                }
                else {
                    // proceed as target item is in nested level, only if it is a valid target ds
                    if (ds) {
                        ds[this.fields.child] = child;
                        this.addItemInNestedList(ds, data);
                    }
                }
            }
        }
    };
    ListView.prototype.addItemInNestedList = function (targetItemData, itemQueue) {
        var targetItemId = targetItemData[this.fields.id];
        var targetChildDS = targetItemData[this.fields.child];
        var isAlreadyRenderedUL = this.element.querySelector('[pid=\'' + targetItemId + '\']');
        var targetLi = this.element.querySelector('[data-uid=\'' + targetItemId + '\']');
        var targetUL = isAlreadyRenderedUL
            ? isAlreadyRenderedUL
            : targetLi
                ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(targetLi, 'ul')
                : null;
        var targetDS = isAlreadyRenderedUL ? targetChildDS : [targetItemData];
        var isTargetEmptyChild = targetLi ? !targetLi.classList.contains(classNames.hasChild) : false;
        var isRefreshTemplateNeeded = false;
        // if li element is already rendered, that element needs to be refreshed so that
        // it becomes child viewable due to new child items are added now
        if (isTargetEmptyChild) {
            var targetRefreshedElement = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createListItemFromJson(this.createElement, targetDS, this.listBaseOption, null, null, this);
            this.setAttributes(targetRefreshedElement);
            targetUL.insertBefore(targetRefreshedElement[0], targetLi);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(targetLi);
            isRefreshTemplateNeeded = true;
        }
        // if it is already rendered element, we need to create and append new elements
        if (isAlreadyRenderedUL && itemQueue) {
            for (var i = 0; i < itemQueue.length; i++) {
                targetDS.push(itemQueue[i]);
                this.addItemIntoDom(itemQueue[i], targetUL, targetDS);
            }
            isRefreshTemplateNeeded = true;
        }
        if (isRefreshTemplateNeeded) {
            this.updateBlazorTemplates(true);
        }
    };
    ListView.prototype.addItemIntoDom = function (currentItem, targetUL, curViewDS) {
        var index = curViewDS.indexOf(currentItem);
        this.addListItem(currentItem, index, targetUL, curViewDS);
        var curItemDS = curViewDS[index - 1];
        if (curItemDS && curItemDS.isHeader && curItemDS.items.length === 1) {
            this.addListItem(curItemDS, (index - 1), targetUL, curViewDS);
        }
    };
    ListView.prototype.addListItem = function (dataSource, index, ulElement, curViewDS) {
        var target = this.getLiFromObjOrElement(curViewDS[index + 1]) ||
            this.getLiFromObjOrElement(curViewDS[index + 2]) || null;
        var li = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createListItemFromJson(this.createElement, [dataSource], this.listBaseOption, null, null, this);
        this.setAttributes(li);
        // tslint:disable-next-line
        if (this.template && this.isReact) {
            this.renderReactTemplates();
        }
        ulElement.insertBefore(li[0], target);
    };
    /**
     * Removes the list item from the data source based on a passed
     *  element like fields: { text: 'Name', tooltip: 'Name', id:'id'}
     * @param  {Fields | HTMLElement | Element} item - We can pass element Object or Fields as Object with ID and Text fields.
     */
    ListView.prototype.removeItem = function (item) {
        var listDataSource = this.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]
            ? this.localData : this.dataSource;
        if (this.enableVirtualization) {
            this.virtualizationModule.removeItem(item);
        }
        else {
            this.removeItemFromList(item, listDataSource);
            this.updateBlazorTemplates(true);
        }
    };
    ListView.prototype.removeItemFromList = function (obj, listDataSource) {
        var _this = this;
        var curViewDS = this.curViewDS;
        var fields = obj instanceof Element ? this.getElementUID(obj) : obj;
        var dataSource;
        dataSource = this.findItemFromDS(listDataSource, fields, true);
        if (dataSource) {
            var data_1;
            data_1 = this.findItemFromDS(dataSource, fields);
            var index = curViewDS.indexOf(data_1);
            var li = this.getLiFromObjOrElement(obj);
            var groupLi = void 0;
            this.validateNestedView(li);
            if (this.fields.groupBy && this.curViewDS[index - 1] &&
                curViewDS[index - 1].isHeader &&
                curViewDS[index - 1].items.length === 1) {
                if (li && li.previousElementSibling.classList.contains(classNames.groupListItem) &&
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li.nextElementSibling) || (li.nextElementSibling &&
                        li.nextElementSibling.classList.contains(classNames.groupListItem)))) {
                    groupLi = li.previousElementSibling;
                }
            }
            if (li) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(li);
            }
            if (groupLi) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(groupLi);
            }
            // tslint:disable-next-line:no-any
            var foundData = (dataSource.length - 1) <= 0
                ? this.findParent(this.localData, this.fields.id, function (value) { return value === data_1[_this.fields.id]; }, null) : null;
            var dsIndex = dataSource.indexOf(data_1);
            dataSource.splice(dsIndex, 1);
            this.setViewDataSource(listDataSource);
            if (foundData
                && foundData.parent
                && Array.isArray(foundData.parent[this.fields.child])
                && foundData.parent[this.fields.child].length <= 0) {
                var parentLi = this.getLiFromObjOrElement(foundData.parent);
                if (parentLi) {
                    var li_1 = _common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].createListItemFromJson(this.createElement, [foundData.parent], this.listBaseOption, null, null, this);
                    this.setAttributes(li_1);
                    parentLi.parentElement.insertBefore(li_1[0], parentLi);
                    parentLi.parentElement.removeChild(parentLi);
                }
            }
            if (dataSource.length <= 0) {
                this.back();
            }
            this.liCollection = Array.prototype.slice.call(this.element.querySelectorAll('.' + classNames.listItem));
        }
    };
    // validate before removing an element whether the current view is inside target element's child view
    ListView.prototype.validateNestedView = function (li) {
        var liID = li ? li.getAttribute('data-uid').toString().toLowerCase() : null;
        if (liID && this.curDSLevel && this.curDSLevel.length > 0) {
            while (this.curDSLevel.some(function (id) { return id.toString().toLowerCase() === liID; })) {
                this.back();
            }
        }
    };
    /**
     * Removes multiple items from the ListView by passing the array of elements or array of field objects.
     * @param  {Fields[] | HTMLElement[] | Element[]} item - We can pass array of elements or array of field Object with ID and Text fields.
     */
    ListView.prototype.removeMultipleItems = function (item) {
        if (item.length) {
            for (var i = 0; i < item.length; i++) {
                this.removeItem(item[i]);
            }
            this.updateBlazorTemplates(true);
        }
    };
    // tslint:disable-next-line:no-any
    ListView.prototype.findParent = function (dataSource, id, callback, parent) {
        if (dataSource.hasOwnProperty(id) && callback(dataSource[id]) === true) {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, dataSource);
        }
        for (var i = 0; i < Object.keys(dataSource).length; i++) {
            if (dataSource[Object.keys(dataSource)[i]]
                && typeof dataSource[Object.keys(dataSource)[i]] === 'object') {
                // tslint:disable-next-line:no-any
                var result = this.findParent(dataSource[Object.keys(dataSource)[i]], id, callback, dataSource);
                if (result != null) {
                    if (!result.parent) {
                        result.parent = parent;
                    }
                    return result;
                }
            }
        }
        return null;
    };
    // Module Required function
    ListView.prototype.getModuleName = function () {
        return 'listview';
    };
    ListView.prototype.requiredModules = function () {
        var modules = [];
        if (this.enableVirtualization) {
            modules.push({ args: [this], member: 'virtualization' });
        }
        return modules;
    };
    /**
     * Get the properties to be maintained in the persisted state.
     */
    ListView.prototype.getPersistData = function () {
        return this.addOnPersist(['cssClass', 'enableRtl', 'htmlAttributes',
            'enable', 'fields', 'animation', 'headerTitle',
            'sortOrder', 'showIcon', 'height', 'width', 'showCheckBox', 'checkBoxPosition']);
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ListView.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ListView.prototype, "enableVirtualization", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], ListView.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], ListView.prototype, "enable", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], ListView.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], ListView.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])(_common_list_base__WEBPACK_IMPORTED_MODULE_3__["ListBase"].defaultMappedFields, FieldSettings)
    ], ListView.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({ effect: 'SlideLeft', duration: 400, easing: 'ease' })
    ], ListView.prototype, "animation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], ListView.prototype, "sortOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ListView.prototype, "showIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ListView.prototype, "showCheckBox", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], ListView.prototype, "checkBoxPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ListView.prototype, "headerTitle", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ListView.prototype, "showHeader", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], ListView.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ListView.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ListView.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ListView.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ListView.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], ListView.prototype, "groupTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ListView.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ListView.prototype, "actionBegin", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ListView.prototype, "actionComplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ListView.prototype, "actionFailure", void 0);
    ListView = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], ListView);
    return ListView;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/virtualization.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/list-view/virtualization.js ***!
  \*****************************************************************************/
/*! exports provided: Virtualization */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Virtualization", function() { return Virtualization; });
/* harmony import */ var _list_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list-view */ "./ej2-resources/18.4.46/scripts/ej2-lists/list-view/list-view.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_list_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/list-base */ "./ej2-resources/18.4.46/scripts/ej2-lists/common/list-base.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");





var listElementCount = 1.5;
var windowElementCount = 3;
var Virtualization = /** @__PURE__ @class */ (function () {
    function Virtualization(instance) {
        this.elementDifference = 0;
        this.listViewInstance = instance;
    }
    /**
     * For internal use only.
     * @private
     */
    Virtualization.prototype.isNgTemplate = function () {
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.listViewInstance.templateRef) && typeof this.listViewInstance.templateRef !== 'string';
    };
    /**
     * For internal use only.
     * @private
     */
    Virtualization.prototype.uiVirtualization = function () {
        this.wireScrollEvent(false);
        var curViewDS = this.listViewInstance.curViewDS;
        var firstDs = curViewDS.slice(0, 1);
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() || this.listViewInstance.isServerRendered)) {
            this.listViewInstance.ulElement = this.listViewInstance.curUL = _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createList(this.listViewInstance.createElement, firstDs, this.listViewInstance.listBaseOption, null, this);
            this.listViewInstance.contentContainer = this.listViewInstance.createElement('div', { className: _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].content });
            this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer);
            this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement);
        }
        this.listItemHeight = this.listViewInstance.ulElement.firstElementChild.getBoundingClientRect().height;
        this.expectedDomItemCount = this.ValidateItemCount(10000);
        this.domItemCount = this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length);
        this.uiFirstIndex = 0;
        this.uiLastIndex = this.domItemCount - 1;
        var otherDs = curViewDS.slice(1, this.domItemCount);
        if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() || this.listViewInstance.isServerRendered)) {
            var listItems = _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromJson(this.listViewInstance.createElement, otherDs, this.listViewInstance.listBaseOption, null, null, this);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["append"])(listItems, this.listViewInstance.ulElement);
            this.listViewInstance.liCollection = this.listViewInstance.curUL.querySelectorAll('li');
            this.topElement = this.listViewInstance.createElement('div');
            this.listViewInstance.ulElement.insertBefore(this.topElement, this.listViewInstance.ulElement.firstElementChild);
            this.bottomElement = this.listViewInstance.createElement('div');
            this.listViewInstance.ulElement.insertBefore(this.bottomElement, null);
            this.totalHeight = (Object.keys(curViewDS).length * this.listItemHeight) - (this.domItemCount * this.listItemHeight);
            this.topElement.style.height = 0 + 'px';
            this.bottomElement.style.height = this.totalHeight + 'px';
            this.topElementHeight = 0;
            this.bottomElementHeight = this.totalHeight;
        }
        else {
            this.listViewInstance.contentContainer = this.listViewInstance.element.querySelector('.e-content');
            this.listViewInstance.liCollection = this.listViewInstance.curUL.querySelectorAll('li');
        }
        this.listDiff = 0;
        this.uiIndicesInitialization();
    };
    Virtualization.prototype.wireScrollEvent = function (destroy) {
        if (!destroy) {
            if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered)) {
                if (this.listViewInstance.isWindow) {
                    this.onVirtualScroll = this.onVirtualUiScroll.bind(this);
                    window.addEventListener('scroll', this.onVirtualScroll);
                }
                else {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].add(this.listViewInstance.element, 'scroll', this.onVirtualUiScroll, this);
                }
            }
            else {
                if (this.listViewInstance.isWindow) {
                    // tslint:disable-next-line:no-any
                    this.onVirtualScroll = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["debounce"])(this.onVirtualUiScroll.bind(this), 350);
                    // tslint:enable-next-line:no-any      
                    this.updateUl = this.updateUlContainer.bind(this);
                    window.addEventListener('scroll', this.onVirtualScroll);
                    window.addEventListener('scroll', this.updateUl);
                }
                else {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].add(this.listViewInstance.element, 'scroll', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["debounce"])(this.onVirtualUiScroll, 350), this);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].add(this.listViewInstance.element, 'scroll', this.updateUlContainer, this);
                }
            }
        }
        else {
            this.listViewInstance.isWindow ? window.removeEventListener('scroll', this.onVirtualScroll) :
                _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].remove(this.listViewInstance.element, 'scroll', this.onVirtualUiScroll);
            this.listViewInstance.isWindow ? window.removeEventListener('scroll', this.updateUl) :
                _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].remove(this.listViewInstance.element, 'scroll', this.updateUlContainer);
        }
    };
    Virtualization.prototype.updateUlContainer = function (e) {
        var listDiff;
        var virtualElementContainer = this.listViewInstance.ulElement.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].virtualElementContainer);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.listViewInstance.liElementHeight)) {
            this.listViewInstance.updateLiElementHeight();
        }
        if (this.listViewInstance.isWindow) {
            // tslint:disable-next-line:no-any
            listDiff = Math.round(e.target.documentElement.scrollTop / this.listViewInstance.liElementHeight) - 2;
            // tslint:enable-next-line:no-any  
        }
        else {
            // tslint:disable-next-line:no-any
            listDiff = Math.round(e.target.scrollTop / this.listViewInstance.liElementHeight) - 2;
            // tslint:enable-next-line:no-any  
        }
        if (((listDiff - 1) * this.listViewInstance.liElementHeight) < 0) {
            virtualElementContainer.style.top = '0px';
        }
        else {
            virtualElementContainer.style.top = (listDiff) * this.listViewInstance.liElementHeight + 'px';
        }
    };
    Virtualization.prototype.ValidateItemCount = function (dataSourceLength) {
        var height = parseFloat(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["formatUnit"])(this.listViewInstance.height));
        var itemCount;
        if (this.listViewInstance.isWindow) {
            itemCount = Math.round((window.innerHeight / this.listItemHeight) * windowElementCount);
        }
        else {
            if (typeof this.listViewInstance.height === 'string' && this.listViewInstance.height.indexOf('%') !== -1) {
                // tslint:disable-next-line:max-line-length
                itemCount = Math.round((this.listViewInstance.element.getBoundingClientRect().height / this.listItemHeight) * listElementCount);
            }
            else {
                itemCount = Math.round((height / this.listItemHeight) * listElementCount);
            }
        }
        if (itemCount > dataSourceLength) {
            itemCount = dataSourceLength;
        }
        return itemCount;
    };
    Virtualization.prototype.uiIndicesInitialization = function () {
        this.uiIndices = { 'activeIndices': [], 'disabledItemIndices': [], 'hiddenItemIndices': [] };
        var data = this.listViewInstance.curViewDS;
        for (var i = 0; i < data.length; i++) {
            if (this.listViewInstance.showCheckBox && data[i][this.listViewInstance.fields.isChecked]) {
                this.uiIndices.activeIndices.push(i);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(data[i][this.listViewInstance.fields.enabled]) && !data[i][this.listViewInstance.fields.enabled]) {
                this.uiIndices.disabledItemIndices.push(i);
            }
        }
        if (this.isNgTemplate()) {
            var items = this.listViewInstance.element.querySelectorAll('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItem);
            for (var index = 0; index < items.length; index++) {
                items[index].context = this.listViewInstance.viewContainerRef.get(index).context;
            }
        }
    };
    Virtualization.prototype.refreshItemHeight = function () {
        if (this.listViewInstance.curViewDS.length) {
            var curViewDS = this.listViewInstance.curViewDS;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
                this.listViewInstance.ulElement.children[0].style.height =
                    (this.listViewInstance.liElementHeight * (Object.keys(curViewDS).length)) + 'px';
            }
            else {
                this.listItemHeight = this.topElement.nextSibling.getBoundingClientRect().height;
                this.totalHeight = (Object.keys(curViewDS).length * this.listItemHeight) - (this.domItemCount * this.listItemHeight);
                this.bottomElementHeight = this.totalHeight;
                this.bottomElement.style.height = this.totalHeight + 'px';
            }
        }
    };
    Virtualization.prototype.getscrollerHeight = function (startingHeight) {
        return this.listViewInstance.isWindow ? (((pageYOffset - startingHeight) <= 0) ? 0 :
            (pageYOffset - startingHeight)) : ((this.listViewInstance.element.scrollTop - startingHeight) <= 0) ? 0 :
            (this.listViewInstance.element.scrollTop - startingHeight);
    };
    Virtualization.prototype.onVirtualUiScroll = function (e) {
        var _a;
        var startingHeight;
        if (this.listViewInstance.isWindow) {
            startingHeight = this.listViewInstance.ulElement.getBoundingClientRect().top -
                document.documentElement.getBoundingClientRect().top;
        }
        else {
            startingHeight = this.listViewInstance.headerEle ? this.listViewInstance.headerEle.getBoundingClientRect().height : 0;
        }
        this.scrollPosition = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.scrollPosition) ? 0 : this.scrollPosition;
        var scroll = this.getscrollerHeight(startingHeight);
        this.topElementHeight = this.listItemHeight * Math.floor(scroll / this.listItemHeight);
        this.bottomElementHeight = this.totalHeight - this.topElementHeight;
        _a = scroll <= this.totalHeight ?
            [this.topElementHeight, this.bottomElementHeight] : [this.totalHeight, 0], this.topElementHeight = _a[0], this.bottomElementHeight = _a[1];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            var listDiff = void 0;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.listViewInstance.liElementHeight)) {
                this.listViewInstance.updateLiElementHeight();
            }
            if (this.listViewInstance.isWindow) {
                listDiff = Math.round(document.documentElement.scrollTop / this.listViewInstance.liElementHeight);
            }
            else {
                // tslint:disable-next-line:no-any
                listDiff = Math.round(e.target.scrollTop / this.listViewInstance.liElementHeight);
                // tslint:enable-next-line:no-any
            }
            if ((listDiff - 2) - this.elementDifference >= 3 || (listDiff - 2) - this.elementDifference <= -1) {
                var args = { listDiff: listDiff - 2, selectedItems: this.listViewInstance.previousSelectedItems };
                this.listViewInstance.interopAdaptor.invokeMethodAsync('VirtalScrolling', args);
                if (this.listViewInstance.ulElement.querySelector('.e-focused')) {
                    this.listViewInstance.ulElement.querySelector('.e-focused').classList.remove('e-focused');
                }
                this.elementDifference = listDiff - 2;
            }
        }
        else {
            if (this.topElementHeight !== parseFloat(this.topElement.style.height)) {
                this.topElement.style.height = this.topElementHeight + 'px';
                this.bottomElement.style.height = this.bottomElementHeight + 'px';
                if (scroll > this.scrollPosition) {
                    var listDiff = Math.round(((this.topElementHeight / this.listItemHeight) - this.listDiff));
                    if (listDiff > (this.expectedDomItemCount + 5)) {
                        this.onLongScroll(listDiff, true);
                    }
                    else {
                        this.onNormalScroll(listDiff, true);
                    }
                }
                else {
                    var listDiff = Math.round((this.listDiff - (this.topElementHeight / this.listItemHeight)));
                    if (listDiff > (this.expectedDomItemCount + 5)) {
                        this.onLongScroll(listDiff, false);
                    }
                    else {
                        this.onNormalScroll(listDiff, false);
                    }
                }
            }
            this.listDiff = Math.round(this.topElementHeight / this.listItemHeight);
            if (typeof this.listViewInstance.onUIScrolled === 'function') {
                this.listViewInstance.onUIScrolled();
            }
        }
        this.scrollPosition = scroll;
    };
    Virtualization.prototype.onLongScroll = function (listDiff, isScrollingDown) {
        var index = isScrollingDown ? (this.uiFirstIndex + listDiff) : (this.uiFirstIndex - listDiff);
        var elements = this.listViewInstance.ulElement.querySelectorAll('li');
        for (var i = 0; i < elements.length; i++) {
            this.updateUI(elements[i], index);
            index++;
        }
        this.uiLastIndex = isScrollingDown ? (this.uiLastIndex + listDiff) : (this.uiLastIndex - listDiff);
        this.uiFirstIndex = isScrollingDown ? (this.uiFirstIndex + listDiff) : (this.uiFirstIndex - listDiff);
    };
    Virtualization.prototype.onNormalScroll = function (listDiff, isScrollingDown) {
        if (isScrollingDown) {
            for (var i = 0; i < listDiff; i++) {
                var index = ++this.uiLastIndex;
                this.updateUI(this.topElement.nextElementSibling, index, this.bottomElement);
                this.uiFirstIndex++;
            }
        }
        else {
            for (var i = 0; i < listDiff; i++) {
                var index = --this.uiFirstIndex;
                var target = this.topElement.nextSibling;
                this.updateUI(this.bottomElement.previousElementSibling, index, target);
                this.uiLastIndex--;
            }
        }
    };
    Virtualization.prototype.updateUiContent = function (element, index) {
        var curViewDs = this.listViewInstance.curViewDS;
        if (typeof this.listViewInstance.dataSource[0] === 'string' ||
            typeof this.listViewInstance.dataSource[0] === 'number') {
            element.dataset.uid = _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateId();
            element.getElementsByClassName(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItemText)[0].innerHTML =
                this.listViewInstance.curViewDS[index].toString();
        }
        else {
            element.dataset.uid = curViewDs[index][this.listViewInstance.fields.id] ?
                curViewDs[index][this.listViewInstance.fields.id].toString() : _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateId();
            element.getElementsByClassName(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItemText)[0].innerHTML =
                curViewDs[index][this.listViewInstance.fields.text].toString();
        }
        if (this.listViewInstance.showIcon) {
            if (element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listIcon)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listIcon));
            }
            if (this.listViewInstance.curViewDS[index][this.listViewInstance.fields.iconCss]) {
                var textContent = element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].textContent);
                var target = this.listViewInstance.createElement('div', {
                    className: _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listIcon + ' ' +
                        this.listViewInstance.curViewDS[index][this.listViewInstance.fields.iconCss]
                });
                textContent.insertBefore(target, element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItemText));
            }
        }
        if (this.listViewInstance.showCheckBox && this.listViewInstance.fields.groupBy) {
            if (!this.checkListWrapper) {
                this.checkListWrapper = this.listViewInstance.curUL.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper).cloneNode(true);
            }
            var textContent = element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].textContent);
            if (this.listViewInstance.curViewDS[index].isHeader) {
                if (element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper)) {
                    element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checklist);
                    textContent.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkbox);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper));
                }
            }
            else {
                if (!element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper)) {
                    element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checklist);
                    textContent.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkbox);
                    textContent.insertBefore(this.checkListWrapper.cloneNode(true), element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItemText));
                }
            }
        }
    };
    Virtualization.prototype.changeElementAttributes = function (element, index) {
        element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].disable);
        if (this.uiIndices.disabledItemIndices.length && this.uiIndices.disabledItemIndices.indexOf(index) !== -1) {
            element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].disable);
        }
        element.style.display = '';
        if (this.uiIndices.hiddenItemIndices.length && this.uiIndices.hiddenItemIndices.indexOf(index) !== -1) {
            element.style.display = 'none';
        }
        if (this.listViewInstance.showCheckBox) {
            var checklistElement = element.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper);
            element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected);
            element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused);
            if (checklistElement) {
                checklistElement.removeAttribute('aria-checked');
                checklistElement.firstElementChild.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checked);
            }
            if (this.uiIndices.activeIndices.length && this.uiIndices.activeIndices.indexOf(index) !== -1 &&
                !this.listViewInstance.curUL.querySelector(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected)) {
                element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected);
                checklistElement.firstElementChild.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checked);
                checklistElement.setAttribute('aria-checked', 'true');
                if (this.activeIndex === index) {
                    element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused);
                }
            }
        }
        else {
            element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected);
            element.removeAttribute('aria-selected');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.activeIndex) && this.activeIndex === index &&
                !this.listViewInstance.curUL.querySelector(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected)) {
                element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected);
                element.setAttribute('aria-selected', 'true');
            }
        }
        if (this.listViewInstance.fields.groupBy) {
            if (this.listViewInstance.curViewDS[index].isHeader) {
                if (element.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItem)) {
                    element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItem);
                    element.setAttribute('role', 'group');
                    element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].groupListItem);
                }
            }
            else {
                if (element.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].groupListItem)) {
                    element.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].groupListItem);
                    element.setAttribute('role', 'listitem');
                    element.classList.add(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].listItem);
                }
            }
        }
    };
    Virtualization.prototype.findDSAndIndexFromId = function (ds, fields) {
        var _this = this;
        var resultJSON = {};
        fields = this.listViewInstance.getElementUID(fields);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(fields)) {
            ds.some(function (data, index) {
                if ((fields[_this.listViewInstance.fields.id] &&
                    fields[_this.listViewInstance.fields.id].toString()
                        === (data[_this.listViewInstance.fields.id] && data[_this.listViewInstance.fields.id].toString())) || fields === data) {
                    resultJSON.index = index;
                    resultJSON.data = data;
                    return true;
                }
                else {
                    return false;
                }
            });
        }
        return resultJSON;
    };
    Virtualization.prototype.getSelectedItems = function () {
        var _this = this;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.activeIndex) || (this.listViewInstance.showCheckBox && this.uiIndices.activeIndices.length)) {
            var dataCollection = [];
            var textCollection = [];
            if (typeof this.listViewInstance.dataSource[0] === 'string' ||
                typeof this.listViewInstance.dataSource[0] === 'number') {
                var curViewDS_1 = this.listViewInstance.curViewDS;
                if (this.listViewInstance.showCheckBox) {
                    var indices = this.uiIndices.activeIndices;
                    for (var i = 0; i < indices.length; i++) {
                        dataCollection.push(curViewDS_1[indices[i]]);
                    }
                    return {
                        text: dataCollection,
                        data: dataCollection,
                        index: this.uiIndices.activeIndices.map(function (index) {
                            return _this.listViewInstance.dataSource.indexOf(curViewDS_1[index]);
                        })
                    };
                }
                else {
                    return {
                        text: curViewDS_1[this.activeIndex],
                        data: curViewDS_1[this.activeIndex],
                        index: this.listViewInstance.dataSource.indexOf(curViewDS_1[this.activeIndex])
                    };
                }
            }
            else {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
                    var scrollDiff = Math.round(this.listViewInstance.element.scrollTop /
                        this.listViewInstance.liElementHeight) - 2;
                    if (scrollDiff < 0) {
                        scrollDiff = 0;
                    }
                    this.activeIndex += scrollDiff;
                }
                var curViewDS_2 = this.listViewInstance.curViewDS;
                var text = this.listViewInstance.fields.text;
                if (this.listViewInstance.showCheckBox) {
                    var indexArray = this.uiIndices.activeIndices;
                    for (var i = 0; i < indexArray.length; i++) {
                        textCollection.push(curViewDS_2[indexArray[i]][text]);
                        dataCollection.push(curViewDS_2[indexArray[i]]);
                    }
                    var dataSource_1 = this.listViewInstance.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"]
                        ? curViewDS_2 : this.listViewInstance.dataSource;
                    return {
                        text: textCollection,
                        data: dataCollection,
                        index: this.uiIndices.activeIndices.map(function (index) {
                            return dataSource_1.indexOf(curViewDS_2[index]);
                        })
                    };
                }
                else {
                    var dataSource = this.listViewInstance.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"]
                        ? curViewDS_2 : this.listViewInstance.dataSource;
                    return {
                        text: curViewDS_2[this.activeIndex][this.listViewInstance.fields.text],
                        data: curViewDS_2[this.activeIndex],
                        index: dataSource.indexOf(curViewDS_2[this.activeIndex])
                    };
                }
            }
        }
        else {
            return undefined;
        }
    };
    Virtualization.prototype.selectItem = function (obj) {
        var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
        if (Object.keys(resutJSON).length) {
            var isSelected = this.activeIndex === resutJSON.index;
            var isChecked = void 0;
            this.activeIndex = resutJSON.index;
            if (this.listViewInstance.showCheckBox) {
                if (this.uiIndices.activeIndices.indexOf(resutJSON.index) === -1) {
                    isChecked = true;
                    this.uiIndices.activeIndices.push(resutJSON.index);
                }
                else {
                    isChecked = false;
                    this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(resutJSON.index), 1);
                }
                if (this.listViewInstance.curUL.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused)) {
                    this.listViewInstance.curUL.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused).classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused);
                }
            }
            if (this.listViewInstance.getLiFromObjOrElement(obj)) {
                if (this.listViewInstance.showCheckBox) {
                    this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(obj));
                }
                else {
                    this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(obj));
                }
            }
            else {
                var eventArgs = void 0;
                if (typeof this.listViewInstance.dataSource[0] === 'string' ||
                    typeof this.listViewInstance.dataSource[0] === 'number') {
                    eventArgs = {
                        text: this.listViewInstance.curViewDS[this.activeIndex],
                        data: this.listViewInstance.curViewDS[this.activeIndex],
                        index: this.activeIndex
                    };
                }
                else {
                    var curViewDS = this.listViewInstance.curViewDS;
                    eventArgs = {
                        text: curViewDS[this.activeIndex][this.listViewInstance.fields.text],
                        data: curViewDS[this.activeIndex],
                        index: this.activeIndex
                    };
                }
                if (this.listViewInstance.showCheckBox) {
                    eventArgs.isChecked = isChecked;
                    this.listViewInstance.trigger('select', eventArgs);
                }
                else if (!isSelected) {
                    this.listViewInstance.removeSelect();
                    this.listViewInstance.trigger('select', eventArgs);
                }
            }
        }
        else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(obj) && !this.listViewInstance.showCheckBox) {
            this.listViewInstance.removeSelect();
            this.activeIndex = undefined;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            // tslint:disable-next-line:no-any
            var elementId = resutJSON.data[this.listViewInstance.fields.id];
            // tslint:enable-next-line:no-any
            if (this.listViewInstance.showCheckBox) {
                if (!this.listViewInstance.previousSelectedItems.includes(elementId)) {
                    this.listViewInstance.previousSelectedItems.push(elementId);
                }
                else {
                    var indexPosition = this.listViewInstance.previousSelectedItems.indexOf(elementId);
                    if (indexPosition > -1) {
                        this.listViewInstance.previousSelectedItems.splice(indexPosition, 1);
                    }
                }
            }
            else {
                this.listViewInstance.previousSelectedItems[0] = elementId;
            }
            this.listViewInstance.removeActiveClass();
        }
    };
    Virtualization.prototype.enableItem = function (obj) {
        var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            var itemId = resutJSON.data[this.listViewInstance.fields.id];
            if (!this.listViewInstance.enabledItems.includes(itemId)) {
                this.listViewInstance.enabledItems.push(itemId);
                this.listViewInstance.removeActiveClass();
            }
            if (this.listViewInstance.disabledItems.includes(itemId)) {
                var indexPosition = this.listViewInstance.disabledItems.indexOf(itemId);
                if (indexPosition > -1) {
                    this.listViewInstance.disabledItems.splice(indexPosition, 1);
                }
            }
        }
        else {
            if (Object.keys(resutJSON).length) {
                this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(resutJSON.index), 1);
            }
        }
    };
    Virtualization.prototype.disableItem = function (obj) {
        var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            var liElementId = resutJSON.data[this.listViewInstance.fields.id];
            if (!this.listViewInstance.disabledItems.includes(liElementId)) {
                this.listViewInstance.disabledItems.push(liElementId);
                this.listViewInstance.removeActiveClass();
            }
            if (this.listViewInstance.enabledItems.includes(liElementId)) {
                var indexPosition = this.listViewInstance.enabledItems.indexOf(liElementId);
                if (indexPosition > -1) {
                    this.listViewInstance.enabledItems.splice(indexPosition, 1);
                }
            }
        }
        else {
            if (Object.keys(resutJSON).length && this.uiIndices.disabledItemIndices.indexOf(resutJSON.index) === -1) {
                this.uiIndices.disabledItemIndices.push(resutJSON.index);
            }
        }
    };
    Virtualization.prototype.showItem = function (obj) {
        var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            // tslint:disable-next-line:no-any
            var hiddenElementId = resutJSON.data[this.listViewInstance.fields.id];
            // tslint:enable-next-line:no-any
            if (this.listViewInstance.hiddenItems.includes(hiddenElementId)) {
                var indexPosition = this.listViewInstance.hiddenItems.indexOf(hiddenElementId);
                if (indexPosition > -1) {
                    this.listViewInstance.previousSelectedItems.splice(indexPosition, 1);
                    this.listViewInstance.removeActiveClass();
                }
            }
        }
        else {
            if (Object.keys(resutJSON).length) {
                this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(resutJSON.index), 1);
            }
        }
    };
    Virtualization.prototype.hideItem = function (obj) {
        var resutJSON = this.findDSAndIndexFromId(this.listViewInstance.curViewDS, obj);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            // tslint:disable-next-line:no-any
            var elementId = resutJSON.data[this.listViewInstance.fields.id];
            // tslint:enable-next-line:no-any
            if (!this.listViewInstance.hiddenItems.includes(elementId)) {
                this.listViewInstance.hiddenItems.push(elementId);
                this.listViewInstance.removeActiveClass();
            }
        }
        else {
            if (Object.keys(resutJSON).length && this.uiIndices.hiddenItemIndices.indexOf(resutJSON.index) === -1) {
                this.uiIndices.hiddenItemIndices.push(resutJSON.index);
            }
        }
    };
    Virtualization.prototype.removeItem = function (obj) {
        var dataSource;
        var curViewDS = this.listViewInstance.curViewDS;
        var resutJSON = this.findDSAndIndexFromId(curViewDS, obj);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            if (resutJSON.index !== undefined) {
                // tslint:disable
                this.listViewInstance.interopAdaptor.invokeMethodAsync('RemoveItemPosition', resutJSON.index);
                // tslint:enable
            }
        }
        if (Object.keys(resutJSON).length) {
            dataSource = resutJSON.data;
            if (curViewDS[resutJSON.index - 1] &&
                curViewDS[resutJSON.index - 1].isHeader &&
                (curViewDS[resutJSON.index - 1])
                    .items.length === 1) {
                this.removeUiItem(resutJSON.index - 1);
                this.removeUiItem(resutJSON.index - 1);
            }
            else {
                if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered)) {
                    this.removeUiItem(resutJSON.index);
                }
            }
        }
        var listDataSource = this.listViewInstance.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_3__["DataManager"]
            ? this.listViewInstance.localData : this.listViewInstance.dataSource;
        var index = listDataSource.indexOf(dataSource);
        if (index !== -1) {
            listDataSource.splice(index, 1);
            this.listViewInstance.setViewDataSource(listDataSource);
        }
        // recollect all the list item into collection
        this.listViewInstance.liCollection =
            this.listViewInstance.curUL.querySelectorAll('li');
    };
    Virtualization.prototype.setCheckboxLI = function (li, e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])() && this.listViewInstance.isServerRendered) {
            this.uiFirstIndex = Math.round(this.listViewInstance.element.scrollTop / 36) - 4;
            if (this.uiFirstIndex < 0) {
                this.uiFirstIndex = 0;
            }
        }
        var index = Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll('li'), li) + this.uiFirstIndex;
        this.activeIndex = Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll('li'), li) + this.uiFirstIndex;
        if (li.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected)) {
            if (this.uiIndices.activeIndices.indexOf(index) === -1) {
                this.uiIndices.activeIndices.push(index);
            }
        }
        else {
            this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(index), 1);
        }
    };
    Virtualization.prototype.setSelectLI = function (li, e) {
        this.activeIndex = Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll('li'), li) + this.uiFirstIndex;
    };
    Virtualization.prototype.checkedItem = function (checked) {
        if (checked) {
            this.uiIndices.activeIndices = [];
            this.activeIndex = undefined;
            var data = this.listViewInstance.curViewDS;
            for (var index = 0; index < data.length; index++) {
                if (!data[index].isHeader) {
                    this.uiIndices.activeIndices.push(index);
                }
            }
        }
        else {
            this.activeIndex = undefined;
            this.uiIndices.activeIndices = [];
        }
    };
    Virtualization.prototype.addUiItem = function (index) {
        // virtually new add list item based on the scollbar position
        // if the scroll bar is at the top, just pretend the new item has been added since no UI
        // change is required for the item that has been added at last but when scroll bar is at the bottom
        // just detach top and inject into bottom to mimic new item is added
        var curViewDs = this.listViewInstance.curViewDS;
        this.changeUiIndices(index, true);
        if (this.activeIndex && this.activeIndex >= index) {
            this.activeIndex++;
        }
        if (this.listViewInstance.showCheckBox &&
            curViewDs[index][this.listViewInstance.fields.isChecked]) {
            this.uiIndices.activeIndices.push(index);
        }
        if (!parseFloat(this.bottomElement.style.height) && !parseFloat(this.topElement.style.height)) {
            this.bottomElement.style.height = parseFloat(this.bottomElement.style.height) + this.listItemHeight + 'px';
        }
        if (parseFloat(this.bottomElement.style.height)) {
            var liItem = this.listViewInstance.curUL.lastElementChild.previousSibling;
            var target = this.listViewInstance.getLiFromObjOrElement(curViewDs[index + 1]) ||
                this.listViewInstance.getLiFromObjOrElement(curViewDs[index + 2]);
            if (target) {
                this.bottomElement.style.height = parseFloat(this.bottomElement.style.height) + this.listItemHeight + 'px';
                this.updateUI(liItem, index, target);
            }
        }
        else {
            var liItem = this.listViewInstance.curUL.firstElementChild.nextSibling;
            var target = void 0;
            if ((Object.keys(this.listViewInstance.curViewDS).length - 1) === index) {
                target = this.listViewInstance.curUL.lastElementChild;
            }
            else {
                target = this.listViewInstance.getLiFromObjOrElement(curViewDs[index + 1]) ||
                    this.listViewInstance.getLiFromObjOrElement(curViewDs[index + 2]);
            }
            this.topElement.style.height = parseFloat(this.topElement.style.height) + this.listItemHeight + 'px';
            this.uiFirstIndex++;
            this.uiLastIndex++;
            if (target) {
                this.updateUI(liItem, index, target);
                this.listViewInstance.isWindow ? window.scrollTo(0, (pageYOffset + this.listItemHeight)) :
                    this.listViewInstance.element.scrollTop += this.listItemHeight;
            }
        }
        this.totalHeight += this.listItemHeight;
        this.listDiff = Math.round(parseFloat(this.topElement.style.height) / this.listItemHeight);
    };
    Virtualization.prototype.removeUiItem = function (index) {
        this.totalHeight -= this.listItemHeight;
        var curViewDS = this.listViewInstance.curViewDS[index];
        var liItem = this.listViewInstance.getLiFromObjOrElement(curViewDS);
        this.listViewInstance.curViewDS.splice(index, 1);
        if (this.activeIndex && this.activeIndex >= index) {
            this.activeIndex--;
        }
        if (liItem) {
            if (this.domItemCount > Object.keys(this.listViewInstance.curViewDS).length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(liItem);
                this.domItemCount--;
                this.uiLastIndex--;
                this.totalHeight = 0;
            }
            else {
                if (liItem.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].disable)) {
                    liItem.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].disable);
                    this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(index), 1);
                }
                if (liItem.style.display === 'none') {
                    liItem.style.display = '';
                    this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(index), 1);
                }
                if (this.listViewInstance.showCheckBox && liItem.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected)) {
                    this.listViewInstance.removeSelect();
                    this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(index), 1);
                    var checklistElement = liItem.querySelector('.' + _list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checkboxWrapper);
                    checklistElement.removeAttribute('aria-checked');
                    checklistElement.firstElementChild.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].checked);
                    if (liItem.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused)) {
                        liItem.classList.remove(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].focused);
                        this.activeIndex = undefined;
                    }
                }
                else if (liItem.classList.contains(_list_view__WEBPACK_IMPORTED_MODULE_0__["classNames"].selected)) {
                    this.listViewInstance.removeSelect();
                    this.activeIndex = undefined;
                }
                if (!parseFloat(this.bottomElement.style.height) && !parseFloat(this.topElement.style.height)) {
                    this.updateUI(liItem, this.uiLastIndex, this.bottomElement);
                }
                else if (parseFloat(this.bottomElement.style.height)) {
                    this.bottomElement.style.height = parseFloat(this.bottomElement.style.height) - this.listItemHeight + 'px';
                    this.updateUI(liItem, this.uiLastIndex, this.bottomElement);
                }
                else {
                    this.topElement.style.height = parseFloat(this.topElement.style.height) - this.listItemHeight + 'px';
                    this.updateUI(liItem, (this.uiFirstIndex - 1), this.topElement.nextSibling);
                    this.uiLastIndex--;
                    this.uiFirstIndex--;
                }
            }
        }
        this.changeUiIndices(index, false);
        this.listDiff = Math.round(parseFloat(this.topElement.style.height) / this.listItemHeight);
    };
    Virtualization.prototype.changeUiIndices = function (index, increment) {
        var keys = Object.keys(this.uiIndices);
        for (var ind = 0; ind < keys.length; ind++) {
            this.uiIndices[keys[ind]] = this.uiIndices[keys[ind]].map(function (i) {
                if (i >= index) {
                    return increment ? ++i : --i;
                }
                else {
                    return i;
                }
            });
        }
    };
    Virtualization.prototype.addItem = function (data, fields, dataSource) {
        for (var i = 0; i < data.length; i++) {
            var currentItem = data[i];
            // push the given data to main data array
            dataSource.push(currentItem);
            // recalculate all the group data or other datasource related things
            this.listViewInstance.setViewDataSource(dataSource);
            // render list items for first time due to no datasource present earlier
            if (!this.domItemCount) {
                // fresh rendering for first time
                if ((this.listViewInstance.template || this.listViewInstance.groupTemplate) && !this.isNgTemplate()) {
                    this.listViewInstance.listBaseOption.template = null;
                    this.listViewInstance.listBaseOption.groupTemplate = null;
                    this.listViewInstance.listBaseOption.itemCreated = this.createUIItem.bind(this);
                }
                this.uiVirtualization();
                // when expected expected DOM count doesn't meet the condition we need to create and inject new item into DOM
            }
            else if (this.domItemCount < this.expectedDomItemCount) {
                var ds = this.listViewInstance.findItemFromDS(dataSource, fields);
                if (ds instanceof Array) {
                    if (this.listViewInstance.ulElement) {
                        var index = this.listViewInstance.curViewDS.indexOf(currentItem);
                        // inject new list item into DOM
                        this.createAndInjectNewItem(currentItem, index);
                        // check for group header item
                        var curViewDS = this.listViewInstance.curViewDS[index - 1];
                        if (curViewDS && curViewDS.isHeader && curViewDS.items.length === 1) {
                            // target group item index in datasource
                            --index;
                            // inject new group header into DOM for previously created list item
                            this.createAndInjectNewItem(curViewDS, index);
                        }
                    }
                    // recollect all the list item into collection
                    this.listViewInstance.liCollection =
                        this.listViewInstance.curUL.querySelectorAll('li');
                }
            }
            else {
                var index = this.listViewInstance.curViewDS.indexOf(currentItem);
                // virtually new add list item based on the scollbar position
                this.addUiItem(index);
                // check for group header item needs to be added
                var curViewDS = this.listViewInstance.curViewDS[index - 1];
                if (curViewDS && curViewDS.isHeader && curViewDS.items.length === 1) {
                    this.addUiItem(index - 1);
                }
            }
        }
    };
    Virtualization.prototype.createAndInjectNewItem = function (itemData, index) {
        // generate li item for given datasource
        var target;
        var li = _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromJson(this.listViewInstance.createElement, [itemData], this.listViewInstance.listBaseOption, null, null, this);
        // check for target element whether to insert before last item or group item
        if ((Object.keys(this.listViewInstance.curViewDS).length - 1) === index) {
            target = this.listViewInstance.curUL.lastElementChild;
        }
        else {
            // target group header's first child item to append its header
            target = this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[index + 1]) ||
                this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[index + 2]);
        }
        // insert before the target element
        this.listViewInstance.ulElement.insertBefore(li[0], target);
        // increment internal DOM count, last index count for new element
        this.domItemCount++;
        if (this.bottomElementHeight <= 0) {
            this.uiLastIndex++;
        }
        // recalculate the current item height, to avoid jumpy scroller
        this.refreshItemHeight();
    };
    Virtualization.prototype.createUIItem = function (args) {
        var virtualTemplate = this.listViewInstance.template;
        var template = this.listViewInstance.createElement('div');
        var commonTemplate = '<div class="e-text-content" role="presentation"> ' +
            '<span class="e-list-text"> ${' + this.listViewInstance.fields.text + '} </span></div>';
        if (this.listViewInstance.showCheckBox) {
            // tslint:disable-next-line:no-any
            this.listViewInstance.renderCheckbox(args);
            // tslint:enable-next-line:no-any
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.listViewInstance.virtualCheckBox)) &&
                (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(this.listViewInstance.virtualCheckBox.outerHTML))) {
                var div = document.createElement('div');
                div.innerHTML = this.listViewInstance.template || commonTemplate;
                div.children[0].classList.add('e-checkbox');
                this.listViewInstance.checkBoxPosition === 'Left' ? div.children[0].classList.add('e-checkbox-left') :
                    div.children[0].classList.add('e-checkbox-right');
                if (this.listViewInstance.checkBoxPosition === 'Left') {
                    div.children[0].insertBefore(this.listViewInstance.virtualCheckBox, div.childNodes[0].children[0]);
                }
                else {
                    div.children[0].appendChild(this.listViewInstance.virtualCheckBox);
                }
                this.listViewInstance.template = div.innerHTML;
            }
            template.innerHTML = this.listViewInstance.template;
            this.listViewInstance.template = virtualTemplate;
        }
        else {
            template.innerHTML = this.listViewInstance.template || commonTemplate;
        }
        // tslint:disable-next-line:no-any
        var templateElements = template.getElementsByTagName('*');
        var groupTemplate = this.listViewInstance.createElement('div');
        if (this.listViewInstance.fields.groupBy) {
            groupTemplate.innerHTML = this.listViewInstance.groupTemplate || commonTemplate;
        }
        // tslint:disable-next-line:no-any
        var groupTemplateElements = groupTemplate.getElementsByTagName('*');
        if (args.curData.isHeader) {
            this.headerData = args.curData;
        }
        this.templateData = args.curData.isHeader ? args.curData.items[0] :
            args.curData;
        args.item.innerHTML = '';
        args.item.context = { data: args.curData, nodes: { flatTemplateNodes: [], groupTemplateNodes: [] } };
        for (var i = 0; i < templateElements.length; i++) {
            this.compileTemplate(templateElements[i], args.item, false);
        }
        for (var i = 0; i < groupTemplateElements.length; i++) {
            this.compileTemplate(groupTemplateElements[i], args.item, true);
        }
        args.item.context.template = args.curData.isHeader ? template.firstElementChild :
            groupTemplate.firstElementChild;
        args.item.context.type = args.curData.isHeader ? 'flatList' : 'groupList';
        var element = args.curData.isHeader ? groupTemplate : template;
        args.item.insertBefore(element.firstElementChild, null);
    };
    Virtualization.prototype.compileTemplate = function (element, item, isHeader) {
        this.textProperty(element, item, isHeader);
        this.classProperty(element, item, isHeader);
        this.attributeProperty(element, item, isHeader);
    };
    Virtualization.prototype.onChange = function (newData, listElement) {
        listElement.context.data = newData;
        var groupTemplateNodes = listElement.context.nodes.groupTemplateNodes;
        var flatTemplateNodes = listElement.context.nodes.flatTemplateNodes;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(newData.isHeader) && newData.isHeader && listElement.context.type === 'groupList') {
            var element = listElement.firstElementChild;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(listElement.firstElementChild);
            listElement.insertBefore(listElement.context.template, null);
            listElement.context.template = element;
            listElement.context.type = 'flatList';
            for (var i = 0; i < groupTemplateNodes.length; i++) {
                groupTemplateNodes[i].onChange(newData);
            }
        }
        else if (!newData.isHeader && listElement.context.type === 'flatList') {
            var element = listElement.firstElementChild;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(listElement.firstElementChild);
            listElement.insertBefore(listElement.context.template, null);
            listElement.context.template = element;
            listElement.context.type = 'groupList';
            for (var i = 0; i < flatTemplateNodes.length; i++) {
                flatTemplateNodes[i].onChange(newData);
            }
        }
        else if (!newData.isHeader) {
            for (var i = 0; i < flatTemplateNodes.length; i++) {
                flatTemplateNodes[i].onChange(newData);
            }
        }
        else {
            for (var i = 0; i < groupTemplateNodes.length; i++) {
                groupTemplateNodes[i].onChange(newData);
            }
        }
    };
    Virtualization.prototype.updateContextData = function (listElement, node, isHeader) {
        if (isHeader) {
            listElement.context.nodes.groupTemplateNodes.push(node);
        }
        else {
            listElement.context.nodes.flatTemplateNodes.push(node);
        }
    };
    Virtualization.prototype.classProperty = function (element, listElement, isHeader) {
        var regex = new RegExp('\\${([^}]*)}', 'g');
        var resultantOutput = [];
        var regexMatch;
        while (regexMatch !== null) {
            var match = regex.exec(element.className);
            resultantOutput.push(match);
            regexMatch = match;
            if (regexMatch === null) {
                resultantOutput.pop();
            }
        }
        if (resultantOutput && resultantOutput.length) {
            var _loop_1 = function (i) {
                var classNameMatch = resultantOutput[i];
                var classFunction;
                if (classNameMatch[1].indexOf('?') !== -1 && classNameMatch[1].indexOf(':') !== -1) {
                    // tslint:disable-next-line:no-function-constructor-with-string-args
                    classFunction = new Function('data', 'return ' + classNameMatch[1].replace(/\$/g, 'data.'));
                }
                else {
                    // tslint:disable-next-line:no-function-constructor-with-string-args
                    classFunction = new Function('data', 'return ' + 'data.' + classNameMatch[1]);
                }
                var subNode = {};
                if (isHeader) {
                    subNode.bindedvalue = classFunction(this_1.headerData);
                }
                else {
                    subNode.bindedvalue = classFunction(this_1.templateData);
                }
                subNode.onChange = function (value) {
                    if (subNode.bindedvalue) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["removeClass"])([element], subNode.bindedvalue.split(' ').filter(function (css) { return css; }));
                    }
                    var newCss = classFunction(value);
                    if (newCss) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["addClass"])([element], (newCss).split(' ').filter(function (css) { return css; }));
                    }
                    subNode.bindedvalue = newCss;
                };
                var className = classNameMatch[0].split(' ');
                for (var i_1 = 0; i_1 < className.length; i_1++) {
                    element.classList.remove(className[i_1]);
                }
                if (subNode.bindedvalue) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["addClass"])([element], subNode.bindedvalue.split(' ').filter(function (css) { return css; }));
                }
                this_1.updateContextData(listElement, subNode, isHeader);
            };
            var this_1 = this;
            for (var i = 0; i < resultantOutput.length; i++) {
                _loop_1(i);
            }
        }
    };
    Virtualization.prototype.attributeProperty = function (element, listElement, isHeader) {
        var attributeNames = [];
        for (var i = 0; i < element.attributes.length; i++) {
            attributeNames.push(element.attributes[i].nodeName);
        }
        if (attributeNames.indexOf('class') !== -1) {
            attributeNames.splice(attributeNames.indexOf('class'), 1);
        }
        var _loop_2 = function (i) {
            var attributeName = attributeNames[i];
            var attrNameMatch = new RegExp('\\${([^}]*)}', 'g').exec(attributeName) || [];
            var attrValueMatch = new RegExp('\\${([^}]*)}', 'g').exec(element.getAttribute(attributeName))
                || [];
            var attributeNameFunction;
            var attributeValueFunction;
            if (attrNameMatch.length || attrValueMatch.length) {
                if (attrNameMatch[1]) {
                    // tslint:disable-next-line:no-function-constructor-with-string-args
                    attributeNameFunction = new Function('data', 'return ' + 'data.' + attrNameMatch[1]);
                }
                if (attrValueMatch[1]) {
                    if (attrValueMatch[1].indexOf('?') !== -1 && attrValueMatch[1].indexOf(':') !== -1) {
                        // tslint:disable-next-line:no-function-constructor-with-string-args
                        attributeValueFunction = new Function('data', 'return ' + attrValueMatch[1].replace(/\$/g, 'data.'));
                    }
                    else {
                        // tslint:disable-next-line:no-function-constructor-with-string-args
                        attributeValueFunction = new Function('data', 'return ' + 'data.' + attrValueMatch[1]);
                    }
                }
                var subNode_1 = {};
                if (isHeader) {
                    subNode_1.bindedvalue = [attrNameMatch[1] === undefined ? undefined : attributeNameFunction(this_2.headerData),
                        attrValueMatch[1] === undefined ? undefined : attributeValueFunction(this_2.headerData)];
                }
                else {
                    subNode_1.bindedvalue = [attrNameMatch[1] === undefined ? undefined : attributeNameFunction(this_2.templateData),
                        attrValueMatch[1] === undefined ? undefined : attributeValueFunction(this_2.templateData)];
                }
                subNode_1.attrName = subNode_1.bindedvalue[0] === undefined ?
                    attributeName : subNode_1.bindedvalue[0];
                subNode_1.onChange = function (value) {
                    var bindedvalue = subNode_1.bindedvalue[1] === undefined ?
                        element.getAttribute(subNode_1.attrName) : attributeValueFunction(value);
                    element.removeAttribute(subNode_1.attrName);
                    subNode_1.attrName = subNode_1.bindedvalue[0] === undefined ? subNode_1.attrName : attributeNameFunction(value);
                    element.setAttribute(subNode_1.attrName, bindedvalue);
                    subNode_1.bindedvalue = [subNode_1.bindedvalue[0] === undefined ? undefined : attributeNameFunction(value),
                        subNode_1.bindedvalue[1] === undefined ? undefined : attributeValueFunction(value)];
                };
                var attributeValue = subNode_1.bindedvalue[1] === undefined ? element.getAttribute(attributeName) :
                    subNode_1.bindedvalue[1];
                element.removeAttribute(attributeName);
                element.setAttribute(subNode_1.attrName, attributeValue);
                this_2.updateContextData(listElement, subNode_1, isHeader);
            }
        };
        var this_2 = this;
        for (var i = 0; i < attributeNames.length; i++) {
            _loop_2(i);
        }
    };
    Virtualization.prototype.textProperty = function (element, listElement, isHeader) {
        var regex = new RegExp('\\${([^}]*)}', 'g');
        var resultantOutput = [];
        var regexMatch;
        while (regexMatch !== null) {
            var match = regex.exec(element.innerText);
            resultantOutput.push(match);
            regexMatch = match;
            if (regexMatch === null) {
                resultantOutput.pop();
            }
        }
        var isChildHasTextContent = Array.prototype.some.call(element.children, function (element) {
            if (new RegExp('\\${([^}]*)}', 'g').exec(element.innerText)) {
                return true;
            }
            else {
                return false;
            }
        });
        if (resultantOutput && resultantOutput.length && !isChildHasTextContent) {
            var _loop_3 = function (i) {
                var textPropertyMatch = resultantOutput[i];
                var subNode = {};
                var textFunction;
                if (textPropertyMatch[1].indexOf('?') !== -1 && textPropertyMatch[1].indexOf(':') !== -1) {
                    // tslint:disable-next-line:no-function-constructor-with-string-args
                    textFunction = new Function('data', 'return ' + textPropertyMatch[1].replace(/\$/g, 'data.'));
                }
                else {
                    // tslint:disable-next-line:no-function-constructor-with-string-args
                    textFunction = new Function('data', 'return ' + 'data.' + textPropertyMatch[1]);
                }
                if (isHeader) {
                    subNode.bindedvalue = textFunction(this_3.headerData);
                }
                else {
                    subNode.bindedvalue = textFunction(this_3.templateData);
                }
                subNode.onChange = function (value) {
                    element.innerText = element.innerText.replace(subNode.bindedvalue, textFunction(value));
                    subNode.bindedvalue = textFunction(value);
                };
                element.innerText = element.innerText.replace(textPropertyMatch[0], subNode.bindedvalue);
                this_3.updateContextData(listElement, subNode, isHeader);
            };
            var this_3 = this;
            for (var i = 0; i < resultantOutput.length; i++) {
                _loop_3(i);
            }
        }
    };
    Virtualization.prototype.reRenderUiVirtualization = function () {
        this.wireScrollEvent(true);
        if (this.listViewInstance.contentContainer) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["detach"])(this.listViewInstance.contentContainer);
        }
        this.listViewInstance.preRender();
        // resetting the dom count to 0, to avoid edge case of dataSource suddenly becoming zero
        // and then manually adding item using addItem API
        this.domItemCount = 0;
        this.listViewInstance.header();
        this.listViewInstance.setLocalData();
    };
    Virtualization.prototype.updateUI = function (element, index, targetElement) {
        var onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
        if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
            var curViewDS = this.listViewInstance.curViewDS[index];
            element.dataset.uid = curViewDS[this.listViewInstance.fields.id] ?
                curViewDS[this.listViewInstance.fields.id].toString() : _common_list_base__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateId();
            onChange(curViewDS, element, this);
        }
        else {
            this.updateUiContent(element, index);
        }
        this.changeElementAttributes(element, index);
        if (targetElement) {
            this.listViewInstance.ulElement.insertBefore(element, targetElement);
        }
    };
    Virtualization.prototype.onNgChange = function (newData, listElement, virtualThis) {
        // compile given target element with template for new data
        var templateCompiler = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["compile"])(virtualThis.listViewInstance.template);
        var resultElement = templateCompiler(newData);
        while (listElement.lastChild) {
            listElement.removeChild(listElement.lastChild);
        }
        listElement.appendChild(resultElement[0]);
    };
    Virtualization.prototype.getModuleName = function () {
        return 'virtualization';
    };
    Virtualization.prototype.destroy = function () {
        this.wireScrollEvent(true);
    };
    return Virtualization;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/sortable/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/sortable/index.js ***!
  \*******************************************************************/
/*! exports provided: Sortable, moveTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _sortable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sortable */ "./ej2-resources/18.4.46/scripts/ej2-lists/sortable/sortable.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return _sortable__WEBPACK_IMPORTED_MODULE_0__["Sortable"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "moveTo", function() { return _sortable__WEBPACK_IMPORTED_MODULE_0__["moveTo"]; });

/**
 * Sortable Module
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-lists/sortable/sortable.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-lists/sortable/sortable.js ***!
  \**********************************************************************/
/*! exports provided: Sortable, moveTo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return Sortable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveTo", function() { return moveTo; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



/**
 * Sortable Module provides support to enable sortable functionality in Dom Elements.
 * ```html
 * <div id="sortable">
 *   <div>Item 1</div>
 *   <div>Item 2</div>
 *   <div>Item 3</div>
 *   <div>Item 4</div>
 *   <div>Item 5</div>
 * </div>
 * ```
 * ```typescript
 *   let ele: HTMLElement = document.getElementById('sortable');
 *   let sortObj: Sortable = new Sortable(ele, {});
 * ```
 */
var Sortable = /** @__PURE__ @class */ (function (_super) {
    __extends(Sortable, _super);
    function Sortable(element, options) {
        var _this = _super.call(this, options, element) || this;
        _this.getHelper = function (e) {
            var target = _this.getSortableElement(e.sender.target);
            if (!_this.isValidTarget(target, _this)) {
                return false;
            }
            var element;
            if (_this.helper) {
                element = _this.helper({ sender: target, element: e.element });
            }
            else {
                element = target.cloneNode(true);
                element.style.width = target.offsetWidth + "px";
                element.style.height = target.offsetHeight + "px";
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], ['e-sortableclone']);
            document.body.appendChild(element);
            return element;
        };
        _this.onDrag = function (e) {
            _this.trigger('drag', { event: e.event, element: _this.element, target: e.target });
            var newInst = _this.getSortableInstance(e.target);
            var target = _this.getSortableElement(e.target, newInst);
            if ((_this.isValidTarget(target, newInst) || e.target.className.indexOf('e-list-group-item') > -1) && (_this.curTarget !== target ||
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newInst.placeHolder)) && (newInst.placeHolderElement ? newInst.placeHolderElement !== e.target :
                true)) {
                if (e.target.className.indexOf('e-list-group-item') > -1) {
                    target = e.target;
                }
                _this.curTarget = target;
                if (_this.target === target) {
                    return;
                }
                var oldIdx = _this.getIndex(newInst.placeHolderElement, newInst);
                var placeHolder = _this.getPlaceHolder(target, newInst);
                var newIdx = void 0;
                if (placeHolder) {
                    oldIdx = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldIdx) ? _this.getIndex(_this.target) : oldIdx;
                    newIdx = _this.getIndex(target, newInst, e.event);
                    var isPlaceHolderPresent = _this.isPlaceHolderPresent(newInst);
                    if (isPlaceHolderPresent && oldIdx === newIdx) {
                        return;
                    }
                    if (isPlaceHolderPresent) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(newInst.placeHolderElement);
                    }
                    newInst.placeHolderElement = placeHolder;
                    if (e.target.className.indexOf('e-list-group-item') > -1) {
                        newInst.element.insertBefore(newInst.placeHolderElement, newInst.element.children[newIdx]);
                    }
                    else if (newInst.element !== _this.element && newIdx === newInst.element.childElementCount) {
                        newInst.element.appendChild(newInst.placeHolderElement);
                    }
                    else {
                        newInst.element.insertBefore(newInst.placeHolderElement, newInst.element.children[newIdx]);
                    }
                    _this.refreshDisabled(oldIdx, newIdx, newInst);
                }
                else {
                    oldIdx = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldIdx) ? _this.getIndex(_this.target) :
                        _this.getIndex(target, newInst) < oldIdx || !oldIdx ? oldIdx : oldIdx - 1;
                    newIdx = _this.getIndex(target, newInst);
                    var idx = newInst.element !== _this.element ? newIdx : oldIdx < newIdx ? newIdx + 1 : newIdx;
                    _this.updateItemClass(newInst);
                    newInst.element.insertBefore(_this.target, newInst.element.children[idx]);
                    _this.refreshDisabled(oldIdx, newIdx, newInst);
                    _this.curTarget = _this.target;
                    _this.trigger('drop', { droppedElement: _this.target, element: newInst.element, previousIndex: oldIdx, currentIndex: newIdx,
                        target: e.target, helper: document.getElementsByClassName('e-sortableclone')[0], event: e.event, scope: _this.scope });
                }
            }
            newInst = _this.getSortableInstance(_this.curTarget);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) && e.target !== newInst.placeHolderElement) {
                if (_this.isPlaceHolderPresent(newInst)) {
                    _this.removePlaceHolder(newInst);
                }
            }
            else {
                var placeHolders = [].slice.call(document.getElementsByClassName('e-sortable-placeholder'));
                var inst_1;
                placeHolders.forEach(function (placeHolder) {
                    inst_1 = _this.getSortableInstance(placeHolder);
                    if (inst_1.element && inst_1 !== newInst) {
                        _this.removePlaceHolder(inst_1);
                    }
                });
            }
        };
        _this.onDragStart = function (e) {
            _this.target = _this.getSortableElement(e.target);
            var cancelDrag = false;
            _this.target.classList.add('e-grabbed');
            _this.curTarget = _this.target;
            e.helper = document.getElementsByClassName('e-sortableclone')[0];
            var args = { cancel: false, element: _this.element, target: _this.target };
            _this.trigger('beforeDragStart', args, function (observedArgs) {
                if (observedArgs.cancel) {
                    cancelDrag = observedArgs.cancel;
                    _this.onDragStop(e);
                }
            });
            if (cancelDrag) {
                return;
            }
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"]) {
                _this.trigger('dragStart', { event: e.event, element: _this.element, target: _this.target,
                    bindEvents: e.bindEvents, dragElement: e.dragElement });
            }
            else {
                _this.trigger('dragStart', { event: e.event, element: _this.element, target: _this.target });
            }
        };
        _this.onDragStop = function (e) {
            var dropInst = _this.getSortableInstance(_this.curTarget);
            var prevIdx;
            var curIdx;
            var handled;
            prevIdx = _this.getIndex(_this.target);
            var isPlaceHolderPresent = _this.isPlaceHolderPresent(dropInst);
            if (isPlaceHolderPresent) {
                var curIdx_1 = _this.getIndex(dropInst.placeHolderElement, dropInst);
                var args = { previousIndex: prevIdx, currentIndex: curIdx_1, target: e.target, droppedElement: _this.target,
                    helper: e.helper, cancel: false, handled: false };
                _this.trigger('beforeDrop', args, function (observedArgs) {
                    if (!observedArgs.cancel) {
                        handled = observedArgs.handled;
                        _this.updateItemClass(dropInst);
                        if (observedArgs.handled) {
                            var ele = _this.target.cloneNode(true);
                            _this.target.classList.remove('e-grabbed');
                            _this.target = ele;
                        }
                        dropInst.element.insertBefore(_this.target, dropInst.placeHolderElement);
                        var curIdx_2 = _this.getIndex(_this.target, dropInst);
                        prevIdx = _this === dropInst && (prevIdx - curIdx_2) > 1 ? prevIdx - 1 : prevIdx;
                        _this.trigger('drop', { event: e.event, element: dropInst.element, previousIndex: prevIdx, currentIndex: curIdx_2,
                            target: e.target, helper: e.helper, droppedElement: _this.target, scopeName: _this.scope, handled: handled });
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(dropInst.placeHolderElement);
                });
            }
            dropInst = _this.getSortableInstance(e.target);
            curIdx = dropInst.element.childElementCount;
            prevIdx = _this.getIndex(_this.target);
            if (dropInst.element === e.target || (!isPlaceHolderPresent && _this.curTarget === _this.target)) {
                var beforeDropArgs = { previousIndex: prevIdx, currentIndex: _this.curTarget === _this.target ? prevIdx : curIdx,
                    target: e.target, droppedElement: _this.target, helper: e.helper, cancel: false };
                _this.trigger('beforeDrop', beforeDropArgs, function (observedArgs) {
                    if (dropInst.element === e.target && !observedArgs.cancel) {
                        _this.updateItemClass(dropInst);
                        dropInst.element.appendChild(_this.target);
                        _this.trigger('drop', { event: e.event, element: dropInst.element, previousIndex: prevIdx, currentIndex: curIdx,
                            target: e.target, helper: e.helper, droppedElement: _this.target, scopeName: _this.scope });
                    }
                });
            }
            _this.target.classList.remove('e-grabbed');
            _this.target = null;
            _this.curTarget = null;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(e.helper);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getComponent"])(_this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"]).intDestroy(e.event);
        };
        _this.bind();
        return _this;
    }
    Sortable_1 = Sortable;
    Sortable.prototype.bind = function () {
        if (!this.element.id) {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('sortable');
        }
        if (!this.itemClass) {
            this.itemClass = 'e-sort-item';
            this.dataBind();
        }
        this.initializeDraggable();
    };
    Sortable.prototype.initializeDraggable = function () {
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"](this.element, {
            helper: this.getHelper,
            dragStart: this.onDragStart,
            drag: this.onDrag,
            dragStop: this.onDragStop,
            dragTarget: "." + this.itemClass,
            enableTapHold: true,
            tapHoldThreshold: 200,
            queryPositionInfo: this.queryPositionInfo,
            distance: 5
        });
    };
    Sortable.prototype.getPlaceHolder = function (target, instance) {
        if (instance.placeHolder) {
            var placeHolderElement = instance.placeHolder({ element: instance.element, grabbedElement: this.target, target: target });
            placeHolderElement.classList.add('e-sortable-placeholder');
            return placeHolderElement;
        }
        return null;
    };
    Sortable.prototype.isValidTarget = function (target, instance) {
        return target && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compareElementParent"])(target, instance.element) && target.classList.contains(instance.itemClass) &&
            !target.classList.contains('e-disabled');
    };
    Sortable.prototype.removePlaceHolder = function (instance) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(instance.placeHolderElement);
        instance.placeHolderElement = null;
    };
    Sortable.prototype.updateItemClass = function (instance) {
        if (this !== instance) {
            this.target.classList.remove(this.itemClass);
            this.target.classList.add(instance.itemClass);
        }
    };
    Sortable.prototype.getSortableInstance = function (element) {
        element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, ".e-" + this.getModuleName());
        if (element) {
            var inst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getComponent"])(element, Sortable_1);
            return inst.scope && this.scope && inst.scope === this.scope ? inst : this;
        }
        else {
            return this;
        }
    };
    Sortable.prototype.refreshDisabled = function (oldIdx, newIdx, instance) {
        if (instance === this) {
            var element = void 0;
            var increased = oldIdx < newIdx;
            var disabledIdx = void 0;
            var start = increased ? oldIdx : newIdx;
            var end = increased ? newIdx : oldIdx;
            while (start <= end) {
                element = this.element.children[start];
                if (element.classList.contains('e-disabled')) {
                    disabledIdx = this.getIndex(element);
                    this.element.insertBefore(element, this.element.children[increased ? disabledIdx + 2 : disabledIdx - 1]);
                    start = increased ? disabledIdx + 2 : disabledIdx + 1;
                }
                else {
                    start++;
                }
            }
        }
    };
    Sortable.prototype.getIndex = function (target, instance, e) {
        if (instance === void 0) { instance = this; }
        var idx;
        var placeHolderPresent;
        [].slice.call(instance.element.children).forEach(function (element, index) {
            if (element.classList.contains('e-sortable-placeholder')) {
                placeHolderPresent = true;
            }
            if (element === target) {
                idx = index;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)) {
                    if (placeHolderPresent) {
                        idx -= 1;
                    }
                    var offset = target.getBoundingClientRect();
                    var clientY = offset.bottom - ((offset.bottom - offset.top) / 2);
                    idx = e.clientY <= clientY ? idx : idx + 1;
                }
                return;
            }
        });
        return idx;
    };
    Sortable.prototype.getSortableElement = function (element, instance) {
        if (instance === void 0) { instance = this; }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, "." + instance.itemClass);
    };
    Sortable.prototype.queryPositionInfo = function (value) {
        value.left = pageXOffset ? parseFloat(value.left) - pageXOffset + "px" : value.left;
        value.top = pageYOffset ? parseFloat(value.top) - pageYOffset + "px" : value.top;
        return value;
    };
    Sortable.prototype.isPlaceHolderPresent = function (instance) {
        return instance.placeHolderElement && !!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(instance.placeHolderElement, "#" + instance.element.id);
    };
    /**
     * It is used to sort array of elements from source element to destination element.
     * @param destination - Defines the destination element to which the sortable elements needs to be appended.
     * If it is null, then the Sortable library element will be considered as destination.
     * @param targetIndexes - Specifies the sortable elements indexes which needs to be sorted.
     * @param insertBefore - Specifies the index before which the sortable elements needs to be appended.
     * If it is null, elements will be appended as last child.
     * @method moveTo
     * @return {void}
     */
    Sortable.prototype.moveTo = function (destination, targetIndexes, insertBefore) {
        moveTo(this.element, destination, targetIndexes, insertBefore);
    };
    /**
     * It is used to destroy the Sortable library.
     */
    Sortable.prototype.destroy = function () {
        if (this.itemClass === 'e-sort-item') {
            this.itemClass = null;
            this.dataBind();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getComponent"])(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"]).destroy();
        _super.prototype.destroy.call(this);
    };
    Sortable.prototype.getModuleName = function () {
        return 'sortable';
    };
    Sortable.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'itemClass':
                    [].slice.call(this.element.children).forEach(function (element) {
                        if (element.classList.contains(oldProp.itemClass)) {
                            element.classList.remove(oldProp.itemClass);
                        }
                        if (newProp.itemClass) {
                            element.classList.add(newProp.itemClass);
                        }
                    });
                    break;
            }
        }
    };
    var Sortable_1;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sortable.prototype, "enableAnimation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Sortable.prototype, "itemClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Sortable.prototype, "scope", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Sortable.prototype, "helper", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Sortable.prototype, "placeHolder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sortable.prototype, "drag", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sortable.prototype, "beforeDragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sortable.prototype, "dragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sortable.prototype, "beforeDrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sortable.prototype, "drop", void 0);
    Sortable = Sortable_1 = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Sortable);
    return Sortable;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));

/**
 * It is used to sort array of elements from source element to destination element.
 * @private
 */
function moveTo(from, to, targetIndexes, insertBefore) {
    var targetElements = [];
    if (!to) {
        to = from;
    }
    if (targetIndexes && targetIndexes.length) {
        targetIndexes.forEach(function (index) {
            targetElements.push(from.children[index]);
        });
    }
    else {
        targetElements = [].slice.call(from.children);
    }
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(insertBefore)) {
        targetElements.forEach(function (target) {
            to.appendChild(target);
        });
    }
    else {
        var insertElement_1 = to.children[insertBefore];
        targetElements.forEach(function (target) {
            to.insertBefore(target, insertElement_1);
        });
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/accordion.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/accordion.js ***!
  \******************************************************************************/
/*! exports provided: AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionActionSettings", function() { return AccordionActionSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionAnimationSettings", function() { return AccordionAnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionItem", function() { return AccordionItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};






var CLS_ACRDN_ROOT = 'e-acrdn-root';
var CLS_ROOT = 'e-accordion';
var CLS_ITEM = 'e-acrdn-item';
var CLS_ITEMFOCUS = 'e-item-focus';
var CLS_ITEMHIDE = 'e-hide';
var CLS_HEADER = 'e-acrdn-header';
var CLS_HEADERICN = 'e-acrdn-header-icon';
var CLS_HEADERCTN = 'e-acrdn-header-content';
var CLS_CONTENT = 'e-acrdn-panel';
var CLS_CTENT = 'e-acrdn-content';
var CLS_TOOGLEICN = 'e-toggle-icon';
var CLS_COLLAPSEICN = 'e-tgl-collapse-icon e-icons';
var CLS_EXPANDICN = 'e-expand-icon';
var CLS_RTL = 'e-rtl';
var CLS_CTNHIDE = 'e-content-hide';
var CLS_SLCT = 'e-select';
var CLS_SLCTED = 'e-selected';
var CLS_ACTIVE = 'e-active';
var CLS_ANIMATE = 'e-animate';
var CLS_DISABLE = 'e-overlay';
var CLS_TOGANIMATE = 'e-toggle-animation';
var CLS_NEST = 'e-nested';
var CLS_EXPANDSTATE = 'e-expand-state';
var CLS_CONTAINER = 'e-accordion-container';
/**
 * Objects used for configuring the Accordion expanding item action properties.
 */
var AccordionActionSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(AccordionActionSettings, _super);
    function AccordionActionSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('SlideDown')
    ], AccordionActionSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(400)
    ], AccordionActionSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('linear')
    ], AccordionActionSettings.prototype, "easing", void 0);
    return AccordionActionSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Objects used for configuring the Accordion animation properties.
 */
var AccordionAnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(AccordionAnimationSettings, _super);
    function AccordionAnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideUp', duration: 400, easing: 'linear' }, AccordionActionSettings)
    ], AccordionAnimationSettings.prototype, "collapse", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideDown', duration: 400, easing: 'linear' }, AccordionActionSettings)
    ], AccordionAnimationSettings.prototype, "expand", void 0);
    return AccordionAnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * An item object that is used to configure Accordion items.
 */
var AccordionItem = /** @__PURE__ @class */ (function (_super) {
    __extends(AccordionItem, _super);
    function AccordionItem() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AccordionItem.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AccordionItem.prototype, "header", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AccordionItem.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], AccordionItem.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], AccordionItem.prototype, "expanded", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], AccordionItem.prototype, "visible", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], AccordionItem.prototype, "disabled", void 0);
    return AccordionItem;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * The Accordion is a vertically collapsible content panel that displays one or more panels at a time within the available space.
 * ```html
 * <div id='accordion'/>
 * <script>
 *   var accordionObj = new Accordion();
 *   accordionObj.appendTo('#accordion');
 * </script>
 * ```
 */
var Accordion = /** @__PURE__ @class */ (function (_super) {
    __extends(Accordion, _super);
    /**
     * Initializes a new instance of the Accordion class.
     * @param options  - Specifies Accordion model properties as options.
     * @param element  - Specifies the element that is rendered as an Accordion.
     */
    function Accordion(options, element) {
        var _this = _super.call(this, options, element) || this;
        /**
         * Contains the keyboard configuration of the Accordion.
         */
        _this.keyConfigs = {
            moveUp: 'uparrow',
            moveDown: 'downarrow',
            enter: 'enter',
            space: 'space',
            home: 'home',
            end: 'end',
        };
        return _this;
    }
    /**
     * Removes the control from the DOM and also removes all its related events.
     * @returns void
     */
    Accordion.prototype.destroy = function () {
        var _this = this;
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        var ele = this.element;
        _super.prototype.destroy.call(this);
        this.unwireEvents();
        this.isDestroy = true;
        this.restoreContent(null);
        [].slice.call(ele.children).forEach(function (el) {
            ele.removeChild(el);
        });
        if (this.trgtEle) {
            while (this.ctrlTem.firstElementChild) {
                ele.appendChild(this.ctrlTem.firstElementChild);
            }
        }
        ele.classList.remove(CLS_ACRDN_ROOT);
        ele.removeAttribute('style');
        ['aria-disabled', 'aria-multiselectable', 'role', 'data-ripple'].forEach(function (attrb) {
            _this.element.removeAttribute(attrb);
        });
        if (!this.isNested && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["isRippleEnabled"]) {
            this.removeRippleEffect();
        }
    };
    Accordion.prototype.preRender = function () {
        var nested = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.' + CLS_CONTENT);
        this.isNested = false;
        this.templateEle = [];
        if (!this.isDestroy) {
            this.isDestroy = false;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nested)) {
            nested.classList.add(CLS_NEST);
            this.isNested = true;
        }
        else {
            this.element.classList.add(CLS_ACRDN_ROOT);
        }
        if (this.enableRtl) {
            this.add(this.element, CLS_RTL);
        }
    };
    Accordion.prototype.add = function (ele, val) {
        ele.classList.add(val);
    };
    Accordion.prototype.remove = function (ele, val) {
        ele.classList.remove(val);
    };
    /**
     * To initialize the control rendering
     * @private
     */
    Accordion.prototype.render = function () {
        if (!this.isServerRendered) {
            this.initializeheaderTemplate();
            this.initializeItemTemplate();
            this.initialize();
            this.renderControl();
        }
        else {
            this.wireFocusEvents();
        }
        this.wireEvents();
        this.renderComplete();
    };
    Accordion.prototype.initialize = function () {
        var width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        var height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': width, 'height': height });
        var ariaAttr = {
            'aria-disabled': 'false', 'role': 'presentation', 'aria-multiselectable': 'true'
        };
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.initExpand)) {
            this.initExpand = [];
        }
        if (this.expandedIndices.length > 0) {
            this.initExpand = this.expandedIndices;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, ariaAttr);
        if (this.expandMode === 'Single') {
            this.element.setAttribute('aria-multiselectable', 'false');
        }
    };
    Accordion.prototype.renderControl = function () {
        this.trgtEle = (this.element.children.length > 0) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div', this.element) : null;
        this.renderItems();
        this.initItemExpand();
    };
    Accordion.prototype.wireFocusEvents = function () {
        var acrdItem = [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM));
        for (var _i = 0, acrdItem_1 = acrdItem; _i < acrdItem_1.length; _i++) {
            var item = acrdItem_1[_i];
            var headerEle = item.querySelector('.' + CLS_HEADER);
            if (item.childElementCount > 0 && headerEle) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(headerEle);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(headerEle, 'focus', this.focusIn, this);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(headerEle, 'blur', this.focusOut, this);
            }
        }
    };
    Accordion.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.keyModule)) {
            this.keyModule.destroy();
        }
    };
    Accordion.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
        if (!this.isNested && !this.isDestroy) {
            this.removeRippleEffect = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, { selector: '.' + CLS_HEADER });
        }
        if (!this.isNested) {
            this.keyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
                keyAction: this.keyActionHandler.bind(this),
                keyConfigs: this.keyConfigs,
                eventName: 'keydown'
            });
        }
    };
    Accordion.prototype.templateParser = function (template) {
        if (template) {
            try {
                if (document.querySelectorAll(template).length) {
                    return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(document.querySelector(template).innerHTML.trim());
                }
            }
            catch (error) {
                return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
            }
        }
        return undefined;
    };
    Accordion.prototype.initializeheaderTemplate = function () {
        if (this.headerTemplate) {
            this.headerTemplateFn = this.templateParser(this.headerTemplate);
        }
    };
    Accordion.prototype.initializeItemTemplate = function () {
        if (this.itemTemplate) {
            this.itemTemplateFn = this.templateParser(this.itemTemplate);
        }
    };
    Accordion.prototype.getheaderTemplate = function () {
        return this.headerTemplateFn;
    };
    Accordion.prototype.getItemTemplate = function () {
        return this.itemTemplateFn;
    };
    Accordion.prototype.focusIn = function (e) {
        e.target.parentElement.classList.add(CLS_ITEMFOCUS);
    };
    Accordion.prototype.focusOut = function (e) {
        e.target.parentElement.classList.remove(CLS_ITEMFOCUS);
    };
    Accordion.prototype.ctrlTemplate = function () {
        this.ctrlTem = this.element.cloneNode(true);
        var innerEles;
        var rootEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTAINER, this.element);
        if (rootEle) {
            innerEles = rootEle.children;
        }
        else {
            innerEles = this.element.children;
        }
        var items = [];
        /* tslint:disable */
        [].slice.call(innerEles).forEach(function (el) {
            items.push({
                header: (el.childElementCount > 0 && el.children[0]) ? (el.children[0]) : '',
                content: (el.childElementCount > 1 && el.children[1]) ? (el.children[1]) : ''
            });
            el.parentNode.removeChild(el);
        });
        /* tslint:enable */
        if (rootEle) {
            this.element.removeChild(rootEle);
        }
        this.setProperties({ items: items }, true);
    };
    Accordion.prototype.toggleIconGenerate = function () {
        var tglIcon = this.createElement('div', { className: CLS_TOOGLEICN });
        var hdrColIcon = this.createElement('span', { className: CLS_COLLAPSEICN });
        tglIcon.appendChild(hdrColIcon);
        return tglIcon;
    };
    Accordion.prototype.initItemExpand = function () {
        var len = this.initExpand.length;
        if (len === 0) {
            return;
        }
        if (this.expandMode === 'Single') {
            this.expandItem(true, this.initExpand[len - 1]);
        }
        else {
            for (var i = 0; i < len; i++) {
                this.expandItem(true, this.initExpand[i]);
            }
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Accordion.prototype.renderItems = function () {
        var _this = this;
        var ele = this.element;
        var innerItem;
        var innerDataSourceItem;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.trgtEle)) {
            this.ctrlTemplate();
        }
        if (this.dataSource.length > 0) {
            this.dataSource.forEach(function (item, index) {
                innerDataSourceItem = _this.renderInnerItem(item, index);
                ele.appendChild(innerDataSourceItem);
                if (innerDataSourceItem.childElementCount > 0) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerDataSourceItem.querySelector('.' + CLS_HEADER), 'focus', _this.focusIn, _this);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerDataSourceItem.querySelector('.' + CLS_HEADER), 'blur', _this.focusOut, _this);
                }
            });
        }
        else {
            var items = this.items;
            if (ele && items.length > 0) {
                items.forEach(function (item, index) {
                    innerItem = _this.renderInnerItem(item, index);
                    ele.appendChild(innerItem);
                    if (innerItem.childElementCount > 0) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerItem.querySelector('.' + CLS_HEADER), 'focus', _this.focusIn, _this);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerItem.querySelector('.' + CLS_HEADER), 'blur', _this.focusOut, _this);
                    }
                });
            }
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Accordion.prototype.clickHandler = function (e) {
        var _this = this;
        var trgt = e.target;
        var items = this.getItems();
        var eventArgs = {};
        var index;
        var tglIcon;
        var acrdEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ROOT);
        if (acrdEle !== this.element) {
            return;
        }
        trgt.classList.add('e-target');
        var acrdnItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ITEM);
        var acrdnHdr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_HEADER);
        var acrdnCtn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_CONTENT);
        if (acrdnItem && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnHdr) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnCtn))) {
            acrdnHdr = acrdnItem.children[0];
            acrdnCtn = acrdnItem.children[1];
        }
        if (acrdnHdr) {
            tglIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TOOGLEICN, acrdnHdr);
        }
        var acrdnCtnItem;
        if (acrdnHdr) {
            acrdnCtnItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(acrdnHdr, '.' + CLS_ITEM);
        }
        else if (acrdnCtn) {
            acrdnCtnItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(acrdnCtn, '.' + CLS_ITEM);
        }
        index = this.getIndexByItem(acrdnItem);
        if (acrdnCtnItem) {
            eventArgs.item = items[this.getIndexByItem(acrdnCtnItem)];
        }
        eventArgs.originalEvent = e;
        var ctnCheck = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tglIcon) && acrdnItem.childElementCount <= 1;
        if (ctnCheck && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnCtn) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER + ' .' + CLS_TOOGLEICN, acrdnCtnItem)))) {
            if (!this.isServerRendered) {
                acrdnItem.appendChild(this.contentRendering(index));
                this.ariaAttrUpdate(acrdnItem);
                this.afterContentRender(trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem);
            }
            else {
                var id = acrdnItem.id;
                if (this.items.length > 0) {
                    // tslint:disable-next-line:no-any
                    this.interopAdaptor.invokeMethodAsync('OnItemClick', index).then(function () {
                        if (_this.isDestroyed) {
                            return;
                        }
                        _this.afterContentRender(trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem);
                    });
                }
                else {
                    // tslint:disable-next-line:no-any
                    this.interopAdaptor.invokeMethodAsync('OnDataClick', id).then(function () {
                        if (_this.isDestroyed) {
                            return;
                        }
                        _this.afterContentRender(trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem);
                    });
                }
            }
        }
        else {
            this.afterContentRender(trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem);
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Accordion.prototype.afterContentRender = function (trgt, eventArgs, acrdnItem, acrdnHdr, acrdnCtn, acrdnCtnItem) {
        var _this = this;
        var acrdActive = [];
        this.trigger('clicked', eventArgs);
        var cntclkCheck = (acrdnCtn && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-target', acrdnCtn)));
        var inlineAcrdnSel = '.' + CLS_CONTENT + ' .' + CLS_ROOT;
        var inlineEleAcrdn = acrdnCtn && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_ROOT, acrdnCtn)) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, inlineAcrdnSel));
        var nestContCheck = acrdnCtn && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_ROOT, acrdnCtn)) || !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ROOT) === this.element);
        cntclkCheck = cntclkCheck && (inlineEleAcrdn || nestContCheck);
        trgt.classList.remove('e-target');
        if (trgt.classList.contains(CLS_CONTENT) || trgt.classList.contains(CLS_CTENT) || cntclkCheck) {
            return;
        }
        var acrdcontainer = this.element.querySelector('.' + CLS_CONTAINER);
        var acrdnchild = (acrdcontainer) ? acrdcontainer.children : this.element.children;
        [].slice.call(acrdnchild).forEach(function (el) {
            if (el.classList.contains(CLS_ACTIVE)) {
                acrdActive.push(el);
            }
        });
        var acrdAniEle = [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM + ' [' + CLS_ANIMATE + ']'));
        if (acrdAniEle.length > 0) {
            for (var _i = 0, acrdAniEle_1 = acrdAniEle; _i < acrdAniEle_1.length; _i++) {
                var el = acrdAniEle_1[_i];
                acrdActive.push(el.parentElement);
            }
        }
        var sameContentCheck = acrdActive.indexOf(acrdnCtnItem) !== -1 && acrdnCtn.getAttribute('e-animate') === 'true';
        var sameHeader = false;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnItem) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnHdr)) {
            var acrdnCtn_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, acrdnItem);
            var acrdnRoot = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(acrdnItem, '.' + CLS_ACRDN_ROOT);
            var expandState = acrdnRoot.querySelector('.' + CLS_EXPANDSTATE);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(acrdnCtn_1)) {
                return;
            }
            sameHeader = (expandState === acrdnItem);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(acrdnCtn_1) && (!sameContentCheck || acrdnCtnItem.classList.contains(CLS_SLCTED))) {
                this.collapse(acrdnCtn_1);
            }
            else {
                if ((acrdActive.length > 0) && this.expandMode === 'Single' && !sameContentCheck) {
                    acrdActive.forEach(function (el) {
                        _this.collapse(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, el));
                        el.classList.remove(CLS_EXPANDSTATE);
                    });
                }
                this.expand(acrdnCtn_1);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(expandState) && !sameHeader) {
                expandState.classList.remove(CLS_EXPANDSTATE);
            }
        }
    };
    Accordion.prototype.eleMoveFocus = function (action, root, trgt) {
        var clst;
        var clstItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ITEM);
        if (trgt === root) {
            clst = ((action === 'moveUp' ? trgt.lastElementChild : trgt).querySelector('.' + CLS_HEADER));
        }
        else if (trgt.classList.contains(CLS_HEADER)) {
            clstItem = (action === 'moveUp' ? clstItem.previousElementSibling : clstItem.nextElementSibling);
            if (clstItem) {
                clst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, clstItem);
            }
        }
        if (clst) {
            clst.focus();
        }
    };
    Accordion.prototype.keyActionHandler = function (e) {
        var trgt = e.target;
        var header = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, CLS_HEADER);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(header) && !trgt.classList.contains(CLS_ROOT) && !trgt.classList.contains(CLS_HEADER)) {
            return;
        }
        var clst;
        var root = this.element;
        var content;
        switch (e.action) {
            case 'moveUp':
                this.eleMoveFocus(e.action, root, trgt);
                break;
            case 'moveDown':
                this.eleMoveFocus(e.action, root, trgt);
                break;
            case 'space':
            case 'enter':
                content = trgt.nextElementSibling;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(content) && content.classList.contains(CLS_CONTENT)) {
                    if (content.getAttribute('e-animate') !== 'true') {
                        trgt.click();
                    }
                }
                else {
                    trgt.click();
                }
                break;
            case 'home':
            case 'end':
                clst = e.action === 'home' ? root.firstElementChild.children[0] : root.lastElementChild.children[0];
                clst.focus();
                break;
        }
    };
    Accordion.prototype.headerEleGenerate = function () {
        var header = this.createElement('div', { className: CLS_HEADER, id: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('acrdn_header') });
        var items = this.getItems();
        var ariaAttr = {
            'tabindex': '0', 'role': 'heading', 'aria-selected': 'false',
            'aria-disabled': 'false', 'aria-level': items.length.toString()
        };
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(header, ariaAttr);
        return header;
    };
    Accordion.prototype.renderInnerItem = function (item, index) {
        var innerEle;
        innerEle = this.createElement('div', { className: CLS_ITEM });
        innerEle.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('acrdn_item');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(innerEle, { 'aria-expanded': 'false' });
        if (this.headerTemplate) {
            var ctnEle = this.headerEleGenerate();
            var hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
            ctnEle.appendChild(hdrEle);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getheaderTemplate()(item, this, 'headerTemplate', this.element.id + '_headerTemplate', false), hdrEle);
            innerEle.appendChild(ctnEle);
            ctnEle.appendChild(this.toggleIconGenerate());
            this.add(innerEle, CLS_SLCT);
            return innerEle;
        }
        if (item.header && this.angularnativeCondiCheck(item, 'header')) {
            if (this.enableHtmlSanitizer && typeof (item.header) === 'string') {
                item.header = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(item.header);
            }
            var ctnEle = this.headerEleGenerate();
            var hdrEle = this.createElement('div', { className: CLS_HEADERCTN });
            ctnEle.appendChild(hdrEle);
            ctnEle.appendChild(this.fetchElement(hdrEle, item.header, index, true));
            innerEle.appendChild(ctnEle);
        }
        var hdr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, innerEle);
        if (item.expanded && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) && (!this.enablePersistence)) {
            if (this.initExpand.indexOf(index) === -1) {
                this.initExpand.push(index);
            }
        }
        if (item.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([innerEle], item.cssClass.split(' '));
        }
        if (item.disabled) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([innerEle], CLS_DISABLE);
        }
        if (item.visible === false) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([innerEle], CLS_ITEMHIDE);
        }
        if (item.iconCss) {
            var hdrIcnEle = this.createElement('div', { className: CLS_HEADERICN });
            var icon = this.createElement('span', { className: item.iconCss + ' e-icons' });
            hdrIcnEle.appendChild(icon);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hdr)) {
                hdr = this.headerEleGenerate();
                hdr.appendChild(hdrIcnEle);
                innerEle.appendChild(hdr);
            }
            else {
                hdr.insertBefore(hdrIcnEle, hdr.childNodes[0]);
            }
        }
        if (item.content && this.angularnativeCondiCheck(item, 'content')) {
            var hdrIcon = this.toggleIconGenerate();
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hdr)) {
                hdr = this.headerEleGenerate();
                innerEle.appendChild(hdr);
            }
            hdr.appendChild(hdrIcon);
            this.add(innerEle, CLS_SLCT);
        }
        return innerEle;
    };
    Accordion.prototype.angularnativeCondiCheck = function (item, prop) {
        var property = prop === 'content' ? item.content : item.header;
        var content = property;
        if (this.isAngular && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(content.elementRef)) {
            var data = content.elementRef.nativeElement.data;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data) || data === '' || (data.indexOf('bindings=') === -1)) {
                return true;
            }
            var parseddata = JSON.parse(content.elementRef.nativeElement.data.replace('bindings=', ''));
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parseddata) && parseddata['ng-reflect-ng-if'] === 'false') {
                return false;
            }
            else {
                return true;
            }
        }
        else {
            return true;
        }
    };
    Accordion.prototype.fetchElement = function (ele, value, index, isHeader) {
        var templateFn;
        var temString;
        try {
            if (document.querySelectorAll(value).length && value !== 'Button') {
                var eleVal = document.querySelector(value);
                temString = eleVal.outerHTML.trim();
                ele.appendChild(eleVal);
                eleVal.style.display = '';
            }
        }
        catch (e) {
            if (typeof (value) === 'string') {
                ele.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(value);
                /* tslint:disable */
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.trgtEle) && (value instanceof (HTMLElement))) {
                ele.appendChild(value);
                ele.firstElementChild.style.display = '';
                /* tslint:enable */
            }
            else {
                templateFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(value);
            }
        }
        var tempArray;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateFn)) {
            // tslint:disable-next-line:no-any
            if (this.isReact) {
                this.renderReactTemplates();
            }
            var templateProps = void 0;
            var templateName = void 0;
            if (ele.classList.contains(CLS_HEADERCTN)) {
                templateProps = this.element.id + index + '_header';
                templateName = 'header';
            }
            else if (ele.classList.contains(CLS_CTENT)) {
                templateProps = this.element.id + index + '_content';
                templateName = 'content';
            }
            tempArray = templateFn({}, this, templateName, templateProps, this.isStringTemplate);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tempArray) && tempArray.length > 0 && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tempArray[0].tagName) && tempArray.length === 1)) {
            [].slice.call(tempArray).forEach(function (el) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(el.tagName)) {
                    el.style.display = '';
                }
                ele.appendChild(el);
            });
        }
        else if (ele.childElementCount === 0) {
            ele.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(value);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(temString)) {
            if (this.templateEle.indexOf(value) === -1) {
                this.templateEle.push(value);
            }
        }
        return ele;
    };
    Accordion.prototype.ariaAttrUpdate = function (itemEle) {
        var header = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, itemEle);
        var content = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, itemEle);
        header.setAttribute('aria-controls', content.id);
        content.setAttribute('aria-labelledby', header.id);
        content.setAttribute('role', 'definition');
    };
    Accordion.prototype.contentRendering = function (index) {
        var itemcnt = this.createElement('div', { className: CLS_CONTENT + ' ' + CLS_CTNHIDE, id: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('acrdn_panel') });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(itemcnt, { 'aria-hidden': 'true' });
        var ctn = this.createElement('div', { className: CLS_CTENT });
        if (this.dataSource.length > 0) {
            // tslint:disable-next-line:no-any
            if (this.isReact) {
                this.renderReactTemplates();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getItemTemplate()(this.dataSource[index], this, 'itemTemplate', this.element.id + '_itemTemplate', false), ctn);
            itemcnt.appendChild(ctn);
        }
        else {
            if (this.enableHtmlSanitizer && typeof (this.items[index].content)) {
                this.items[index].content = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.items[index].content);
            }
            itemcnt.appendChild(this.fetchElement(ctn, this.items[index].content, index, false));
        }
        return itemcnt;
    };
    Accordion.prototype.expand = function (trgt) {
        var _this = this;
        var eventArgs;
        var items = this.getItems();
        var trgtItemEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ITEM);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgt) || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(trgt) && trgt.getAttribute('e-animate') !== 'true') || trgtItemEle.classList.contains(CLS_DISABLE)) {
            return;
        }
        var acrdnRoot = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgtItemEle, '.' + CLS_ACRDN_ROOT);
        var expandState = acrdnRoot.querySelector('.' + CLS_EXPANDSTATE);
        var animation = {
            name: this.animation.expand.effect,
            duration: this.animation.expand.duration,
            timingFunction: this.animation.expand.easing
        };
        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TOOGLEICN, trgtItemEle).firstElementChild;
        eventArgs = {
            element: trgtItemEle,
            item: items[this.getIndexByItem(trgtItemEle)],
            index: this.getIndexByItem(trgtItemEle),
            content: trgtItemEle.querySelector('.' + CLS_CONTENT),
            isExpanded: true
        };
        this.trigger('expanding', eventArgs, function (expandArgs) {
            if (!expandArgs.cancel) {
                icon.classList.add(CLS_TOGANIMATE);
                _this.expandedItemsPush(trgtItemEle);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(expandState)) {
                    expandState.classList.remove(CLS_EXPANDSTATE);
                }
                trgtItemEle.classList.add(CLS_EXPANDSTATE);
                if ((animation.name === 'None')) {
                    _this.expandProgress('begin', icon, trgt, trgtItemEle, expandArgs);
                    _this.expandProgress('end', icon, trgt, trgtItemEle, expandArgs);
                }
                else {
                    _this.expandAnimation(animation.name, icon, trgt, trgtItemEle, animation, expandArgs);
                }
            }
        });
    };
    Accordion.prototype.expandAnimation = function (ef, icn, trgt, trgtItemEle, animate, args) {
        var _this = this;
        var height;
        this.lastActiveItemId = trgtItemEle.id;
        if (ef === 'SlideDown') {
            animate.begin = function () {
                _this.expandProgress('begin', icn, trgt, trgtItemEle, args);
                trgt.style.position = 'absolute';
                height = trgtItemEle.offsetHeight;
                trgt.style.maxHeight = (trgt.offsetHeight) + 'px';
                trgtItemEle.style.maxHeight = '';
            };
            animate.progress = function () {
                trgtItemEle.style.minHeight = (height + trgt.offsetHeight) + 'px';
            };
            animate.end = function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(trgt, { 'position': '', 'maxHeight': '' });
                trgtItemEle.style.minHeight = '';
                _this.expandProgress('end', icn, trgt, trgtItemEle, args);
            };
        }
        else {
            animate.begin = function () {
                _this.expandProgress('begin', icn, trgt, trgtItemEle, args);
            };
            animate.end = function () {
                _this.expandProgress('end', icn, trgt, trgtItemEle, args);
            };
        }
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animate).animate(trgt);
    };
    Accordion.prototype.expandProgress = function (progress, icon, trgt, trgtItemEle, eventArgs) {
        this.remove(trgt, CLS_CTNHIDE);
        this.add(trgtItemEle, CLS_SLCTED);
        this.add(icon, CLS_EXPANDICN);
        if (progress === 'end') {
            this.add(trgtItemEle, CLS_ACTIVE);
            trgt.setAttribute('aria-hidden', 'false');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(trgtItemEle, { 'aria-expanded': 'true' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(trgt.previousElementSibling, { 'aria-selected': 'true' });
            icon.classList.remove(CLS_TOGANIMATE);
            this.trigger('expanded', eventArgs);
        }
    };
    Accordion.prototype.expandedItemsPush = function (item) {
        var index = this.getIndexByItem(item);
        if (this.expandedIndices.indexOf(index) === -1) {
            var temp = [].slice.call(this.expandedIndices);
            temp.push(index);
            this.setProperties({ expandedIndices: temp }, true);
        }
    };
    Accordion.prototype.getIndexByItem = function (item) {
        var itemEle = this.getItemElements();
        return [].slice.call(itemEle).indexOf(item);
    };
    Accordion.prototype.getItemElements = function () {
        var itemEle = [];
        var itemCollection = this.element.children;
        [].slice.call(itemCollection).forEach(function (el) {
            if (el.classList.contains(CLS_ITEM)) {
                itemEle.push(el);
            }
        });
        return itemEle;
    };
    Accordion.prototype.expandedItemsPop = function (item) {
        var index = this.getIndexByItem(item);
        var temp = [].slice.call(this.expandedIndices);
        temp.splice(temp.indexOf(index), 1);
        this.setProperties({ expandedIndices: temp }, true);
    };
    Accordion.prototype.collapse = function (trgt) {
        var _this = this;
        var eventArgs;
        var items = this.getItems();
        var trgtItemEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ITEM);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgt) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(trgt) || trgtItemEle.classList.contains(CLS_DISABLE)) {
            return;
        }
        var animation = {
            name: this.animation.collapse.effect,
            duration: this.animation.collapse.duration,
            timingFunction: this.animation.collapse.easing,
        };
        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TOOGLEICN, trgtItemEle).firstElementChild;
        eventArgs = {
            element: trgtItemEle,
            item: items[this.getIndexByItem(trgtItemEle)],
            index: this.getIndexByItem(trgtItemEle),
            content: trgtItemEle.querySelector('.' + CLS_CONTENT),
            isExpanded: false
        };
        this.trigger('expanding', eventArgs, function (expandArgs) {
            if (!expandArgs.cancel) {
                _this.expandedItemsPop(trgtItemEle);
                trgtItemEle.classList.add(CLS_EXPANDSTATE);
                icon.classList.add(CLS_TOGANIMATE);
                if ((animation.name === 'None')) {
                    _this.collapseProgress('begin', icon, trgt, trgtItemEle, expandArgs);
                    _this.collapseProgress('end', icon, trgt, trgtItemEle, expandArgs);
                }
                else {
                    _this.collapseAnimation(animation.name, trgt, trgtItemEle, icon, animation, expandArgs);
                }
            }
        });
    };
    Accordion.prototype.collapseAnimation = function (ef, trgt, trgtItEl, icn, animate, args) {
        var _this = this;
        var height;
        var trgtHeight;
        var itemHeight;
        var remain;
        this.lastActiveItemId = trgtItEl.id;
        if (ef === 'SlideUp') {
            animate.begin = function () {
                itemHeight = trgtItEl.offsetHeight;
                trgtItEl.style.minHeight = itemHeight + 'px';
                trgt.style.position = 'absolute';
                height = trgtItEl.offsetHeight;
                trgtHeight = trgt.offsetHeight;
                trgt.style.maxHeight = trgtHeight + 'px';
                _this.collapseProgress('begin', icn, trgt, trgtItEl, args);
            };
            animate.progress = function () {
                remain = ((height - (trgtHeight - trgt.offsetHeight)));
                if (remain < itemHeight) {
                    trgtItEl.style.minHeight = remain + 'px';
                }
            };
            animate.end = function () {
                trgt.style.display = 'none';
                _this.collapseProgress('end', icn, trgt, trgtItEl, args);
                trgtItEl.style.minHeight = '';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(trgt, { 'position': '', 'maxHeight': '', 'display': '' });
            };
        }
        else {
            animate.begin = function () {
                _this.collapseProgress('begin', icn, trgt, trgtItEl, args);
            };
            animate.end = function () {
                _this.collapseProgress('end', icn, trgt, trgtItEl, args);
            };
        }
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animate).animate(trgt);
    };
    Accordion.prototype.collapseProgress = function (progress, icon, trgt, trgtItemEle, eventArgs) {
        this.remove(icon, CLS_EXPANDICN);
        this.remove(trgtItemEle, CLS_SLCTED);
        if (progress === 'end') {
            this.add(trgt, CLS_CTNHIDE);
            icon.classList.remove(CLS_TOGANIMATE);
            this.remove(trgtItemEle, CLS_ACTIVE);
            trgt.setAttribute('aria-hidden', 'true');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(trgtItemEle, { 'aria-expanded': 'false' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(trgt.previousElementSibling, { 'aria-selected': 'false' });
            this.trigger('expanded', eventArgs);
        }
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    Accordion.prototype.getModuleName = function () {
        return 'accordion';
    };
    Accordion.prototype.itemAttribUpdate = function () {
        var items = this.getItems();
        var itemEle = this.getItemElements();
        var itemLen = items.length;
        itemEle.forEach(function (ele) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, ele).setAttribute('aria-level', '' + itemLen);
        });
    };
    Accordion.prototype.getItems = function () {
        var items;
        if (this.itemTemplate && this.headerTemplate) {
            items = this.dataSource;
        }
        else {
            items = this.items;
        }
        return items;
    };
    /**
     * Adds new item to the Accordion with the specified index of the Accordion.
     * @param  {AccordionItemModel | AccordionItemModel[] | Object | Object[]} item - Item array that is to be added to the Accordion.
     * @param  {number} index - Number value that determines where the item should be added.
     * By default, item is added at the last index if the index is not specified.
     * @returns void
     */
    Accordion.prototype.addItem = function (item, index) {
        var _this = this;
        var ele = this.element;
        var itemEle = this.getItemElements();
        var items = this.getItems();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            index = items.length;
        }
        if (ele.childElementCount >= index) {
            var addItems = (item instanceof Array) ? item : [item];
            addItems.forEach(function (addItem, i) {
                var itemIndex = index + i;
                items.splice(itemIndex, 0, addItem);
                var innerItemEle = _this.renderInnerItem(addItem, itemIndex);
                if (ele.childElementCount === itemIndex) {
                    ele.appendChild(innerItemEle);
                }
                else {
                    ele.insertBefore(innerItemEle, itemEle[itemIndex]);
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerItemEle.querySelector('.' + CLS_HEADER), 'focus', _this.focusIn, _this);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(innerItemEle.querySelector('.' + CLS_HEADER), 'blur', _this.focusOut, _this);
                _this.itemAttribUpdate();
                _this.expandedIndices = [];
                _this.expandedItemRefresh(ele);
                if (addItem && addItem.expanded) {
                    _this.expandItem(true, itemIndex);
                }
            });
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Accordion.prototype.expandedItemRefresh = function (ele) {
        var _this = this;
        var itemEle = this.getItemElements();
        [].slice.call(itemEle).forEach(function (el) {
            if (el.classList.contains(CLS_SLCTED)) {
                _this.expandedItemsPush(el);
            }
        });
    };
    /**
     * Dynamically removes item from Accordion.
     * @param  {number} index - Number value that determines which item should be removed.
     * @returns void.
     */
    Accordion.prototype.removeItem = function (index) {
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate(['headerTemplate', 'itemTemplate'], index);
        }
        var itemEle = this.getItemElements();
        var ele = itemEle[index];
        var items = this.getItems();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
            return;
        }
        this.restoreContent(index);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
        items.splice(index, 1);
        this.itemAttribUpdate();
        this.expandedIndices = [];
        this.expandedItemRefresh(this.element);
    };
    /**
     * Sets focus to the specified index item header in Accordion.
     * @param  {number} index - Number value that determines which item should be focused.
     * @returns void.
     */
    Accordion.prototype.select = function (index) {
        var itemEle = this.getItemElements();
        var ele = itemEle[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, ele))) {
            return;
        }
        ele.children[0].focus();
    };
    /**
     * Shows or hides the specified item from Accordion.
     * @param  {number} index - Number value that determines which item should be hidden/shown.
     * @param  {Boolean} isHidden - Boolean value that determines the action either hide (true) or show (false). Default value is false.
     *  If the `isHidden` value is false, the item is shown or else item it is hidden.
     * @returns void.
     */
    Accordion.prototype.hideItem = function (index, isHidden) {
        var itemEle = this.getItemElements();
        var ele = itemEle[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
            return;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(isHidden)) {
            isHidden = true;
        }
        isHidden ? this.add(ele, CLS_ITEMHIDE) : this.remove(ele, CLS_ITEMHIDE);
    };
    /**
     * Enables/Disables the specified Accordion item.
     * @param  {number} index - Number value that determines which item should be enabled/disabled.
     * @param  {boolean} isEnable - Boolean value that determines the action as enable (true) or disable (false).
     * If the `isEnable` value is true, the item is enabled or else it is disabled.
     * @returns void.
     */
    Accordion.prototype.enableItem = function (index, isEnable) {
        var itemEle = this.getItemElements();
        var ele = itemEle[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
            return;
        }
        var eleHeader = ele.firstElementChild;
        if (isEnable) {
            this.remove(ele, CLS_DISABLE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(eleHeader, { 'tabindex': '0', 'aria-disabled': 'false' });
            eleHeader.focus();
        }
        else {
            if (ele.classList.contains(CLS_ACTIVE)) {
                this.expandItem(false, index);
                this.eleMoveFocus('movedown', this.element, eleHeader);
            }
            this.add(ele, CLS_DISABLE);
            eleHeader.setAttribute('aria-disabled', 'true');
            eleHeader.removeAttribute('tabindex');
        }
    };
    /**
     * Refresh the Accordion component.
     * @returns void.
     */
    Accordion.prototype.refresh = function () {
        if (!this.isServerRendered) {
            _super.prototype.refresh.call(this);
        }
    };
    /**
     * Expands/Collapses the specified Accordion item.
     * @param  {boolean} isExpand - Boolean value that determines the action as expand or collapse.
     * @param  {number} index - Number value that determines which item should be expanded/collapsed.`index` is optional parameter.
     *  Without Specifying index, based on the `isExpand` value all Accordion item can be expanded or collapsed.
     * @returns void.
     */
    Accordion.prototype.expandItem = function (isExpand, index) {
        var _this = this;
        var itemEle = this.getItemElements();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            if (this.expandMode === 'Single' && isExpand) {
                var ele = itemEle[itemEle.length - 1];
                this.itemExpand(isExpand, ele, this.getIndexByItem(ele));
            }
            else {
                var item = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + this.lastActiveItemId, this.element);
                [].slice.call(itemEle).forEach(function (el) {
                    _this.itemExpand(isExpand, el, _this.getIndexByItem(el));
                    el.classList.remove(CLS_EXPANDSTATE);
                });
                var expandedItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_EXPANDSTATE, this.element);
                if (expandedItem) {
                    expandedItem.classList.remove(CLS_EXPANDSTATE);
                }
                if (item) {
                    item.classList.add(CLS_EXPANDSTATE);
                }
            }
        }
        else {
            var ele = itemEle[index];
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) || !ele.classList.contains(CLS_SLCT) || (ele.classList.contains(CLS_ACTIVE) && isExpand)) {
                return;
            }
            else {
                if (this.expandMode === 'Single') {
                    this.expandItem(false);
                }
                this.itemExpand(isExpand, ele, index);
            }
        }
    };
    Accordion.prototype.itemExpand = function (isExpand, ele, index) {
        var _this = this;
        var ctn = ele.children[1];
        if (ele.classList.contains(CLS_DISABLE)) {
            return;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ctn) && isExpand) {
            if (!this.isServerRendered) {
                ctn = this.contentRendering(index);
                ele.appendChild(ctn);
                this.ariaAttrUpdate(ele);
                this.expand(ctn);
            }
            else {
                var id = ele.id;
                if (this.items.length > 0) {
                    // tslint:disable-next-line:no-any
                    this.interopAdaptor.invokeMethodAsync('OnItemClick', index).then(function () {
                        if (_this.isDestroyed) {
                            return;
                        }
                        ctn = ele.children[1];
                        _this.expand(ctn);
                    });
                }
                else {
                    // tslint:disable-next-line:no-any
                    this.interopAdaptor.invokeMethodAsync('OnDataClick', id).then(function () {
                        if (_this.isDestroyed) {
                            return;
                        }
                        ctn = ele.children[1];
                        _this.expand(ctn);
                    });
                }
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ctn)) {
            isExpand ? this.expand(ctn) : this.collapse(ctn);
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Accordion.prototype.destroyItems = function () {
        this.restoreContent(null);
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) { Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(el); });
    };
    Accordion.prototype.restoreContent = function (index) {
        var ctnElePos;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            ctnElePos = this.element;
        }
        else {
            ctnElePos = this.element.querySelectorAll('.' + CLS_ITEM)[index];
        }
        this.templateEle.forEach(function (eleStr) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ctnElePos.querySelector(eleStr))) {
                document.body.appendChild(ctnElePos.querySelector(eleStr)).style.display = 'none';
            }
        });
    };
    Accordion.prototype.updateItem = function (item, index) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            var items = this.getItems();
            var itemObj = items[index];
            items.splice(index, 1);
            this.restoreContent(index);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(item);
            this.addItem(itemObj, index);
        }
    };
    Accordion.prototype.setTemplate = function (template, toElement, index) {
        toElement.innerHTML = '';
        this.templateCompile(toElement, template, index);
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    // tslint:disable-next-line
    Accordion.prototype.templateCompile = function (ele, cnt, index) {
        var tempEle = this.createElement('div');
        this.fetchElement(tempEle, cnt, index, false);
        if (tempEle.childNodes.length !== 0) {
            [].slice.call(tempEle.childNodes).forEach(function (childEle) {
                ele.appendChild(childEle);
            });
        }
    };
    Accordion.prototype.getPersistData = function () {
        var keyEntity = ['expandedIndices'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Gets called when the model property changes.The data that describes the old and new values of the property that changed.
     * @param  {AccordionModel} newProp
     * @param  {AccordionModel} oldProp
     * @returns void
     * @private
     */
    Accordion.prototype.onPropertyChanged = function (newProp, oldProp) {
        var acrdn = this.element;
        var isRefresh = false;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'items':
                    if (this.isServerRendered) {
                        this.wireFocusEvents();
                        break;
                    }
                    if (!(newProp.items instanceof Array && oldProp.items instanceof Array)) {
                        var changedProp = Object.keys(newProp.items);
                        for (var j = 0; j < changedProp.length; j++) {
                            var index = parseInt(Object.keys(newProp.items)[j], 10);
                            var property = Object.keys(newProp.items[index])[0];
                            var item = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element)[index];
                            var oldVal = Object(oldProp.items[index])[property];
                            var newVal = Object(newProp.items[index])[property];
                            var temp = property;
                            if (temp === 'header' || temp === 'iconCss' || temp === 'expanded' || ((temp === 'content') && (oldVal === ''))) {
                                this.updateItem(item, index);
                            }
                            if (property === 'cssClass' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                                item.classList.remove(oldVal);
                                item.classList.add(newVal);
                            }
                            if (property === 'visible' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                                (Object(newProp.items[index])[property] === false) ? item.classList.add(CLS_ITEMHIDE) : item.classList.remove(CLS_ITEMHIDE);
                            }
                            if (property === 'disabled' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                                this.enableItem(index, !newVal);
                            }
                            if (property === 'content' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) && item.children.length === 2) {
                                if (typeof newVal === 'function') {
                                    var activeContent = item.querySelector('.' + CLS_CTENT);
                                    activeContent.innerHTML = '';
                                    this.setTemplate(newVal, activeContent, index);
                                }
                                else {
                                    if (item.classList.contains(CLS_SLCTED)) {
                                        this.expandItem(false, index);
                                    }
                                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(item.querySelector('.' + CLS_CONTENT));
                                }
                            }
                        }
                    }
                    else {
                        isRefresh = true;
                    }
                    break;
                case 'dataSource':
                case 'expandedIndices':
                    if (this.expandedIndices === null) {
                        this.expandedIndices = [];
                    }
                    isRefresh = true;
                    break;
                case 'headerTemplate':
                    this.initializeheaderTemplate();
                    isRefresh = true;
                    break;
                case 'itemTemplate':
                    this.initializeItemTemplate();
                    isRefresh = true;
                    break;
                case 'enableRtl':
                    newProp.enableRtl ? this.add(acrdn, CLS_RTL) : this.remove(acrdn, CLS_RTL);
                    break;
                case 'height':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height) });
                    break;
                case 'width':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width) });
                    break;
                case 'expandMode':
                    if (newProp.expandMode === 'Single') {
                        this.element.setAttribute('aria-multiselectable', 'false');
                        if (this.expandedIndices.length > 1) {
                            this.expandItem(false);
                        }
                    }
                    else {
                        this.element.setAttribute('aria-multiselectable', 'true');
                    }
                    break;
            }
        }
        if (isRefresh && !this.isServerRendered) {
            this.initExpand = [];
            if (this.expandedIndices.length > 0) {
                this.initExpand = this.expandedIndices;
            }
            this.destroyItems();
            this.renderItems();
            this.initItemExpand();
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], AccordionItem)
    ], Accordion.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], Accordion.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Accordion.prototype, "itemTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Accordion.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], Accordion.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Accordion.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], Accordion.prototype, "expandedIndices", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Multiple')
    ], Accordion.prototype, "expandMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Accordion.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, AccordionAnimationSettings)
    ], Accordion.prototype, "animation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Accordion.prototype, "clicked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Accordion.prototype, "expanding", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Accordion.prototype, "expanded", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Accordion.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Accordion.prototype, "destroyed", void 0);
    Accordion = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Accordion);
    return Accordion;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/index.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/index.js ***!
  \**************************************************************************/
/*! exports provided: AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _accordion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accordion */ "./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/accordion.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionActionSettings", function() { return _accordion__WEBPACK_IMPORTED_MODULE_0__["AccordionActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionAnimationSettings", function() { return _accordion__WEBPACK_IMPORTED_MODULE_0__["AccordionAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionItem", function() { return _accordion__WEBPACK_IMPORTED_MODULE_0__["AccordionItem"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _accordion__WEBPACK_IMPORTED_MODULE_0__["Accordion"]; });

/**
 * Accordion all modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js ***!
  \**************************************************************************/
/*! exports provided: HScroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HScroll", function() { return HScroll; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var CLS_ROOT = 'e-hscroll';
var CLS_RTL = 'e-rtl';
var CLS_DISABLE = 'e-overlay';
var CLS_HSCROLLBAR = 'e-hscroll-bar';
var CLS_HSCROLLCON = 'e-hscroll-content';
var CLS_NAVARROW = 'e-nav-arrow';
var CLS_NAVRIGHTARROW = 'e-nav-right-arrow';
var CLS_NAVLEFTARROW = 'e-nav-left-arrow';
var CLS_HSCROLLNAV = 'e-scroll-nav';
var CLS_HSCROLLNAVRIGHT = 'e-scroll-right-nav';
var CLS_HSCROLLNAVLEFT = 'e-scroll-left-nav';
var CLS_DEVICE = 'e-scroll-device';
var CLS_OVERLAY = 'e-scroll-overlay';
var CLS_RIGHTOVERLAY = 'e-scroll-right-overlay';
var CLS_LEFTOVERLAY = 'e-scroll-left-overlay';
var OVERLAY_MAXWID = 40;
/**
 * HScroll module is introduces horizontal scroller when content exceeds the current viewing area.
 * It can be useful for the components like Toolbar, Tab which needs horizontal scrolling alone.
 * Hidden content can be view by touch moving or icon click.
 * ```html
 * <div id="scroll"/>
 * <script>
 *   var scrollObj = new HScroll();
 *   scrollObj.appendTo("#scroll");
 * </script>
 * ```
 */
var HScroll = /** @__PURE__ @class */ (function (_super) {
    __extends(HScroll, _super);
    /**
     * Initializes a new instance of the HScroll class.
     * @param options  - Specifies HScroll model properties as options.
     * @param element  - Specifies the element for which horizontal scrolling applies.
     */
    function HScroll(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Initialize the event handler
     * @private
     */
    HScroll.prototype.preRender = function () {
        this.browser = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name;
        this.browserCheck = this.browser === 'mozilla';
        this.isDevice = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice;
        this.customStep = true;
        var element = this.element;
        this.ieCheck = this.browser === 'edge' || this.browser === 'msie';
        this.initialize();
        if (element.id === '') {
            element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('hscroll');
            this.uniqueId = true;
        }
        element.style.display = 'block';
        if (this.enableRtl) {
            element.classList.add(CLS_RTL);
        }
    };
    /**
     * To Initialize the horizontal scroll  rendering
     * @private
     */
    HScroll.prototype.render = function () {
        this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, { scroll: this.touchHandler.bind(this), swipe: this.swipeHandler.bind(this) });
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.scrollEle, 'scroll', this.scrollHandler, this);
        if (!this.isDevice) {
            this.createNavIcon(this.element);
        }
        else {
            this.element.classList.add(CLS_DEVICE);
            this.createOverlay(this.element);
        }
        this.setScrollState();
    };
    HScroll.prototype.setScrollState = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollStep) || this.scrollStep < 0) {
            this.scrollStep = this.scrollEle.offsetWidth;
            this.customStep = false;
        }
        else {
            this.customStep = true;
        }
    };
    HScroll.prototype.initialize = function () {
        var scrollEle = this.createElement('div', { className: CLS_HSCROLLCON });
        var scrollDiv = this.createElement('div', { className: CLS_HSCROLLBAR });
        scrollDiv.setAttribute('tabindex', '-1');
        var ele = this.element;
        var innerEle = [].slice.call(ele.children);
        for (var _i = 0, innerEle_1 = innerEle; _i < innerEle_1.length; _i++) {
            var ele_1 = innerEle_1[_i];
            scrollEle.appendChild(ele_1);
        }
        scrollDiv.appendChild(scrollEle);
        ele.appendChild(scrollDiv);
        scrollDiv.style.overflowX = 'hidden';
        this.scrollEle = scrollDiv;
        this.scrollItems = scrollEle;
    };
    HScroll.prototype.getPersistData = function () {
        var keyEntity = ['scrollStep'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    HScroll.prototype.getModuleName = function () {
        return 'hScroll';
    };
    /**
     * Removes the control from the DOM and also removes all its related events.
     * @returns void
     */
    HScroll.prototype.destroy = function () {
        var ele = this.element;
        ele.style.display = '';
        ele.classList.remove(CLS_ROOT);
        ele.classList.remove(CLS_DEVICE);
        var nav = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-' + ele.id + '_nav.' + CLS_HSCROLLNAV, ele);
        var overlay = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_OVERLAY, ele);
        [].slice.call(overlay).forEach(function (ele) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
        });
        for (var _i = 0, _a = [].slice.call(this.scrollItems.children); _i < _a.length; _i++) {
            var elem = _a[_i];
            ele.appendChild(elem);
        }
        if (this.uniqueId) {
            this.element.removeAttribute('id');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.scrollEle);
        if (nav.length > 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(nav[0]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nav[1])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(nav[1]);
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.scrollEle, 'scroll', this.scrollHandler);
        this.touchModule.destroy();
        this.touchModule = null;
        _super.prototype.destroy.call(this);
    };
    /**
     * Specifies the value to disable/enable the HScroll component.
     * When set to `true` , the component will be disabled.
     * @param  {boolean} value - Based on this Boolean value, HScroll will be enabled (false) or disabled (true).
     * @returns void.
     */
    HScroll.prototype.disable = function (value) {
        var navEles = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-scroll-nav:not(.' + CLS_DISABLE + ')', this.element);
        value ? this.element.classList.add(CLS_DISABLE) : this.element.classList.remove(CLS_DISABLE);
        [].slice.call(navEles).forEach(function (el) {
            el.setAttribute('tabindex', !value ? '0' : '-1');
        });
    };
    HScroll.prototype.createOverlay = function (element) {
        var id = element.id.concat('_nav');
        var rightOverlayEle = this.createElement('div', { className: CLS_OVERLAY + ' ' + CLS_RIGHTOVERLAY });
        var clsRight = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVRIGHT);
        var rightEle = this.createElement('div', { id: id.concat('_right'), className: clsRight });
        var navItem = this.createElement('div', { className: CLS_NAVRIGHTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        rightEle.appendChild(navItem);
        var leftEle = this.createElement('div', { className: CLS_OVERLAY + ' ' + CLS_LEFTOVERLAY });
        if (this.ieCheck) {
            rightEle.classList.add('e-ie-align');
        }
        element.appendChild(rightOverlayEle);
        element.appendChild(rightEle);
        element.insertBefore(leftEle, element.firstChild);
        this.eventBinding([rightEle]);
    };
    HScroll.prototype.createNavIcon = function (element) {
        var id = element.id.concat('_nav');
        var clsRight = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVRIGHT);
        var nav = this.createElement('div', { id: id.concat('_right'), className: clsRight });
        nav.setAttribute('aria-disabled', 'false');
        var navItem = this.createElement('div', { className: CLS_NAVRIGHTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        var clsLeft = 'e-' + element.id.concat('_nav ' + CLS_HSCROLLNAV + ' ' + CLS_HSCROLLNAVLEFT);
        var navEle = this.createElement('div', { id: id.concat('_left'), className: clsLeft + ' ' + CLS_DISABLE });
        navEle.setAttribute('aria-disabled', 'true');
        var navLeftItem = this.createElement('div', { className: CLS_NAVLEFTARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        navEle.appendChild(navLeftItem);
        nav.appendChild(navItem);
        element.appendChild(nav);
        element.insertBefore(navEle, element.firstChild);
        if (this.ieCheck) {
            nav.classList.add('e-ie-align');
            navEle.classList.add('e-ie-align');
        }
        this.eventBinding([nav, navEle]);
    };
    HScroll.prototype.onKeyPress = function (e) {
        var _this = this;
        if (e.key === 'Enter') {
            var timeoutFun_1 = function () {
                _this.keyTimeout = true;
                _this.eleScrolling(10, e.target, true);
            };
            this.keyTimer = window.setTimeout(function () {
                timeoutFun_1();
            }, 100);
        }
    };
    HScroll.prototype.onKeyUp = function (e) {
        if (e.key !== 'Enter') {
            return;
        }
        if (this.keyTimeout) {
            this.keyTimeout = false;
        }
        else {
            e.target.click();
        }
        clearTimeout(this.keyTimer);
    };
    HScroll.prototype.eventBinding = function (ele) {
        var _this = this;
        [].slice.call(ele).forEach(function (el) {
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](el, { tapHold: _this.tabHoldHandler.bind(_this), tapHoldThreshold: 500 });
            el.addEventListener('keydown', _this.onKeyPress.bind(_this));
            el.addEventListener('keyup', _this.onKeyUp.bind(_this));
            el.addEventListener('mouseup', _this.repeatScroll.bind(_this));
            el.addEventListener('touchend', _this.repeatScroll.bind(_this));
            el.addEventListener('contextmenu', function (e) {
                e.preventDefault();
            });
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(el, 'click', _this.clickEventHandler, _this);
        });
    };
    HScroll.prototype.repeatScroll = function () {
        clearInterval(this.timeout);
    };
    HScroll.prototype.tabHoldHandler = function (e) {
        var _this = this;
        var trgt = e.originalEvent.target;
        trgt = this.contains(trgt, CLS_HSCROLLNAV) ? trgt.firstElementChild : trgt;
        var scrollDis = 10;
        var timeoutFun = function () {
            _this.eleScrolling(scrollDis, trgt, true);
        };
        this.timeout = window.setInterval(function () {
            timeoutFun();
        }, 50);
    };
    HScroll.prototype.contains = function (ele, className) {
        return ele.classList.contains(className);
    };
    HScroll.prototype.eleScrolling = function (scrollDis, trgt, isContinuous) {
        var element = this.scrollEle;
        var rootEle = this.element;
        var classList = trgt.classList;
        if (classList.contains(CLS_HSCROLLNAV)) {
            classList = trgt.querySelector('.' + CLS_NAVARROW).classList;
        }
        if (this.contains(rootEle, CLS_RTL) && this.browserCheck) {
            scrollDis = -scrollDis;
        }
        var scrlLeft = element.scrollLeft;
        if ((!this.contains(rootEle, CLS_RTL) || this.browserCheck) || this.ieCheck) {
            if (classList.contains(CLS_NAVRIGHTARROW)) {
                this.frameScrollRequest(scrollDis, 'add', isContinuous);
            }
            else {
                this.frameScrollRequest(scrollDis, '', isContinuous);
            }
        }
        else {
            if (classList.contains(CLS_NAVLEFTARROW)) {
                this.frameScrollRequest(scrollDis, 'add', isContinuous);
            }
            else {
                this.frameScrollRequest(scrollDis, '', isContinuous);
            }
        }
    };
    HScroll.prototype.clickEventHandler = function (e) {
        this.eleScrolling(this.scrollStep, e.target, false);
    };
    HScroll.prototype.swipeHandler = function (e) {
        var swipeEle = this.scrollEle;
        var distance;
        if (e.velocity <= 1) {
            distance = e.distanceX / (e.velocity * 10);
        }
        else {
            distance = e.distanceX / e.velocity;
        }
        var start = 0.5;
        var animate = function () {
            var step = Math.sin(start);
            if (step <= 0) {
                window.cancelAnimationFrame(step);
            }
            else {
                if (e.swipeDirection === 'Left') {
                    swipeEle.scrollLeft += distance * step;
                }
                else if (e.swipeDirection === 'Right') {
                    swipeEle.scrollLeft -= distance * step;
                }
                start -= 0.5;
                window.requestAnimationFrame(animate);
            }
        };
        animate();
    };
    HScroll.prototype.scrollUpdating = function (scrollVal, action) {
        if (action === 'add') {
            this.scrollEle.scrollLeft += scrollVal;
        }
        else {
            this.scrollEle.scrollLeft -= scrollVal;
        }
    };
    HScroll.prototype.frameScrollRequest = function (scrollVal, action, isContinuous) {
        var _this = this;
        var step = 10;
        if (isContinuous) {
            this.scrollUpdating(scrollVal, action);
            return;
        }
        if (!this.customStep) {
            [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_OVERLAY, this.element)).forEach(function (el) {
                scrollVal -= el.offsetWidth;
            });
        }
        var animate = function () {
            var scrollValue;
            var scrollStep;
            if (_this.contains(_this.element, CLS_RTL) && _this.browserCheck) {
                scrollValue = -scrollVal;
                scrollStep = -step;
            }
            else {
                scrollValue = scrollVal;
                scrollStep = step;
            }
            if (scrollValue < step) {
                window.cancelAnimationFrame(scrollStep);
            }
            else {
                _this.scrollUpdating(scrollStep, action);
                scrollVal -= scrollStep;
                window.requestAnimationFrame(animate);
            }
        };
        animate();
    };
    HScroll.prototype.touchHandler = function (e) {
        var ele = this.scrollEle;
        var distance;
        distance = e.distanceX;
        if ((this.ieCheck) && this.contains(this.element, CLS_RTL)) {
            distance = -distance;
        }
        if (e.scrollDirection === 'Left') {
            ele.scrollLeft = ele.scrollLeft + distance;
        }
        else if (e.scrollDirection === 'Right') {
            ele.scrollLeft = ele.scrollLeft - distance;
        }
    };
    HScroll.prototype.arrowDisabling = function (addDisable, removeDisable) {
        if (this.isDevice) {
            var arrowEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(addDisable) ? removeDisable : addDisable;
            var arrowIcon = arrowEle.querySelector('.' + CLS_NAVARROW);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(addDisable)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(arrowIcon, [CLS_NAVRIGHTARROW], [CLS_NAVLEFTARROW]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(arrowIcon, [CLS_NAVLEFTARROW], [CLS_NAVRIGHTARROW]);
            }
        }
        else {
            addDisable.classList.add(CLS_DISABLE);
            addDisable.setAttribute('aria-disabled', 'true');
            addDisable.removeAttribute('tabindex');
            removeDisable.classList.remove(CLS_DISABLE);
            removeDisable.setAttribute('aria-disabled', 'false');
            removeDisable.setAttribute('tabindex', '0');
        }
        this.repeatScroll();
    };
    HScroll.prototype.scrollHandler = function (e) {
        var target = e.target;
        var width = target.offsetWidth;
        var rootEle = this.element;
        var navLeftEle = this.element.querySelector('.' + CLS_HSCROLLNAVLEFT);
        var navRightEle = this.element.querySelector('.' + CLS_HSCROLLNAVRIGHT);
        var leftOverlay = this.element.querySelector('.' + CLS_LEFTOVERLAY);
        var rightOverlay = this.element.querySelector('.' + CLS_RIGHTOVERLAY);
        var scrollLeft = target.scrollLeft;
        if (scrollLeft <= 0) {
            scrollLeft = -scrollLeft;
        }
        if (this.isDevice) {
            if (this.enableRtl && !(this.browserCheck || this.ieCheck)) {
                leftOverlay = this.element.querySelector('.' + CLS_RIGHTOVERLAY);
                rightOverlay = this.element.querySelector('.' + CLS_LEFTOVERLAY);
            }
            if (scrollLeft < OVERLAY_MAXWID) {
                leftOverlay.style.width = scrollLeft + 'px';
            }
            else {
                leftOverlay.style.width = '40px';
            }
            if ((target.scrollWidth - Math.ceil(width + scrollLeft)) < OVERLAY_MAXWID) {
                rightOverlay.style.width = (target.scrollWidth - Math.ceil(width + scrollLeft)) + 'px';
            }
            else {
                rightOverlay.style.width = '40px';
            }
        }
        if (scrollLeft === 0) {
            if ((!this.contains(rootEle, CLS_RTL) || this.browserCheck) || this.ieCheck) {
                this.arrowDisabling(navLeftEle, navRightEle);
            }
            else {
                this.arrowDisabling(navRightEle, navLeftEle);
            }
        }
        else if (Math.ceil(width + scrollLeft + .1) >= target.scrollWidth) {
            if ((!this.contains(rootEle, CLS_RTL) || this.browserCheck) || this.ieCheck) {
                this.arrowDisabling(navRightEle, navLeftEle);
            }
            else {
                this.arrowDisabling(navLeftEle, navRightEle);
            }
        }
        else {
            var disEle = this.element.querySelector('.' + CLS_HSCROLLNAV + '.' + CLS_DISABLE);
            if (disEle) {
                disEle.classList.remove(CLS_DISABLE);
                disEle.setAttribute('aria-disabled', 'false');
                disEle.setAttribute('tabindex', '0');
            }
        }
    };
    /**
     * Gets called when the model property changes.The data that describes the old and new values of property that changed.
     * @param  {HScrollModel} newProp
     * @param  {HScrollModel} oldProp
     * @returns void
     * @private
     */
    HScroll.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'scrollStep':
                    this.setScrollState();
                    break;
                case 'enableRtl':
                    newProp.enableRtl ? this.element.classList.add(CLS_RTL) : this.element.classList.remove(CLS_RTL);
                    break;
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], HScroll.prototype, "scrollStep", void 0);
    HScroll = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], HScroll);
    return HScroll;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/index.js":
/*!***********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/common/index.js ***!
  \***********************************************************************/
/*! exports provided: HScroll, VScroll, MenuAnimationSettings, MenuItem, addScrolling, destroyScroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _h_scroll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./h-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HScroll", function() { return _h_scroll__WEBPACK_IMPORTED_MODULE_0__["HScroll"]; });

/* harmony import */ var _v_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScroll", function() { return _v_scroll__WEBPACK_IMPORTED_MODULE_1__["VScroll"]; });

/* harmony import */ var _menu_scroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./menu-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-scroll.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addScrolling", function() { return _menu_scroll__WEBPACK_IMPORTED_MODULE_2__["addScrolling"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "destroyScroll", function() { return _menu_scroll__WEBPACK_IMPORTED_MODULE_2__["destroyScroll"]; });

/* harmony import */ var _menu_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./menu-base */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuAnimationSettings", function() { return _menu_base__WEBPACK_IMPORTED_MODULE_3__["MenuAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return _menu_base__WEBPACK_IMPORTED_MODULE_3__["MenuItem"]; });

/**
 * Navigation Common modules
 */







/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-base.js":
/*!***************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-base.js ***!
  \***************************************************************************/
/*! exports provided: FieldSettings, MenuItem, MenuAnimationSettings, MenuBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldSettings", function() { return FieldSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return MenuItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuAnimationSettings", function() { return MenuAnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuBase", function() { return MenuBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _common_h_scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/h-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js");
/* harmony import */ var _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/v-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js");
/* harmony import */ var _common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/menu-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-scroll.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};












var ENTER = 'enter';
var ESCAPE = 'escape';
var FOCUSED = 'e-focused';
var HEADER = 'e-menu-header';
var SELECTED = 'e-selected';
var SEPARATOR = 'e-separator';
var UPARROW = 'uparrow';
var DOWNARROW = 'downarrow';
var LEFTARROW = 'leftarrow';
var RIGHTARROW = 'rightarrow';
var HOME = 'home';
var END = 'end';
var CARET = 'e-caret';
var ITEM = 'e-menu-item';
var DISABLED = 'e-disabled';
var HIDE = 'e-menu-hide';
var ICONS = 'e-icons';
var RTL = 'e-rtl';
var POPUP = 'e-menu-popup';
var TEMPLATE_PROPERTY = 'Template';
/**
 * Configures the field options of the Menu.
 */
var FieldSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(FieldSettings, _super);
    function FieldSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('id')
    ], FieldSettings.prototype, "itemId", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('parentId')
    ], FieldSettings.prototype, "parentId", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('text')
    ], FieldSettings.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('iconCss')
    ], FieldSettings.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('url')
    ], FieldSettings.prototype, "url", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('separator')
    ], FieldSettings.prototype, "separator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('items')
    ], FieldSettings.prototype, "children", void 0);
    return FieldSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Specifies menu items.
 */
var MenuItem = /** @__PURE__ @class */ (function (_super) {
    __extends(MenuItem, _super);
    function MenuItem() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MenuItem.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuItem.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MenuItem.prototype, "separator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], MenuItem)
    ], MenuItem.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuItem.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuItem.prototype, "url", void 0);
    return MenuItem;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Animation configuration settings.
 */
var MenuAnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(MenuAnimationSettings, _super);
    function MenuAnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('SlideDown')
    ], MenuAnimationSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(400)
    ], MenuAnimationSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('ease')
    ], MenuAnimationSettings.prototype, "easing", void 0);
    return MenuAnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * @private
 * Base class for Menu and ContextMenu components.
 */
var MenuBase = /** @__PURE__ @class */ (function (_super) {
    __extends(MenuBase, _super);
    /**
     * Constructor for creating the widget.
     * @private
     */
    function MenuBase(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.navIdx = [];
        _this.animation = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"]({});
        _this.isTapHold = false;
        _this.tempItem = [];
        return _this;
    }
    /**
     * Initialized third party configuration settings.
     * @private
     */
    MenuBase.prototype.preRender = function () {
        if (!this.isMenu) {
            var ul = void 0;
            if (this.element.tagName === 'EJS-CONTEXTMENU') {
                ul = this.createElement('ul', {
                    id: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(this.getModuleName()), className: 'e-control e-lib e-' + this.getModuleName()
                });
                var ejInst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', this.element);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], ['e-control', 'e-lib', 'e-' + this.getModuleName()]);
                this.clonedElement = this.element;
                this.element = ul;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInst, this.element);
            }
            else {
                ul = this.createElement('ul', { id: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(this.getModuleName()) });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(this.element.cloneNode(true).children), ul);
                var refEle = this.element.nextElementSibling;
                refEle ? this.element.parentElement.insertBefore(ul, refEle) : this.element.parentElement.appendChild(ul);
                this.clonedElement = ul;
            }
            this.clonedElement.style.display = 'none';
        }
        if (this.element.tagName === 'EJS-MENU') {
            var ele = this.element;
            var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', ele);
            var ul = this.createElement('ul');
            var wrapper = this.createElement('EJS-MENU', { className: 'e-' + this.getModuleName() + '-wrapper' });
            for (var idx = 0, len = ele.attributes.length; idx < len; idx++) {
                ul.setAttribute(ele.attributes[idx].nodeName, ele.attributes[idx].nodeValue);
            }
            ele.parentNode.insertBefore(wrapper, ele);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
            ele = ul;
            wrapper.appendChild(ele);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, ele);
            this.clonedElement = wrapper;
            this.element = ele;
            if (!this.element.id) {
                this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(this.getModuleName());
            }
        }
    };
    /**
     * Initialize the control rendering
     * @private
     */
    MenuBase.prototype.render = function () {
        this.initialize();
        this.renderItems();
        if (this.isMenu && this.template && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var menuTemplateId = this.element.id + TEMPLATE_PROPERTY;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(menuTemplateId, TEMPLATE_PROPERTY);
            if (Object.keys(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"]).length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.tempItem, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"][menuTemplateId], [], true);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(menuTemplateId, TEMPLATE_PROPERTY, this);
        }
        this.wireEvents();
        this.renderComplete();
    };
    MenuBase.prototype.initialize = function () {
        var wrapper = this.getWrapper();
        if (!wrapper) {
            wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-wrapper' });
            if (this.isMenu) {
                this.element.parentElement.insertBefore(wrapper, this.element);
            }
            else {
                document.body.appendChild(wrapper);
            }
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], this.cssClass.split(' '));
        }
        if (this.enableRtl) {
            wrapper.classList.add(RTL);
        }
        wrapper.appendChild(this.element);
        if (this.isMenu && this.hamburgerMode) {
            if (!this.target) {
                this.createHeaderContainer(wrapper);
            }
        }
    };
    MenuBase.prototype.renderItems = function () {
        if (!this.items.length) {
            var items = _ej2_lists__WEBPACK_IMPORTED_MODULE_1__["ListBase"].createJsonFromElement(this.element, { fields: { child: 'items' } });
            this.setProperties({ items: items }, true);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.element = this.removeChildElement(this.element);
            }
            else {
                this.element.innerHTML = '';
            }
        }
        var ul = this.createItems(this.items);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(Array.prototype.slice.call(ul.children), this.element);
        this.element.classList.add('e-menu-parent');
        if (this.isMenu) {
            if (!this.hamburgerMode && this.element.classList.contains('e-vertical')) {
                this.setBlankIconStyle(this.element);
            }
            if (this.enableScrolling) {
                var wrapper = this.getWrapper();
                this.element.classList.contains('e-vertical') ?
                    Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(this.createElement, wrapper, this.element, 'vscroll', this.enableRtl)
                    : Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(this.createElement, wrapper, this.element, 'hscroll', this.enableRtl);
            }
        }
    };
    MenuBase.prototype.wireEvents = function () {
        var wrapper = this.getWrapper();
        if (this.target) {
            var target = void 0;
            var targetElems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(this.target);
            for (var i = 0, len = targetElems.length; i < len; i++) {
                target = targetElems[i];
                if (this.isMenu) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'click', this.menuHeaderClickHandler, this);
                }
                else {
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIos) {
                        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](target, { tapHold: this.touchHandler.bind(this) });
                    }
                    else {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'contextmenu', this.cmenuHandler, this);
                    }
                }
            }
            this.targetElement = target;
            if (!this.isMenu) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.targetElement, 'scroll', this.scrollHandler, this);
                for (var _i = 0, _a = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["getScrollableParent"])(this.targetElement); _i < _a.length; _i++) {
                    var parent_1 = _a[_i];
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(parent_1, 'scroll', this.scrollHandler, this);
                }
            }
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.delegateMoverHandler = this.moverHandler.bind(this);
            this.delegateMouseDownHandler = this.mouseDownHandler.bind(this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.isMenu ? document : wrapper, 'mouseover', this.delegateMoverHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown', this.delegateMouseDownHandler, this);
        }
        this.delegateClickHandler = this.clickHandler.bind(this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'click', this.delegateClickHandler, this);
        this.wireKeyboardEvent(wrapper);
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(wrapper, { selector: '.' + ITEM });
    };
    MenuBase.prototype.wireKeyboardEvent = function (element) {
        var keyConfigs = {
            downarrow: DOWNARROW,
            uparrow: UPARROW,
            enter: ENTER,
            leftarrow: LEFTARROW,
            rightarrow: RIGHTARROW,
            escape: ESCAPE
        };
        if (this.isMenu) {
            keyConfigs.home = HOME;
            keyConfigs.end = END;
        }
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](element, {
            keyAction: this.keyBoardHandler.bind(this),
            keyConfigs: keyConfigs
        });
    };
    MenuBase.prototype.mouseDownHandler = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-' + this.getModuleName() + '-wrapper') !== this.getWrapper()
            && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-' + this.getModuleName() + '-popup'))) {
            this.closeMenu(this.isMenu ? null : this.navIdx.length, e);
        }
    };
    MenuBase.prototype.keyBoardHandler = function (e) {
        var actionName = '';
        var trgt = e.target;
        var actionNeeded = this.isMenu && !this.hamburgerMode && !this.element.classList.contains('e-vertical')
            && this.navIdx.length < 1;
        e.preventDefault();
        if (this.enableScrolling && e.keyCode === 13 && trgt.classList.contains('e-scroll-nav')) {
            this.removeLIStateByClass([FOCUSED, SELECTED], [Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.e-' + this.getModuleName() + '-wrapper')]);
        }
        if (actionNeeded) {
            switch (e.action) {
                case RIGHTARROW:
                    actionName = RIGHTARROW;
                    e.action = DOWNARROW;
                    break;
                case LEFTARROW:
                    actionName = LEFTARROW;
                    e.action = UPARROW;
                    break;
                case DOWNARROW:
                    actionName = DOWNARROW;
                    e.action = RIGHTARROW;
                    break;
                case UPARROW:
                    actionName = UPARROW;
                    e.action = '';
                    break;
            }
        }
        else if (this.enableRtl) {
            switch (e.action) {
                case LEFTARROW:
                    actionNeeded = true;
                    actionName = LEFTARROW;
                    e.action = RIGHTARROW;
                    break;
                case RIGHTARROW:
                    actionNeeded = true;
                    actionName = RIGHTARROW;
                    e.action = LEFTARROW;
                    break;
            }
        }
        switch (e.action) {
            case DOWNARROW:
            case UPARROW:
            case END:
            case HOME:
                this.upDownKeyHandler(e);
                break;
            case RIGHTARROW:
                this.rightEnterKeyHandler(e);
                break;
            case LEFTARROW:
                this.leftEscKeyHandler(e);
                break;
            case ENTER:
                if (this.hamburgerMode && trgt.tagName === 'SPAN' && trgt.classList.contains('e-menu-icon')) {
                    this.menuHeaderClickHandler(e);
                }
                else {
                    this.rightEnterKeyHandler(e);
                }
                break;
            case ESCAPE:
                this.leftEscKeyHandler(e);
                break;
        }
        if (actionNeeded) {
            e.action = actionName;
        }
    };
    MenuBase.prototype.upDownKeyHandler = function (e) {
        var cul = this.getUlByNavIdx();
        var defaultIdx = (e.action === DOWNARROW || e.action === HOME) ? 0 : cul.childElementCount - 1;
        var fliIdx = defaultIdx;
        var fli = this.getLIByClass(cul, FOCUSED);
        if (fli) {
            if (e.action !== END && e.action !== HOME) {
                fliIdx = this.getIdx(cul, fli);
            }
            fli.classList.remove(FOCUSED);
            if (e.action !== END && e.action !== HOME) {
                e.action === DOWNARROW ? fliIdx++ : fliIdx--;
                if (fliIdx === (e.action === DOWNARROW ? cul.childElementCount : -1)) {
                    fliIdx = defaultIdx;
                }
            }
        }
        var cli = cul.children[fliIdx];
        fliIdx = this.isValidLI(cli, fliIdx, e.action);
        cul.children[fliIdx].classList.add(FOCUSED);
        cul.children[fliIdx].focus();
    };
    MenuBase.prototype.isValidLI = function (cli, index, action) {
        var wrapper = this.getWrapper();
        var cul = this.getUlByNavIdx();
        if (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE)) {
            ((action === DOWNARROW) || (action === RIGHTARROW)) ? index++ : index--;
        }
        cli = cul.children[index];
        if (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE)) {
            index = this.isValidLI(cli, index, action);
        }
        return index;
    };
    MenuBase.prototype.getUlByNavIdx = function (navIdxLen) {
        if (navIdxLen === void 0) { navIdxLen = this.navIdx.length; }
        if (this.isMenu) {
            var popup = [this.getWrapper()].concat([].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + POPUP)))[navIdxLen];
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popup) ? null : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-menu-parent', popup);
        }
        else {
            return this.getWrapper().children[navIdxLen];
        }
    };
    MenuBase.prototype.rightEnterKeyHandler = function (e) {
        var eventArgs;
        var cul = this.getUlByNavIdx();
        var fli = this.getLIByClass(cul, FOCUSED);
        if (fli) {
            var fliIdx = this.getIdx(cul, fli);
            var navIdx = this.navIdx.concat(fliIdx);
            var index = void 0;
            var item = this.getItem(navIdx);
            if (item.items.length) {
                this.navIdx.push(fliIdx);
                this.keyType = 'right';
                this.action = e.action;
                this.openMenu(fli, item, -1, -1, e);
            }
            else {
                if (e.action === ENTER) {
                    if (this.isMenu && this.navIdx.length === 0) {
                        this.removeLIStateByClass([SELECTED], [this.getWrapper()]);
                    }
                    else {
                        fli.classList.remove(FOCUSED);
                    }
                    fli.classList.add(SELECTED);
                    eventArgs = { element: fli, item: item, event: e };
                    this.trigger('select', eventArgs);
                    this.closeMenu(null, e);
                }
            }
        }
    };
    MenuBase.prototype.leftEscKeyHandler = function (e) {
        if (this.navIdx.length) {
            this.keyType = 'left';
            this.closeMenu(this.navIdx.length, e);
        }
        else {
            if (e.action === ESCAPE) {
                this.closeMenu(null, e);
            }
        }
    };
    MenuBase.prototype.scrollHandler = function (e) {
        this.closeMenu(null, e);
    };
    MenuBase.prototype.touchHandler = function (e) {
        this.isTapHold = true;
        this.cmenuHandler(e.originalEvent);
    };
    MenuBase.prototype.cmenuHandler = function (e) {
        e.preventDefault();
        this.isCMenu = true;
        this.pageX = e.changedTouches ? e.changedTouches[0].pageX + 1 : e.pageX + 1;
        this.pageY = e.changedTouches ? e.changedTouches[0].pageY + 1 : e.pageY + 1;
        this.closeMenu(null, e);
        if (this.isCMenu) {
            if (this.canOpen(e.target)) {
                this.openMenu(null, null, this.pageY, this.pageX, e);
            }
            this.isCMenu = false;
        }
    };
    // tslint:disable-next-line:max-func-body-length
    MenuBase.prototype.closeMenu = function (ulIndex, e, isIterated) {
        var _this = this;
        if (ulIndex === void 0) { ulIndex = 0; }
        if (e === void 0) { e = null; }
        if (this.isMenuVisible()) {
            var sli = void 0;
            var ul_1;
            var item_1;
            var wrapper = this.getWrapper();
            var beforeCloseArgs = void 0;
            var items_1;
            var popups = this.getPopups();
            var isClose = false;
            var cnt = this.isMenu ? popups.length + 1 : wrapper.childElementCount;
            ul_1 = this.isMenu && cnt !== 1 ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-ul', popups[cnt - 2])
                : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-menu-parent', wrapper)[cnt - 1];
            if (this.isMenu && ul_1.classList.contains('e-menu')) {
                sli = this.getLIByClass(ul_1, SELECTED);
                if (sli) {
                    sli.classList.remove(SELECTED);
                }
                isClose = true;
            }
            if (!isClose) {
                var liElem_1 = e && e.target && this.getLI(e.target);
                item_1 = this.navIdx.length ? this.getItem(this.navIdx) : null;
                items_1 = item_1 ? item_1.items : this.items;
                beforeCloseArgs = { element: ul_1, parentItem: this.isMenu && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getMenuItemModel(item_1, ulIndex) : item_1,
                    items: items_1, event: e, cancel: false, isFocused: true };
                this.trigger('beforeClose', beforeCloseArgs, function (observedCloseArgs) {
                    var popupEle;
                    var closeArgs;
                    var popupId = '';
                    var popupObj;
                    var isOpen = !observedCloseArgs.cancel;
                    if (isOpen || _this.isCMenu) {
                        if (_this.isMenu) {
                            popupEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(ul_1, '.' + POPUP);
                            if (_this.hamburgerMode) {
                                popupEle.parentElement.style.minHeight = '';
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(ul_1, '.e-menu-item').setAttribute('aria-expanded', 'false');
                            }
                            _this.unWireKeyboardEvent(popupEle);
                            Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["destroyScroll"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(popupEle.children[0], _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__["VScroll"]), popupEle.children[0]);
                            popupObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(popupEle, _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Popup"]);
                            popupObj.hide();
                            popupId = popupEle.id;
                            popupObj.destroy();
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(popupEle);
                        }
                        else {
                            _this.toggleAnimation(ul_1, false);
                        }
                        closeArgs = { element: ul_1, parentItem: item_1, items: items_1 };
                        _this.trigger('onClose', closeArgs);
                        _this.navIdx.pop();
                    }
                    _this.updateReactTemplate();
                    var trgtliId;
                    var closedLi;
                    var trgtLi;
                    var trgtpopUp = _this.getWrapper() && _this.getUlByNavIdx();
                    if (_this.isCMenu) {
                        if (_this.canOpen(e.target)) {
                            _this.openMenu(null, null, _this.pageY, _this.pageX, e);
                        }
                        _this.isCMenu = false;
                    }
                    if (_this.isMenu && trgtpopUp && popupId.length) {
                        trgtliId = new RegExp('(.*)-ej2menu-' + _this.element.id + '-popup').exec(popupId)[1];
                        closedLi = trgtpopUp.querySelector('[id="' + trgtliId + '"]');
                        trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
                    }
                    var submenus = liElem_1 && liElem_1.querySelectorAll('.e-menu-item');
                    if (isOpen && _this.hamburgerMode && ulIndex && !(submenus.length)) {
                        _this.afterCloseMenu(e);
                    }
                    else if (isOpen && !_this.hamburgerMode && _this.navIdx.length && closedLi && !trgtLi) {
                        var ele = (e && e.target.classList.contains('e-vscroll'))
                            ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-menu-wrapper') : null;
                        if (ele) {
                            ele = ele.querySelector('.e-menu-item');
                            if (_this.showItemOnClick || (ele && _this.getIndex(ele.id, true).length <= _this.navIdx.length)) {
                                _this.closeMenu(_this.navIdx[_this.navIdx.length - 1], e, true);
                            }
                        }
                        else {
                            _this.closeMenu(_this.navIdx[_this.navIdx.length - 1], e);
                        }
                    }
                    else if (isOpen && !isIterated && !ulIndex && ((_this.hamburgerMode && _this.navIdx.length) ||
                        _this.navIdx.length === 1)) {
                        _this.closeMenu(null, e);
                    }
                    else if (isOpen && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ulIndex) && _this.navIdx.length) {
                        _this.closeMenu(null, e);
                    }
                    else if (isOpen && !_this.isMenu && !ulIndex && _this.navIdx.length === 0 && !_this.isMenusClosed) {
                        _this.isMenusClosed = true;
                        _this.closeMenu(0, e);
                    }
                    else if (isOpen && _this.isMenu && e && e.target &&
                        _this.navIdx.length !== 0 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-menu-parent.e-control')) {
                        _this.closeMenu(0, e);
                    }
                    else {
                        if (isOpen && (_this.keyType === 'right' || _this.keyType === 'click')) {
                            _this.afterCloseMenu(e);
                        }
                        else {
                            var cul = _this.getUlByNavIdx();
                            var sli_1 = _this.getLIByClass(cul, SELECTED);
                            if (sli_1) {
                                sli_1.setAttribute('aria-expanded', 'false');
                                sli_1.classList.remove(SELECTED);
                                if (observedCloseArgs.isFocused && liElem_1) {
                                    sli_1.classList.add(FOCUSED);
                                    sli_1.focus();
                                }
                            }
                            if (!isOpen && _this.hamburgerMode && liElem_1 && liElem_1.getAttribute('aria-expanded') === 'false' &&
                                liElem_1.getAttribute('aria-haspopup') === 'true') {
                                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(liElem_1, '.e-menu-parent.e-control')) {
                                    _this.navIdx = [];
                                }
                                else {
                                    _this.navIdx.pop();
                                }
                                _this.navIdx.push(_this.cliIdx);
                                var item_2 = _this.getItem(_this.navIdx);
                                liElem_1.setAttribute('aria-expanded', 'true');
                                _this.openMenu(liElem_1, item_2, -1, -1, e);
                            }
                        }
                    }
                    _this.removeStateWrapper();
                });
            }
        }
    };
    MenuBase.prototype.updateReactTemplate = function () {
        // tslint:disable
        if (this.isReact && this.template && this.navIdx.length === 0) {
            // tslint:disable
            var portals = this.portals.splice(0, this.items.length);
            this.clearTemplate(['template']);
            // tslint:disable
            this.portals = portals;
            this.renderReactTemplates();
        }
    };
    MenuBase.prototype.getMenuItemModel = function (item, level) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            return null;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(level)) {
            level = 0;
        }
        var fields = this.getFields(level);
        return { text: item[fields.text], id: item[fields.id], items: item[fields.child], separator: item[fields.separator],
            iconCss: item[fields.iconCss], url: item[fields.url] };
    };
    MenuBase.prototype.getPopups = function () {
        var _this = this;
        var popups = [];
        [].slice.call(document.querySelectorAll('.' + POPUP)).forEach(function (elem) {
            if (_this.getIndex(elem.querySelector('.' + ITEM).id, true).length) {
                popups.push(elem);
            }
        });
        return popups;
    };
    MenuBase.prototype.isMenuVisible = function () {
        return (this.navIdx.length > 0 || (this.element.classList.contains('e-contextmenu') && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.element).valueOf()));
    };
    MenuBase.prototype.canOpen = function (target) {
        var canOpen = true;
        if (this.filter) {
            canOpen = false;
            var filter = this.filter.split(' ');
            for (var i = 0, len = filter.length; i < len; i++) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + filter[i])) {
                    canOpen = true;
                    break;
                }
            }
        }
        return canOpen;
    };
    MenuBase.prototype.openMenu = function (li, item, top, left, e, target) {
        if (top === void 0) { top = 0; }
        if (left === void 0) { left = 0; }
        if (e === void 0) { e = null; }
        if (target === void 0) { target = this.targetElement; }
        var eventArgs;
        var wrapper = this.getWrapper();
        this.lItem = li;
        var elemId = this.element.id !== '' ? this.element.id : 'menu';
        this.isMenusClosed = false;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(top)) {
            top = -1;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(left)) {
            left = -1;
        }
        if (li) {
            this.uList = this.createItems(item[this.getField('children', this.navIdx.length - 1)]);
            if (!this.isMenu && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                wrapper.lastChild.style.display = 'none';
                var data = {
                    text: item[this.getField('text')].toString(), iconCss: ICONS + ' e-previous'
                };
                var hdata = new MenuItem(this.items[0], 'items', data, true);
                var hli = this.createItems([hdata]).children[0];
                hli.classList.add(HEADER);
                this.uList.insertBefore(hli, this.uList.children[0]);
            }
            if (this.isMenu) {
                this.popupWrapper = this.createElement('div', {
                    className: 'e-' + this.getModuleName() + '-wrapper ' + POPUP, id: li.id + '-ej2menu-' + elemId + '-popup'
                });
                if (this.hamburgerMode) {
                    top = li.offsetHeight;
                    li.appendChild(this.popupWrapper);
                }
                else {
                    document.body.appendChild(this.popupWrapper);
                }
                this.isNestedOrVertical = this.element.classList.contains('e-vertical') || this.navIdx.length !== 1;
                this.popupObj = this.generatePopup(this.popupWrapper, this.uList, li, this.isNestedOrVertical);
                if (this.template) {
                    this.renderReactTemplates();
                }
                if (this.hamburgerMode) {
                    this.calculateIndentSize(this.uList, li);
                }
                else {
                    if (this.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.popupWrapper], this.cssClass.split(' '));
                    }
                    this.popupObj.hide();
                }
                this.triggerBeforeOpen(li, this.uList, item, e, 0, 0, 'menu');
            }
            else {
                this.uList.style.zIndex = this.element.style.zIndex;
                wrapper.appendChild(this.uList);
                this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
            }
        }
        else {
            this.uList = this.element;
            this.uList.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["getZindexPartial"])(target ? target : this.element).toString();
            this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
        }
        if (this.isMenu && this.template && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var menuTemplateId = this.element.id + TEMPLATE_PROPERTY;
            if (Object.keys(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"]).length) {
                var itemFromBlazorTemplate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"][menuTemplateId];
                this.tempItem = this.tempItem.concat(itemFromBlazorTemplate);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["blazorTemplates"][menuTemplateId] = this.tempItem;
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(menuTemplateId, TEMPLATE_PROPERTY, this);
        }
    };
    MenuBase.prototype.calculateIndentSize = function (ul, li) {
        var liStyle = getComputedStyle(li);
        var liIndent = parseInt(liStyle.textIndent, 10);
        if (this.navIdx.length < 2 && !li.classList.contains('e-blankicon')) {
            liIndent *= 2;
        }
        else {
            liIndent += (liIndent / 4);
        }
        ul.style.textIndent = liIndent + 'px';
        var blankIconElem = ul.querySelectorAll('.e-blankicon');
        if (blankIconElem && blankIconElem.length) {
            var menuIconElem = ul.querySelector('.e-menu-icon');
            var menuIconElemStyle = getComputedStyle(menuIconElem);
            var blankIconIndent = (parseInt(menuIconElemStyle.marginRight, 10) + menuIconElem.offsetWidth + liIndent);
            for (var i = 0; i < blankIconElem.length; i++) {
                blankIconElem[i].style.textIndent = blankIconIndent + 'px';
            }
        }
    };
    MenuBase.prototype.generatePopup = function (popupWrapper, ul, li, isNestedOrVertical) {
        var _this = this;
        var popupObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Popup"](popupWrapper, {
            actionOnScroll: this.hamburgerMode ? 'none' : 'reposition',
            relateTo: li,
            collision: this.hamburgerMode ? { X: 'none', Y: 'none' } : { X: isNestedOrVertical ||
                    this.enableRtl ? 'none' : 'flip', Y: 'fit' },
            position: (isNestedOrVertical && !this.hamburgerMode) ? { X: 'right', Y: 'top' } : { X: 'left', Y: 'bottom' },
            targetType: 'relative',
            enableRtl: this.enableRtl,
            content: ul,
            open: function () {
                var scrollEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-menu-vscroll', popupObj.element);
                if (scrollEle) {
                    scrollEle.style.height = 'inherit';
                    scrollEle.style.maxHeight = '';
                }
                var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-ul', popupObj.element);
                popupObj.element.style.maxHeight = '';
                ul.focus();
                _this.triggerOpen(ul);
            }
        });
        return popupObj;
    };
    MenuBase.prototype.createHeaderContainer = function (wrapper) {
        wrapper = wrapper || this.getWrapper();
        var spanElem = this.createElement('span', { className: 'e-' + this.getModuleName() + '-header' });
        var tempTitle = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.title) : this.title;
        var spanTitle = this.createElement('span', {
            className: 'e-' + this.getModuleName() + '-title', innerHTML: tempTitle
        });
        var spanIcon = this.createElement('span', {
            className: 'e-icons e-' + this.getModuleName() + '-icon', attrs: { 'tabindex': '0' }
        });
        spanElem.appendChild(spanTitle);
        spanElem.appendChild(spanIcon);
        wrapper.insertBefore(spanElem, this.element);
    };
    MenuBase.prototype.openHamburgerMenu = function (e) {
        if (this.hamburgerMode) {
            var eventArgs = void 0;
            this.triggerBeforeOpen(null, this.element, null, e, 0, 0, 'hamburger');
        }
    };
    MenuBase.prototype.closeHamburgerMenu = function (e) {
        var _this = this;
        if (this.hamburgerMode) {
            var beforeCloseArgs = void 0;
            beforeCloseArgs = { element: this.element, parentItem: null, event: e, items: this.items, cancel: false };
            this.trigger('beforeClose', beforeCloseArgs, function (observedHamburgerCloseArgs) {
                if (!observedHamburgerCloseArgs.cancel) {
                    _this.closeMenu(null, e);
                    _this.element.classList.add('e-hide-menu');
                    _this.trigger('onClose', { element: _this.element, parentItem: null, items: _this.items });
                }
            });
        }
    };
    MenuBase.prototype.callFit = function (element, x, y, top, left) {
        return Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["fit"])(element, null, { X: x, Y: y }, { top: top, left: left });
    };
    MenuBase.prototype.triggerBeforeOpen = function (li, ul, item, e, top, left, type) {
        var _this = this;
        var navIdx = this.getIndex(li ? li.id : null, true);
        var items = li ? item[this.getField('children', this.navIdx.length - 1)] : this.items;
        var eventArgs = {
            element: ul, items: items, parentItem: this.isMenu && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.getMenuItemModel(item, this.navIdx.length - 1) :
                item, event: e, cancel: false, top: top, left: left
        };
        var menuType = type;
        var collide;
        this.trigger('beforeOpen', eventArgs, function (observedOpenArgs) {
            switch (menuType) {
                case 'menu':
                    if (!_this.hamburgerMode) {
                        _this.top = observedOpenArgs.top;
                        _this.left = observedOpenArgs.left;
                    }
                    _this.popupWrapper.style.display = 'block';
                    if (!_this.hamburgerMode) {
                        _this.popupWrapper.style.maxHeight = _this.popupWrapper.getBoundingClientRect().height + 'px';
                        if (_this.enableScrolling) {
                            Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(_this.createElement, _this.popupWrapper, _this.uList, 'vscroll', _this.enableRtl);
                        }
                        _this.checkScrollOffset(e);
                    }
                    if (!_this.hamburgerMode && !_this.left && !_this.top) {
                        _this.popupObj.refreshPosition(_this.lItem, true);
                        _this.left = parseInt(_this.popupWrapper.style.left, 10);
                        _this.top = parseInt(_this.popupWrapper.style.top, 10);
                        if (_this.enableRtl) {
                            _this.left =
                                _this.isNestedOrVertical ? _this.left - _this.popupWrapper.offsetWidth - _this.lItem.parentElement.offsetWidth + 2
                                    : _this.left - _this.popupWrapper.offsetWidth + _this.lItem.offsetWidth;
                        }
                        collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(_this.popupWrapper, null, _this.left, _this.top);
                        if ((_this.isNestedOrVertical || _this.enableRtl) && (collide.indexOf('right') > -1
                            || collide.indexOf('left') > -1)) {
                            _this.popupObj.collision.X = 'none';
                            var offWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(_this.lItem, '.e-' + _this.getModuleName() + '-wrapper').offsetWidth;
                            _this.left =
                                _this.enableRtl ? Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["calculatePosition"])(_this.lItem, _this.isNestedOrVertical ? 'right' : 'left', 'top').left
                                    : _this.left - _this.popupWrapper.offsetWidth - offWidth + 2;
                        }
                        collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(_this.popupWrapper, null, _this.left, _this.top);
                        if (collide.indexOf('left') > -1 || collide.indexOf('right') > -1) {
                            _this.left = _this.callFit(_this.popupWrapper, true, false, _this.top, _this.left).left;
                        }
                        _this.popupWrapper.style.left = _this.left + 'px';
                    }
                    else {
                        _this.popupObj.collision = { X: 'none', Y: 'none' };
                    }
                    _this.popupWrapper.style.display = '';
                    break;
                case 'none':
                    _this.top = observedOpenArgs.top;
                    _this.left = observedOpenArgs.left;
                    break;
                case 'hamburger':
                    if (!observedOpenArgs.cancel) {
                        _this.element.classList.remove('e-hide-menu');
                        _this.triggerOpen(_this.element);
                    }
                    break;
            }
            if (menuType !== 'hamburger') {
                if (observedOpenArgs.cancel) {
                    if (_this.isMenu) {
                        _this.popupObj.destroy();
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(_this.popupWrapper);
                    }
                    else if (ul.className.indexOf('e-ul') > -1) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ul);
                    }
                    _this.navIdx.pop();
                }
                else {
                    if (_this.isMenu) {
                        if (_this.hamburgerMode) {
                            _this.popupWrapper.style.top = _this.top + 'px';
                            _this.popupWrapper.style.left = 0 + 'px';
                            _this.toggleAnimation(_this.popupWrapper);
                        }
                        else {
                            _this.setBlankIconStyle(_this.popupWrapper);
                            _this.wireKeyboardEvent(_this.popupWrapper);
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(_this.popupWrapper, { selector: '.' + ITEM });
                            _this.popupWrapper.style.left = _this.left + 'px';
                            _this.popupWrapper.style.top = _this.top + 'px';
                            var animationOptions = _this.animationSettings.effect !== 'None' ? {
                                name: _this.animationSettings.effect, duration: _this.animationSettings.duration,
                                timingFunction: _this.animationSettings.easing
                            } : null;
                            _this.popupObj.show(animationOptions, _this.lItem);
                        }
                    }
                    else {
                        _this.setBlankIconStyle(_this.uList);
                        _this.setPosition(_this.lItem, _this.uList, _this.top, _this.left);
                        _this.toggleAnimation(_this.uList);
                    }
                }
            }
            if (_this.keyType === 'right') {
                var cul = _this.getUlByNavIdx();
                li.classList.remove(FOCUSED);
                var index = void 0;
                if (_this.isMenu && _this.navIdx.length === 1) {
                    _this.removeLIStateByClass([SELECTED], [_this.getWrapper()]);
                }
                li.classList.add(SELECTED);
                if (_this.action === ENTER) {
                    var eventArgs_1 = { element: li, item: item, event: e };
                    _this.trigger('select', eventArgs_1);
                }
                li.focus();
                cul = _this.getUlByNavIdx();
                index = _this.isValidLI(cul.children[0], 0, _this.action);
                cul.children[index].classList.add(FOCUSED);
                cul.children[index].focus();
            }
        });
    };
    MenuBase.prototype.setBlankIconStyle = function (menu) {
        var blankIconList = [].slice.call(menu.getElementsByClassName('e-blankicon'));
        if (!blankIconList.length) {
            return;
        }
        var iconLi = menu.querySelector('.e-menu-item:not(.e-blankicon):not(.e-separator)');
        var icon = iconLi.querySelector('.e-menu-icon');
        if (!icon) {
            return;
        }
        var cssProp = this.enableRtl ? { padding: 'paddingRight', margin: 'marginLeft' } :
            { padding: 'paddingLeft', margin: 'marginRight' };
        var iconCssProps = getComputedStyle(icon);
        var iconSize = parseInt(iconCssProps.fontSize, 10);
        if (!!parseInt(iconCssProps.width, 10) && parseInt(iconCssProps.width, 10) > iconSize) {
            iconSize = parseInt(iconCssProps.width, 10);
        }
        // tslint:disable
        var size = iconSize + parseInt(iconCssProps[cssProp.margin], 10) + parseInt(getComputedStyle(iconLi)[cssProp.padding], 10) + "px";
        blankIconList.forEach(function (li) {
            li.style[cssProp.padding] = size;
        });
        // tslint:enable
    };
    MenuBase.prototype.checkScrollOffset = function (e) {
        var wrapper = this.getWrapper();
        if (wrapper.children[0].classList.contains('e-menu-hscroll') && this.navIdx.length === 1) {
            var trgt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? this.element : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + ITEM);
            var offsetEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-hscroll-bar', wrapper);
            var offsetLeft = void 0;
            var offsetRight = void 0;
            if (offsetEle.scrollLeft > trgt.offsetLeft) {
                offsetEle.scrollLeft -= (offsetEle.scrollLeft - trgt.offsetLeft);
            }
            offsetLeft = offsetEle.scrollLeft + offsetEle.offsetWidth;
            offsetRight = trgt.offsetLeft + trgt.offsetWidth;
            if (offsetLeft < offsetRight) {
                offsetEle.scrollLeft += (offsetRight - offsetLeft);
            }
        }
    };
    MenuBase.prototype.setPosition = function (li, ul, top, left) {
        var px = 'px';
        this.toggleVisiblity(ul);
        if (ul === this.element || (left > -1 && top > -1)) {
            var collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(ul, null, left, top);
            if (collide.indexOf('right') > -1) {
                left = left - ul.offsetWidth;
            }
            if (collide.indexOf('bottom') > -1) {
                var offset = this.callFit(ul, false, true, top, left);
                top = offset.top - 20;
                if (top < 0) {
                    var newTop = (pageYOffset + document.documentElement.clientHeight) - ul.getBoundingClientRect().height;
                    if (newTop > -1) {
                        top = newTop;
                    }
                }
            }
            collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(ul, null, left, top);
            if (collide.indexOf('left') > -1) {
                var offset = this.callFit(ul, true, false, top, left);
                left = offset.left;
            }
        }
        else {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                top = Number(this.element.style.top.replace(px, ''));
                left = Number(this.element.style.left.replace(px, ''));
            }
            else {
                var x = this.enableRtl ? 'left' : 'right';
                var offset = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["calculatePosition"])(li, x, 'top');
                top = offset.top;
                left = offset.left;
                var collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(ul, null, this.enableRtl ? left - ul.offsetWidth : left, top);
                var xCollision = collide.indexOf('left') > -1 || collide.indexOf('right') > -1;
                if (xCollision) {
                    offset = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["calculatePosition"])(li, this.enableRtl ? 'right' : 'left', 'top');
                    left = offset.left;
                }
                if (this.enableRtl || xCollision) {
                    left = (this.enableRtl && xCollision) ? left : left - ul.offsetWidth;
                }
                if (collide.indexOf('bottom') > -1) {
                    offset = this.callFit(ul, false, true, top, left);
                    top = offset.top;
                }
            }
        }
        this.toggleVisiblity(ul, false);
        ul.style.top = top + px;
        ul.style.left = left + px;
    };
    MenuBase.prototype.toggleVisiblity = function (ul, isVisible) {
        if (isVisible === void 0) { isVisible = true; }
        ul.style.visibility = isVisible ? 'hidden' : '';
        ul.style.display = isVisible ? 'block' : 'none';
    };
    MenuBase.prototype.createItems = function (items) {
        var _this = this;
        var level = this.navIdx ? this.navIdx.length : 0;
        var fields = this.getFields(level);
        // tslint:disable-next-line:no-any
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.template && items.length && items[0].properties) {
            var itemsObj_1 = [];
            items.forEach(function (item, index) {
                itemsObj_1.push({});
                itemsObj_1[index][fields.text] = item[fields.text];
                if (!item[fields.id]) {
                    item[fields.id] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('menuitem');
                }
                itemsObj_1[index][fields.id] = item[fields.id];
                itemsObj_1[index][fields.iconCss] = item[fields.iconCss];
                itemsObj_1[index][fields.url] = item[fields.url];
                itemsObj_1[index][fields.child] = item[fields.child];
                itemsObj_1[index][fields.separator] = item[fields.separator];
            });
            items = itemsObj_1;
        }
        var showIcon = this.hasField(items, this.getField('iconCss', level));
        var listBaseOptions = {
            showIcon: showIcon,
            moduleName: 'menu',
            fields: fields,
            template: this.template,
            itemNavigable: true,
            itemCreating: function (args) {
                if (!args.curData[args.fields[fields.id]]) {
                    args.curData[args.fields[fields.id]] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('menuitem');
                }
                args.curData.htmlAttributes = {
                    role: 'menuitem',
                    tabindex: '-1'
                };
                if (_this.isMenu && !args.curData[_this.getField('separator', level)]) {
                    args.curData.htmlAttributes['aria-label'] = args.curData[args.fields.text];
                }
                if (args.curData[args.fields[fields.iconCss]] === '') {
                    args.curData[args.fields[fields.iconCss]] = null;
                }
            },
            itemCreated: function (args) {
                if (args.curData[_this.getField('separator', level)]) {
                    args.item.classList.add(SEPARATOR);
                    args.item.removeAttribute('role');
                }
                if (showIcon && !args.curData[args.fields.iconCss]
                    && !args.curData[_this.getField('separator', level)]) {
                    args.item.classList.add('e-blankicon');
                }
                if (args.curData[args.fields.child]
                    && args.curData[args.fields.child].length) {
                    var span = _this.createElement('span', { className: ICONS + ' ' + CARET });
                    args.item.appendChild(span);
                    args.item.setAttribute('aria-haspopup', 'true');
                    args.item.setAttribute('aria-expanded', 'false');
                    if (!_this.isMenu) {
                        args.item.removeAttribute('role');
                    }
                    args.item.classList.add('e-menu-caret-icon');
                }
                if (_this.isMenu && _this.template) {
                    args.item.setAttribute('id', args.curData[args.fields.id].toString());
                    args.item.removeAttribute('data-uid');
                    if (args.item.classList.contains('e-level-1')) {
                        args.item.classList.remove('e-level-1');
                    }
                    if (args.item.classList.contains('e-has-child')) {
                        args.item.classList.remove('e-has-child');
                    }
                }
                var eventArgs = { item: args.curData, element: args.item };
                _this.trigger('beforeItemRender', eventArgs);
            }
        };
        this.setProperties({ 'items': this.items }, true);
        if (this.isMenu) {
            listBaseOptions.templateID = this.element.id + TEMPLATE_PROPERTY;
        }
        var ul = _ej2_lists__WEBPACK_IMPORTED_MODULE_1__["ListBase"].createList(this.createElement, items, listBaseOptions, !this.template, this);
        ul.setAttribute('tabindex', '0');
        if (this.isMenu) {
            ul.setAttribute('role', 'menu');
        }
        return ul;
    };
    MenuBase.prototype.moverHandler = function (e) {
        var trgt = e.target;
        this.liTrgt = trgt;
        var cli = this.getLI(trgt);
        var wrapper = cli ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(cli, '.e-' + this.getModuleName() + '-wrapper') : this.getWrapper();
        var hdrWrapper = this.getWrapper();
        var regex = new RegExp('-ej2menu-(.*)-popup');
        var ulId;
        var isDifferentElem = false;
        if (!wrapper) {
            return;
        }
        if (wrapper.id !== '') {
            ulId = regex.exec(wrapper.id)[1];
        }
        else {
            ulId = wrapper.querySelector('ul').id;
        }
        if (ulId !== this.element.id) {
            this.removeLIStateByClass([FOCUSED, SELECTED], [this.getWrapper()]);
            if (this.navIdx.length) {
                isDifferentElem = true;
            }
            else {
                return;
            }
        }
        if (cli && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(cli, '.e-' + this.getModuleName() + '-wrapper') && !isDifferentElem) {
            this.removeLIStateByClass([FOCUSED], this.isMenu ? [wrapper].concat(this.getPopups()) : [wrapper]);
            this.removeLIStateByClass([FOCUSED], this.isMenu ? [hdrWrapper].concat(this.getPopups()) : [hdrWrapper]);
            cli.classList.add(FOCUSED);
            if (!this.showItemOnClick) {
                this.clickHandler(e);
            }
        }
        else if (this.isMenu && this.showItemOnClick && !isDifferentElem) {
            this.removeLIStateByClass([FOCUSED], [wrapper].concat(this.getPopups()));
        }
        if (this.isMenu) {
            if (!this.showItemOnClick && (trgt.parentElement !== wrapper && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.e-' + this.getModuleName() + '-popup'))
                && (!cli || (cli && !this.getIndex(cli.id, true).length))) {
                this.removeLIStateByClass([FOCUSED], [wrapper]);
                if (this.navIdx.length) {
                    this.isClosed = true;
                    this.closeMenu(null, e);
                }
            }
            else if (isDifferentElem && !this.showItemOnClick) {
                if (this.navIdx.length) {
                    this.isClosed = true;
                    this.closeMenu(null, e);
                }
            }
            if (!this.isClosed) {
                this.removeStateWrapper();
            }
            this.isClosed = false;
        }
    };
    MenuBase.prototype.removeStateWrapper = function () {
        if (this.liTrgt) {
            var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.liTrgt, '.e-menu-vscroll');
            if (this.liTrgt.tagName === 'DIV' && wrapper) {
                this.removeLIStateByClass([FOCUSED, SELECTED], [wrapper]);
            }
        }
    };
    MenuBase.prototype.removeLIStateByClass = function (classList, element) {
        var li;
        var _loop_1 = function (i) {
            classList.forEach(function (className) {
                li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + className, element[i]);
                if (li) {
                    li.classList.remove(className);
                }
            });
        };
        for (var i = 0; i < element.length; i++) {
            _loop_1(i);
        }
    };
    MenuBase.prototype.getField = function (propName, level) {
        if (level === void 0) { level = 0; }
        var fieldName = this.fields[propName];
        return typeof fieldName === 'string' ? fieldName :
            (!fieldName[level] ? fieldName[fieldName.length - 1].toString()
                : fieldName[level].toString());
    };
    MenuBase.prototype.getFields = function (level) {
        if (level === void 0) { level = 0; }
        return {
            id: this.getField('itemId', level),
            iconCss: this.getField('iconCss', level),
            text: this.getField('text', level),
            url: this.getField('url', level),
            child: this.getField('children', level),
            separator: this.getField('separator', level)
        };
    };
    MenuBase.prototype.hasField = function (items, field) {
        for (var i = 0, len = items.length; i < len; i++) {
            if (items[i][field]) {
                return true;
            }
        }
        return false;
    };
    MenuBase.prototype.menuHeaderClickHandler = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-menu-wrapper').querySelector('ul.e-menu-parent').id !== this.element.id) {
            return;
        }
        this.element.classList.contains('e-hide-menu') ? this.openHamburgerMenu(e) : this.closeHamburgerMenu(e);
    };
    MenuBase.prototype.clickHandler = function (e) {
        if (this.isTapHold) {
            this.isTapHold = false;
        }
        else {
            var wrapper = this.getWrapper();
            var trgt = e.target;
            var cli = this.cli = this.getLI(trgt);
            var regex = new RegExp('-ej2menu-(.*)-popup');
            var cliWrapper = cli ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(cli, '.e-' + this.getModuleName() + '-wrapper') : null;
            var isInstLI = cli && cliWrapper && (this.isMenu ? this.getIndex(cli.id, true).length > 0
                : wrapper.firstElementChild.id === cliWrapper.firstElementChild.id);
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isMenu) {
                this.removeLIStateByClass([FOCUSED], [wrapper].concat(this.getPopups()));
                this.mouseDownHandler(e);
            }
            if (cli && cliWrapper && this.isMenu) {
                var cliWrapperId = cliWrapper.id ? regex.exec(cliWrapper.id)[1] : cliWrapper.querySelector('.e-menu-parent').id;
                if (this.element.id !== cliWrapperId) {
                    return;
                }
            }
            if (isInstLI && e.type === 'click' && !cli.classList.contains(HEADER)) {
                this.setLISelected(cli);
                var navIdx = this.getIndex(cli.id, true);
                var item = this.getItem(navIdx);
                var eventArgs = { element: cli, item: item, event: e };
                this.trigger('select', eventArgs);
            }
            if (isInstLI && (e.type === 'mouseover' || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice || this.showItemOnClick)) {
                var ul = void 0;
                if (cli.classList.contains(HEADER)) {
                    ul = wrapper.children[this.navIdx.length - 1];
                    this.toggleAnimation(ul);
                    var sli = this.getLIByClass(ul, SELECTED);
                    if (sli) {
                        sli.classList.remove(SELECTED);
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(cli.parentNode);
                    this.navIdx.pop();
                }
                else {
                    if (!cli.classList.contains(SEPARATOR)) {
                        this.showSubMenu = true;
                        var cul = cli.parentNode;
                        this.cliIdx = this.getIdx(cul, cli);
                        if (this.isMenu || !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                            var culIdx = this.isMenu ? Array.prototype.indexOf.call([wrapper].concat(this.getPopups()), Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(cul, '.' + 'e-' + this.getModuleName() + '-wrapper'))
                                : this.getIdx(wrapper, cul);
                            if (this.navIdx[culIdx] === this.cliIdx) {
                                this.showSubMenu = false;
                            }
                            if (culIdx !== this.navIdx.length && (e.type !== 'mouseover' || this.showSubMenu)) {
                                var sli = this.getLIByClass(cul, SELECTED);
                                if (sli) {
                                    sli.classList.remove(SELECTED);
                                }
                                this.isClosed = true;
                                this.keyType = 'click';
                                if (this.showItemOnClick) {
                                    this.setLISelected(cli);
                                }
                                this.closeMenu(culIdx + 1, e);
                                if (this.showItemOnClick) {
                                    this.setLISelected(cli);
                                }
                            }
                        }
                        if (!this.isClosed) {
                            this.afterCloseMenu(e);
                        }
                        this.isClosed = false;
                    }
                }
            }
            else {
                if (this.isMenu && trgt.tagName === 'DIV' && this.navIdx.length && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.e-menu-vscroll')) {
                    var popupEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + POPUP);
                    var cIdx = Array.prototype.indexOf.call(this.getPopups(), popupEle) + 1;
                    if (cIdx < this.navIdx.length) {
                        this.closeMenu(cIdx + 1, e);
                        if (popupEle) {
                            this.removeLIStateByClass([FOCUSED, SELECTED], [popupEle]);
                        }
                    }
                }
                else if (this.isMenu && this.hamburgerMode && trgt.tagName === 'SPAN'
                    && trgt.classList.contains('e-menu-icon')) {
                    this.menuHeaderClickHandler(e);
                }
                else {
                    if (trgt.tagName !== 'UL' || (this.isMenu ? trgt.parentElement.classList.contains('e-menu-wrapper') &&
                        !this.getIndex(trgt.querySelector('.' + ITEM).id, true).length : trgt.parentElement !== wrapper)) {
                        if (!cli) {
                            this.removeLIStateByClass([SELECTED], [wrapper]);
                        }
                        if (!cli || !cli.querySelector('.' + CARET)) {
                            this.closeMenu(null, e);
                        }
                    }
                }
            }
        }
    };
    MenuBase.prototype.afterCloseMenu = function (e) {
        var isHeader;
        if (this.showSubMenu) {
            if (this.showItemOnClick && this.navIdx.length === 0) {
                isHeader = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-menu-parent.e-control');
            }
            else {
                isHeader = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.e-menu-parent.e-control');
            }
            var idx = this.navIdx.concat(this.cliIdx);
            var item = this.getItem(idx);
            if (item && item[this.getField('children', idx.length - 1)] &&
                item[this.getField('children', idx.length - 1)].length) {
                if (e.type === 'mouseover' || (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.isMenu)) {
                    this.setLISelected(this.cli);
                }
                if ((!this.hamburgerMode && isHeader) || (this.hamburgerMode && this.cli.getAttribute('aria-expanded') === 'false')) {
                    this.cli.setAttribute('aria-expanded', 'true');
                    this.navIdx.push(this.cliIdx);
                    this.openMenu(this.cli, item, null, null, e);
                }
            }
            else {
                if (e.type !== 'mouseover') {
                    this.closeMenu(null, e);
                }
            }
            if (!isHeader) {
                var cul = this.getUlByNavIdx();
                var sli = this.getLIByClass(cul, SELECTED);
                if (sli) {
                    sli.setAttribute('aria-expanded', 'false');
                    sli.classList.remove(SELECTED);
                }
            }
        }
        this.keyType = '';
    };
    MenuBase.prototype.setLISelected = function (li) {
        var sli = this.getLIByClass(li.parentElement, SELECTED);
        if (sli) {
            sli.classList.remove(SELECTED);
        }
        if (!this.isMenu) {
            li.classList.remove(FOCUSED);
        }
        li.classList.add(SELECTED);
    };
    MenuBase.prototype.getLIByClass = function (ul, classname) {
        for (var i = 0, len = ul.children.length; i < len; i++) {
            if (ul.children[i].classList.contains(classname)) {
                return ul.children[i];
            }
        }
        return null;
    };
    /**
     * This method is used to get the index of the menu item in the Menu based on the argument.
     * @param item - item be passed to get the index | id to be passed to get the item index.
     * @param isUniqueId - Set `true` if it is a unique id.
     * @returns void
     */
    MenuBase.prototype.getItemIndex = function (item, isUniqueId) {
        var idx;
        if (typeof item === 'string') {
            idx = item;
        }
        else {
            idx = item.id;
        }
        var isText = (isUniqueId === false) ? false : true;
        var navIdx = this.getIndex(idx, isText);
        return navIdx;
    };
    /**
     * This method is used to set the menu item in the Menu based on the argument.
     * @param item - item need to be updated.
     * @param id - id to be passed to update the item.
     * @param isUniqueId - Set `true` if it is a unique id.
     * @returns void
     */
    MenuBase.prototype.setItem = function (item, id, isUniqueId) {
        var idx = id ? id : item.id;
        var isText = (isUniqueId === false) ? false : true;
        var navIdx = this.getIndex(idx, isText);
        var newItem = this.getItem(navIdx);
        newItem.iconCss = item.iconCss;
        newItem.id = item.id;
        newItem.text = item.text;
        newItem.url = item.url;
        newItem.separator = item.separator;
        newItem.items = item.items;
    };
    MenuBase.prototype.getItem = function (navIdx) {
        navIdx = navIdx.slice();
        var idx = navIdx.pop();
        var items = this.getItems(navIdx);
        return items[idx];
    };
    MenuBase.prototype.getItems = function (navIdx) {
        var items = this.items;
        for (var i = 0; i < navIdx.length; i++) {
            items = items[navIdx[i]][this.getField('children', i)];
        }
        return items;
    };
    MenuBase.prototype.setItems = function (newItems, navIdx) {
        var items = this.getItems(navIdx);
        items.splice(0, items.length);
        for (var i = 0; i < newItems.length; i++) {
            items.splice(i, 0, newItems[i]);
        }
    };
    MenuBase.prototype.getIdx = function (ul, li, skipHdr) {
        if (skipHdr === void 0) { skipHdr = true; }
        var idx = Array.prototype.indexOf.call(ul.querySelectorAll('li'), li);
        if (this.isMenu && this.template && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            idx = Array.prototype.indexOf.call(ul.querySelectorAll(li.tagName), li);
        }
        else {
            idx = Array.prototype.indexOf.call(ul.children, li);
        }
        if (skipHdr && ul.children[0].classList.contains(HEADER)) {
            idx--;
        }
        return idx;
    };
    MenuBase.prototype.getLI = function (elem) {
        if (elem.tagName === 'LI' && elem.classList.contains('e-menu-item')) {
            return elem;
        }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(elem, 'li.e-menu-item');
    };
    MenuBase.prototype.updateItemsByNavIdx = function () {
        var items = this.items;
        var count = 0;
        for (var index = 0; index < this.navIdx.length; index++) {
            items = items[index].items;
            if (!items) {
                break;
            }
            count++;
            var ul = this.getUlByNavIdx(count);
            if (!ul) {
                break;
            }
            this.updateItem(ul, items);
        }
    };
    MenuBase.prototype.removeChildElement = function (elem) {
        while (elem.firstElementChild) {
            elem.removeChild(elem.firstElementChild);
        }
        return elem;
    };
    /**
     * Called internally if any of the property value changed
     * @private
     * @param {MenuBaseModel} newProp
     * @param {MenuBaseModel} oldProp
     * @returns void
     */
    MenuBase.prototype.onPropertyChanged = function (newProp, oldProp) {
        var _this = this;
        var wrapper = this.getWrapper();
        var _loop_2 = function (prop) {
            switch (prop) {
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([wrapper], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], newProp.cssClass.split(' '));
                    }
                    break;
                case 'enableRtl':
                    wrapper.classList.toggle(RTL);
                    break;
                case 'showItemOnClick':
                    this_1.unWireEvents();
                    this_1.showItemOnClick = newProp.showItemOnClick;
                    this_1.wireEvents();
                    break;
                case 'enableScrolling':
                    if (newProp.enableScrolling) {
                        var ul_2;
                        this_1.element.classList.contains('e-vertical') ?
                            Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(this_1.createElement, wrapper, this_1.element, 'vscroll', this_1.enableRtl)
                            : Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(this_1.createElement, wrapper, this_1.element, 'hscroll', this_1.enableRtl);
                        this_1.getPopups().forEach(function (wrapper) {
                            ul_2 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-ul', wrapper);
                            Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["addScrolling"])(_this.createElement, wrapper, ul_2, 'vscroll', _this.enableRtl);
                        });
                    }
                    else {
                        var ul_3 = wrapper.children[0];
                        this_1.element.classList.contains('e-vertical') ? Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["destroyScroll"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(ul_3, _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__["VScroll"]), ul_3)
                            : Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["destroyScroll"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(ul_3, _common_h_scroll__WEBPACK_IMPORTED_MODULE_3__["HScroll"]), ul_3);
                        wrapper.style.overflow = '';
                        wrapper.appendChild(this_1.element);
                        this_1.getPopups().forEach(function (wrapper) {
                            ul_3 = wrapper.children[0];
                            Object(_common_menu_scroll__WEBPACK_IMPORTED_MODULE_5__["destroyScroll"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(ul_3, _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__["VScroll"]), ul_3);
                            wrapper.style.overflow = '';
                        });
                    }
                    break;
                case 'items':
                    var idx = void 0;
                    var navIdx = void 0;
                    var item = void 0;
                    if (!Object.keys(oldProp.items).length) {
                        this_1.updateItem(this_1.element, this_1.items);
                        for (var i = 1, count = wrapper.childElementCount; i < count; i++) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(wrapper.lastElementChild);
                        }
                        if (this_1.isMenu && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                            this_1.updateItemsByNavIdx();
                        }
                        else {
                            this_1.navIdx = [];
                        }
                    }
                    else {
                        var keys = Object.keys(newProp.items);
                        for (var i = 0; i < keys.length; i++) {
                            navIdx = this_1.getChangedItemIndex(newProp, [], Number(keys[i]));
                            if (navIdx.length <= this_1.getWrapper().children.length) {
                                idx = navIdx.pop();
                                item = this_1.getItems(navIdx);
                                this_1.insertAfter([item[idx]], item[idx].text);
                                this_1.removeItem(item, navIdx, idx);
                                this_1.setItems(item, navIdx);
                            }
                            navIdx.length = 0;
                        }
                    }
                    break;
            }
        };
        var this_1 = this;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            _loop_2(prop);
        }
    };
    MenuBase.prototype.updateItem = function (ul, items) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            ul = this.removeChildElement(ul);
        }
        else {
            ul.innerHTML = '';
        }
        var lis = [].slice.call(this.createItems(items).children);
        lis.forEach(function (li) {
            ul.appendChild(li);
        });
    };
    MenuBase.prototype.getChangedItemIndex = function (newProp, index, idx) {
        index.push(idx);
        var key = Object.keys(newProp.items[idx]).pop();
        if (key === 'items') {
            var item = newProp.items[idx];
            var popStr = Object.keys(item.items).pop();
            if (popStr) {
                this.getChangedItemIndex(item, index, Number(popStr));
            }
        }
        else {
            if (key === 'isParentArray' && index.length > 1) {
                index.pop();
            }
        }
        return index;
    };
    MenuBase.prototype.removeItem = function (item, navIdx, idx) {
        item.splice(idx, 1);
        var uls = this.getWrapper().children;
        if (navIdx.length < uls.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(uls[navIdx.length].children[idx]);
        }
    };
    /**
     * Used to unwire the bind events.
     * @private
     */
    MenuBase.prototype.unWireEvents = function (targetSelctor) {
        if (targetSelctor === void 0) { targetSelctor = this.target; }
        var wrapper = this.getWrapper();
        if (targetSelctor) {
            var target = void 0;
            var touchModule = void 0;
            var targetElems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(targetSelctor);
            for (var i = 0, len = targetElems.length; i < len; i++) {
                target = targetElems[i];
                if (this.isMenu) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'click', this.menuHeaderClickHandler);
                }
                else {
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIos) {
                        touchModule = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(target, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"]);
                        if (touchModule) {
                            touchModule.destroy();
                        }
                    }
                    else {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'contextmenu', this.cmenuHandler);
                    }
                }
            }
            if (!this.isMenu) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.targetElement, 'scroll', this.scrollHandler);
                for (var _i = 0, _a = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["getScrollableParent"])(this.targetElement); _i < _a.length; _i++) {
                    var parent_2 = _a[_i];
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(parent_2, 'scroll', this.scrollHandler);
                }
            }
        }
        if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.isMenu ? document : wrapper, 'mouseover', this.delegateMoverHandler);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown', this.delegateMouseDownHandler);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'click', this.delegateClickHandler);
        this.unWireKeyboardEvent(wrapper);
        this.rippleFn();
    };
    MenuBase.prototype.unWireKeyboardEvent = function (element) {
        var keyboardModule = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"]);
        if (keyboardModule) {
            keyboardModule.destroy();
        }
    };
    MenuBase.prototype.toggleAnimation = function (ul, isMenuOpen) {
        var _this = this;
        if (isMenuOpen === void 0) { isMenuOpen = true; }
        var pUlHeight;
        var pElement;
        if (this.animationSettings.effect === 'None' || !isMenuOpen) {
            this.end(ul, isMenuOpen);
        }
        else {
            this.animation.animate(ul, {
                name: this.animationSettings.effect,
                duration: this.animationSettings.duration,
                timingFunction: this.animationSettings.easing,
                begin: function (options) {
                    if (_this.hamburgerMode) {
                        pElement = options.element.parentElement;
                        options.element.style.position = 'absolute';
                        pUlHeight = pElement.offsetHeight;
                        options.element.style.maxHeight = options.element.offsetHeight + 'px';
                        pElement.style.maxHeight = '';
                    }
                    else {
                        options.element.style.display = 'block';
                        options.element.style.maxHeight = options.element.getBoundingClientRect().height + 'px';
                    }
                },
                progress: function (options) {
                    if (_this.hamburgerMode) {
                        pElement.style.minHeight = (pUlHeight + options.element.offsetHeight) + 'px';
                    }
                },
                end: function (options) {
                    if (_this.hamburgerMode) {
                        options.element.style.position = '';
                        options.element.style.maxHeight = '';
                        pElement.style.minHeight = '';
                        options.element.style.top = 0 + 'px';
                        options.element.children[0].focus();
                        _this.triggerOpen(options.element.children[0]);
                    }
                    else {
                        _this.end(options.element, isMenuOpen);
                    }
                }
            });
        }
    };
    MenuBase.prototype.triggerOpen = function (ul) {
        var item = this.navIdx.length ? this.getItem(this.navIdx) : null;
        var eventArgs = {
            element: ul, parentItem: item, items: item ? item.items : this.items
        };
        this.trigger('onOpen', eventArgs);
    };
    MenuBase.prototype.end = function (ul, isMenuOpen) {
        if (isMenuOpen) {
            ul.style.display = 'block';
            ul.style.maxHeight = '';
            this.triggerOpen(ul);
            if (ul.querySelector('.' + FOCUSED)) {
                ul.querySelector('.' + FOCUSED).focus();
            }
            else {
                var ele = void 0;
                ele = this.getWrapper().children[this.getIdx(this.getWrapper(), ul) - 1];
                if (ele) {
                    ele.querySelector('.' + SELECTED).focus();
                }
                else {
                    this.element.focus();
                }
            }
        }
        else {
            if (ul === this.element) {
                var fli = this.getLIByClass(this.element, FOCUSED);
                if (fli) {
                    fli.classList.remove(FOCUSED);
                }
                var sli = this.getLIByClass(this.element, SELECTED);
                if (sli) {
                    sli.classList.remove(SELECTED);
                }
                ul.style.display = 'none';
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ul);
            }
        }
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     */
    MenuBase.prototype.getPersistData = function () {
        return '';
    };
    /**
     * Get wrapper element.
     * @returns Element
     * @private
     */
    MenuBase.prototype.getWrapper = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.e-' + this.getModuleName() + '-wrapper');
    };
    MenuBase.prototype.getIndex = function (data, isUniqueId, items, nIndex, isCallBack, level) {
        if (items === void 0) { items = this.items; }
        if (nIndex === void 0) { nIndex = []; }
        if (isCallBack === void 0) { isCallBack = false; }
        if (level === void 0) { level = 0; }
        var item;
        level = isCallBack ? level + 1 : 0;
        for (var i = 0, len = items.length; i < len; i++) {
            item = items[i];
            if ((isUniqueId ? item[this.getField('itemId', level)] : item[this.getField('text', level)]) === data) {
                nIndex.push(i);
                break;
            }
            else if (item[this.getField('children', level)]
                && item[this.getField('children', level)].length) {
                nIndex = this.getIndex(data, isUniqueId, item[this.getField('children', level)], nIndex, true, level);
                if (nIndex[nIndex.length - 1] === -1) {
                    if (i !== len - 1) {
                        nIndex.pop();
                    }
                }
                else {
                    nIndex.unshift(i);
                    break;
                }
            }
            else {
                if (i === len - 1) {
                    nIndex.push(-1);
                }
            }
        }
        return (!isCallBack && nIndex[0] === -1) ? [] : nIndex;
    };
    /**
     * This method is used to enable or disable the menu items in the Menu based on the items and enable argument.
     * @param items Text items that needs to be enabled/disabled.
     * @param enable Set `true`/`false` to enable/disable the list items.
     * @param isUniqueId - Set `true` if it is a unique id.
     * @returns void
     */
    MenuBase.prototype.enableItems = function (items, enable, isUniqueId) {
        if (enable === void 0) { enable = true; }
        var ul;
        var idx;
        var navIdx;
        var disabled = DISABLED;
        var skipItem;
        for (var i = 0; i < items.length; i++) {
            navIdx = this.getIndex(items[i], isUniqueId);
            if (this.navIdx.length) {
                if (navIdx.length !== 1) {
                    skipItem = false;
                    for (var i_1 = 0, len = navIdx.length - 1; i_1 < len; i_1++) {
                        if (navIdx[i_1] !== this.navIdx[i_1]) {
                            skipItem = true;
                            break;
                        }
                    }
                    if (skipItem) {
                        continue;
                    }
                }
            }
            else {
                if (navIdx.length !== 1) {
                    continue;
                }
            }
            idx = navIdx.pop();
            ul = this.getUlByNavIdx(navIdx.length);
            if (ul) {
                if (enable) {
                    if (this.isMenu) {
                        ul.children[idx].classList.remove(disabled);
                        ul.children[idx].removeAttribute('aria-disabled');
                    }
                    else {
                        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !ul.classList.contains('e-contextmenu')) {
                            ul.children[idx + 1].classList.remove(disabled);
                        }
                        else {
                            ul.children[idx].classList.remove(disabled);
                        }
                    }
                }
                else {
                    if (this.isMenu) {
                        ul.children[idx].classList.add(disabled);
                        ul.children[idx].setAttribute('aria-disabled', 'true');
                    }
                    else {
                        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !ul.classList.contains('e-contextmenu')) {
                            ul.children[idx + 1].classList.add(disabled);
                        }
                        else {
                            ul.children[idx].classList.add(disabled);
                        }
                    }
                }
            }
        }
    };
    /**
     * This method is used to show the menu items in the Menu based on the items text.
     * @param items Text items that needs to be shown.
     * @param isUniqueId - Set `true` if it is a unique id.
     * @returns void
     */
    MenuBase.prototype.showItems = function (items, isUniqueId) {
        this.showHideItems(items, false, isUniqueId);
    };
    /**
     * This method is used to hide the menu items in the Menu based on the items text.
     * @param items Text items that needs to be hidden.
     * @returns void
     */
    MenuBase.prototype.hideItems = function (items, isUniqueId) {
        this.showHideItems(items, true, isUniqueId);
    };
    MenuBase.prototype.showHideItems = function (items, ishide, isUniqueId) {
        var ul;
        var index;
        var navIdx;
        for (var i = 0; i < items.length; i++) {
            navIdx = this.getIndex(items[i], isUniqueId);
            index = navIdx.pop();
            ul = this.getUlByNavIdx(navIdx.length);
            if (ul) {
                if (ishide) {
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !ul.classList.contains('e-contextmenu')) {
                        ul.children[index + 1].classList.add(HIDE);
                    }
                    else {
                        ul.children[index].classList.add(HIDE);
                    }
                }
                else {
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !ul.classList.contains('e-contextmenu')) {
                        ul.children[index + 1].classList.remove(HIDE);
                    }
                    else {
                        ul.children[index].classList.remove(HIDE);
                    }
                }
            }
        }
    };
    /**
     * It is used to remove the menu items from the Menu based on the items text.
     * @param items Text items that needs to be removed.
     * @returns void
     */
    MenuBase.prototype.removeItems = function (items, isUniqueId) {
        var idx;
        var navIdx;
        var iitems;
        for (var i = 0; i < items.length; i++) {
            navIdx = this.getIndex(items[i], isUniqueId);
            idx = navIdx.pop();
            iitems = this.getItems(navIdx);
            this.removeItem(iitems, navIdx, idx);
        }
    };
    /**
     * It is used to insert the menu items after the specified menu item text.
     * @param items Items that needs to be inserted.
     * @param text Text item after that the element to be inserted.
     * @returns void
     */
    MenuBase.prototype.insertAfter = function (items, text, isUniqueId) {
        this.insertItems(items, text, isUniqueId);
    };
    /**
     * It is used to insert the menu items before the specified menu item text.
     * @param items Items that needs to be inserted.
     * @param text Text item before that the element to be inserted.
     * @param isUniqueId - Set `true` if it is a unique id.
     * @returns void
     */
    MenuBase.prototype.insertBefore = function (items, text, isUniqueId) {
        this.insertItems(items, text, isUniqueId, false);
    };
    MenuBase.prototype.insertItems = function (items, text, isUniqueId, isAfter) {
        if (isAfter === void 0) { isAfter = true; }
        var li;
        var idx;
        var navIdx;
        var iitems;
        var menuitem;
        var showIcon;
        for (var i = 0; i < items.length; i++) {
            navIdx = this.getIndex(text, isUniqueId);
            idx = navIdx.pop();
            iitems = this.getItems(navIdx);
            menuitem = new MenuItem(iitems[0], 'items', items[i], true);
            iitems.splice(isAfter ? idx + 1 : idx, 0, menuitem);
            var uls = this.isMenu ? [this.getWrapper()].concat(this.getPopups()) : [].slice.call(this.getWrapper().children);
            if (navIdx.length < uls.length) {
                idx = isAfter ? idx + 1 : idx;
                showIcon = this.hasField(iitems, this.getField('iconCss', navIdx.length - 1));
                li = this.createItems(iitems).children[idx];
                var ul = this.isMenu ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
                ul.insertBefore(li, ul.children[idx]);
            }
        }
    };
    MenuBase.prototype.removeAttributes = function () {
        var _this = this;
        ['top', 'left', 'display', 'z-index'].forEach(function (key) {
            _this.element.style.removeProperty(key);
        });
        ['role', 'tabindex', 'class', 'style'].forEach(function (key) {
            if (key === 'class' && _this.element.classList.contains('e-menu-parent')) {
                _this.element.classList.remove('e-menu-parent');
            }
            if (['class', 'style'].indexOf(key) === -1 || !_this.element.getAttribute(key)) {
                _this.element.removeAttribute(key);
            }
            if (_this.isMenu && key === 'class' && _this.element.classList.contains('e-vertical')) {
                _this.element.classList.remove('e-vertical');
            }
        });
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    MenuBase.prototype.destroy = function () {
        var wrapper = this.getWrapper();
        if (wrapper) {
            this.unWireEvents();
            if (!this.isMenu) {
                this.clonedElement.style.display = '';
                if (this.clonedElement.tagName === 'EJS-CONTEXTMENU') {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.clonedElement], ['e-control', 'e-lib', 'e-' + this.getModuleName()]);
                    this.element = this.clonedElement;
                }
                else {
                    if (this.refreshing && this.clonedElement.childElementCount && this.clonedElement.children[0].tagName === 'LI') {
                        this.setProperties({ 'items': [] }, true);
                    }
                    if (document.getElementById(this.clonedElement.id)) {
                        var refEle = this.clonedElement.nextElementSibling;
                        refEle && refEle !== wrapper ? this.clonedElement.parentElement.insertBefore(this.element, refEle) :
                            this.clonedElement.parentElement.appendChild(this.element);
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                            this.element = this.removeChildElement(this.element);
                        }
                        else {
                            this.element.innerHTML = '';
                        }
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(this.clonedElement.children), this.element);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.clonedElement);
                        this.removeAttributes();
                    }
                }
                this.clonedElement = null;
            }
            else {
                this.closeMenu();
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                    this.element = this.removeChildElement(this.element);
                }
                else {
                    this.element.innerHTML = '';
                }
                this.removeAttributes();
                wrapper.parentNode.insertBefore(this.element, wrapper);
            }
            if (this.isMenu && this.clonedElement) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element);
                wrapper.style.display = '';
                wrapper.classList.remove('e-' + this.getModuleName() + '-wrapper');
                wrapper.removeAttribute('data-ripple');
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(wrapper);
            }
            _super.prototype.destroy.call(this);
            if (this.template) {
                this.clearTemplate(['template']);
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "beforeItemRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "onOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "onClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], MenuBase.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuBase.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MenuBase.prototype, "showItemOnClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuBase.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], MenuBase.prototype, "filter", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], MenuBase.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MenuBase.prototype, "enableScrolling", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], MenuBase.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ itemId: "id", text: "text", parentId: "parentId", iconCss: "iconCss", url: "url", separator: "separator", children: "items" }, FieldSettings)
    ], MenuBase.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], MenuItem)
    ], MenuBase.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ duration: 400, easing: 'ease', effect: 'SlideDown' }, MenuAnimationSettings)
    ], MenuBase.prototype, "animationSettings", void 0);
    MenuBase = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], MenuBase);
    return MenuBase;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-scroll.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-scroll.js ***!
  \*****************************************************************************/
/*! exports provided: addScrolling, destroyScroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addScrolling", function() { return addScrolling; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroyScroll", function() { return destroyScroll; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _v_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js");
/* harmony import */ var _h_scroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./h-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js");



/**
 * Used to add scroll in menu.
 * @hidden
 */
function addScrolling(createElement, container, content, scrollType, enableRtl, offset) {
    var containerOffset;
    var contentOffset;
    if (scrollType === 'vscroll') {
        containerOffset = offset || container.getBoundingClientRect().height;
        contentOffset = content.getBoundingClientRect().height;
    }
    else {
        containerOffset = container.getBoundingClientRect().width;
        contentOffset = content.getBoundingClientRect().width;
    }
    if (containerOffset < contentOffset) {
        var scrollEle = createElement('div', { className: 'e-menu-' + scrollType });
        container.appendChild(scrollEle);
        scrollEle.appendChild(content);
        if (offset) {
            scrollEle.style.overflow = 'hidden';
            scrollEle.style.height = offset + 'px';
        }
        else {
            scrollEle.style.maxHeight = container.style.maxHeight;
            container.style.overflow = 'hidden';
        }
        var scrollObj = void 0;
        if (scrollType === 'vscroll') {
            scrollObj = new _v_scroll__WEBPACK_IMPORTED_MODULE_1__["VScroll"]({ enableRtl: enableRtl }, scrollEle);
            scrollObj.scrollStep = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-' + scrollType + '-bar', container).offsetHeight / 2;
        }
        else {
            scrollObj = new _h_scroll__WEBPACK_IMPORTED_MODULE_2__["HScroll"]({ enableRtl: enableRtl }, scrollEle);
            scrollObj.scrollStep = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-' + scrollType + '-bar', container).offsetWidth;
        }
        return scrollEle;
    }
    else {
        return content;
    }
}
/**
 * Used to destroy the scroll option.
 * @hidden
 */
function destroyScroll(scrollObj, element, skipEle) {
    if (scrollObj) {
        var menu = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-menu-parent', element);
        if (menu) {
            if (!skipEle || skipEle === menu) {
                scrollObj.destroy();
                element.parentElement.appendChild(menu);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(element);
            }
        }
        else {
            scrollObj.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(element);
        }
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js ***!
  \**************************************************************************/
/*! exports provided: VScroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VScroll", function() { return VScroll; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var CLS_ROOT = 'e-vscroll';
var CLS_RTL = 'e-rtl';
var CLS_DISABLE = 'e-overlay';
var CLS_VSCROLLBAR = 'e-vscroll-bar';
var CLS_VSCROLLCON = 'e-vscroll-content';
var CLS_NAVARROW = 'e-nav-arrow';
var CLS_NAVUPARROW = 'e-nav-up-arrow';
var CLS_NAVDOWNARROW = 'e-nav-down-arrow';
var CLS_VSCROLLNAV = 'e-scroll-nav';
var CLS_VSCROLLNAVUP = 'e-scroll-up-nav';
var CLS_VSCROLLNAVDOWN = 'e-scroll-down-nav';
var CLS_DEVICE = 'e-scroll-device';
var CLS_OVERLAY = 'e-scroll-overlay';
var CLS_UPOVERLAY = 'e-scroll-up-overlay';
var CLS_DOWNOVERLAY = 'e-scroll-down-overlay';
var OVERLAY_MAXWID = 40;
/**
 * VScroll module is introduces vertical scroller when content exceeds the current viewing area.
 * It can be useful for the components like Toolbar, Tab which needs vertical scrolling alone.
 * Hidden content can be view by touch moving or icon click.
 * ```html
 * <div id="scroll"/>
 * <script>
 *   var scrollObj = new VScroll();
 *   scrollObj.appendTo("#scroll");
 * </script>
 * ```
 */
var VScroll = /** @__PURE__ @class */ (function (_super) {
    __extends(VScroll, _super);
    /**
     * Initializes a new instance of the VScroll class.
     * @param options  - Specifies VScroll model properties as options.
     * @param element  - Specifies the element for which vertical scrolling applies.
     */
    function VScroll(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Initialize the event handler
     * @private
     */
    VScroll.prototype.preRender = function () {
        this.browser = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name;
        this.browserCheck = this.browser === 'mozilla';
        this.isDevice = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice;
        this.customStep = true;
        var ele = this.element;
        this.ieCheck = this.browser === 'edge' || this.browser === 'msie';
        this.initialize();
        if (ele.id === '') {
            ele.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('vscroll');
            this.uniqueId = true;
        }
        ele.style.display = 'block';
        if (this.enableRtl) {
            ele.classList.add(CLS_RTL);
        }
    };
    /**
     * To Initialize the vertical scroll rendering
     * @private
     */
    VScroll.prototype.render = function () {
        this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, { scroll: this.touchHandler.bind(this), swipe: this.swipeHandler.bind(this) });
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.scrollEle, 'scroll', this.scrollEventHandler, this);
        if (!this.isDevice) {
            this.createNavIcon(this.element);
        }
        else {
            this.element.classList.add(CLS_DEVICE);
            this.createOverlayElement(this.element);
        }
        this.setScrollState();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'wheel', this.wheelEventHandler, this);
    };
    VScroll.prototype.setScrollState = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollStep) || this.scrollStep < 0) {
            this.scrollStep = this.scrollEle.offsetHeight;
            this.customStep = false;
        }
        else {
            this.customStep = true;
        }
    };
    VScroll.prototype.initialize = function () {
        var scrollCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_VSCROLLCON });
        var scrollBar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_VSCROLLBAR });
        scrollBar.setAttribute('tabindex', '-1');
        var ele = this.element;
        var innerEle = [].slice.call(ele.children);
        for (var _i = 0, innerEle_1 = innerEle; _i < innerEle_1.length; _i++) {
            var ele_1 = innerEle_1[_i];
            scrollCnt.appendChild(ele_1);
        }
        scrollBar.appendChild(scrollCnt);
        ele.appendChild(scrollBar);
        scrollBar.style.overflowY = 'hidden';
        this.scrollEle = scrollBar;
        this.scrollItems = scrollCnt;
    };
    VScroll.prototype.getPersistData = function () {
        var keyEntity = ['scrollStep'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    VScroll.prototype.getModuleName = function () {
        return 'vScroll';
    };
    /**
     * Removes the control from the DOM and also removes all its related events.
     * @returns void
     */
    VScroll.prototype.destroy = function () {
        var el = this.element;
        el.style.display = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [CLS_ROOT, CLS_DEVICE]);
        var navs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-' + el.id + '_nav.' + CLS_VSCROLLNAV, el);
        var overlays = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_OVERLAY, el);
        [].slice.call(overlays).forEach(function (ele) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
        });
        for (var _i = 0, _a = [].slice.call(this.scrollItems.children); _i < _a.length; _i++) {
            var elem = _a[_i];
            el.appendChild(elem);
        }
        if (this.uniqueId) {
            this.element.removeAttribute('id');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.scrollEle);
        if (navs.length > 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(navs[0]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(navs[1])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(navs[1]);
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.scrollEle, 'scroll', this.scrollEventHandler);
        this.touchModule.destroy();
        this.touchModule = null;
        _super.prototype.destroy.call(this);
    };
    /**
     * Specifies the value to disable/enable the VScroll component.
     * When set to `true` , the component will be disabled.
     * @param  {boolean} value - Based on this Boolean value, VScroll will be enabled (false) or disabled (true).
     * @returns void.
     */
    VScroll.prototype.disable = function (value) {
        var navEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.e-scroll-nav:not(.' + CLS_DISABLE + ')', this.element);
        value ? this.element.classList.add(CLS_DISABLE) : this.element.classList.remove(CLS_DISABLE);
        [].slice.call(navEle).forEach(function (el) {
            el.setAttribute('tabindex', !value ? '0' : '-1');
        });
    };
    VScroll.prototype.createOverlayElement = function (element) {
        var id = element.id.concat('_nav');
        var downOverlayEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_OVERLAY + ' ' + CLS_DOWNOVERLAY });
        var clsDown = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVDOWN);
        var downEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: id.concat('down'), className: clsDown });
        var navItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_NAVDOWNARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        downEle.appendChild(navItem);
        var upEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_OVERLAY + ' ' + CLS_UPOVERLAY });
        if (this.ieCheck) {
            downEle.classList.add('e-ie-align');
        }
        element.appendChild(downOverlayEle);
        element.appendChild(downEle);
        element.insertBefore(upEle, element.firstChild);
        this.eventBinding([downEle]);
    };
    VScroll.prototype.createNavIcon = function (element) {
        var id = element.id.concat('_nav');
        var clsDown = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVDOWN);
        var nav = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: id.concat('_down'), className: clsDown });
        nav.setAttribute('aria-disabled', 'false');
        var navItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_NAVDOWNARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        var clsUp = 'e-' + element.id.concat('_nav ' + CLS_VSCROLLNAV + ' ' + CLS_VSCROLLNAVUP);
        var navElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: id.concat('_up'), className: clsUp + ' ' + CLS_DISABLE });
        navElement.setAttribute('aria-disabled', 'true');
        var navUpItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: CLS_NAVUPARROW + ' ' + CLS_NAVARROW + ' e-icons' });
        navElement.appendChild(navUpItem);
        nav.appendChild(navItem);
        nav.setAttribute('tabindex', '0');
        element.appendChild(nav);
        element.insertBefore(navElement, element.firstChild);
        if (this.ieCheck) {
            nav.classList.add('e-ie-align');
            navElement.classList.add('e-ie-align');
        }
        this.eventBinding([nav, navElement]);
    };
    VScroll.prototype.onKeyPress = function (ev) {
        var _this = this;
        if (ev.key === 'Enter') {
            var timeoutFun_1 = function () {
                _this.keyTimeout = true;
                _this.eleScrolling(10, ev.target, true);
            };
            this.keyTimer = window.setTimeout(function () { timeoutFun_1(); }, 100);
        }
    };
    VScroll.prototype.onKeyUp = function (ev) {
        if (ev.key !== 'Enter') {
            return;
        }
        if (this.keyTimeout) {
            this.keyTimeout = false;
        }
        else {
            ev.target.click();
        }
        clearTimeout(this.keyTimer);
    };
    VScroll.prototype.eventBinding = function (element) {
        var _this = this;
        [].slice.call(element).forEach(function (ele) {
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](ele, { tapHold: _this.tabHoldHandler.bind(_this), tapHoldThreshold: 500 });
            ele.addEventListener('keydown', _this.onKeyPress.bind(_this));
            ele.addEventListener('keyup', _this.onKeyUp.bind(_this));
            ele.addEventListener('mouseup', _this.repeatScroll.bind(_this));
            ele.addEventListener('touchend', _this.repeatScroll.bind(_this));
            ele.addEventListener('contextmenu', function (e) {
                e.preventDefault();
            });
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(ele, 'click', _this.clickEventHandler, _this);
        });
    };
    VScroll.prototype.repeatScroll = function () {
        clearInterval(this.timeout);
    };
    VScroll.prototype.tabHoldHandler = function (ev) {
        var _this = this;
        var trgt = ev.originalEvent.target;
        trgt = this.contains(trgt, CLS_VSCROLLNAV) ? trgt.firstElementChild : trgt;
        var scrollDistance = 10;
        var timeoutFun = function () {
            _this.eleScrolling(scrollDistance, trgt, true);
        };
        this.timeout = window.setInterval(function () { timeoutFun(); }, 50);
    };
    VScroll.prototype.contains = function (element, className) {
        return element.classList.contains(className);
    };
    VScroll.prototype.eleScrolling = function (scrollDis, trgt, isContinuous) {
        var rootElement = this.element;
        var classList = trgt.classList;
        if (classList.contains(CLS_VSCROLLNAV)) {
            classList = trgt.querySelector('.' + CLS_NAVARROW).classList;
        }
        if (classList.contains(CLS_NAVDOWNARROW)) {
            this.frameScrollRequest(scrollDis, 'add', isContinuous);
        }
        else if (classList.contains(CLS_NAVUPARROW)) {
            this.frameScrollRequest(scrollDis, '', isContinuous);
        }
    };
    VScroll.prototype.clickEventHandler = function (event) {
        this.eleScrolling(this.scrollStep, event.target, false);
    };
    VScroll.prototype.wheelEventHandler = function (e) {
        e.preventDefault();
        this.frameScrollRequest(this.scrollStep, (e.deltaY > 0 ? 'add' : ''), false);
    };
    VScroll.prototype.swipeHandler = function (e) {
        var swipeElement = this.scrollEle;
        var distance;
        if (e.velocity <= 1) {
            distance = e.distanceY / (e.velocity * 10);
        }
        else {
            distance = e.distanceY / e.velocity;
        }
        var start = 0.5;
        var animate = function () {
            var step = Math.sin(start);
            if (step <= 0) {
                window.cancelAnimationFrame(step);
            }
            else {
                if (e.swipeDirection === 'Up') {
                    swipeElement.scrollTop += distance * step;
                }
                else if (e.swipeDirection === 'Down') {
                    swipeElement.scrollTop -= distance * step;
                }
                start -= 0.02;
                window.requestAnimationFrame(animate);
            }
        };
        animate();
    };
    VScroll.prototype.scrollUpdating = function (scrollVal, action) {
        if (action === 'add') {
            this.scrollEle.scrollTop += scrollVal;
        }
        else {
            this.scrollEle.scrollTop -= scrollVal;
        }
    };
    VScroll.prototype.frameScrollRequest = function (scrollValue, action, isContinuous) {
        var _this = this;
        var step = 10;
        if (isContinuous) {
            this.scrollUpdating(scrollValue, action);
            return;
        }
        if (!this.customStep) {
            [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_OVERLAY, this.element)).forEach(function (el) {
                scrollValue -= el.offsetHeight;
            });
        }
        var animate = function () {
            if (scrollValue < step) {
                window.cancelAnimationFrame(step);
            }
            else {
                _this.scrollUpdating(step, action);
                scrollValue -= step;
                window.requestAnimationFrame(animate);
            }
        };
        animate();
    };
    VScroll.prototype.touchHandler = function (e) {
        var el = this.scrollEle;
        var distance;
        distance = e.distanceY;
        if (e.scrollDirection === 'Up') {
            el.scrollTop = el.scrollTop + distance;
        }
        else if (e.scrollDirection === 'Down') {
            el.scrollTop = el.scrollTop - distance;
        }
    };
    VScroll.prototype.arrowDisabling = function (addDisableCls, removeDisableCls) {
        if (this.isDevice) {
            var arrowEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(addDisableCls) ? removeDisableCls : addDisableCls;
            var arrowIcon = arrowEle.querySelector('.' + CLS_NAVARROW);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(addDisableCls)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(arrowIcon, [CLS_NAVDOWNARROW], [CLS_NAVUPARROW]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(arrowIcon, [CLS_NAVUPARROW], [CLS_NAVDOWNARROW]);
            }
        }
        else {
            addDisableCls.classList.add(CLS_DISABLE);
            addDisableCls.setAttribute('aria-disabled', 'true');
            addDisableCls.removeAttribute('tabindex');
            removeDisableCls.classList.remove(CLS_DISABLE);
            removeDisableCls.setAttribute('aria-disabled', 'false');
            removeDisableCls.setAttribute('tabindex', '0');
        }
        this.repeatScroll();
    };
    VScroll.prototype.scrollEventHandler = function (e) {
        var target = e.target;
        var height = target.offsetHeight;
        var rootEle = this.element;
        var navUpEle = this.element.querySelector('.' + CLS_VSCROLLNAVUP);
        var navDownEle = this.element.querySelector('.' + CLS_VSCROLLNAVDOWN);
        var upOverlay = this.element.querySelector('.' + CLS_UPOVERLAY);
        var downOverlay = this.element.querySelector('.' + CLS_DOWNOVERLAY);
        var scrollTop = target.scrollTop;
        if (scrollTop <= 0) {
            scrollTop = -scrollTop;
        }
        if (this.isDevice) {
            if (scrollTop < OVERLAY_MAXWID) {
                upOverlay.style.height = scrollTop + 'px';
            }
            else {
                upOverlay.style.height = '40px';
            }
            if ((target.scrollHeight - Math.ceil(height + scrollTop)) < OVERLAY_MAXWID) {
                downOverlay.style.height = (target.scrollHeight - Math.ceil(height + scrollTop)) + 'px';
            }
            else {
                downOverlay.style.height = '40px';
            }
        }
        if (scrollTop === 0) {
            this.arrowDisabling(navUpEle, navDownEle);
        }
        else if (Math.ceil(height + scrollTop + .1) >= target.scrollHeight) {
            this.arrowDisabling(navDownEle, navUpEle);
        }
        else {
            var disEle = this.element.querySelector('.' + CLS_VSCROLLNAV + '.' + CLS_DISABLE);
            if (disEle) {
                disEle.classList.remove(CLS_DISABLE);
                disEle.setAttribute('aria-disabled', 'false');
                disEle.setAttribute('tabindex', '0');
            }
        }
    };
    /**
     * Gets called when the model property changes.The data that describes the old and new values of property that changed.
     * @param  {VScrollModel} newProp
     * @param  {VScrollModel} oldProp
     * @returns void
     * @private
     */
    VScroll.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'scrollStep':
                    this.setScrollState();
                    break;
                case 'enableRtl':
                    newProp.enableRtl ? this.element.classList.add(CLS_RTL) : this.element.classList.remove(CLS_RTL);
                    break;
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], VScroll.prototype, "scrollStep", void 0);
    VScroll = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], VScroll);
    return VScroll;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/context-menu.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/context-menu.js ***!
  \************************************************************************************/
/*! exports provided: ContextMenu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextMenu", function() { return ContextMenu; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _common_menu_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/menu-base */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-base.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../common/menu-base-model.d.ts'/>



/**
 * The ContextMenu is a graphical user interface that appears on the user right click/touch hold operation.
 * ```html
 * <div id = 'target'></div>
 * <ul id = 'contextmenu'></ul>
 * ```
 * ```typescript
 * <script>
 * var contextMenuObj = new ContextMenu({items: [{ text: 'Cut' }, { text: 'Copy' },{ text: 'Paste' }], target: '#target'});
 * </script>
 * ```
 */
var ContextMenu = /** @__PURE__ @class */ (function (_super) {
    __extends(ContextMenu, _super);
    /**
     * Constructor for creating the widget.
     * @private
     */
    function ContextMenu(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * For internal use only - prerender processing.
     * @private
     */
    ContextMenu.prototype.preRender = function () {
        this.isMenu = false;
        this.element.id = this.element.id || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2-contextmenu');
        _super.prototype.preRender.call(this);
    };
    ContextMenu.prototype.initialize = function () {
        _super.prototype.initialize.call(this);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'role': 'context menu', 'tabindex': '0' });
        this.element.style.zIndex = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["getZindexPartial"])(this.element).toString();
    };
    /**
     * This method is used to open the ContextMenu in specified position.
     * @param top - To specify ContextMenu vertical positioning.
     * @param left - To specify ContextMenu horizontal positioning.
     * @param target - To calculate z-index for ContextMenu based upon the specified target.
     * @method open
     * @returns void
     */
    ContextMenu.prototype.open = function (top, left, target) {
        _super.prototype.openMenu.call(this, null, null, top, left, null, target);
    };
    /**
     * Closes the ContextMenu if it is opened.
     */
    ContextMenu.prototype.close = function () {
        _super.prototype.closeMenu.call(this);
    };
    /**
     * Called internally if any of the property value changed
     * @private
     * @param {ContextMenuModel} newProp
     * @param {ContextMenuModel} oldProp
     * @returns void
     */
    ContextMenu.prototype.onPropertyChanged = function (newProp, oldProp) {
        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'filter':
                    this.close();
                    this.filter = newProp.filter;
                    break;
                case 'target':
                    this.unWireEvents(oldProp.target);
                    this.wireEvents();
                    break;
            }
        }
    };
    /**
     * Get module name.
     * @returns string
     * @private
     */
    ContextMenu.prototype.getModuleName = function () {
        return 'contextmenu';
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ContextMenu.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], ContextMenu.prototype, "filter", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], _common_menu_base__WEBPACK_IMPORTED_MODULE_2__["MenuItem"])
    ], ContextMenu.prototype, "items", void 0);
    ContextMenu = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], ContextMenu);
    return ContextMenu;
}(_common_menu_base__WEBPACK_IMPORTED_MODULE_2__["MenuBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/index.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/index.js ***!
  \*****************************************************************************/
/*! exports provided: ContextMenu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _context_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./context-menu */ "./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/context-menu.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextMenu", function() { return _context_menu__WEBPACK_IMPORTED_MODULE_0__["ContextMenu"]; });

/**
 * ContextMenu modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/index.js":
/*!****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/index.js ***!
  \****************************************************************/
/*! exports provided: HScroll, VScroll, MenuAnimationSettings, MenuItem, Item, Toolbar, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, addScrolling, destroyScroll, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, Sidebar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HScroll", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["HScroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VScroll", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["VScroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuAnimationSettings", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["MenuAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["MenuItem"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addScrolling", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["addScrolling"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "destroyScroll", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["destroyScroll"]; });

/* harmony import */ var _toolbar_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toolbar/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return _toolbar_index__WEBPACK_IMPORTED_MODULE_1__["Item"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return _toolbar_index__WEBPACK_IMPORTED_MODULE_1__["Toolbar"]; });

/* harmony import */ var _accordion_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./accordion/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/accordion/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionActionSettings", function() { return _accordion_index__WEBPACK_IMPORTED_MODULE_2__["AccordionActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionAnimationSettings", function() { return _accordion_index__WEBPACK_IMPORTED_MODULE_2__["AccordionAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionItem", function() { return _accordion_index__WEBPACK_IMPORTED_MODULE_2__["AccordionItem"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _accordion_index__WEBPACK_IMPORTED_MODULE_2__["Accordion"]; });

/* harmony import */ var _context_menu_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context-menu/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/context-menu/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContextMenu", function() { return _context_menu_index__WEBPACK_IMPORTED_MODULE_3__["ContextMenu"]; });

/* harmony import */ var _menu_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./menu/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/menu/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Menu", function() { return _menu_index__WEBPACK_IMPORTED_MODULE_4__["Menu"]; });

/* harmony import */ var _tab_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tab/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/tab/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabActionSettings", function() { return _tab_index__WEBPACK_IMPORTED_MODULE_5__["TabActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabAnimationSettings", function() { return _tab_index__WEBPACK_IMPORTED_MODULE_5__["TabAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return _tab_index__WEBPACK_IMPORTED_MODULE_5__["Header"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabItem", function() { return _tab_index__WEBPACK_IMPORTED_MODULE_5__["TabItem"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return _tab_index__WEBPACK_IMPORTED_MODULE_5__["Tab"]; });

/* harmony import */ var _treeview_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./treeview/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldsSettings", function() { return _treeview_index__WEBPACK_IMPORTED_MODULE_6__["FieldsSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionSettings", function() { return _treeview_index__WEBPACK_IMPORTED_MODULE_6__["ActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NodeAnimationSettings", function() { return _treeview_index__WEBPACK_IMPORTED_MODULE_6__["NodeAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeView", function() { return _treeview_index__WEBPACK_IMPORTED_MODULE_6__["TreeView"]; });

/* harmony import */ var _sidebar_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sidebar/index */ "./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sidebar", function() { return _sidebar_index__WEBPACK_IMPORTED_MODULE_7__["Sidebar"]; });

/**
 * Navigation all modules
 */










/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/menu/index.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/menu/index.js ***!
  \*********************************************************************/
/*! exports provided: Menu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./menu */ "./ej2-resources/18.4.46/scripts/ej2-navigations/menu/menu.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Menu", function() { return _menu__WEBPACK_IMPORTED_MODULE_0__["Menu"]; });

/**
 * Menu modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/menu/menu.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/menu/menu.js ***!
  \********************************************************************/
/*! exports provided: Menu */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Menu", function() { return Menu; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_menu_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/menu-base */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/menu-base.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../common/menu-base-model.d.ts'/>



var VMENU = 'e-vertical';
var SCROLLABLE = 'e-scrollable';
var HAMBURGER = 'e-hamburger';
/**
 * The Menu is a graphical user interface that serve as navigation headers for your application or site.
 * ```html
 * <ul id = 'menu'></ul>
 * ```
 * ```typescript
 * <script>
 * var menuObj = new Menu({ items: [{ text: 'Home' }, { text: 'Contact Us' },{ text: 'Login' }]});
 * menuObj.appendTo("#menu");
 * </script>
 * ```
 */
var Menu = /** @__PURE__ @class */ (function (_super) {
    __extends(Menu, _super);
    /**
     * Constructor for creating the component.
     * @private
     */
    function Menu(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.tempItems = [];
        return _this;
    }
    /**
     * Get module name.
     * @returns string
     * @private
     */
    Menu.prototype.getModuleName = function () {
        return 'menu';
    };
    /**
     * For internal use only - prerender processing.
     * @private
     */
    Menu.prototype.preRender = function () {
        this.isMenu = true;
        this.element.id = this.element.id || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('ej2-menu');
        if (this.template) {
            try {
                if (document.querySelectorAll(this.template).length) {
                    this.template = document.querySelector(this.template).innerHTML.trim();
                    this.clearChanges();
                }
            }
            catch (e) {
                /* action on catch */
            }
        }
        else {
            this.updateMenuItems(this.items);
        }
        _super.prototype.preRender.call(this);
    };
    Menu.prototype.initialize = function () {
        _super.prototype.initialize.call(this);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'role': 'menubar', 'tabindex': '0' });
        if (this.orientation === 'Vertical') {
            this.element.classList.add(VMENU);
            if (this.hamburgerMode && !this.target) {
                this.element.previousElementSibling.classList.add(VMENU);
            }
            this.element.setAttribute('aria-orientation', 'vertical');
        }
        else {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && !this.enableScrolling) {
                this.element.parentElement.classList.add(SCROLLABLE);
            }
        }
        if (this.hamburgerMode) {
            this.element.parentElement.classList.add(HAMBURGER);
            if (this.orientation === 'Horizontal') {
                this.element.classList.add('e-hide-menu');
            }
        }
    };
    Menu.prototype.updateMenuItems = function (items) {
        this.tempItems = items;
        this.items = [];
        this.tempItems.map(this.createMenuItems, this);
        this.setProperties({ items: this.items }, true);
        this.tempItems = [];
    };
    /**
     * Called internally if any of the property value changed
     * @private
     * @param {MenuModel} newProp
     * @param {MenuModel} oldProp
     * @returns void
     */
    Menu.prototype.onPropertyChanged = function (newProp, oldProp) {
        var _this = this;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'orientation':
                    if (newProp.orientation === 'Vertical') {
                        this.element.classList.add(VMENU);
                        if (this.hamburgerMode) {
                            if (!this.target) {
                                this.element.previousElementSibling.classList.add(VMENU);
                            }
                            this.element.classList.remove('e-hide-menu');
                        }
                        this.element.setAttribute('aria-orientation', 'vertical');
                    }
                    else {
                        this.element.classList.remove(VMENU);
                        if (this.hamburgerMode) {
                            if (!this.target) {
                                this.element.previousElementSibling.classList.remove(VMENU);
                            }
                            this.element.classList.add('e-hide-menu');
                        }
                        this.element.removeAttribute('aria-orientation');
                    }
                    break;
                case 'items':
                    if (!Object.keys(oldProp.items).length) {
                        this.updateMenuItems(newProp.items);
                    }
                    break;
                case 'hamburgerMode':
                    if (!this.element.previousElementSibling) {
                        _super.prototype.createHeaderContainer.call(this);
                    }
                    if (newProp.hamburgerMode) {
                        this.element.parentElement.classList.add(HAMBURGER);
                        [].slice.call(this.element.getElementsByClassName('e-blankicon')).forEach(function (li) {
                            li.style[_this.enableRtl ? 'paddingRight' : 'paddingLeft'] = '';
                        });
                    }
                    else {
                        this.element.parentElement.classList.remove(HAMBURGER);
                        if (this.orientation === 'Vertical') {
                            this.setBlankIconStyle(this.element);
                        }
                    }
                    if (this.orientation === 'Vertical') {
                        if (!this.target) {
                            this.element.previousElementSibling.classList.add(VMENU);
                        }
                        this.element.classList.remove('e-hide-menu');
                    }
                    else {
                        if (this.target) {
                            this.element.previousElementSibling.classList.add(VMENU);
                        }
                        else {
                            this.element.previousElementSibling.classList.remove(VMENU);
                        }
                        this.element.classList[newProp.hamburgerMode ? 'add' : 'remove']('e-hide-menu');
                    }
                    break;
                case 'title':
                    if (this.hamburgerMode && this.element.previousElementSibling) {
                        newProp.title = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(newProp.title) : newProp.title;
                        this.element.previousElementSibling.querySelector('.e-menu-title').innerHTML = newProp.title;
                    }
                    break;
                case 'target':
                    if (this.hamburgerMode) {
                        this.unWireEvents(oldProp.target);
                        this.wireEvents();
                        if (this.orientation === 'Horizontal') {
                            if (!newProp.target) {
                                if (!this.element.previousElementSibling) {
                                    _super.prototype.createHeaderContainer.call(this);
                                }
                                this.element.previousElementSibling.classList.remove(VMENU);
                            }
                            else {
                                this.element.previousElementSibling.classList.add(VMENU);
                            }
                            this.element.classList.add('e-hide-menu');
                        }
                    }
                    break;
            }
        }
        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
    };
    Menu.prototype.createMenuItems = function (item) {
        var pIdField;
        var idx;
        var i;
        var items = this.items;
        pIdField = this.getField('parentId');
        if (item[pIdField]) {
            idx = this.getIndex(item[pIdField].toString(), true);
            for (i = 0; i < idx.length; i++) {
                if (!items[idx[i]].items) {
                    items[idx[i]].items = [];
                }
                items = items[idx[i]].items;
            }
            items.push(item);
        }
        else {
            this.items.push(item);
        }
    };
    /**
     * This method is used to open the Menu in hamburger mode.
     * @method open
     * @returns void
     */
    Menu.prototype.open = function () {
        _super.prototype.openHamburgerMenu.call(this);
    };
    /**
     * Closes the Menu if it is opened in hamburger mode.
     */
    Menu.prototype.close = function () {
        _super.prototype.closeHamburgerMenu.call(this);
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Horizontal')
    ], Menu.prototype, "orientation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Menu.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Menu.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Menu.prototype, "enableScrolling", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Menu.prototype, "hamburgerMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Menu')
    ], Menu.prototype, "title", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Menu.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ itemId: "id", text: "text", parentId: "parentId", iconCss: "iconCss", url: "url", separator: "separator", children: "items" }, _common_menu_base__WEBPACK_IMPORTED_MODULE_1__["FieldSettings"])
    ], Menu.prototype, "fields", void 0);
    Menu = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Menu);
    return Menu;
}(_common_menu_base__WEBPACK_IMPORTED_MODULE_1__["MenuBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/index.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/index.js ***!
  \************************************************************************/
/*! exports provided: Sidebar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _sidebar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sidebar */ "./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/sidebar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sidebar", function() { return _sidebar__WEBPACK_IMPORTED_MODULE_0__["Sidebar"]; });

/**
 * Sidebar modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/sidebar.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/sidebar/sidebar.js ***!
  \**************************************************************************/
/*! exports provided: Sidebar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sidebar", function() { return Sidebar; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var CONTROL = 'e-control';
var ROOT = 'e-sidebar';
var DOCKER = 'e-dock';
var CLOSE = 'e-close';
var OPEN = 'e-open';
var TRASITION = 'e-transition';
var DEFAULTBACKDROP = 'e-sidebar-overlay';
var CONTEXTBACKDROP = 'e-backdrop';
var RTL = 'e-rtl';
var RIGHT = 'e-right';
var LEFT = 'e-left';
var OVER = 'e-over';
var PUSH = 'e-push';
var SLIDE = 'e-slide';
var VISIBILITY = 'e-visibility';
var MAINCONTENTANIMATION = 'e-content-animation';
var DISABLEANIMATION = 'e-disable-animation';
var CONTEXT = 'e-sidebar-context';
var SIDEBARABSOLUTE = 'e-sidebar-absolute';
/**
 * Sidebar is an expandable or collapsible
 * component that typically act as a side container to place the primary or secondary content alongside of the main content.
 * ```html
 * <aside id="sidebar">
 * </aside>
 * ```
 * ```typescript
 * <script>
 *   let sidebarObject: Sidebar = new Sidebar();
 *   sidebarObject.appendTo("#sidebar");
 * </script>
 * ```
 */
var Sidebar = /** @__PURE__ @class */ (function (_super) {
    __extends(Sidebar, _super);
    function Sidebar(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isBlazor = false;
        return _this;
    }
    Sidebar.prototype.preRender = function () {
        this.isBlazor = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered);
        if (!this.isBlazor) {
            this.setWidth();
        }
    };
    Sidebar.prototype.render = function () {
        this.initialize();
        this.wireEvents();
        this.renderComplete();
    };
    Sidebar.prototype.initialize = function () {
        this.setTarget();
        this.addClass();
        if (!this.isBlazor) {
            this.setZindex();
        }
        if (this.enableDock) {
            this.setDock();
        }
        if (this.isOpen) {
            this.show();
        }
        else {
            this.setMediaQuery();
        }
        this.checkType(true);
        this.setType(this.type);
        this.setCloseOnDocumentClick();
        if (!this.isBlazor) {
            this.setEnableRTL();
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.windowWidth = window.innerWidth;
        }
    };
    Sidebar.prototype.setEnableRTL = function () {
        this.enableRtl ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], RTL)) :
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], RTL));
    };
    Sidebar.prototype.setTarget = function () {
        this.targetEle = this.element.nextElementSibling;
        this.sidebarEleCopy = this.element.cloneNode(true);
        if (typeof (this.target) === 'string') {
            this.setProperties({ target: document.querySelector(this.target) }, true);
        }
        if (this.target) {
            this.target.insertBefore(this.element, this.target.children[0]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], SIDEBARABSOLUTE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.target], CONTEXT);
            this.targetEle = this.getTargetElement();
        }
    };
    Sidebar.prototype.getTargetElement = function () {
        var siblingElement = this.element.nextElementSibling;
        while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(siblingElement)) {
            if (!siblingElement.classList.contains(ROOT)) {
                break;
            }
            siblingElement = siblingElement.nextElementSibling;
        }
        return siblingElement;
    };
    Sidebar.prototype.setCloseOnDocumentClick = function () {
        if (this.closeOnDocumentClick) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', this.documentclickHandler, this);
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.documentclickHandler);
        }
    };
    Sidebar.prototype.setWidth = function () {
        if (this.enableDock && this.position === 'Left') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': this.setDimension(this.dockSize) });
        }
        else if (this.enableDock && this.position === 'Right') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': this.setDimension(this.dockSize) });
        }
        else if (!this.enableDock) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': this.setDimension(this.width) });
        }
    };
    Sidebar.prototype.setDimension = function (width) {
        if (typeof width === 'number') {
            width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else if (typeof width === 'string') {
            width = (width.match(/px|%|em/)) ? width : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        else {
            width = '100%';
        }
        return width;
    };
    Sidebar.prototype.setZindex = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'z-index': '' + this.zIndex });
    };
    Sidebar.prototype.addClass = function () {
        var classELement = document.querySelector('.e-main-content');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(classELement || this.targetEle)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([classELement || this.targetEle], [MAINCONTENTANIMATION]);
        }
        this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
        if (!this.isBlazor) {
            if (!this.enableDock && this.type !== 'Auto') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [VISIBILITY]);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [OPEN, CLOSE, RIGHT, LEFT, SLIDE, PUSH, OVER]);
            this.element.classList.add(ROOT);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], (this.position === 'Right') ? RIGHT : LEFT);
            if (this.enableDock) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], DOCKER);
            }
            this.element.setAttribute('tabindex', this.tabIndex);
        }
        if (this.type === 'Auto' && !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.show();
        }
        else if (!this.isOpen) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], CLOSE);
        }
    };
    Sidebar.prototype.checkType = function (val) {
        if (!(this.type === 'Push' || this.type === 'Over' || this.type === 'Slide')) {
            this.type = 'Auto';
        }
        else {
            if (!this.element.classList.contains(CLOSE) && !val) {
                this.hide();
            }
        }
    };
    Sidebar.prototype.transitionEnd = function (e) {
        this.setDock();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) && e.target === this.element) {
            this.triggerChange();
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'transitionend', this.transitionEnd);
    };
    Sidebar.prototype.destroyBackDrop = function () {
        var sibling = document.querySelector('.e-main-content') || this.targetEle;
        if (this.target && this.showBackdrop && sibling) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([sibling], CONTEXTBACKDROP);
        }
        else if (this.showBackdrop && this.modal) {
            this.modal.style.display = 'none';
            this.modal.outerHTML = '';
            this.modal = null;
        }
    };
    /**
     * Hide the Sidebar component, if it is in an open state.
     * @returns void
     */
    Sidebar.prototype.hide = function (e) {
        var _this = this;
        var closeArguments = {
            model: this,
            element: this.element,
            cancel: false,
            isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e),
            event: (e || null)
        };
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            delete closeArguments.model;
        }
        this.trigger('close', closeArguments, function (observedcloseArgs) {
            if (!observedcloseArgs.cancel) {
                if (_this.element.classList.contains(CLOSE)) {
                    return;
                }
                if (_this.element.classList.contains(OPEN) && !_this.animate) {
                    _this.triggerChange();
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], CLOSE);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], OPEN);
                _this.enableDock ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(_this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(_this.dockSize) }) :
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(_this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(_this.width) });
                _this.setType(_this.type);
                var sibling = document.querySelector('.e-main-content') || _this.targetEle;
                if (!_this.enableDock && sibling) {
                    sibling.style.transform = 'translateX(' + 0 + 'px)';
                    _this.position === 'Left' ? sibling.style.marginLeft = '0px' : sibling.style.marginRight = '0px';
                }
                _this.destroyBackDrop();
                _this.setAnimation();
                if (_this.type === 'Slide') {
                    document.body.classList.remove('e-sidebar-overflow');
                }
                _this.setProperties({ isOpen: false }, true);
                if (_this.enableDock) {
                    setTimeout(function () { return _this.setTimeOut(); }, 50);
                }
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(_this.element, 'transitionend', _this.transitionEnd, _this);
            }
        });
    };
    Sidebar.prototype.setTimeOut = function () {
        var sibling = document.querySelector('.e-main-content') || this.targetEle;
        if (this.element.classList.contains(OPEN) && sibling) {
            if (this.position === 'Left') {
                this.width === 'auto' ? sibling.style.marginLeft = this.setDimension(this.element.getBoundingClientRect().width)
                    : sibling.style.marginLeft = this.setDimension(this.width);
            }
            else {
                this.width === 'auto' ? sibling.style.marginRight = this.setDimension(this.element.getBoundingClientRect().width)
                    : sibling.style.marginRight = this.setDimension(this.width);
            }
        }
        else if (this.element.classList.contains(CLOSE) && sibling) {
            if (this.position === 'Left') {
                this.dockSize === 'auto' ? sibling.style.marginLeft = this.setDimension(this.element.getBoundingClientRect().width)
                    : sibling.style.marginLeft = this.setDimension(this.dockSize);
            }
            else {
                this.dockSize === 'auto' ? sibling.style.marginRight = this.setDimension(this.element.getBoundingClientRect().width)
                    : sibling.style.marginRight = this.setDimension(this.dockSize);
            }
        }
    };
    ;
    /**
     * Shows the Sidebar component, if it is in closed state.
     * @returns void
     */
    Sidebar.prototype.show = function (e) {
        var _this = this;
        var openArguments = {
            model: this,
            element: this.element,
            cancel: false,
            isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e),
            event: (e || null)
        };
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            delete openArguments.model;
        }
        this.trigger('open', openArguments, function (observedopenArgs) {
            if (!observedopenArgs.cancel) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], VISIBILITY);
                if (_this.element.classList.contains(OPEN)) {
                    return;
                }
                if (_this.element.classList.contains(CLOSE) && !_this.animate) {
                    _this.triggerChange();
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], [OPEN, TRASITION]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(_this.element, { 'transform': '' });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], CLOSE);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(_this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(_this.width) });
                _this.setType(_this.type);
                _this.createBackDrop();
                _this.setAnimation();
                if (_this.type === 'Slide') {
                    document.body.classList.add('e-sidebar-overflow');
                }
                _this.setProperties({ isOpen: true }, true);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(_this.element, 'transitionend', _this.transitionEnd, _this);
            }
        });
    };
    Sidebar.prototype.setAnimation = function () {
        if (this.animate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], DISABLEANIMATION);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], DISABLEANIMATION);
        }
    };
    Sidebar.prototype.triggerChange = function () {
        var changeArguments = { name: 'change', element: this.element };
        this.trigger('change', changeArguments);
    };
    Sidebar.prototype.setDock = function () {
        if (this.enableDock && this.position === 'Left' && !this.getState()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'transform': 'translateX(' + -100 + '%) translateX(' + this.setDimension(this.dockSize) + ')' });
        }
        else if (this.enableDock && this.position === 'Right' && !this.getState()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'transform': 'translateX(' + 100 + '%) translateX(' + '-' + this.setDimension(this.dockSize) + ')' });
        }
        if (this.element.classList.contains(CLOSE) && this.enableDock) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': this.setDimension(this.dockSize) });
        }
    };
    Sidebar.prototype.createBackDrop = function () {
        if (this.target && this.showBackdrop && this.getState()) {
            var sibling = document.querySelector('.e-main-content') || this.targetEle;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([sibling], CONTEXTBACKDROP);
        }
        else if (this.showBackdrop && !this.modal && this.getState()) {
            this.modal = this.createElement('div');
            this.modal.className = DEFAULTBACKDROP;
            this.modal.style.display = 'block';
            document.body.appendChild(this.modal);
        }
    };
    Sidebar.prototype.getPersistData = function () {
        return this.addOnPersist(['type', 'position', 'isOpen']);
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    Sidebar.prototype.getModuleName = function () {
        return 'sidebar';
    };
    /**
     * Shows or hides the Sidebar based on the current state.
     * @returns void
     */
    Sidebar.prototype.toggle = function (e) {
        this.element.classList.contains(OPEN) ? this.hide() : this.show();
    };
    Sidebar.prototype.getState = function () {
        return this.element.classList.contains(OPEN) ? true : false;
    };
    Sidebar.prototype.setMediaQuery = function () {
        if (this.mediaQuery) {
            var media = false;
            if (typeof (this.mediaQuery) === 'string') {
                media = window.matchMedia(this.mediaQuery).matches;
            }
            else {
                media = (this.mediaQuery).matches;
            }
            if (media && this.windowWidth !== window.innerWidth) {
                this.show();
            }
            else if (this.getState() && this.windowWidth !== window.innerWidth) {
                this.hide();
            }
        }
    };
    Sidebar.prototype.resize = function (e) {
        if (this.type === 'Auto') {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], OVER);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], PUSH);
            }
        }
        this.setMediaQuery();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            this.windowWidth = window.innerWidth;
        }
    };
    Sidebar.prototype.documentclickHandler = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CONTROL + '' + '.' + ROOT)) {
            return;
        }
        this.hide(e);
    };
    Sidebar.prototype.enableGestureHandler = function (args) {
        if (!this.isOpen && this.position === 'Left' && args.swipeDirection === 'Right' &&
            (args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
            this.show();
        }
        else if (this.isOpen && this.position === 'Left' && args.swipeDirection === 'Left') {
            this.hide();
        }
        else if (this.isOpen && this.position === 'Right' && args.swipeDirection === 'Right') {
            this.hide();
        }
        else if (!this.isOpen && this.position === 'Right' && args.swipeDirection === 'Left'
            && (window.innerWidth - args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
            this.show();
        }
    };
    Sidebar.prototype.setEnableGestures = function () {
        if (this.enableGestures) {
            this.mainContentEle = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](document.body, { swipe: this.enableGestureHandler.bind(this) });
            this.sidebarEle = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, { swipe: this.enableGestureHandler.bind(this) });
        }
        else {
            if (this.mainContentEle && this.sidebarEle) {
                this.mainContentEle.destroy();
                this.sidebarEle.destroy();
            }
        }
    };
    Sidebar.prototype.wireEvents = function () {
        this.setEnableGestures();
        window.addEventListener('resize', this.resize.bind(this));
    };
    Sidebar.prototype.unWireEvents = function () {
        window.removeEventListener('resize', this.resize.bind(this));
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.documentclickHandler);
        if (this.mainContentEle) {
            this.mainContentEle.destroy();
        }
        if (this.sidebarEle) {
            this.sidebarEle.destroy();
        }
    };
    /**
     * Called internally if any of the property value changed.
     * @private
     */
    Sidebar.prototype.onPropertyChanged = function (newProp, oldProp) {
        var sibling = document.querySelector('.e-main-content') || this.targetEle;
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'isOpen':
                    this.isOpen ? this.show() : this.hide();
                    break;
                case 'width':
                    this.setWidth();
                    if (!this.getState()) {
                        this.setDock();
                    }
                    break;
                case 'animate':
                    this.setAnimation();
                    break;
                case 'type':
                    this.checkType(false);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [VISIBILITY]);
                    this.addClass();
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.type === 'Auto' ? (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? ['e-over'] :
                        ['e-push']) : ['e-' + this.type.toLowerCase()]);
                    break;
                case 'position':
                    this.element.style.transform = '';
                    this.setDock();
                    if (sibling) {
                        this.position === 'Left' ? sibling.style.marginRight = '0px' : sibling.style.marginLeft = '0px';
                    }
                    if (this.position === 'Right') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], LEFT);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], RIGHT);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], RIGHT);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], LEFT);
                    }
                    this.setType(this.type);
                    break;
                case 'showBackdrop':
                    if (this.showBackdrop) {
                        this.createBackDrop();
                    }
                    else {
                        if (this.modal) {
                            this.modal.style.display = 'none';
                            this.modal.outerHTML = '';
                            this.modal = null;
                        }
                    }
                    break;
                case 'target':
                    if (typeof (this.target) === 'string') {
                        this.setProperties({ target: document.querySelector(this.target) }, true);
                    }
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], SIDEBARABSOLUTE);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([oldProp.target], CONTEXT);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(sibling, { 'margin-left': 0, 'margin-right': 0 });
                        document.body.insertAdjacentElement('afterbegin', this.element);
                    }
                    var isRendered = this.isServerRendered;
                    this.isServerRendered = false;
                    _super.prototype.refresh.call(this);
                    this.isServerRendered = isRendered;
                    break;
                case 'closeOnDocumentClick':
                    this.setCloseOnDocumentClick();
                    break;
                case 'enableDock':
                    if (!this.getState()) {
                        this.setDock();
                    }
                    break;
                case 'zIndex':
                    this.setZindex();
                    break;
                case 'mediaQuery':
                    this.setMediaQuery();
                    break;
                case 'enableGestures':
                    this.setEnableGestures();
                    break;
                case 'enableRtl':
                    this.setEnableRTL();
                    break;
            }
        }
    };
    Sidebar.prototype.setType = function (type) {
        var elementWidth = this.element.getBoundingClientRect().width;
        this.setZindex();
        var sibling = document.querySelector('.e-main-content') || this.targetEle;
        if (sibling) {
            sibling.style.transform = 'translateX(' + 0 + 'px)';
            if (!_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && this.type !== 'Auto') {
                this.position === 'Left' ? sibling.style.marginLeft = '0px' : sibling.style.marginRight = '0px';
            }
        }
        var margin = this.position === 'Left' ? elementWidth + 'px' : elementWidth + 'px';
        var eleWidth = this.position === 'Left' ? elementWidth : -(elementWidth);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [PUSH, OVER, SLIDE]);
        switch (type) {
            case 'Push':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [PUSH]);
                if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
                    this.position === 'Left' ? sibling.style.marginLeft = margin : sibling.style.marginRight = margin;
                }
                break;
            case 'Slide':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [SLIDE]);
                if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
                    sibling.style.transform = 'translateX(' + eleWidth + 'px)';
                }
                break;
            case 'Over':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [OVER]);
                if (this.enableDock && this.element.classList.contains(CLOSE)) {
                    if (sibling) {
                        this.position === 'Left' ? sibling.style.marginLeft = margin : sibling.style.marginRight = margin;
                    }
                }
                break;
            case 'Auto':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [TRASITION]);
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    if (sibling && (this.enableDock) && !this.getState()) {
                        this.position === 'Left' ? sibling.style.marginLeft = margin : sibling.style.marginRight = margin;
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], PUSH);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], OVER);
                    }
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], PUSH);
                    if (sibling && (this.enableDock || this.element.classList.contains(OPEN))) {
                        this.position === 'Left' ? sibling.style.marginLeft = margin : sibling.style.marginRight = margin;
                    }
                }
                this.createBackDrop();
        }
    };
    /**
     * Removes the control from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
     * @returns void
     */
    Sidebar.prototype.destroy = function () {
        _super.prototype.destroy.call(this);
        if (this.target) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.target], CONTEXT);
        }
        this.destroyBackDrop();
        if (this.element) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [OPEN, CLOSE, PUSH, SLIDE, OVER, LEFT, RIGHT, TRASITION]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], SIDEBARABSOLUTE);
            this.element.style.width = '';
            this.element.style.zIndex = '';
            this.element.style.transform = '';
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.sidebarEleCopy.getAttribute('tabindex'))) ?
                this.element.setAttribute('tabindex', this.tabIndex) : this.element.removeAttribute('tabindex');
        }
        this.windowWidth = null;
        var sibling = document.querySelector('.e-main-content') || this.targetEle;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(sibling)) {
            sibling.style.margin = '';
            sibling.style.transform = '';
        }
        this.unWireEvents();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Sidebar.prototype, "dockSize", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Sidebar.prototype, "mediaQuery", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "enableDock", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('en-US')
    ], Sidebar.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Sidebar.prototype, "enableGestures", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "isOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "enableRtl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Sidebar.prototype, "animate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Sidebar.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "closeOnDocumentClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], Sidebar.prototype, "position", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Sidebar.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Sidebar.prototype, "showBackdrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Auto')
    ], Sidebar.prototype, "type", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Sidebar.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], Sidebar.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sidebar.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sidebar.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sidebar.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sidebar.prototype, "change", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Sidebar.prototype, "destroyed", void 0);
    Sidebar = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Sidebar);
    return Sidebar;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/tab/index.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/tab/index.js ***!
  \********************************************************************/
/*! exports provided: TabActionSettings, TabAnimationSettings, Header, TabItem, Tab */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _tab__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tab */ "./ej2-resources/18.4.46/scripts/ej2-navigations/tab/tab.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabActionSettings", function() { return _tab__WEBPACK_IMPORTED_MODULE_0__["TabActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabAnimationSettings", function() { return _tab__WEBPACK_IMPORTED_MODULE_0__["TabAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return _tab__WEBPACK_IMPORTED_MODULE_0__["Header"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabItem", function() { return _tab__WEBPACK_IMPORTED_MODULE_0__["TabItem"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return _tab__WEBPACK_IMPORTED_MODULE_0__["Tab"]; });

/**
 * Tab modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/tab/tab.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/tab/tab.js ***!
  \******************************************************************/
/*! exports provided: TabActionSettings, TabAnimationSettings, Header, TabItem, Tab */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabActionSettings", function() { return TabActionSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabAnimationSettings", function() { return TabAnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return Header; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabItem", function() { return TabItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return Tab; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _toolbar_toolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toolbar/toolbar */ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/toolbar.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};







var CLS_TAB = 'e-tab';
var CLS_HEADER = 'e-tab-header';
var CLS_BLA_TEM = 'blazor-template';
var CLS_CONTENT = 'e-content';
var CLS_NEST = 'e-nested';
var CLS_ITEMS = 'e-items';
var CLS_ITEM = 'e-item';
var CLS_TEMPLATE = 'e-template';
var CLS_RTL = 'e-rtl';
var CLS_ACTIVE = 'e-active';
var CLS_DISABLE = 'e-disable';
var CLS_HIDDEN = 'e-hidden';
var CLS_FOCUS = 'e-focused';
var CLS_ICONS = 'e-icons';
var CLS_ICON = 'e-icon';
var CLS_ICON_TAB = 'e-icon-tab';
var CLS_ICON_CLOSE = 'e-close-icon';
var CLS_CLOSE_SHOW = 'e-close-show';
var CLS_TEXT = 'e-tab-text';
var CLS_INDICATOR = 'e-indicator';
var CLS_WRAP = 'e-tab-wrap';
var CLS_TEXT_WRAP = 'e-text-wrap';
var CLS_TAB_ICON = 'e-tab-icon';
var CLS_TB_ITEMS = 'e-toolbar-items';
var CLS_TB_ITEM = 'e-toolbar-item';
var CLS_TB_POP = 'e-toolbar-pop';
var CLS_TB_POPUP = 'e-toolbar-popup';
var CLS_HOR_NAV = 'e-hor-nav';
var CLS_POPUP_OPEN = 'e-popup-open';
var CLS_POPUP_CLOSE = 'e-popup-close';
var CLS_PROGRESS = 'e-progress';
var CLS_IGNORE = 'e-ignore';
var CLS_OVERLAY = 'e-overlay';
var CLS_HSCRCNT = 'e-hscroll-content';
var CLS_VSCRCNT = 'e-vscroll-content';
var CLS_HORIZONTAL = 'e-horizontal';
var CLS_VTAB = 'e-vertical-tab';
var CLS_VERTICAL = 'e-vertical';
var CLS_VLEFT = 'e-vertical-left';
var CLS_VRIGHT = 'e-vertical-right';
var CLS_HBOTTOM = 'e-horizontal-bottom';
var CLS_FILL = 'e-fill-mode';
/**
 * Objects used for configuring the Tab selecting item action properties.
 */
var TabActionSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(TabActionSettings, _super);
    function TabActionSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('SlideLeftIn')
    ], TabActionSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(600)
    ], TabActionSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('ease')
    ], TabActionSettings.prototype, "easing", void 0);
    return TabActionSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Objects used for configuring the Tab animation properties.
 */
var TabAnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(TabAnimationSettings, _super);
    function TabAnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideLeftIn', duration: 600, easing: 'ease' }, TabActionSettings)
    ], TabAnimationSettings.prototype, "previous", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideRightIn', duration: 600, easing: 'ease' }, TabActionSettings)
    ], TabAnimationSettings.prototype, "next", void 0);
    return TabAnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Objects used for configuring the Tab item header properties.
 */
var Header = /** @__PURE__ @class */ (function (_super) {
    __extends(Header, _super);
    function Header() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Header.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Header.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('left')
    ], Header.prototype, "iconPosition", void 0);
    return Header;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * An array of object that is used to configure the Tab.
 */
var TabItem = /** @__PURE__ @class */ (function (_super) {
    __extends(TabItem, _super);
    function TabItem() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, Header)
    ], TabItem.prototype, "header", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TabItem.prototype, "headerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], TabItem.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], TabItem.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TabItem.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TabItem.prototype, "visible", void 0);
    return TabItem;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Tab is a content panel to show multiple contents in a single space, one at a time.
 * Each Tab item has an associated content, that will be displayed based on the active Tab header item.
 * ```html
 * <div id="tab"></div>
 * <script>
 *   var tabObj = new Tab();
 *   tab.appendTo("#tab");
 * </script>
 * ```
 */
var Tab = /** @__PURE__ @class */ (function (_super) {
    __extends(Tab, _super);
    /**
     * Initializes a new instance of the Tab class.
     * @param options  - Specifies Tab model properties as options.
     * @param element  - Specifies the element that is rendered as a Tab.
     */
    function Tab(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.show = {};
        _this.hide = {};
        _this.maxHeight = 0;
        _this.title = 'Close';
        _this.lastIndex = 0;
        _this.isAdd = false;
        _this.isIconAlone = false;
        _this.resizeContext = _this.refreshActElePosition.bind(_this);
        /**
         * Contains the keyboard configuration of the Tab.
         */
        _this.keyConfigs = {
            tab: 'tab',
            home: 'home',
            end: 'end',
            enter: 'enter',
            space: 'space',
            delete: 'delete',
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            moveUp: 'uparrow',
            moveDown: 'downarrow'
        };
        return _this;
    }
    /**
     * Removes the component from the DOM and detaches all its related event handlers, attributes and classes.
     * @returns void
     */
    Tab.prototype.destroy = function () {
        var _this = this;
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tbObj)) {
            this.tbObj.destroy();
        }
        this.unWireEvents();
        ['role', 'aria-disabled', 'aria-activedescendant', 'tabindex', 'aria-orientation'].forEach(function (val) {
            _this.element.removeAttribute(val);
        });
        this.expTemplateContent();
        if (!this.isTemplate) {
            while (this.element.firstElementChild) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element.firstElementChild);
            }
        }
        else {
            var cntEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TAB + ' > .' + CLS_CONTENT, this.element);
            this.element.classList.remove(CLS_TEMPLATE);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cntEle)) {
                cntEle.innerHTML = this.cnt;
            }
        }
        _super.prototype.destroy.call(this);
        this.trigger('destroyed');
    };
    /**
     * Refresh the tab component
     */
    Tab.prototype.refresh = function () {
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        if (!this.isServerRendered) {
            _super.prototype.refresh.call(this);
        }
        else if (this.isServerRendered && this.loadOn !== 'Dynamic') {
            this.setActiveBorder();
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    /**
     * Initialize component
     * @private
     */
    Tab.prototype.preRender = function () {
        var nested = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.' + CLS_CONTENT);
        this.prevIndex = 0;
        this.isNested = false;
        this.isPopup = false;
        this.initRender = true;
        this.isSwipeed = false;
        this.itemIndexArray = [];
        this.templateEle = [];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nested)) {
            nested.parentElement.classList.add(CLS_NEST);
            this.isNested = true;
        }
        var name = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name;
        var css = (name === 'msie') ? 'e-ie' : (name === 'edge') ? 'e-edge' : (name === 'safari') ? 'e-safari' : '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width), 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height) });
        this.setCssClass(this.element, this.cssClass, true);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { role: 'tablist', 'aria-disabled': 'false', 'aria-activedescendant': '' });
        this.setCssClass(this.element, css, true);
        this.updatePopAnimationConfig();
    };
    /**
     * Initialize the component rendering
     * @private
     */
    Tab.prototype.render = function () {
        this.btnCls = this.createElement('span', { className: CLS_ICONS + ' ' + CLS_ICON_CLOSE, attrs: { title: this.title } });
        this.tabId = this.element.id.length > 0 ? ('-' + this.element.id) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getRandomId"])();
        this.renderContainer();
        this.wireEvents();
        this.initRender = false;
    };
    Tab.prototype.renderContainer = function () {
        if (this.isServerRendered) {
            this.isTemplate = false;
            return;
        }
        var ele = this.element;
        if (this.items.length > 0 && ele.children.length === 0) {
            ele.appendChild(this.createElement('div', { className: CLS_CONTENT }));
            this.setOrientation(this.headerPlacement, this.createElement('div', { className: CLS_HEADER }));
            this.isTemplate = false;
        }
        else if (this.element.children.length > 0) {
            this.isTemplate = true;
            ele.classList.add(CLS_TEMPLATE);
            var header = ele.querySelector('.' + CLS_HEADER);
            if (header && this.headerPlacement === 'Bottom') {
                this.setOrientation(this.headerPlacement, header);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, this.element)) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element))) {
            this.renderHeader();
            this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER + ' .' + CLS_TB_ITEMS, this.element);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tbItems)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.tbItems, { selector: '.e-tab-wrap' });
            }
            this.renderContent();
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element).length > 0) {
                var scrCnt = void 0;
                this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER + ' .' + CLS_TB_ITEMS, this.element);
                this.bdrLine = this.createElement('div', { className: CLS_INDICATOR + ' ' + CLS_HIDDEN + ' ' + CLS_IGNORE });
                scrCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + this.scrCntClass, this.tbItems);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrCnt)) {
                    scrCnt.insertBefore(this.bdrLine, scrCnt.firstChild);
                }
                else {
                    this.tbItems.insertBefore(this.bdrLine, this.tbItems.firstChild);
                }
                this.setContentHeight(true);
                this.select(this.selectedItem);
            }
            this.setRTL(this.enableRtl);
        }
    };
    Tab.prototype.serverItemsChanged = function () {
        this.enableAnimation = false;
        this.setActive(this.selectedItem, true);
        if (this.loadOn !== 'Dynamic' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            var itemCollection = [].slice.call(this.cntEle.children);
            var content_1 = CLS_CONTENT + this.tabId + '_' + this.selectedItem;
            itemCollection.forEach(function (item) {
                if (item.classList.contains(CLS_ACTIVE) && item.id !== content_1) {
                    item.classList.remove(CLS_ACTIVE);
                }
                if (item.id === content_1) {
                    item.classList.add(CLS_ACTIVE);
                }
            });
            this.prevIndex = this.selectedItem;
            this.triggerAnimation(CLS_ITEM + this.tabId + '_' + this.selectedItem, false);
        }
        this.enableAnimation = true;
    };
    Tab.prototype.headerReady = function () {
        this.initRender = true;
        this.hdrEle = this.getTabHeader();
        this.setOrientation(this.headerPlacement, this.hdrEle);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.hdrEle)) {
            this.tbObj = (this.hdrEle && this.hdrEle.ej2_instances[0]);
        }
        this.tbObj.clicked = this.clickHandler.bind(this);
        this.tbObj.on('onItemsChanged', this.serverItemsChanged.bind(this));
        this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER + ' .' + CLS_TB_ITEMS, this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tbItems)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.tbItems, { selector: '.e-tab-wrap' });
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element).length > 0) {
            var scrollCnt = void 0;
            this.bdrLine = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_INDICATOR + '.' + CLS_IGNORE, this.element);
            scrollCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + this.scrCntClass, this.tbItems);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollCnt)) {
                scrollCnt.insertBefore(this.bdrLine, scrollCnt.firstElementChild);
            }
            else {
                this.tbItems.insertBefore(this.bdrLine, this.tbItems.firstElementChild);
            }
            this.select(this.selectedItem);
        }
        this.cntEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TAB + ' > .' + CLS_CONTENT, this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.cntEle, { swipe: this.swipeHandler.bind(this) });
        }
        if (this.loadOn === 'Demand') {
            var id = this.setActiveContent();
            this.triggerAnimation(id, false);
        }
        this.initRender = false;
        this.renderComplete();
    };
    Tab.prototype.setActiveContent = function () {
        var id = CLS_ITEM + this.tabId + '_' + this.selectedItem;
        var item = this.getTrgContent(this.cntEle, this.extIndex(id));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            item.classList.add(CLS_ACTIVE);
        }
        return id;
    };
    Tab.prototype.renderHeader = function () {
        var _this = this;
        var hdrPlace = this.headerPlacement;
        var tabItems = [];
        this.hdrEle = this.getTabHeader();
        this.addVerticalClass();
        if (!this.isTemplate) {
            tabItems = this.parseObject(this.items, 0);
        }
        else {
            if (this.element.children.length > 1 && this.element.children[1].classList.contains(CLS_HEADER)) {
                this.setProperties({ headerPlacement: 'Bottom' }, true);
            }
            var count = this.hdrEle.children.length;
            var hdrItems = [];
            for (var i = 0; i < count; i++) {
                hdrItems.push(this.hdrEle.children.item(i).innerHTML);
            }
            if (count > 0) {
                while (this.hdrEle.firstElementChild) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.hdrEle.firstElementChild);
                }
                var tabItems_1 = this.createElement('div', { className: CLS_ITEMS });
                this.hdrEle.appendChild(tabItems_1);
                hdrItems.forEach(function (item, index) {
                    _this.lastIndex = index;
                    var attr = {
                        className: CLS_ITEM, id: CLS_ITEM + _this.tabId + '_' + index,
                        attrs: { role: 'tab', 'aria-controls': CLS_CONTENT + _this.tabId + '_' + index, 'aria-selected': 'false' }
                    };
                    var txt = _this.createElement('span', {
                        className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
                    }).outerHTML;
                    var cont = _this.createElement('div', {
                        className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
                    }).outerHTML;
                    var wrap = _this.createElement('div', { className: CLS_WRAP, innerHTML: cont, attrs: { tabIndex: '-1' } });
                    tabItems_1.appendChild(_this.createElement('div', attr));
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, tabItems_1)[index].appendChild(wrap);
                });
            }
        }
        this.tbObj = new _toolbar_toolbar__WEBPACK_IMPORTED_MODULE_1__["Toolbar"]({
            width: (hdrPlace === 'Left' || hdrPlace === 'Right') ? 'auto' : '100%',
            height: (hdrPlace === 'Left' || hdrPlace === 'Right') ? '100%' : 'auto',
            overflowMode: this.overflowMode,
            items: (tabItems.length !== 0) ? tabItems : [],
            clicked: this.clickHandler.bind(this),
            scrollStep: this.scrollStep,
            enableHtmlSanitizer: this.enableHtmlSanitizer
        });
        this.tbObj.isStringTemplate = true;
        this.tbObj.createElement = this.createElement;
        this.tbObj.appendTo(this.hdrEle);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.hdrEle, { 'aria-label': 'tab-header' });
        this.updateOrientationAttribute();
        this.setCloseButton(this.showCloseButton);
    };
    Tab.prototype.renderContent = function () {
        this.cntEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element);
        var hdrItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element);
        if (this.isTemplate) {
            this.cnt = (this.cntEle.children.length > 0) ? this.cntEle.innerHTML : '';
            var contents = this.cntEle.children;
            for (var i = 0; i < hdrItem.length; i++) {
                if (contents.length - 1 >= i) {
                    contents.item(i).className += CLS_ITEM;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(contents.item(i), { 'role': 'tabpanel', 'aria-labelledby': CLS_ITEM + this.tabId + '_' + i });
                    contents.item(i).id = CLS_CONTENT + this.tabId + '_' + i;
                }
            }
        }
    };
    Tab.prototype.reRenderItems = function () {
        this.renderContainer();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.cntEle, { swipe: this.swipeHandler.bind(this) });
        }
    };
    Tab.prototype.parseObject = function (items, index) {
        var _this = this;
        var tbCount = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element).length;
        var tItems = [];
        var txtWrapEle;
        var spliceArray = [];
        var i = 0;
        items.forEach(function (item, i) {
            var pos = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.iconPosition)) ? '' : item.header.iconPosition;
            var css = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.iconCss)) ? '' : item.header.iconCss;
            if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.headerTemplate)) && (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.text) ||
                ((item.header.text.length === 0)) && (css === ''))) {
                spliceArray.push(i);
                return;
            }
            var txt = item.headerTemplate || item.header.text;
            if (typeof txt === 'string' && _this.enableHtmlSanitizer) {
                txt = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(txt);
            }
            _this.lastIndex = ((tbCount === 0) ? i : ((_this.isReplace) ? (index + i) : (_this.lastIndex + 1)));
            var disabled = (item.disabled) ? ' ' + CLS_DISABLE + ' ' + CLS_OVERLAY : '';
            var hidden = (item.visible === false) ? ' ' + CLS_HIDDEN : '';
            txtWrapEle = _this.createElement('div', { className: CLS_TEXT, attrs: { 'role': 'presentation' } });
            var tHtml = ((txt instanceof Object) ? txt.outerHTML : txt);
            var txtEmpty = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tHtml) && tHtml !== '');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(txt.tagName)) {
                txtWrapEle.appendChild(txt);
            }
            else {
                _this.headerTextCompile(txtWrapEle, txt, i);
            }
            var tEle;
            var icon = _this.createElement('span', {
                className: CLS_ICONS + ' ' + CLS_TAB_ICON + ' ' + CLS_ICON + '-' + pos + ' ' + css
            });
            var tCont = _this.createElement('div', { className: CLS_TEXT_WRAP });
            tCont.appendChild(txtWrapEle);
            if ((txt !== '' && txt !== undefined) && css !== '') {
                if ((pos === 'left' || pos === 'top')) {
                    tCont.insertBefore(icon, tCont.firstElementChild);
                }
                else {
                    tCont.appendChild(icon);
                }
                tEle = txtWrapEle;
                _this.isIconAlone = false;
            }
            else {
                tEle = ((css === '') ? txtWrapEle : icon);
                if (tEle === icon) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(txtWrapEle);
                    tCont.appendChild(icon);
                    _this.isIconAlone = true;
                }
            }
            var wrapAttrs = (item.disabled) ? {} : { tabIndex: '-1' };
            tCont.appendChild(_this.btnCls.cloneNode(true));
            var wrap = _this.createElement('div', { className: CLS_WRAP, attrs: wrapAttrs });
            wrap.appendChild(tCont);
            if (_this.itemIndexArray === []) {
                _this.itemIndexArray.push(CLS_ITEM + _this.tabId + '_' + _this.lastIndex);
            }
            else {
                _this.itemIndexArray.splice((index + i), 0, CLS_ITEM + _this.tabId + '_' + _this.lastIndex);
            }
            var attrObj = {
                id: CLS_ITEM + _this.tabId + '_' + _this.lastIndex, role: 'tab', 'aria-selected': 'false'
            };
            var tItem = { htmlAttributes: attrObj, template: wrap };
            tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden
                + ((css !== '') ? 'e-i' + pos : '') + ' ' + ((!txtEmpty) ? CLS_ICON : '');
            if (pos === 'top' || pos === 'bottom') {
                _this.element.classList.add('e-vertical-icon');
            }
            tItems.push(tItem);
            i++;
        });
        if (!this.isAdd) {
            spliceArray.forEach(function (spliceItemIndex) {
                _this.items.splice(spliceItemIndex, 1);
            });
        }
        (this.isIconAlone) ? this.element.classList.add(CLS_ICON_TAB) : this.element.classList.remove(CLS_ICON_TAB);
        return tItems;
    };
    Tab.prototype.removeActiveClass = function () {
        var tabHeader = this.getTabHeader();
        if (tabHeader) {
            var tabItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE, tabHeader);
            [].slice.call(tabItems).forEach(function (node) { return node.classList.remove(CLS_ACTIVE); });
        }
    };
    Tab.prototype.checkPopupOverflow = function (ele) {
        this.tbPop = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_POP, this.element);
        var popIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-hor-nav', this.element);
        var tbrItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS, this.element);
        var lastChild = tbrItems.lastChild;
        var isOverflow = false;
        if (!this.isVertical() && ((this.enableRtl && ((popIcon.offsetLeft + popIcon.offsetWidth) > tbrItems.offsetLeft))
            || (!this.enableRtl && popIcon.offsetLeft < tbrItems.offsetWidth))) {
            isOverflow = true;
        }
        else if (this.isVertical() && (popIcon.offsetTop < lastChild.offsetTop + lastChild.offsetHeight)) {
            isOverflow = true;
        }
        if (isOverflow) {
            ele.classList.add(CLS_TB_POPUP);
            this.tbPop.insertBefore(ele, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_POPUP, this.tbPop)[0]);
        }
        return true;
    };
    Tab.prototype.popupHandler = function (target) {
        var ripEle = target.querySelector('.e-ripple-element');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ripEle)) {
            ripEle.outerHTML = '';
            target.querySelector('.' + CLS_WRAP).classList.remove('e-ripple');
        }
        this.tbItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEMS + ' .' + CLS_TB_ITEM, this.hdrEle);
        var lastChild = this.tbItem[this.tbItem.length - 1];
        if (this.tbItem.length !== 0) {
            target.classList.remove(CLS_TB_POPUP);
            target.removeAttribute('style');
            this.tbItems.appendChild(target);
            this.actEleId = target.id;
            if (this.checkPopupOverflow(lastChild)) {
                var prevEle = this.tbItems.lastChild.previousElementSibling;
                this.checkPopupOverflow(prevEle);
            }
            this.isPopup = true;
        }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.tbItems).length - 1;
    };
    Tab.prototype.updateOrientationAttribute = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-orientation': (this.isVertical() ? 'vertical' : 'horizontal') });
    };
    Tab.prototype.setCloseButton = function (val) {
        var trg = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, this.element);
        (val === true) ? trg.classList.add(CLS_CLOSE_SHOW) : trg.classList.remove(CLS_CLOSE_SHOW);
        this.tbObj.refreshOverflow();
        this.refreshActElePosition();
    };
    Tab.prototype.prevCtnAnimation = function (prev, current) {
        var animation;
        var checkRTL = this.enableRtl || this.element.classList.contains(CLS_RTL);
        if (this.isPopup || prev <= current) {
            if (this.animation.previous.effect === 'SlideLeftIn') {
                animation = {
                    name: 'SlideLeftOut',
                    duration: this.animation.previous.duration, timingFunction: this.animation.previous.easing
                };
            }
            else {
                animation = null;
            }
        }
        else {
            if (this.animation.next.effect === 'SlideRightIn') {
                animation = {
                    name: 'SlideRightOut',
                    duration: this.animation.next.duration, timingFunction: this.animation.next.easing
                };
            }
            else {
                animation = null;
            }
        }
        return animation;
    };
    Tab.prototype.triggerPrevAnimation = function (oldCnt, prevIndex) {
        var _this = this;
        var animateObj = this.prevCtnAnimation(prevIndex, this.selectedItem);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animateObj)) {
            animateObj.begin = function () {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(oldCnt, { 'position': 'absolute' });
                oldCnt.classList.add(CLS_PROGRESS);
                oldCnt.classList.add('e-view');
            };
            animateObj.end = function () {
                oldCnt.style.display = 'none';
                oldCnt.classList.remove(CLS_ACTIVE);
                oldCnt.classList.remove(CLS_PROGRESS);
                oldCnt.classList.remove('e-view');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(oldCnt, { 'display': '', 'position': '' });
                if (oldCnt.childNodes.length === 0 && !_this.isTemplate) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(oldCnt);
                }
            };
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animateObj).animate(oldCnt);
        }
        else {
            oldCnt.classList.remove(CLS_ACTIVE);
        }
    };
    Tab.prototype.triggerAnimation = function (id, value) {
        var _this = this;
        var prevIndex = this.prevIndex;
        var oldCnt;
        var newCnt;
        if (!this.isServerRendered || (this.isServerRendered && this.loadOn !== 'Dynamic')) {
            var itemCollection = [].slice.call(this.element.querySelector('.' + CLS_CONTENT).children);
            itemCollection.forEach(function (item) {
                if (item.id === _this.prevActiveEle) {
                    oldCnt = item;
                }
            });
            var prevEle = this.tbItem[prevIndex];
            newCnt = this.getTrgContent(this.cntEle, this.extIndex(id));
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCnt) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prevEle)) {
                var idNo = this.extIndex(prevEle.id);
                oldCnt = this.getTrgContent(this.cntEle, idNo);
            }
        }
        else {
            newCnt = this.cntEle.firstElementChild;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newCnt)) {
            this.prevActiveEle = newCnt.id;
        }
        if (this.initRender || value === false || this.animation === {} || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.animation)) {
            if (oldCnt && oldCnt !== newCnt) {
                oldCnt.classList.remove(CLS_ACTIVE);
            }
            return;
        }
        var cnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element);
        var animateObj;
        if (this.prevIndex > this.selectedItem && !this.isPopup) {
            var openEff = this.animation.previous.effect;
            animateObj = {
                name: ((openEff === 'None') ? '' : ((openEff !== 'SlideLeftIn') ? openEff : 'SlideLeftIn')),
                duration: this.animation.previous.duration,
                timingFunction: this.animation.previous.easing
            };
        }
        else if (this.isPopup || this.prevIndex < this.selectedItem || this.prevIndex === this.selectedItem) {
            var clsEff = this.animation.next.effect;
            animateObj = {
                name: ((clsEff === 'None') ? '' : ((clsEff !== 'SlideRightIn') ? clsEff : 'SlideRightIn')),
                duration: this.animation.next.duration,
                timingFunction: this.animation.next.easing
            };
        }
        animateObj.progress = function () {
            cnt.classList.add(CLS_PROGRESS);
            _this.setActiveBorder();
        };
        animateObj.end = function () {
            cnt.classList.remove(CLS_PROGRESS);
            newCnt.classList.add(CLS_ACTIVE);
        };
        if (!this.initRender && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldCnt)) {
            this.triggerPrevAnimation(oldCnt, prevIndex);
        }
        this.isPopup = false;
        if (animateObj.name === '') {
            newCnt.classList.add(CLS_ACTIVE);
        }
        else {
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animateObj).animate(newCnt);
        }
    };
    Tab.prototype.keyPressed = function (trg) {
        var trgParent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_HEADER + ' .' + CLS_TB_ITEM);
        var trgIndex = this.getEleIndex(trgParent);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popEle) && trg.classList.contains('e-hor-nav')) {
            (this.popEle.classList.contains(CLS_POPUP_OPEN)) ? this.popObj.hide(this.hide) : this.popObj.show(this.show);
        }
        else if (trg.classList.contains('e-scroll-nav')) {
            trg.click();
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgParent) && trgParent.classList.contains(CLS_ACTIVE) === false) {
                this.select(trgIndex);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popEle)) {
                    this.popObj.hide(this.hide);
                }
            }
        }
    };
    Tab.prototype.getTabHeader = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element)) {
            return undefined;
        }
        var headers = [].slice.call(this.element.children).filter(function (e) { return e.classList.contains(CLS_HEADER); });
        if (headers.length > 0) {
            return headers[0];
        }
        else {
            var wrap = [].slice.call(this.element.children).filter(function (e) { return !e.classList.contains(CLS_BLA_TEM); })[0];
            if (!wrap) {
                return undefined;
            }
            return [].slice.call(wrap.children).filter(function (e) { return e.classList.contains(CLS_HEADER); })[0];
        }
    };
    Tab.prototype.getEleIndex = function (item) {
        return Array.prototype.indexOf.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.getTabHeader()), item);
    };
    Tab.prototype.extIndex = function (id) {
        return id.replace(CLS_ITEM + this.tabId + '_', '');
    };
    Tab.prototype.expTemplateContent = function () {
        var _this = this;
        this.templateEle.forEach(function (eleStr) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.element.querySelector(eleStr))) {
                document.body.appendChild(_this.element.querySelector(eleStr)).style.display = 'none';
            }
        });
    };
    Tab.prototype.templateCompile = function (ele, cnt, index) {
        var tempEle = this.createElement('div');
        this.compileElement(tempEle, cnt, 'content', index);
        if (tempEle.childNodes.length !== 0) {
            ele.appendChild(tempEle);
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Tab.prototype.compileElement = function (ele, val, prop, index) {
        var templateFn;
        if (typeof val === 'string') {
            val = val.trim();
            ele.innerHTML = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(val);
        }
        else {
            templateFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(val);
        }
        var templateFUN;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateFn)) {
            templateFUN = templateFn({}, this, prop);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateFn) && templateFUN.length > 0) {
            [].slice.call(templateFUN).forEach(function (el) {
                ele.appendChild(el);
            });
        }
    };
    Tab.prototype.headerTextCompile = function (element, text, index) {
        this.compileElement(element, text, 'headerTemplate', index);
    };
    Tab.prototype.getContent = function (ele, cnt, callType, index) {
        var eleStr;
        if (typeof cnt === 'string' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cnt.innerHTML)) {
            if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
                cnt = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(cnt);
            }
            if (cnt[0] === '.' || cnt[0] === '#') {
                if (document.querySelectorAll(cnt).length) {
                    var eleVal = document.querySelector(cnt);
                    eleStr = eleVal.outerHTML.trim();
                    if (callType === 'clone') {
                        ele.appendChild(eleVal.cloneNode(true));
                    }
                    else {
                        ele.appendChild(eleVal);
                        eleVal.style.display = '';
                    }
                }
                else {
                    this.templateCompile(ele, cnt, index);
                }
            }
            else {
                this.templateCompile(ele, cnt, index);
            }
        }
        else {
            ele.appendChild(cnt);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eleStr)) {
            if (this.templateEle.indexOf(cnt.toString()) === -1) {
                this.templateEle.push(cnt.toString());
            }
        }
    };
    Tab.prototype.getTrgContent = function (cntEle, no) {
        var ele;
        if (this.element.classList.contains(CLS_NEST)) {
            ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_NEST + '> .' + CLS_CONTENT + ' > #' + CLS_CONTENT + this.tabId + '_' + no, this.element);
        }
        else {
            ele = this.findEle(cntEle.children, CLS_CONTENT + this.tabId + '_' + no);
        }
        return ele;
    };
    Tab.prototype.findEle = function (items, key) {
        var ele;
        for (var i = 0; i < items.length; i++) {
            if (items[i].id === key) {
                ele = items[i];
                break;
            }
        }
        return ele;
    };
    Tab.prototype.isVertical = function () {
        var isVertical = (this.headerPlacement === 'Left' || this.headerPlacement === 'Right') ? true : false;
        this.scrCntClass = (isVertical) ? CLS_VSCRCNT : CLS_HSCRCNT;
        return isVertical;
    };
    Tab.prototype.addVerticalClass = function () {
        if (this.isVertical()) {
            var tbPos = (this.headerPlacement === 'Left') ? CLS_VLEFT : CLS_VRIGHT;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.hdrEle], [CLS_VERTICAL, tbPos]);
            if (!this.element.classList.contains(CLS_NEST)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [CLS_VTAB, tbPos]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.hdrEle], [CLS_VTAB, tbPos]);
            }
        }
        if (this.headerPlacement === 'Bottom') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.hdrEle], [CLS_HBOTTOM]);
        }
    };
    Tab.prototype.updatePopAnimationConfig = function () {
        this.show = { name: (this.isVertical() ? 'FadeIn' : 'SlideDown'), duration: 100 };
        this.hide = { name: (this.isVertical() ? 'FadeOut' : 'SlideUp'), duration: 100 };
    };
    Tab.prototype.changeOrientation = function (place) {
        this.setOrientation(place, this.hdrEle);
        var isVertical = this.hdrEle.classList.contains(CLS_VERTICAL) ? true : false;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [CLS_VTAB]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.hdrEle], [CLS_VERTICAL, CLS_VLEFT, CLS_VRIGHT]);
        if (isVertical !== this.isVertical()) {
            this.changeToolbarOrientation();
        }
        this.addVerticalClass();
        this.updateOrientationAttribute();
        this.setActiveBorder();
        this.focusItem();
    };
    Tab.prototype.focusItem = function () {
        var curActItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(' #' + CLS_ITEM + this.tabId + '_' + this.selectedItem, this.hdrEle);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(curActItem)) {
            curActItem.firstElementChild.focus();
        }
    };
    Tab.prototype.serverChangeOrientation = function (newProp, oldProp) {
        this.setOrientation(newProp, this.hdrEle);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [CLS_VTAB]);
        var newValue = newProp === 'Left' || newProp === 'Right';
        var oldValue = oldProp === 'Left' || oldProp === 'Right';
        if (newValue !== oldValue) {
            this.changeToolbarOrientation();
        }
        if (this.isVertical()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [CLS_VTAB]);
        }
        this.updateOrientationAttribute();
        this.setActiveBorder();
        this.focusItem();
    };
    Tab.prototype.changeToolbarOrientation = function () {
        this.tbObj.setProperties({ height: (this.isVertical() ? '100%' : 'auto'), width: (this.isVertical() ? 'auto' : '100%') }, true);
        this.tbObj.changeOrientation();
        this.updatePopAnimationConfig();
    };
    Tab.prototype.setOrientation = function (place, ele) {
        var headerPos = Array.prototype.indexOf.call(this.element.children, ele);
        var contentPos = Array.prototype.indexOf.call(this.element.children, this.element.querySelector('.' + CLS_CONTENT));
        if (place === 'Bottom' && (contentPos > headerPos)) {
            this.element.appendChild(ele);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ele], [CLS_HBOTTOM]);
            this.element.insertBefore(ele, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element));
        }
    };
    Tab.prototype.setCssClass = function (ele, cls, val) {
        if (cls === '') {
            return;
        }
        var list = cls.split(' ');
        for (var i = 0; i < list.length; i++) {
            if (val) {
                ele.classList.add(list[i]);
            }
            else {
                ele.classList.remove(list[i]);
            }
        }
    };
    Tab.prototype.setContentHeight = function (val) {
        if (this.element.classList.contains(CLS_FILL)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], [CLS_FILL]);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            return;
        }
        var hdrEle = this.getTabHeader();
        if (this.heightAdjustMode === 'None') {
            if (this.height === 'auto') {
                return;
            }
            else {
                if (!this.isVertical()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.cntEle, { 'height': (this.element.offsetHeight - hdrEle.offsetHeight) + 'px' });
                }
            }
        }
        else if (this.heightAdjustMode === 'Fill') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [CLS_FILL]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': '100%' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.cntEle, { 'height': (this.element.offsetHeight - hdrEle.offsetHeight) + 'px' });
        }
        else if (this.heightAdjustMode === 'Auto') {
            if (this.isTemplate === true) {
                var cnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_CONTENT + ' > .' + CLS_ITEM, this.element);
                for (var i = 0; i < cnt.length; i++) {
                    cnt[i].setAttribute('style', 'display:block; visibility: visible');
                    this.maxHeight = Math.max(this.maxHeight, this.getHeight(cnt[i]));
                    cnt[i].style.removeProperty('display');
                    cnt[i].style.removeProperty('visibility');
                }
            }
            else {
                this.cntEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element);
                if (val === true) {
                    this.cntEle.appendChild(this.createElement('div', {
                        id: (CLS_CONTENT + this.tabId + '_' + 0), className: CLS_ITEM + ' ' + CLS_ACTIVE,
                        attrs: { 'role': 'tabpanel', 'aria-labelledby': CLS_ITEM + this.tabId + '_' + 0 }
                    }));
                }
                var ele = this.cntEle.children.item(0);
                for (var i = 0; i < this.items.length; i++) {
                    this.getContent(ele, this.items[i].content, 'clone', i);
                    this.maxHeight = Math.max(this.maxHeight, this.getHeight(ele));
                    while (ele.firstChild) {
                        ele.removeChild(ele.firstChild);
                    }
                }
                this.clearTemplate(['content']);
                this.templateEle = [];
                this.getContent(ele, this.items[0].content, 'render', 0);
                ele.classList.remove(CLS_ACTIVE);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.cntEle, { 'height': this.maxHeight + 'px' });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.cntEle, { 'height': 'auto' });
        }
    };
    Tab.prototype.getHeight = function (ele) {
        var cs = window.getComputedStyle(ele);
        return ele.offsetHeight + parseFloat(cs.getPropertyValue('padding-top')) + parseFloat(cs.getPropertyValue('padding-bottom')) +
            parseFloat(cs.getPropertyValue('margin-top')) + parseFloat(cs.getPropertyValue('margin-bottom'));
    };
    Tab.prototype.setActiveBorder = function () {
        var bar;
        var scrollCnt;
        var trgHdrEle = this.getTabHeader();
        var trg = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE, trgHdrEle);
        if (trg === null) {
            return;
        }
        if (this.isServerRendered && trg.classList.contains(CLS_TB_POPUP)) {
            this.popupHandler(trg);
        }
        var root = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_TAB);
        if (this.element !== root) {
            return;
        }
        this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS, trgHdrEle);
        bar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_INDICATOR, trgHdrEle);
        scrollCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS + ' .' + this.scrCntClass, trgHdrEle);
        if (this.isVertical()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'left': '', 'right': '' });
            var tbHeight = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollCnt)) ? this.tbItems.offsetHeight : scrollCnt.offsetHeight;
            if (tbHeight !== 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'top': trg.offsetTop + 'px', 'height': trg.offsetHeight + 'px' });
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'top': 0, 'height': 0 });
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'top': '', 'height': '' });
            var tbWidth = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollCnt)) ? this.tbItems.offsetWidth : scrollCnt.offsetWidth;
            if (tbWidth !== 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'left': trg.offsetLeft + 'px', 'right': tbWidth - (trg.offsetLeft + trg.offsetWidth) + 'px' });
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(bar, { 'left': 'auto', 'right': 'auto' });
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.bdrLine)) {
            this.bdrLine.classList.remove(CLS_HIDDEN);
        }
    };
    Tab.prototype.setActive = function (value, skipDataBind) {
        if (skipDataBind === void 0) { skipDataBind = false; }
        this.tbItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.getTabHeader());
        var trg = this.tbItem[value];
        if (this.isServerRendered && trg) {
            value = parseInt(trg.getAttribute('data-index'), 10);
        }
        if (value < 0 || isNaN(value) || this.tbItem.length === 0) {
            return;
        }
        if (value >= 0 && !skipDataBind) {
            this.allowServerDataBinding = false;
            this.setProperties({ selectedItem: value }, true);
            this.allowServerDataBinding = true;
            if (!this.initRender) {
                this.serverDataBind();
            }
        }
        if (trg.classList.contains(CLS_ACTIVE)) {
            this.setActiveBorder();
            return;
        }
        if (!this.isTemplate) {
            var prev = this.tbItem[this.prevIndex];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prev)) {
                prev.removeAttribute('aria-controls');
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(trg, { 'aria-controls': CLS_CONTENT + this.tabId + '_' + value });
        }
        var id = trg.id;
        this.removeActiveClass();
        trg.classList.add(CLS_ACTIVE);
        trg.setAttribute('aria-selected', 'true');
        var no = Number(this.extIndex(id));
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.prevActiveEle)) {
            this.prevActiveEle = CLS_CONTENT + this.tabId + '_' + no;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-activedescendant': id });
        if (this.isTemplate) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element).children.length > 0) {
                var trg_1 = this.findEle(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element).children, CLS_CONTENT + this.tabId + '_' + no);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trg_1)) {
                    trg_1.classList.add(CLS_ACTIVE);
                }
                this.triggerAnimation(id, this.enableAnimation);
            }
        }
        else if (!this.isServerRendered || (this.isServerRendered && this.loadOn === 'Init')) {
            this.cntEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TAB + ' > .' + CLS_CONTENT, this.element);
            var item = this.getTrgContent(this.cntEle, this.extIndex(id));
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                this.cntEle.appendChild(this.createElement('div', {
                    id: CLS_CONTENT + this.tabId + '_' + this.extIndex(id), className: CLS_ITEM + ' ' + CLS_ACTIVE,
                    attrs: { role: 'tabpanel', 'aria-labelledby': CLS_ITEM + this.tabId + '_' + this.extIndex(id) }
                }));
                var eleTrg = this.getTrgContent(this.cntEle, this.extIndex(id));
                var itemIndex = Array.prototype.indexOf.call(this.itemIndexArray, id);
                this.getContent(eleTrg, this.items[itemIndex].content, 'render', itemIndex);
            }
            else {
                item.classList.add(CLS_ACTIVE);
            }
            this.triggerAnimation(id, this.enableAnimation);
        }
        this.setActiveBorder();
        this.refreshItemVisibility(trg);
        if (!this.initRender && !skipDataBind) {
            trg.firstElementChild.focus();
            var eventArg = {
                previousItem: this.prevItem,
                previousIndex: this.prevIndex,
                selectedItem: trg,
                selectedIndex: value,
                selectedContent: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + CLS_CONTENT + this.tabId + '_' + this.selectingID, this.content),
                isSwiped: this.isSwipeed
            };
            this.trigger('selected', eventArg);
        }
    };
    Tab.prototype.contentReady = function () {
        var id = this.setActiveContent();
        this.triggerAnimation(id, this.enableAnimation);
    };
    Tab.prototype.setItems = function (items) {
        this.isReplace = true;
        this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS, this.getTabHeader());
        this.tbObj.items = this.parseObject(items, 0);
        this.tbObj.dataBind();
        this.isReplace = false;
    };
    Tab.prototype.setRTL = function (value) {
        this.tbObj.enableRtl = value;
        this.tbObj.dataBind();
        this.setCssClass(this.element, CLS_RTL, value);
        this.refreshActiveBorder();
    };
    Tab.prototype.refreshActiveBorder = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.bdrLine)) {
            this.bdrLine.classList.add(CLS_HIDDEN);
        }
        this.setActiveBorder();
    };
    Tab.prototype.showPopup = function (config) {
        var tbPop = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-popup.e-toolbar-pop', this.hdrEle);
        if (tbPop.classList.contains('e-popup-close')) {
            var tbPopObj = (tbPop && tbPop.ej2_instances[0]);
            tbPopObj.position.X = (this.headerPlacement === 'Left') ? 'left' : 'right';
            tbPopObj.dataBind();
            tbPopObj.show(config);
        }
    };
    Tab.prototype.wireEvents = function () {
        window.addEventListener('resize', this.resizeContext);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseover', this.hoverHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.spaceKeyDown, this);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.cntEle, { swipe: this.swipeHandler.bind(this) });
        }
        this.keyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, { keyAction: this.keyHandler.bind(this), keyConfigs: this.keyConfigs });
        this.tabKeyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
            keyAction: this.keyHandler.bind(this),
            keyConfigs: { openPopup: 'shift+f10', tab: 'tab', shiftTab: 'shift+tab' },
            eventName: 'keydown'
        });
    };
    Tab.prototype.unWireEvents = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.keyModule)) {
            this.keyModule.destroy();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tabKeyModule)) {
            this.tabKeyModule.destroy();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cntEle)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.touchModule)) {
                this.touchModule.destroy();
            }
        }
        window.removeEventListener('resize', this.resizeContext);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseover', this.hoverHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', this.spaceKeyDown);
        this.element.classList.remove(CLS_RTL);
        this.element.classList.remove(CLS_FOCUS);
    };
    Tab.prototype.clickHandler = function (args) {
        this.element.classList.remove(CLS_FOCUS);
        var trg = args.originalEvent.target;
        var trgParent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_TB_ITEM);
        var trgIndex = this.getEleIndex(trgParent);
        if (trg.classList.contains(CLS_ICON_CLOSE)) {
            this.removeTab(trgIndex);
        }
        else if (this.isVertical() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_HOR_NAV)) {
            this.showPopup(this.show);
        }
        else {
            this.isPopup = false;
            if (this.isServerRendered && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgParent)) {
                if (parseInt(trgParent.getAttribute('data-index'), 10) !== this.selectedItem) {
                    this.select(trgIndex);
                }
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgParent) && (trgIndex !== this.selectedItem || trgIndex !== this.prevIndex)) {
                this.select(trgIndex, args.originalEvent);
            }
        }
    };
    Tab.prototype.swipeHandler = function (e) {
        if (e.velocity < 3 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.originalEvent.changedTouches)) {
            return;
        }
        if (e.originalEvent) {
            e.originalEvent.stopPropagation();
        }
        this.isSwipeed = true;
        if (e.swipeDirection === 'Right' && this.selectedItem !== 0) {
            for (var k = this.selectedItem - 1; k >= 0; k--) {
                if (!this.tbItem[k].classList.contains(CLS_HIDDEN)) {
                    this.select(k);
                    break;
                }
            }
        }
        else if (e.swipeDirection === 'Left' && (this.selectedItem !== Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element).length - 1)) {
            for (var i = this.selectedItem + 1; i < this.tbItem.length; i++) {
                if (!this.tbItem[i].classList.contains(CLS_HIDDEN)) {
                    this.select(i);
                    break;
                }
            }
        }
        this.isSwipeed = false;
    };
    Tab.prototype.spaceKeyDown = function (e) {
        if ((e.keyCode === 32 && e.which === 32) || (e.keyCode === 35 && e.which === 35)) {
            var clstHead = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CLS_HEADER);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(clstHead)) {
                e.preventDefault();
            }
        }
    };
    Tab.prototype.keyHandler = function (e) {
        if (this.element.classList.contains(CLS_DISABLE)) {
            return;
        }
        this.element.classList.add(CLS_FOCUS);
        var trg = e.target;
        var tabHeader = this.getTabHeader();
        var actEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_ACTIVE, tabHeader);
        this.popEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_POP, tabHeader);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popEle)) {
            this.popObj = this.popEle.ej2_instances[0];
        }
        switch (e.action) {
            case 'space':
            case 'enter':
                if (trg.parentElement.classList.contains(CLS_DISABLE)) {
                    return;
                }
                if (e.action === 'enter' && trg.classList.contains('e-hor-nav')) {
                    this.showPopup(this.show);
                    break;
                }
                this.keyPressed(trg);
                break;
            case 'tab':
            case 'shiftTab':
                if (trg.classList.contains(CLS_WRAP)
                    && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_TB_ITEM).classList.contains(CLS_ACTIVE) === false) {
                    trg.setAttribute('tabindex', '-1');
                }
                if (this.popObj && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element)) {
                    this.popObj.hide(this.hide);
                }
                actEle.children.item(0).setAttribute('tabindex', '0');
                break;
            case 'moveLeft':
            case 'moveRight':
                var item = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(document.activeElement, '.' + CLS_TB_ITEM);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
                    this.refreshItemVisibility(item);
                }
                break;
            case 'openPopup':
                e.preventDefault();
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popEle) && this.popEle.classList.contains(CLS_POPUP_CLOSE)) {
                    this.popObj.show(this.show);
                }
                break;
            case 'delete':
                var trgParent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trg, '.' + CLS_TB_ITEM);
                if (this.showCloseButton === true && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trgParent)) {
                    var nxtSib = trgParent.nextSibling;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nxtSib) && nxtSib.classList.contains(CLS_TB_ITEM)) {
                        nxtSib.firstElementChild.focus();
                    }
                    this.removeTab(this.getEleIndex(trgParent));
                }
                this.setActiveBorder();
                break;
        }
    };
    Tab.prototype.refreshActElePosition = function () {
        var activeEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEM + '.' + CLS_TB_POPUP + '.' + CLS_ACTIVE, this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeEle)) {
            this.select(this.getEleIndex(activeEle));
        }
        this.refreshActiveBorder();
    };
    Tab.prototype.refreshItemVisibility = function (target) {
        var scrCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + this.scrCntClass, this.tbItems);
        if (!this.isVertical() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrCnt)) {
            var scrBar = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-hscroll-bar', this.tbItems);
            var scrStart = scrBar.scrollLeft;
            var scrEnd = scrStart + scrBar.offsetWidth;
            var eleStart = target.offsetLeft;
            var eleWidth = target.offsetWidth;
            var eleEnd = target.offsetLeft + target.offsetWidth;
            if ((scrStart < eleStart) && (scrEnd < eleEnd)) {
                var eleViewRange = scrEnd - eleStart;
                scrBar.scrollLeft = scrStart + (eleWidth - eleViewRange);
            }
            else {
                if ((scrStart > eleStart) && (scrEnd > eleEnd)) {
                    var eleViewRange = eleEnd - scrStart;
                    scrBar.scrollLeft = scrStart - (eleWidth - eleViewRange);
                }
            }
        }
        else {
            return;
        }
    };
    Tab.prototype.hoverHandler = function (e) {
        var trg = e.target;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trg.classList) && trg.classList.contains(CLS_ICON_CLOSE)) {
            trg.setAttribute('title', new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('tab', { closeButtonTitle: this.title }, this.locale).getConstant('closeButtonTitle'));
        }
    };
    Tab.prototype.evalOnPropertyChangeItems = function (newProp, oldProp) {
        if (!(newProp.items instanceof Array && oldProp.items instanceof Array)) {
            var changedProp = Object.keys(newProp.items);
            for (var i = 0; i < changedProp.length; i++) {
                var index = parseInt(Object.keys(newProp.items)[i], 10);
                var property = Object.keys(newProp.items[index])[0];
                var oldVal = Object(oldProp.items[index])[property];
                var newVal = Object(newProp.items[index])[property];
                var hdrItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS + ' #' + CLS_ITEM + this.tabId + '_' + index, this.element);
                var cntItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT + ' #' + CLS_CONTENT + this.tabId + '_' + index, this.element);
                if (property === 'header' || property === 'headerTemplate') {
                    var icon = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.items[index].header) ||
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.items[index].header.iconCss)) ? '' : this.items[index].header.iconCss;
                    var textVal = this.items[index].headerTemplate || this.items[index].header.text;
                    if ((textVal === '') && (icon === '')) {
                        this.removeTab(index);
                    }
                    else {
                        var arr = [];
                        arr.push(this.items[index]);
                        this.items.splice(index, 1);
                        this.itemIndexArray.splice(index, 1);
                        this.tbObj.items.splice(index, 1);
                        var isHiddenEle = hdrItem.classList.contains(CLS_HIDDEN);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(hdrItem);
                        this.isReplace = true;
                        this.addTab(arr, index);
                        if (isHiddenEle) {
                            this.hideTab(index);
                        }
                        this.isReplace = false;
                    }
                }
                if (property === 'content' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cntItem)) {
                    var strVal = typeof newVal === 'string' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newVal.innerHTML);
                    if (strVal && (newVal[0] === '.' || newVal[0] === '#') && newVal.length) {
                        var eleVal = document.querySelector(newVal);
                        cntItem.appendChild(eleVal);
                        eleVal.style.display = '';
                    }
                    else if (newVal === '' && oldVal[0] === '#') {
                        document.body.appendChild(this.element.querySelector(oldVal)).style.display = 'none';
                        cntItem.innerHTML = newVal;
                    }
                    else if (typeof newVal !== 'function') {
                        cntItem.innerHTML = newVal;
                    }
                }
                if (property === 'cssClass') {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hdrItem)) {
                        hdrItem.classList.remove(oldVal);
                        hdrItem.classList.add(newVal);
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cntItem)) {
                        cntItem.classList.remove(oldVal);
                        cntItem.classList.add(newVal);
                    }
                }
                if (property === 'disabled') {
                    this.enableTab(index, ((newVal === true) ? false : true));
                }
                if (property === 'visible') {
                    this.hideTab(index, ((newVal === true) ? false : true));
                }
            }
        }
        else {
            this.lastIndex = 0;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tbObj)) {
                this.reRenderItems();
            }
            else {
                // tslint:disable-next-line:no-any
                if (this.isRect) {
                    this.clearTemplate();
                }
                this.setItems(newProp.items);
                if (this.templateEle.length > 0) {
                    this.expTemplateContent();
                }
                this.templateEle = [];
                var selectElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TAB + ' > .' + CLS_CONTENT, this.element);
                while (selectElement.firstElementChild) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(selectElement.firstElementChild);
                }
                this.select(this.selectedItem);
            }
        }
    };
    /**
     * Enables or disables the specified Tab item. On passing value as `false`, the item will be disabled.
     * @param  {number} index - Index value of target Tab item.
     * @param  {boolean} value - Boolean value that determines whether the command should be enabled or disabled.
     * By default, isEnable is true.
     * @returns void.
     */
    Tab.prototype.enableTab = function (index, value) {
        var tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element)[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tbItems)) {
            return;
        }
        if (value === true) {
            tbItems.classList.remove(CLS_DISABLE, CLS_OVERLAY);
            tbItems.firstElementChild.setAttribute('tabindex', '-1');
        }
        else {
            tbItems.classList.add(CLS_DISABLE, CLS_OVERLAY);
            tbItems.firstElementChild.removeAttribute('tabindex');
            if (tbItems.classList.contains(CLS_ACTIVE)) {
                this.select(index + 1);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.items[index])) {
            this.items[index].disabled = !value;
            this.dataBind();
        }
        tbItems.setAttribute('aria-disabled', (value === true) ? 'false' : 'true');
    };
    /**
     * Adds new items to the Tab that accepts an array as Tab items.
     * @param  {TabItemsModel[]} items - An array of item that is added to the Tab.
     * @param  {number} index - Number value that determines where the items to be added. By default, index is 0.
     * @returns void.
     */
    Tab.prototype.addTab = function (items, index) {
        var _this = this;
        var addArgs = { addedItems: items, cancel: false };
        if (!this.isReplace) {
            this.trigger('adding', addArgs, function (tabAddingArgs) {
                if (!tabAddingArgs.cancel) {
                    _this.addingTabContent(items, index);
                }
            });
        }
        else {
            this.addingTabContent(items, index);
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Tab.prototype.addingTabContent = function (items, index) {
        var _this = this;
        var lastEleIndex = 0;
        this.hdrEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_HEADER, this.element);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.hdrEle)) {
            this.items = items;
            this.reRenderItems();
        }
        else {
            var itemsCount = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element).length;
            if (itemsCount !== 0) {
                lastEleIndex = this.lastIndex + 1;
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
                index = itemsCount - 1;
            }
            if (itemsCount < index || index < 0 || isNaN(index)) {
                return;
            }
            if (itemsCount === 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.hdrEle)) {
                this.hdrEle.style.display = '';
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.bdrLine)) {
                this.bdrLine.classList.add(CLS_HIDDEN);
            }
            this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS, this.getTabHeader());
            this.isAdd = true;
            var tabItems = this.parseObject(items, index);
            this.isAdd = false;
            var i_1 = 0;
            var textValue_1;
            items.forEach(function (item, place) {
                textValue_1 = item.headerTemplate || item.header.text;
                if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.headerTemplate || item.header) ||
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(textValue_1) || (textValue_1.length === 0) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.iconCss))) {
                    _this.items.splice((index + i_1), 0, item);
                    i_1++;
                }
                if (_this.isTemplate && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.text)) {
                    var no = lastEleIndex + place;
                    var ele = _this.createElement('div', {
                        id: CLS_CONTENT + _this.tabId + '_' + no, className: CLS_ITEM,
                        attrs: { role: 'tabpanel', 'aria-labelledby': CLS_ITEM + '_' + no }
                    });
                    _this.cntEle.insertBefore(ele, _this.cntEle.children[(index + place)]);
                    var eleTrg = _this.getTrgContent(_this.cntEle, no.toString());
                    _this.getContent(eleTrg, item.content, 'render', index);
                }
            });
            this.tbObj.addItems(tabItems, index);
            if (!this.isReplace) {
                this.trigger('added', { addedItems: items });
            }
            if (this.selectedItem === index) {
                this.select(index);
            }
            else {
                this.setActiveBorder();
            }
        }
    };
    /**
     * Removes the items in the Tab from the specified index.
     * @param  {number} index - Index of target item that is going to be removed.
     * @returns void.
     */
    Tab.prototype.removeTab = function (index) {
        var _this = this;
        var trg = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element)[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trg)) {
            return;
        }
        var removeArgs = { removedItem: trg, removedIndex: index, cancel: false };
        this.trigger('removing', removeArgs, function (tabRemovingArgs) {
            if (!tabRemovingArgs.cancel) {
                _this.tbObj.removeItems(index);
                _this.items.splice(index, 1);
                _this.itemIndexArray.splice(index, 1);
                _this.refreshActiveBorder();
                var cntTrg = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + CLS_CONTENT + _this.tabId + '_' + _this.extIndex(trg.id), Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, _this.element));
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cntTrg)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(cntTrg);
                }
                _this.trigger('removed', tabRemovingArgs);
                if (trg.classList.contains(CLS_ACTIVE)) {
                    // tslint:disable-next-line:max-line-length
                    index = (index > Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM + ':not(.' + CLS_TB_POPUP + ')', _this.element).length - 1) ? index - 1 : index;
                    _this.enableAnimation = false;
                    _this.selectedItem = index;
                    _this.select(index);
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, _this.element).length === 0) {
                    _this.hdrEle.style.display = 'none';
                }
                _this.enableAnimation = true;
            }
        });
    };
    /**
     * Shows or hides the Tab that is in the specified index.
     * @param  {number} index - Index value of target item.
     * @param  {boolean} value - Based on this Boolean value, item will be hide (false) or show (true). By default, value is true.
     * @returns void.
     */
    Tab.prototype.hideTab = function (index, value) {
        var items;
        var item = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, this.element)[index];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item)) {
            return;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value)) {
            value = true;
        }
        this.bdrLine.classList.add(CLS_HIDDEN);
        if (value === true) {
            item.classList.add(CLS_HIDDEN);
            items = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM + ':not(.' + CLS_HIDDEN + ')', this.tbItems);
            if (items.length !== 0 && item.classList.contains(CLS_ACTIVE)) {
                if (index !== 0) {
                    for (var i = index - 1; i >= 0; i--) {
                        if (!this.tbItem[i].classList.contains(CLS_HIDDEN)) {
                            this.select(i);
                            break;
                        }
                        else if (i === 0) {
                            for (var k = index + 1; k < this.tbItem.length; k++) {
                                if (!this.tbItem[k].classList.contains(CLS_HIDDEN)) {
                                    this.select(k);
                                    break;
                                }
                            }
                        }
                    }
                }
                else {
                    for (var k = index + 1; k < this.tbItem.length; k++) {
                        if (!this.tbItem[k].classList.contains(CLS_HIDDEN)) {
                            this.select(k);
                            break;
                        }
                    }
                }
            }
            else if (items.length === 0) {
                this.element.classList.add(CLS_HIDDEN);
            }
        }
        else {
            this.element.classList.remove(CLS_HIDDEN);
            items = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM + ':not(.' + CLS_HIDDEN + ')', this.tbItems);
            item.classList.remove(CLS_HIDDEN);
            if (items.length === 0) {
                this.select(index);
            }
        }
        this.setActiveBorder();
        item.setAttribute('aria-hidden', '' + value);
        if (!this.isServerRendered && this.overflowMode === 'Popup' && this.tbObj) {
            this.tbObj.refreshOverflow();
        }
    };
    /**
     * Specifies the index or HTMLElement to select an item from the Tab.
     * @param  {number | HTMLElement} args - Index or DOM element is used for selecting an item from the Tab.
     * @returns void.
     */
    Tab.prototype.select = function (args, event) {
        var _this = this;
        var tabHeader = this.getTabHeader();
        this.tbItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_TB_ITEMS, tabHeader);
        this.tbItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TB_ITEM, tabHeader);
        this.content = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CLS_CONTENT, this.element);
        this.prevItem = this.tbItem[this.prevIndex];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedItem) || (this.selectedItem < 0) || (this.tbItem.length <= this.selectedItem) || isNaN(this.selectedItem)) {
            this.selectedItem = 0;
        }
        else {
            this.selectedID = this.extIndex(this.tbItem[this.selectedItem].id);
        }
        var trg = this.tbItem[args];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(trg)) {
            this.selectedID = '0';
        }
        else {
            this.selectingID = this.extIndex(trg.id);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.prevItem) && !this.prevItem.classList.contains(CLS_DISABLE)) {
            this.prevItem.children.item(0).setAttribute('tabindex', '-1');
        }
        var eventArg = {
            event: event,
            previousItem: this.prevItem,
            previousIndex: this.prevIndex,
            selectedItem: this.tbItem[this.selectedItem],
            selectedIndex: this.selectedItem,
            selectedContent: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content) ?
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + CLS_CONTENT + this.tabId + '_' + this.selectedID, this.content) : null,
            selectingItem: trg,
            selectingIndex: args,
            selectingContent: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content) ?
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + CLS_CONTENT + this.tabId + '_' + this.selectingID, this.content) : null,
            isSwiped: this.isSwipeed,
            cancel: false
        };
        if (!this.initRender) {
            this.trigger('selecting', eventArg, function (selectArgs) {
                if (!selectArgs.cancel) {
                    _this.selectingContent(args);
                }
            });
        }
        else {
            this.selectingContent(args);
        }
    };
    Tab.prototype.selectingContent = function (args) {
        if (typeof args === 'number') {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tbItem[args]) && (this.tbItem[args].classList.contains(CLS_DISABLE) ||
                this.tbItem[args].classList.contains(CLS_HIDDEN))) {
                for (var i = args + 1; i < this.items.length; i++) {
                    if (this.items[i].disabled === false && this.items[i].visible === true) {
                        args = i;
                        break;
                    }
                    else {
                        args = 0;
                    }
                }
            }
            if (this.tbItem.length > args && args >= 0 && !isNaN(args)) {
                this.prevIndex = this.selectedItem;
                if (this.tbItem[args].classList.contains(CLS_TB_POPUP)) {
                    this.setActive(this.popupHandler(this.tbItem[args]));
                }
                else {
                    this.setActive(args);
                }
            }
            else {
                this.setActive(0);
            }
        }
        else if (args instanceof (HTMLElement)) {
            this.setActive(this.getEleIndex(args));
        }
    };
    /**
     * Specifies the value to disable/enable the Tab component.
     * When set to `true`, the component will be disabled.
     * @param  {boolean} value - Based on this Boolean value, Tab will be enabled (false) or disabled (true).
     * @returns void.
     */
    Tab.prototype.disable = function (value) {
        this.setCssClass(this.element, CLS_DISABLE, value);
        this.element.setAttribute('aria-disabled', '' + value);
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     */
    Tab.prototype.getPersistData = function () {
        return this.addOnPersist(['selectedItem', 'actEleId']);
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    Tab.prototype.getModuleName = function () {
        return 'tab';
    };
    /**
     * Gets called when the model property changes.The data that describes the old and new values of the property that changed.
     * @param  {TabModel} newProp
     * @param  {TabModel} oldProp
     * @returns void
     * @private
     */
    Tab.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'width':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { width: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width) });
                    break;
                case 'height':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { height: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height) });
                    if (!this.isServerRendered) {
                        this.setContentHeight(false);
                    }
                    break;
                case 'cssClass':
                    if (oldProp.cssClass !== '') {
                        this.setCssClass(this.element, oldProp.cssClass, false);
                        this.setCssClass(this.element, newProp.cssClass, true);
                    }
                    else {
                        this.setCssClass(this.element, newProp.cssClass, true);
                    }
                    break;
                case 'items':
                    if (!this.isServerRendered) {
                        this.evalOnPropertyChangeItems(newProp, oldProp);
                    }
                    break;
                case 'showCloseButton':
                    this.setCloseButton(newProp.showCloseButton);
                    break;
                case 'selectedItem':
                    if (!this.isServerRendered) {
                        this.selectedItem = oldProp.selectedItem;
                        this.select(newProp.selectedItem);
                    }
                    break;
                case 'headerPlacement':
                    if (this.isServerRendered) {
                        this.serverChangeOrientation(newProp.headerPlacement, oldProp.headerPlacement);
                    }
                    else {
                        this.changeOrientation(newProp.headerPlacement);
                    }
                    break;
                case 'enableRtl':
                    this.setRTL(newProp.enableRtl);
                    break;
                case 'overflowMode':
                    this.tbObj.overflowMode = newProp.overflowMode;
                    this.tbObj.dataBind();
                    this.refreshActElePosition();
                    break;
                case 'heightAdjustMode':
                    if (!this.isServerRendered) {
                        this.setContentHeight(false);
                        this.select(this.selectedItem);
                    }
                    break;
                case 'scrollStep':
                    if (this.tbObj) {
                        this.tbObj.scrollStep = this.scrollStep;
                    }
                    break;
            }
        }
    };
    Tab.prototype.refreshActiveTab = function () {
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        if (!this.isTemplate) {
            if (this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE).children[0]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.querySelector('.' + CLS_CONTENT).querySelector('.' + CLS_ACTIVE).children[0]);
                var item = this.items[this.selectedItem];
                var txtWrap = void 0;
                var pos = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.iconPosition)) ? '' : item.header.iconPosition;
                var css = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.header.iconCss)) ? '' : item.header.iconCss;
                var text = item.headerTemplate || item.header.text;
                txtWrap = this.createElement('div', { className: CLS_TEXT, attrs: { 'role': 'presentation' } });
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(text.tagName)) {
                    txtWrap.appendChild(text);
                }
                else {
                    this.headerTextCompile(txtWrap, text, this.selectedItem);
                }
                var tEle = void 0;
                var icon = this.createElement('span', {
                    className: CLS_ICONS + ' ' + CLS_TAB_ICON + ' ' + CLS_ICON + '-' + pos + ' ' + css
                });
                var tConts = this.createElement('div', { className: CLS_TEXT_WRAP });
                tConts.appendChild(txtWrap);
                if ((text !== '' && text !== undefined) && css !== '') {
                    if ((pos === 'left' || pos === 'top')) {
                        tConts.insertBefore(icon, tConts.firstElementChild);
                    }
                    else {
                        tConts.appendChild(icon);
                    }
                    tEle = txtWrap;
                    this.isIconAlone = false;
                }
                else {
                    tEle = ((css === '') ? txtWrap : icon);
                    if (tEle === icon) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(txtWrap);
                        tConts.appendChild(icon);
                        this.isIconAlone = true;
                    }
                }
                var wrapAtt = (item.disabled) ? {} : { tabIndex: '-1' };
                tConts.appendChild(this.btnCls.cloneNode(true));
                var wraper = this.createElement('div', { className: CLS_WRAP, attrs: wrapAtt });
                wraper.appendChild(tConts);
                if (pos === 'top' || pos === 'bottom') {
                    this.element.classList.add('e-vertical-icon');
                }
                this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE).appendChild(wraper);
                var crElem = this.createElement('div');
                var cnt = item.content;
                var eleStr = void 0;
                if (typeof cnt === 'string' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cnt.innerHTML)) {
                    if (typeof cnt === 'string' && this.enableHtmlSanitizer) {
                        cnt = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(cnt);
                    }
                    if (cnt[0] === '.' || cnt[0] === '#') {
                        if (document.querySelectorAll(cnt).length) {
                            var eleVal = document.querySelector(cnt);
                            eleStr = eleVal.outerHTML.trim();
                            crElem.appendChild(eleVal);
                            eleVal.style.display = '';
                        }
                        else {
                            this.compileElement(crElem, cnt, 'content', this.selectedItem);
                        }
                    }
                    else {
                        this.compileElement(crElem, cnt, 'content', this.selectedItem);
                    }
                }
                else {
                    crElem.appendChild(cnt);
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eleStr)) {
                    if (this.templateEle.indexOf(cnt.toString()) === -1) {
                        this.templateEle.push(cnt.toString());
                    }
                }
                this.element.querySelector('.' + CLS_ITEM + '.' + CLS_ACTIVE).appendChild(crElem);
            }
        }
        else {
            var tabItems = this.element.querySelector('.' + CLS_TB_ITEMS);
            var element = this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE);
            var id = element.id;
            var num = (id.indexOf('_'));
            var index = parseInt(id.substring(num + 1), 10);
            var header = element.innerText;
            var detachContent = this.element.querySelector('.' + CLS_CONTENT).querySelector('.' + CLS_ACTIVE).children[0];
            var mainContents = detachContent.innerHTML;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(element);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(detachContent);
            var attr = {
                className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE + ' ' + CLS_ACTIVE, id: CLS_ITEM + this.tabId + '_' + index,
                attrs: {
                    role: 'tab', 'aria-controls': CLS_CONTENT + this.tabId + '_' + index,
                    'aria-disabled': 'false', 'aria-selected': 'true'
                }
            };
            var txtString = this.createElement('span', {
                className: CLS_TEXT, innerHTML: header, attrs: { 'role': 'presentation' }
            }).outerHTML;
            var conte = this.createElement('div', {
                className: CLS_TEXT_WRAP, innerHTML: txtString + this.btnCls.outerHTML
            }).outerHTML;
            var wrap = this.createElement('div', { className: CLS_WRAP, innerHTML: conte, attrs: { tabIndex: '-1' } });
            tabItems.insertBefore(this.createElement('div', attr), tabItems.children[index + 1]);
            this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE).appendChild(wrap);
            var crElem = this.createElement('div', { innerHTML: mainContents });
            this.element.querySelector('.' + CLS_CONTENT).querySelector('.' + CLS_ACTIVE).appendChild(crElem);
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], TabItem)
    ], Tab.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], Tab.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Tab.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Tab.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Tab.prototype, "selectedItem", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Top')
    ], Tab.prototype, "headerPlacement", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Content')
    ], Tab.prototype, "heightAdjustMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Scrollable')
    ], Tab.prototype, "overflowMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Dynamic')
    ], Tab.prototype, "loadOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tab.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tab.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tab.prototype, "showCloseButton", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Tab.prototype, "scrollStep", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, TabAnimationSettings)
    ], Tab.prototype, "animation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "adding", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "added", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "selecting", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "selected", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "removing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "removed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tab.prototype, "destroyed", void 0);
    Tab = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Tab);
    return Tab;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/index.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/index.js ***!
  \************************************************************************/
/*! exports provided: Item, Toolbar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toolbar */ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/toolbar.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return _toolbar__WEBPACK_IMPORTED_MODULE_0__["Item"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return _toolbar__WEBPACK_IMPORTED_MODULE_0__["Toolbar"]; });

/**
 * Toolbar modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/toolbar.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/toolbar/toolbar.js ***!
  \**************************************************************************/
/*! exports provided: Item, Toolbar */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return Item; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return Toolbar; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _common_h_scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/h-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/h-scroll.js");
/* harmony import */ var _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/v-scroll */ "./ej2-resources/18.4.46/scripts/ej2-navigations/common/v-scroll.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};










var CLS_VERTICAL = 'e-vertical';
var CLS_ITEMS = 'e-toolbar-items';
var CLS_ITEM = 'e-toolbar-item';
var CLS_RTL = 'e-rtl';
var CLS_SEPARATOR = 'e-separator';
var CLS_POPUPICON = 'e-popup-up-icon';
var CLS_POPUPDOWN = 'e-popup-down-icon';
var CLS_POPUPOPEN = 'e-popup-open';
var CLS_TEMPLATE = 'e-template';
var CLS_DISABLE = 'e-overlay';
var CLS_POPUPTEXT = 'e-toolbar-text';
var CLS_TBARTEXT = 'e-popup-text';
var CLS_TBAROVERFLOW = 'e-overflow-show';
var CLS_POPOVERFLOW = 'e-overflow-hide';
var CLS_TBARBTN = 'e-tbar-btn';
var CLS_TBARNAV = 'e-hor-nav';
var CLS_TBARSCRLNAV = 'e-scroll-nav';
var CLS_TBARRIGHT = 'e-toolbar-right';
var CLS_TBARLEFT = 'e-toolbar-left';
var CLS_TBARCENTER = 'e-toolbar-center';
var CLS_TBARPOS = 'e-tbar-pos';
var CLS_HSCROLLCNT = 'e-hscroll-content';
var CLS_VSCROLLCNT = 'e-vscroll-content';
var CLS_HSCROLLBAR = 'e-hscroll-bar';
var CLS_POPUPNAV = 'e-hor-nav';
var CLS_POPUPCLASS = 'e-toolbar-pop';
var CLS_POPUP = 'e-toolbar-popup';
var CLS_TBARBTNTEXT = 'e-tbar-btn-text';
var CLS_TBARNAVACT = 'e-nav-active';
var CLS_TBARIGNORE = 'e-ignore';
var CLS_POPPRI = 'e-popup-alone';
var CLS_HIDDEN = 'e-hidden';
var CLS_MULTIROW = 'e-toolbar-multirow';
var CLS_MULTIROWPOS = 'e-multirow-pos';
var CLS_MULTIROW_SEPARATOR = 'e-multirow-separator';
var CLS_EXTENDABLE_SEPARATOR = 'e-extended-separator';
var CLS_EXTEANDABLE_TOOLBAR = 'e-extended-toolbar';
var CLS_EXTENDABLECLASS = 'e-toolbar-extended';
var CLS_EXTENDPOPUP = 'e-expended-nav';
var CLS_EXTENDEDPOPOPEN = 'e-tbar-extended';
/**
 * An item object that is used to configure Toolbar commands.
 */
var Item = /** @__PURE__ @class */ (function (_super) {
    __extends(Item, _super);
    function Item() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Item.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Item.prototype, "showAlwaysInPopup", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Item.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "prefixIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "suffixIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Item.prototype, "visible", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], Item.prototype, "overflow", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Button')
    ], Item.prototype, "type", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Both')
    ], Item.prototype, "showTextOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Item.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "tooltipText", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], Item.prototype, "align", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Item.prototype, "click", void 0);
    return Item;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * The Toolbar control contains a group of commands that are aligned horizontally.
 * ```html
 * <div id="toolbar"/>
 * <script>
 *   var toolbarObj = new Toolbar();
 *   toolbarObj.appendTo("#toolbar");
 * </script>
 * ```
 */
var Toolbar = /** @__PURE__ @class */ (function (_super) {
    __extends(Toolbar, _super);
    /**
     * Initializes a new instance of the Toolbar class.
     * @param options  - Specifies Toolbar model properties as options.
     * @param element  - Specifies the element that is rendered as a Toolbar.
     */
    function Toolbar(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.resizeContext = _this.resize.bind(_this);
        /**
         * Contains the keyboard configuration of the Toolbar.
         */
        _this.keyConfigs = {
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            moveUp: 'uparrow',
            moveDown: 'downarrow',
            popupOpen: 'enter',
            popupClose: 'escape',
            tab: 'tab',
            home: 'home',
            end: 'end',
        };
        return _this;
    }
    /**
     * Removes the control from the DOM and also removes all its related events.
     * @returns void.
     */
    Toolbar.prototype.destroy = function () {
        var _this = this;
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        _super.prototype.destroy.call(this);
        this.unwireEvents();
        this.tempId.forEach(function (ele) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.element.querySelector(ele))) {
                document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
            }
        });
        while (this.element.lastElementChild) {
            this.element.removeChild(this.element.lastElementChild);
        }
        if (this.trgtEle) {
            this.element.appendChild(this.ctrlTem);
        }
        this.clearProperty();
        this.popObj = null;
        this.tbarAlign = null;
        this.remove(this.element, 'e-toolpop');
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], this.cssClass.split(' '));
        }
        this.element.removeAttribute('style');
        ['aria-disabled', 'aria-orientation', 'aria-haspopup', 'role'].forEach(function (attrb) {
            return _this.element.removeAttribute(attrb);
        });
    };
    /**
     * Initialize the event handler
     * @private
     */
    Toolbar.prototype.preRender = function () {
        var eventArgs = { enableCollision: this.enableCollision, scrollStep: this.scrollStep };
        this.trigger('beforeCreate', eventArgs);
        this.enableCollision = eventArgs.enableCollision;
        this.scrollStep = eventArgs.scrollStep;
        this.scrollModule = null;
        this.popObj = null;
        this.tempId = [];
        this.tbarItemsCol = this.items;
        this.isVertical = this.element.classList.contains(CLS_VERTICAL) ? true : false;
        this.isExtendedOpen = false;
        this.popupPriCount = 0;
        if (this.enableRtl) {
            this.add(this.element, CLS_RTL);
        }
    };
    Toolbar.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
        window.addEventListener('resize', this.resizeContext);
        if (this.allowKeyboard) {
            this.wireKeyboardEvent();
        }
    };
    Toolbar.prototype.wireKeyboardEvent = function () {
        this.keyModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
            keyAction: this.keyActionHandler.bind(this),
            keyConfigs: this.keyConfigs
        });
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.docKeyDown, this);
        this.element.setAttribute('tabIndex', '0');
    };
    Toolbar.prototype.unwireKeyboardEvent = function () {
        if (this.keyModule) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', this.docKeyDown);
            this.keyModule.destroy();
            this.keyModule = null;
        }
    };
    Toolbar.prototype.docKeyDown = function (e) {
        if (e.target.tagName === 'INPUT') {
            return;
        }
        var popCheck = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element) && this.overflowMode !== 'Extended';
        if (e.keyCode === 9 && e.target.classList.contains('e-hor-nav') === true && popCheck) {
            this.popObj.hide({ name: 'FadeOut', duration: 100 });
        }
        var keyCheck = (e.keyCode === 40 || e.keyCode === 38 || e.keyCode === 35 || e.keyCode === 36);
        if (keyCheck) {
            e.preventDefault();
        }
    };
    Toolbar.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
        this.destroyScroll();
        this.unwireKeyboardEvent();
        window.removeEventListener('resize', this.resizeContext);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'scroll', this.docEvent);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'click', this.docEvent);
    };
    Toolbar.prototype.clearProperty = function () {
        this.tbarEle = [];
        this.tbarAlgEle = { lefts: [], centers: [], rights: [] };
    };
    Toolbar.prototype.docEvent = function (e) {
        var popEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-popup');
        if (this.popObj && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element) && !popEle && this.overflowMode === 'Popup') {
            this.popObj.hide({ name: 'FadeOut', duration: 100 });
        }
    };
    Toolbar.prototype.destroyScroll = function () {
        if (this.scrollModule) {
            if (this.tbarAlign) {
                this.add(this.scrollModule.element, CLS_TBARPOS);
            }
            this.scrollModule.destroy();
            this.scrollModule = null;
        }
    };
    Toolbar.prototype.destroyItems = function () {
        if (this.element) {
            [].slice.call(this.element.querySelectorAll('.' + CLS_ITEM)).forEach(function (el) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(el);
            });
        }
        var tbarItems = this.element.querySelector('.' + CLS_ITEMS);
        if (this.tbarAlign) {
            [].slice.call(tbarItems.children).forEach(function (el) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(el);
            });
            this.tbarAlign = false;
            this.remove(tbarItems, CLS_TBARPOS);
        }
        this.clearProperty();
    };
    Toolbar.prototype.destroyMode = function () {
        if (this.scrollModule) {
            this.remove(this.scrollModule.element, CLS_RTL);
            this.destroyScroll();
        }
        this.remove(this.element, CLS_EXTENDEDPOPOPEN);
        this.remove(this.element, CLS_EXTEANDABLE_TOOLBAR);
        var tempEle = this.element.querySelector('.e-toolbar-multirow');
        if (tempEle) {
            this.remove(tempEle, CLS_MULTIROW);
        }
        if (this.popObj) {
            this.popupRefresh(this.popObj.element, true);
        }
    };
    Toolbar.prototype.add = function (ele, val) {
        ele.classList.add(val);
    };
    Toolbar.prototype.remove = function (ele, val) {
        ele.classList.remove(val);
    };
    Toolbar.prototype.elementFocus = function (ele) {
        var fChild = ele.firstElementChild;
        if (fChild) {
            fChild.focus();
            this.activeEleSwitch(ele);
        }
        else {
            ele.focus();
        }
    };
    Toolbar.prototype.clstElement = function (tbrNavChk, trgt) {
        var clst;
        if (tbrNavChk && this.popObj && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element)) {
            clst = this.popObj.element.querySelector('.' + CLS_ITEM);
        }
        else if (this.element === trgt || tbrNavChk) {
            // tslint:disable-next-line:max-line-length
            clst = this.element.querySelector('.' + CLS_ITEM + ':not(.' + CLS_DISABLE + ' ):not(.' + CLS_SEPARATOR + ' ):not(.' + CLS_HIDDEN + ' )');
        }
        else {
            clst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_ITEM);
        }
        return clst;
    };
    Toolbar.prototype.keyHandling = function (clst, e, trgt, navChk, scrollChk) {
        var popObj = this.popObj;
        var rootEle = this.element;
        var popAnimate = { name: 'FadeOut', duration: 100 };
        switch (e.action) {
            case 'moveRight':
                if (this.isVertical) {
                    return;
                }
                if (rootEle === trgt) {
                    this.elementFocus(clst);
                }
                else if (!navChk) {
                    this.eleFocus(clst, 'next');
                }
                break;
            case 'moveLeft':
                if (this.isVertical) {
                    return;
                }
                if (!navChk) {
                    this.eleFocus(clst, 'previous');
                }
                break;
            case 'home':
            case 'end':
                var ele = void 0;
                var nodes = void 0;
                if (clst) {
                    var popupCheck = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(clst, '.e-popup');
                    if (popupCheck) {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element)) {
                            nodes = [].slice.call(popupCheck.children);
                            if (e.action === 'home') {
                                ele = nodes[0];
                            }
                            else {
                                ele = nodes[nodes.length - 1];
                            }
                        }
                    }
                    else {
                        nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM);
                        if (e.action === 'home') {
                            ele = nodes[0];
                        }
                        else {
                            ele = nodes[nodes.length - 1];
                        }
                    }
                    if (ele) {
                        this.elementFocus(ele);
                    }
                }
                break;
            case 'moveUp':
            case 'moveDown':
                var value = e.action === 'moveUp' ? 'previous' : 'next';
                if (!this.isVertical) {
                    if (popObj && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.e-popup')) {
                        var popEle = popObj.element;
                        var popFrstEle = popEle.firstElementChild;
                        if ((value === 'previous' && popFrstEle === clst) || (value === 'next' && popEle.lastElementChild === clst)) {
                            return;
                        }
                        else {
                            this.eleFocus(clst, value);
                        }
                    }
                    else if (e.action === 'moveDown' && popObj && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(popObj.element)) {
                        this.elementFocus(clst);
                    }
                }
                else {
                    if (e.action === 'moveUp') {
                        this.eleFocus(clst, 'previous');
                    }
                    else {
                        this.eleFocus(clst, 'next');
                    }
                }
                break;
            case 'tab':
                if (!scrollChk && !navChk) {
                    var ele_1 = clst.firstElementChild;
                    if (rootEle === trgt) {
                        if (this.activeEle) {
                            this.activeEle.focus();
                        }
                        else {
                            this.activeEleRemove(ele_1);
                            ele_1.focus();
                        }
                        this.element.removeAttribute('tabindex');
                    }
                }
                break;
            case 'popupClose':
                if (popObj && this.overflowMode !== 'Extended') {
                    popObj.hide(popAnimate);
                }
                break;
            case 'popupOpen':
                if (!navChk) {
                    return;
                }
                if (popObj && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(popObj.element)) {
                    popObj.element.style.top = rootEle.offsetHeight + 'px';
                    popObj.show({ name: 'FadeIn', duration: 100 });
                }
                else {
                    popObj.hide(popAnimate);
                }
                break;
        }
    };
    Toolbar.prototype.keyActionHandler = function (e) {
        var trgt = e.target;
        if (trgt.tagName === 'INPUT' || trgt.tagName === 'TEXTAREA' || this.element.classList.contains(CLS_DISABLE)) {
            return;
        }
        e.preventDefault();
        var clst;
        var tbrNavChk = trgt.classList.contains(CLS_TBARNAV);
        var tbarScrollChk = trgt.classList.contains(CLS_TBARSCRLNAV);
        clst = this.clstElement(tbrNavChk, trgt);
        if (clst || tbarScrollChk) {
            this.keyHandling(clst, e, trgt, tbrNavChk, tbarScrollChk);
        }
    };
    /**
     * Specifies the value to disable/enable the Toolbar component.
     * When set to `true`, the component will be disabled.
     * @param  {boolean} value - Based on this Boolean value, Toolbar will be enabled (false) or disabled (true).
     * @returns void.
     */
    Toolbar.prototype.disable = function (value) {
        var rootEle = this.element;
        value ? rootEle.classList.add(CLS_DISABLE) : rootEle.classList.remove(CLS_DISABLE);
        rootEle.setAttribute('tabindex', !value ? '0' : '-1');
        if (this.activeEle) {
            this.activeEle.setAttribute('tabindex', !value ? '0' : '-1');
        }
        if (this.scrollModule) {
            this.scrollModule.disable(value);
        }
        if (this.popObj) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(this.popObj.element) && this.overflowMode !== 'Extended') {
                this.popObj.hide();
            }
            rootEle.querySelector('#' + rootEle.id + '_nav').setAttribute('tabindex', !value ? '0' : '-1');
        }
    };
    Toolbar.prototype.eleContains = function (el) {
        // tslint:disable-next-line:max-line-length
        return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(el);
        // tslint:enable-next-line:max-line-length
    };
    Toolbar.prototype.eleFocus = function (closest, pos) {
        var sib = Object(closest)[pos + 'ElementSibling'];
        if (sib) {
            var skipEle = this.eleContains(sib);
            if (skipEle) {
                this.eleFocus(sib, pos);
                return;
            }
            this.elementFocus(sib);
        }
        else if (this.tbarAlign) {
            var elem = Object(closest.parentElement)[pos + 'ElementSibling'];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(elem) && elem.children.length === 0) {
                elem = Object(elem)[pos + 'ElementSibling'];
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(elem) && elem.children.length > 0) {
                if (pos === 'next') {
                    var el = elem.querySelector('.' + CLS_ITEM);
                    if (this.eleContains(el)) {
                        this.eleFocus(el, pos);
                    }
                    else {
                        el.firstElementChild.focus();
                        this.activeEleSwitch(el);
                    }
                }
                else {
                    var el = elem.lastElementChild;
                    if (this.eleContains(el)) {
                        this.eleFocus(el, pos);
                    }
                    else {
                        this.elementFocus(el);
                    }
                }
            }
        }
    };
    Toolbar.prototype.clickHandler = function (e) {
        var _this = this;
        var trgt = e.target;
        var clsList = trgt.classList;
        var ele = this.element;
        var isPopupElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '.' + CLS_POPUPCLASS));
        var popupNav = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, ('.' + CLS_TBARNAV));
        if (!popupNav) {
            popupNav = trgt;
        }
        if (!ele.children[0].classList.contains('e-hscroll') && !ele.children[0].classList.contains('e-vscroll')
            && (clsList.contains(CLS_TBARNAV))) {
            clsList = trgt.querySelector('.e-icons').classList;
        }
        if (clsList.contains(CLS_POPUPICON) || clsList.contains(CLS_POPUPDOWN)) {
            this.popupClickHandler(ele, popupNav, CLS_RTL);
        }
        var itemObj;
        var clst = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CLS_ITEM);
        if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(clst) || clst.classList.contains(CLS_DISABLE)) && !popupNav.classList.contains(CLS_TBARNAV)) {
            return;
        }
        if (clst) {
            var tempItem = this.items[this.tbarEle.indexOf(clst)];
            itemObj = tempItem;
        }
        var eventArgs = { originalEvent: e, item: itemObj };
        if (itemObj && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemObj.click)) {
            this.trigger('items[' + this.tbarEle.indexOf(clst) + '].click', eventArgs);
        }
        if (!eventArgs.cancel) {
            this.trigger('clicked', eventArgs, function (clickedArgs) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.popObj) && isPopupElement && !clickedArgs.cancel && _this.overflowMode === 'Popup' &&
                    clickedArgs.item && clickedArgs.item.type !== 'Input') {
                    _this.popObj.hide({ name: 'FadeOut', duration: 100 });
                }
            });
        }
    };
    ;
    Toolbar.prototype.popupClickHandler = function (ele, popupNav, CLS_RTL) {
        var popObj = this.popObj;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(popObj.element)) {
            popupNav.classList.remove(CLS_TBARNAVACT);
            popObj.hide({ name: 'FadeOut', duration: 100 });
        }
        else {
            if (ele.classList.contains(CLS_RTL)) {
                popObj.enableRtl = true;
                popObj.position = { X: 'left', Y: 'top' };
            }
            if (popObj.offsetX === 0 && !ele.classList.contains(CLS_RTL)) {
                popObj.enableRtl = false;
                popObj.position = { X: 'right', Y: 'top' };
            }
            popObj.dataBind();
            popObj.refreshPosition();
            popObj.element.style.top = this.getElementOffsetY() + 'px';
            if (this.overflowMode === 'Extended') {
                popObj.element.style.minHeight = '0px';
            }
            popupNav.classList.add(CLS_TBARNAVACT);
            popObj.show({ name: 'FadeIn', duration: 100 });
        }
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    Toolbar.prototype.render = function () {
        this.initialize();
        this.renderControl();
        this.wireEvents();
        this.renderComplete();
    };
    Toolbar.prototype.initialize = function () {
        var width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        var height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height);
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name !== 'msie' || this.height !== 'auto' || this.overflowMode === 'MultiRow') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': height });
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': width });
        var ariaAttr = {
            'role': 'toolbar', 'aria-disabled': 'false', 'aria-haspopup': 'false',
            'aria-orientation': !this.isVertical ? 'horizontal' : 'vertical',
        };
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, ariaAttr);
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.cssClass.split(' '));
        }
    };
    Toolbar.prototype.renderControl = function () {
        var ele = this.element;
        this.trgtEle = (ele.children.length > 0) ? ele.querySelector('div') : null;
        this.tbarAlgEle = { lefts: [], centers: [], rights: [] };
        this.renderItems();
        this.renderLayout();
    };
    Toolbar.prototype.renderLayout = function () {
        this.renderOverflowMode();
        if (this.tbarAlign) {
            this.itemPositioning();
        }
        if (this.popObj && this.popObj.element.childElementCount > 1 && this.checkPopupRefresh(this.element, this.popObj.element)) {
            this.popupRefresh(this.popObj.element, false);
        }
        this.separator();
    };
    Toolbar.prototype.itemsAlign = function (items, itemEleDom) {
        var innerItem;
        var innerPos;
        if (!this.tbarEle) {
            this.tbarEle = [];
        }
        for (var i = 0; i < items.length; i++) {
            innerItem = this.renderSubComponent(items[i], i);
            if (this.tbarEle.indexOf(innerItem) === -1) {
                this.tbarEle.push(innerItem);
            }
            if (!this.tbarAlign) {
                this.tbarItemAlign(items[i], itemEleDom, i);
            }
            innerPos = itemEleDom.querySelector('.e-toolbar-' + items[i].align.toLowerCase());
            if (innerPos) {
                if (!(items[i].showAlwaysInPopup && items[i].overflow !== 'Show')) {
                    this.tbarAlgEle[(items[i].align + 's').toLowerCase()].push(innerItem);
                }
                innerPos.appendChild(innerItem);
            }
            else {
                itemEleDom.appendChild(innerItem);
            }
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            var portals = 'portals';
            // tslint:disable-next-line:no-any
            this.notify('render-react-toolbar-template', this[portals]);
            this.renderReactTemplates();
        }
    };
    /** @hidden */
    Toolbar.prototype.changeOrientation = function () {
        var ele = this.element;
        if (this.isVertical) {
            ele.classList.remove(CLS_VERTICAL);
            this.isVertical = false;
            if (this.height === 'auto' || this.height === '100%') {
                ele.style.height = this.height;
            }
            ele.setAttribute('aria-orientation', 'horizontal');
        }
        else {
            ele.classList.add(CLS_VERTICAL);
            this.isVertical = true;
            ele.setAttribute('aria-orientation', 'vertical');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height), 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width) });
        }
        this.destroyMode();
        this.refreshOverflow();
    };
    Toolbar.prototype.initScroll = function (element, innerItems) {
        if (!this.scrollModule && this.checkOverflow(element, innerItems[0])) {
            if (this.tbarAlign) {
                this.element.querySelector('.' + CLS_ITEMS + ' .' + CLS_TBARCENTER).removeAttribute('style');
            }
            if (this.isVertical) {
                this.scrollModule = new _common_v_scroll__WEBPACK_IMPORTED_MODULE_4__["VScroll"]({ scrollStep: this.scrollStep, enableRtl: this.enableRtl }, innerItems[0]);
            }
            else {
                this.scrollModule = new _common_h_scroll__WEBPACK_IMPORTED_MODULE_3__["HScroll"]({ scrollStep: this.scrollStep, enableRtl: this.enableRtl }, innerItems[0]);
            }
            this.remove(this.scrollModule.element, CLS_TBARPOS);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { overflow: 'hidden' });
        }
    };
    Toolbar.prototype.itemWidthCal = function (items) {
        var _this = this;
        var width = 0;
        var style;
        [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, items)).forEach(function (el) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(el)) {
                style = window.getComputedStyle(el);
                width += _this.isVertical ? el.offsetHeight : el.offsetWidth;
                width += parseFloat(_this.isVertical ? style.marginTop : style.marginRight);
                width += parseFloat(_this.isVertical ? style.marginBottom : style.marginLeft);
            }
        });
        return width;
    };
    Toolbar.prototype.getScrollCntEle = function (innerItem) {
        var trgClass = (this.isVertical) ? '.e-vscroll-content' : '.e-hscroll-content';
        return innerItem.querySelector(trgClass);
    };
    Toolbar.prototype.checkOverflow = function (element, innerItem) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(innerItem) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(element)) {
            return false;
        }
        var eleWidth = this.isVertical ? element.offsetHeight : element.offsetWidth;
        var itemWidth = this.isVertical ? innerItem.offsetHeight : innerItem.offsetWidth;
        if (this.tbarAlign || this.scrollModule || (eleWidth === itemWidth)) {
            itemWidth = this.itemWidthCal(this.scrollModule ? this.getScrollCntEle(innerItem) : innerItem);
        }
        var popNav = element.querySelector('.' + CLS_TBARNAV);
        var scrollNav = element.querySelector('.' + CLS_TBARSCRLNAV);
        var navEleWidth = 0;
        if (popNav) {
            navEleWidth = this.isVertical ? popNav.offsetHeight : popNav.offsetWidth;
        }
        else if (scrollNav) {
            navEleWidth = this.isVertical ? (scrollNav.offsetHeight * (2)) : (scrollNav.offsetWidth * 2);
        }
        if (itemWidth > eleWidth - navEleWidth) {
            return true;
        }
        else {
            return false;
        }
    };
    /**
     * Refresh the whole Toolbar component without re-rendering.
     * - It is used to manually refresh the Toolbar overflow modes such as scrollable, popup, multi row, and extended.
     * - It will refresh the Toolbar component after loading items dynamically.
     * @returns void.
     */
    Toolbar.prototype.refreshOverflow = function () {
        this.resize();
    };
    Toolbar.prototype.toolbarAlign = function (innerItems) {
        if (this.tbarAlign) {
            this.add(innerItems, CLS_TBARPOS);
            this.itemPositioning();
        }
    };
    Toolbar.prototype.renderOverflowMode = function () {
        var ele = this.element;
        var innerItems = ele.querySelector('.' + CLS_ITEMS);
        var priorityCheck = this.popupPriCount > 0;
        if (ele && ele.children.length > 0) {
            this.offsetWid = ele.offsetWidth;
            this.remove(this.element, 'e-toolpop');
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie' && this.height === 'auto') {
                ele.style.height = '';
            }
            switch (this.overflowMode) {
                case 'Scrollable':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollModule)) {
                        this.initScroll(ele, [].slice.call(ele.getElementsByClassName(CLS_ITEMS)));
                    }
                    break;
                case 'Popup':
                    this.add(this.element, 'e-toolpop');
                    if (this.tbarAlign) {
                        this.removePositioning();
                    }
                    if (this.checkOverflow(ele, innerItems) || priorityCheck) {
                        this.setOverflowAttributes(ele);
                    }
                    this.toolbarAlign(innerItems);
                    break;
                case 'MultiRow':
                    this.add(innerItems, CLS_MULTIROW);
                    if (this.checkOverflow(ele, innerItems) && this.tbarAlign) {
                        this.removePositioning();
                        this.add(innerItems, CLS_MULTIROWPOS);
                    }
                    if (ele.style.overflow === 'hidden') {
                        ele.style.overflow = '';
                    }
                    if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie' || ele.style.height !== 'auto') {
                        ele.style.height = 'auto';
                    }
                    break;
                case 'Extended':
                    this.add(this.element, CLS_EXTEANDABLE_TOOLBAR);
                    if (this.checkOverflow(ele, innerItems) || priorityCheck) {
                        if (this.tbarAlign) {
                            this.removePositioning();
                        }
                        this.setOverflowAttributes(ele);
                    }
                    this.toolbarAlign(innerItems);
            }
        }
    };
    Toolbar.prototype.setOverflowAttributes = function (ele) {
        this.createPopupEle(ele, [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEMS + ' .' + CLS_ITEM, ele)));
        this.element.querySelector('.' + CLS_TBARNAV).setAttribute('tabIndex', '0');
        this.element.querySelector('.' + CLS_TBARNAV).setAttribute('role', 'list');
    };
    Toolbar.prototype.separator = function () {
        var element = this.element;
        var eleItem = [].slice.call(element.querySelectorAll('.' + CLS_SEPARATOR));
        var eleInlineItem;
        var multiVar = element.querySelector('.' + CLS_MULTIROW_SEPARATOR);
        var extendVar = element.querySelector('.' + CLS_EXTENDABLE_SEPARATOR);
        eleInlineItem = this.overflowMode === 'MultiRow' ? multiVar : extendVar;
        if (eleInlineItem !== null) {
            if (this.overflowMode === 'MultiRow') {
                eleInlineItem.classList.remove(CLS_MULTIROW_SEPARATOR);
            }
            else if (this.overflowMode === 'Extended') {
                eleInlineItem.classList.remove(CLS_EXTENDABLE_SEPARATOR);
            }
        }
        for (var i = 0; i <= eleItem.length - 1; i++) {
            if (eleItem[i].offsetLeft < 30 && eleItem[i].offsetLeft !== 0) {
                if (this.overflowMode === 'MultiRow') {
                    eleItem[i].classList.add(CLS_MULTIROW_SEPARATOR);
                }
                else if (this.overflowMode === 'Extended') {
                    eleItem[i].classList.add(CLS_EXTENDABLE_SEPARATOR);
                }
            }
        }
    };
    Toolbar.prototype.createPopupEle = function (ele, innerEle) {
        var innerNav = ele.querySelector('.' + CLS_TBARNAV);
        var vertical = this.isVertical;
        if (!innerNav) {
            this.createPopupIcon(ele);
        }
        innerNav = ele.querySelector('.' + CLS_TBARNAV);
        var innerNavDom = (vertical ? innerNav.offsetHeight : innerNav.offsetWidth);
        var eleWidth = ((vertical ? ele.offsetHeight : ele.offsetWidth) - (innerNavDom));
        this.element.classList.remove('e-rtl');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { direction: 'initial' });
        this.checkPriority(ele, innerEle, eleWidth, true);
        if (this.enableRtl) {
            this.element.classList.add('e-rtl');
        }
        this.element.style.removeProperty('direction');
        this.createPopup();
    };
    Toolbar.prototype.pushingPoppedEle = function (tbarObj, popupPri, ele, eleHeight, sepHeight) {
        var element = tbarObj.element;
        var nodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TBAROVERFLOW, ele);
        var nodeIndex = 0;
        var poppedEle = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_POPUP, element.querySelector('.' + CLS_ITEMS)));
        var nodePri = 0;
        poppedEle.forEach(function (el, index) {
            nodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TBAROVERFLOW, ele);
            if (el.classList.contains(CLS_TBAROVERFLOW) && nodes.length > 0) {
                if (tbarObj.tbResize && nodes.length > index) {
                    ele.insertBefore(el, nodes[index]);
                    ++nodePri;
                }
                else {
                    ele.insertBefore(el, ele.children[nodes.length]);
                    ++nodePri;
                }
            }
            else if (el.classList.contains(CLS_TBAROVERFLOW)) {
                ele.insertBefore(el, ele.firstChild);
                ++nodePri;
            }
            else if (tbarObj.tbResize && el.classList.contains(CLS_POPOVERFLOW) && ele.children.length > 0 && nodes.length === 0) {
                ele.insertBefore(el, ele.firstChild);
                ++nodePri;
            }
            else if (el.classList.contains(CLS_POPOVERFLOW)) {
                popupPri.push(el);
            }
            else if (tbarObj.tbResize) {
                ele.insertBefore(el, ele.childNodes[nodeIndex + nodePri]);
                ++nodeIndex;
            }
            else {
                ele.appendChild(el);
            }
            if (el.classList.contains(CLS_SEPARATOR)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(el, { display: '', height: sepHeight + 'px' });
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(el, { display: '', height: eleHeight + 'px' });
            }
        });
        popupPri.forEach(function (el) {
            ele.appendChild(el);
        });
        var tbarEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, element.querySelector('.' + CLS_ITEMS));
        for (var i = tbarEle.length - 1; i >= 0; i--) {
            var tbarElement = tbarEle[i];
            if (tbarElement.classList.contains(CLS_SEPARATOR) && this.overflowMode !== 'Extended') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(tbarElement, { display: 'none' });
            }
            else {
                break;
            }
        }
    };
    Toolbar.prototype.createPopup = function () {
        var element = this.element;
        var eleHeight;
        var eleItem;
        var sepHeight;
        var sepItem;
        if (this.overflowMode === 'Extended') {
            sepItem = element.querySelector('.' + CLS_SEPARATOR + ':not(.' + CLS_POPUP + ')');
            sepHeight = (element.style.height === 'auto' || element.style.height === '') ? null : sepItem.offsetHeight;
        }
        eleItem = element.querySelector('.' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + '):not(.' + CLS_POPUP + ')');
        eleHeight = (element.style.height === 'auto' || element.style.height === '') ? null : (eleItem && eleItem.offsetHeight);
        var ele;
        var popupPri = [];
        if (element.querySelector('#' + element.id + '_popup.' + CLS_POPUPCLASS)) {
            ele = element.querySelector('#' + element.id + '_popup.' + CLS_POPUPCLASS);
        }
        else {
            var extendEle = this.createElement('div', {
                id: element.id + '_popup', className: CLS_POPUPCLASS + ' ' + CLS_EXTENDABLECLASS
            });
            var popupEle = this.createElement('div', { id: element.id + '_popup', className: CLS_POPUPCLASS });
            ele = this.overflowMode === 'Extended' ? extendEle : popupEle;
        }
        this.pushingPoppedEle(this, popupPri, ele, eleHeight, sepHeight);
        this.popupInit(element, ele);
    };
    Toolbar.prototype.getElementOffsetY = function () {
        return (this.overflowMode === 'Extended' && window.getComputedStyle(this.element).getPropertyValue('box-sizing') === 'border-box' ?
            this.element.clientHeight : this.element.offsetHeight);
    };
    Toolbar.prototype.popupInit = function (element, ele) {
        if (!this.popObj) {
            element.appendChild(ele);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { overflow: '' });
            var eleStyles = window.getComputedStyle(this.element);
            var popup = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](null, {
                relateTo: this.element,
                offsetY: (this.isVertical) ? 0 : this.getElementOffsetY(),
                enableRtl: this.enableRtl,
                open: this.popupOpen.bind(this),
                close: this.popupClose.bind(this),
                collision: { Y: this.enableCollision ? 'flip' : 'none' },
                position: this.enableRtl ? { X: 'left', Y: 'top' } : { X: 'right', Y: 'top' }
            });
            popup.appendTo(ele);
            if (this.overflowMode === 'Extended') {
                popup.width = parseFloat(eleStyles.width) + ((parseFloat(eleStyles.borderRightWidth)) * 2);
                popup.offsetX = 0;
            }
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'scroll', this.docEvent.bind(this));
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'click ', this.docEvent.bind(this));
            popup.element.style.maxHeight = popup.element.offsetHeight + 'px';
            if (this.isVertical) {
                popup.element.style.visibility = 'hidden';
            }
            if (this.isExtendedOpen) {
                var popupNav = this.element.querySelector('.' + CLS_TBARNAV);
                popupNav.classList.add(CLS_TBARNAVACT);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(popupNav.firstElementChild, [CLS_POPUPICON], [CLS_POPUPDOWN]);
                this.element.querySelector('.' + CLS_EXTENDABLECLASS).classList.add(CLS_POPUPOPEN);
            }
            else {
                popup.hide();
            }
            this.popObj = popup;
            this.element.setAttribute('aria-haspopup', 'true');
        }
        else {
            var popupEle = this.popObj.element;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(popupEle, { maxHeight: '', display: 'block' });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(popupEle, { maxHeight: popupEle.offsetHeight + 'px', display: '' });
        }
    };
    Toolbar.prototype.tbarPopupHandler = function (isOpen) {
        if (this.overflowMode === 'Extended') {
            isOpen ? this.add(this.element, CLS_EXTENDEDPOPOPEN) : this.remove(this.element, CLS_EXTENDEDPOPOPEN);
        }
    };
    Toolbar.prototype.popupOpen = function (e) {
        var popObj = this.popObj;
        if (!this.isVertical) {
            popObj.offsetY = this.getElementOffsetY();
            popObj.dataBind();
        }
        var popupEle = this.popObj.element;
        var toolEle = this.popObj.element.parentElement;
        var popupNav = toolEle.querySelector('.' + CLS_TBARNAV);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(popObj.element, { height: 'auto', maxHeight: '' });
        popObj.element.style.maxHeight = popObj.element.offsetHeight + 'px';
        if (this.overflowMode === 'Extended') {
            popObj.element.style.minHeight = '';
        }
        var popupElePos = popupEle.offsetTop + popupEle.offsetHeight + Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["calculatePosition"])(toolEle).top;
        var popIcon = popupNav.firstElementChild;
        popupNav.classList.add(CLS_TBARNAVACT);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(popIcon, [CLS_POPUPICON], [CLS_POPUPDOWN]);
        this.tbarPopupHandler(true);
        var scrollVal = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(window.scrollY) ? 0 : window.scrollY;
        if (!this.isVertical && ((window.innerHeight + scrollVal) < popupElePos) && (this.element.offsetTop < popupEle.offsetHeight)) {
            var overflowHeight = (popupEle.offsetHeight - ((popupElePos - window.innerHeight - scrollVal) + 5));
            popObj.height = overflowHeight + 'px';
            for (var i = 0; i <= popupEle.childElementCount; i++) {
                var ele = popupEle.children[i];
                if (ele.offsetTop + ele.offsetHeight > overflowHeight) {
                    overflowHeight = ele.offsetTop;
                    break;
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(popObj.element, { maxHeight: overflowHeight + 'px' });
        }
        else if (this.isVertical) {
            var tbEleData = this.element.getBoundingClientRect();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(popObj.element, { maxHeight: (tbEleData.top + this.element.offsetHeight) + 'px', bottom: 0, visibility: '' });
        }
        if (popObj) {
            popObj.refreshPosition();
        }
    };
    Toolbar.prototype.popupClose = function (e) {
        var element = this.element;
        var popupNav = element.querySelector('.' + CLS_TBARNAV);
        var popIcon = popupNav.firstElementChild;
        popupNav.classList.remove(CLS_TBARNAVACT);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(popIcon, [CLS_POPUPDOWN], [CLS_POPUPICON]);
        this.tbarPopupHandler(false);
    };
    Toolbar.prototype.checkPriority = function (ele, inEle, eleWidth, pre) {
        var popPriority = this.popupPriCount > 0;
        var len = inEle.length;
        var eleWid = eleWidth;
        var eleOffset;
        var checkoffset;
        var sepCheck = 0;
        var itemCount = 0;
        var itemPopCount = 0;
        var checkClass = function (ele, val) {
            var rVal = false;
            val.forEach(function (cls) {
                if (ele.classList.contains(cls)) {
                    rVal = true;
                }
            });
            return rVal;
        };
        for (var i = len - 1; i >= 0; i--) {
            var mrgn = void 0;
            var compuStyle = window.getComputedStyle(inEle[i]);
            if (this.isVertical) {
                mrgn = parseFloat((compuStyle).marginTop);
                mrgn += parseFloat((compuStyle).marginBottom);
            }
            else {
                mrgn = parseFloat((compuStyle).marginRight);
                mrgn += parseFloat((compuStyle).marginLeft);
            }
            var fstEleCheck = inEle[i] === this.tbarEle[0];
            if (fstEleCheck) {
                this.tbarEleMrgn = mrgn;
            }
            eleOffset = this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth;
            var eleWid_1 = fstEleCheck ? (eleOffset + mrgn) : eleOffset;
            if (checkClass(inEle[i], [CLS_POPPRI]) && popPriority) {
                inEle[i].classList.add(CLS_POPUP);
                if (this.isVertical) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(inEle[i], { display: 'none', minHeight: eleWid_1 + 'px' });
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(inEle[i], { display: 'none', minWidth: eleWid_1 + 'px' });
                }
                itemPopCount++;
            }
            if (this.isVertical) {
                checkoffset = (inEle[i].offsetTop + inEle[i].offsetHeight + mrgn) > eleWidth;
            }
            else {
                checkoffset = (inEle[i].offsetLeft + inEle[i].offsetWidth + mrgn) > eleWidth;
            }
            if (checkoffset) {
                if (inEle[i].classList.contains(CLS_SEPARATOR)) {
                    if (this.overflowMode === 'Extended') {
                        if (itemCount === itemPopCount) {
                            var sepEle = inEle[i];
                            if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
                                inEle[i].classList.add(CLS_POPUP);
                                itemPopCount++;
                            }
                        }
                        itemCount++;
                    }
                    else if (this.overflowMode === 'Popup') {
                        if (sepCheck > 0 && itemCount === itemPopCount) {
                            var sepEle = inEle[i + itemCount + (sepCheck - 1)];
                            if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(sepEle, { display: 'none' });
                            }
                        }
                        sepCheck++;
                        itemCount = 0;
                        itemPopCount = 0;
                    }
                }
                else {
                    itemCount++;
                }
                if (inEle[i].classList.contains(CLS_TBAROVERFLOW) && pre) {
                    eleWidth -= ((this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth) + (mrgn));
                }
                else if (!checkClass(inEle[i], [CLS_SEPARATOR, CLS_TBARIGNORE])) {
                    inEle[i].classList.add(CLS_POPUP);
                    if (this.isVertical) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(inEle[i], { display: 'none', minHeight: eleWid_1 + 'px' });
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(inEle[i], { display: 'none', minWidth: eleWid_1 + 'px' });
                    }
                    itemPopCount++;
                }
                else {
                    eleWidth -= ((this.isVertical ? inEle[i].offsetHeight : inEle[i].offsetWidth) + (mrgn));
                }
            }
        }
        if (pre) {
            var popedEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM + ':not(.' + CLS_POPUP + ')', this.element);
            this.checkPriority(ele, popedEle, eleWid, false);
        }
    };
    Toolbar.prototype.createPopupIcon = function (element) {
        var id = element.id.concat('_nav');
        var className = 'e-' + element.id.concat('_nav ' + CLS_POPUPNAV);
        className = this.overflowMode === 'Extended' ? className + ' ' + CLS_EXTENDPOPUP : className;
        var nav = this.createElement('div', { id: id, className: className });
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie' || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'edge') {
            nav.classList.add('e-ie-align');
        }
        var navItem = this.createElement('div', { className: CLS_POPUPDOWN + ' e-icons' });
        nav.appendChild(navItem);
        nav.setAttribute('tabindex', '0');
        nav.setAttribute('role', 'list');
        element.appendChild(nav);
    };
    Toolbar.prototype.tbarPriRef = function (inEle, indx, sepPri, el, des, elWid, wid, ig) {
        var ignoreCount = ig;
        var popEle = this.popObj.element;
        var query = '.' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + '):not(.' + CLS_TBAROVERFLOW + ')';
        var priEleCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_POPUP + ':not(.' + CLS_TBAROVERFLOW + ')', popEle).length;
        var checkClass = function (ele, val) {
            return ele.classList.contains(val);
        };
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])(query, inEle).length === 0) {
            var eleSep = inEle.children[indx - (indx - sepPri) - 1];
            var ignoreCheck = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eleSep) && checkClass(eleSep, CLS_TBARIGNORE));
            if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eleSep) && checkClass(eleSep, CLS_SEPARATOR) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(eleSep)) || ignoreCheck) {
                var sepDisplay = 'none';
                eleSep.style.display = 'inherit';
                var eleSepWidth = eleSep.offsetWidth + (parseFloat(window.getComputedStyle(eleSep).marginRight) * 2);
                var prevSep = eleSep.previousElementSibling;
                if ((elWid + eleSepWidth) < wid || des) {
                    inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - (indx - sepPri)]);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prevSep)) {
                        prevSep.style.display = '';
                    }
                }
                else {
                    if (prevSep.classList.contains(CLS_SEPARATOR)) {
                        prevSep.style.display = sepDisplay;
                    }
                }
                eleSep.style.display = '';
            }
            else {
                inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - (indx - sepPri)]);
            }
        }
        else {
            inEle.insertBefore(el, inEle.children[(indx + ignoreCount) - priEleCnt]);
        }
    };
    Toolbar.prototype.popupRefresh = function (popupEle, destroy) {
        var _this = this;
        var ele = this.element;
        var isVer = this.isVertical;
        var popNav = ele.querySelector('.' + CLS_TBARNAV);
        var innerEle = ele.querySelector('.' + CLS_ITEMS);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(popNav)) {
            return;
        }
        innerEle.removeAttribute('style');
        popupEle.style.display = 'block';
        var dimension;
        if (isVer) {
            dimension = ele.offsetHeight - (popNav.offsetHeight + innerEle.offsetHeight);
        }
        else {
            dimension = ele.offsetWidth - (popNav.offsetWidth + innerEle.offsetWidth);
        }
        var popupEleWidth = 0;
        [].slice.call(popupEle.children).forEach(function (el) {
            popupEleWidth += _this.popupEleWidth(el);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(el, { 'position': '' });
        });
        if ((dimension + (isVer ? popNav.offsetHeight : popNav.offsetWidth)) > (popupEleWidth) && this.popupPriCount === 0) {
            destroy = true;
        }
        this.popupEleRefresh(dimension, popupEle, destroy);
        popupEle.style.display = '';
        if (popupEle.children.length === 0 && popNav && this.popObj) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(popNav);
            popNav = null;
            this.popObj.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.popObj.element);
            this.popObj = null;
            ele.setAttribute('aria-haspopup', 'false');
        }
    };
    Toolbar.prototype.ignoreEleFetch = function (index, innerEle) {
        var ignoreEle = [].slice.call(innerEle.querySelectorAll('.' + CLS_TBARIGNORE));
        var ignoreInx = [];
        var count = 0;
        if (ignoreEle.length > 0) {
            ignoreEle.forEach(function (ele) {
                ignoreInx.push([].slice.call(innerEle.children).indexOf(ele));
            });
        }
        else {
            return 0;
        }
        ignoreInx.forEach(function (val) {
            if (val <= index) {
                count++;
            }
        });
        return count;
    };
    Toolbar.prototype.checkPopupRefresh = function (root, popEle) {
        popEle.style.display = 'block';
        var elWid = this.popupEleWidth(popEle.firstElementChild);
        popEle.firstElementChild.style.removeProperty('Position');
        var tbarWidth = root.offsetWidth - root.querySelector('.' + CLS_TBARNAV).offsetWidth;
        var tbarItemsWid = root.querySelector('.' + CLS_ITEMS).offsetWidth;
        popEle.style.removeProperty('display');
        if (tbarWidth > (elWid + tbarItemsWid)) {
            return true;
        }
        return false;
    };
    Toolbar.prototype.popupEleWidth = function (el) {
        el.style.position = 'absolute';
        var elWidth = this.isVertical ? el.offsetHeight : el.offsetWidth;
        var btnText = el.querySelector('.' + CLS_TBARBTNTEXT);
        if (el.classList.contains('e-tbtn-align') || el.classList.contains(CLS_TBARTEXT)) {
            var btn = el.children[0];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(btnText) && el.classList.contains(CLS_TBARTEXT)) {
                btnText.style.display = 'none';
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(btnText) && el.classList.contains(CLS_POPUPTEXT)) {
                btnText.style.display = 'block';
            }
            btn.style.minWidth = '0%';
            elWidth = parseFloat(!this.isVertical ? el.style.minWidth : el.style.minHeight);
            btn.style.minWidth = '';
            btn.style.minHeight = '';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(btnText)) {
                btnText.style.display = '';
            }
        }
        return elWidth;
    };
    Toolbar.prototype.popupEleRefresh = function (width, popupEle, destroy) {
        var popPriority = this.popupPriCount > 0;
        var eleSplice = this.tbarEle;
        var priEleCnt;
        var index;
        var checkOverflow;
        var innerEle = this.element.querySelector('.' + CLS_ITEMS);
        var ignoreCount = 0;
        var _loop_1 = function (el) {
            if (el.classList.contains(CLS_POPPRI) && popPriority && !destroy) {
                return "continue";
            }
            var elWidth = this_1.popupEleWidth(el);
            if (el === this_1.tbarEle[0]) {
                elWidth += this_1.tbarEleMrgn;
            }
            el.style.position = '';
            if (elWidth < width || destroy) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(el, { minWidth: '', height: '', minHeight: '' });
                if (!el.classList.contains(CLS_POPOVERFLOW)) {
                    el.classList.remove(CLS_POPUP);
                }
                index = this_1.tbarEle.indexOf(el);
                if (this_1.tbarAlign) {
                    var pos = this_1.items[index].align;
                    index = this_1.tbarAlgEle[(pos + 's').toLowerCase()].indexOf(el);
                    eleSplice = this_1.tbarAlgEle[(pos + 's').toLowerCase()];
                    innerEle = this_1.element.querySelector('.' + CLS_ITEMS + ' .' + 'e-toolbar-' + pos.toLowerCase());
                }
                var sepBeforePri_1 = 0;
                if (this_1.overflowMode !== 'Extended') {
                    eleSplice.slice(0, index).forEach(function (el) {
                        if (el.classList.contains(CLS_TBAROVERFLOW) || el.classList.contains(CLS_SEPARATOR)) {
                            if (el.classList.contains(CLS_SEPARATOR)) {
                                el.style.display = '';
                                width -= el.offsetWidth;
                            }
                            sepBeforePri_1++;
                        }
                    });
                }
                ignoreCount = this_1.ignoreEleFetch(index, innerEle);
                if (el.classList.contains(CLS_TBAROVERFLOW)) {
                    this_1.tbarPriRef(innerEle, index, sepBeforePri_1, el, destroy, elWidth, width, ignoreCount);
                    width -= el.offsetWidth;
                }
                else if (index === 0) {
                    innerEle.insertBefore(el, innerEle.firstChild);
                    width -= el.offsetWidth;
                }
                else {
                    priEleCnt = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_TBAROVERFLOW, this_1.popObj.element).length;
                    innerEle.insertBefore(el, innerEle.children[(index + ignoreCount) - priEleCnt]);
                    width -= el.offsetWidth;
                }
                el.style.height = '';
            }
            else {
                return "break";
            }
        };
        var this_1 = this;
        for (var _i = 0, _a = [].slice.call(popupEle.children); _i < _a.length; _i++) {
            var el = _a[_i];
            var state_1 = _loop_1(el);
            if (state_1 === "break")
                break;
        }
        checkOverflow = this.checkOverflow(this.element, this.element.getElementsByClassName(CLS_ITEMS)[0]);
        if (checkOverflow && !destroy) {
            this.renderOverflowMode();
        }
    };
    Toolbar.prototype.removePositioning = function () {
        var item = this.element.querySelector('.' + CLS_ITEMS);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) || !item.classList.contains(CLS_TBARPOS)) {
            return;
        }
        this.remove(item, CLS_TBARPOS);
        var innerItem = [].slice.call(item.childNodes);
        innerItem[1].removeAttribute('style');
        innerItem[2].removeAttribute('style');
    };
    Toolbar.prototype.refreshPositioning = function () {
        var item = this.element.querySelector('.' + CLS_ITEMS);
        this.add(item, CLS_TBARPOS);
        this.itemPositioning();
    };
    Toolbar.prototype.itemPositioning = function () {
        var item = this.element.querySelector('.' + CLS_ITEMS);
        var margin;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item) || !item.classList.contains(CLS_TBARPOS)) {
            return;
        }
        var popupNav = this.element.querySelector('.' + CLS_TBARNAV);
        var innerItem;
        if (this.scrollModule) {
            var trgClass = (this.isVertical) ? CLS_VSCROLLCNT : CLS_HSCROLLCNT;
            innerItem = [].slice.call(item.querySelector('.' + trgClass).children);
        }
        else {
            innerItem = [].slice.call(item.childNodes);
        }
        if (this.isVertical) {
            margin = innerItem[0].offsetHeight + innerItem[2].offsetHeight;
        }
        else {
            margin = innerItem[0].offsetWidth + innerItem[2].offsetWidth;
        }
        var tbarWid = this.isVertical ? this.element.offsetHeight : this.element.offsetWidth;
        if (popupNav) {
            tbarWid -= (this.isVertical ? popupNav.offsetHeight : popupNav.offsetWidth);
            var popWid = (this.isVertical ? popupNav.offsetHeight : popupNav.offsetWidth) + 'px';
            innerItem[2].removeAttribute('style');
            if (this.isVertical) {
                this.enableRtl ? innerItem[2].style.top = popWid : innerItem[2].style.bottom = popWid;
            }
            else {
                this.enableRtl ? innerItem[2].style.left = popWid : innerItem[2].style.right = popWid;
            }
        }
        if (tbarWid <= margin) {
            return;
        }
        var value = (((tbarWid - margin)) - (!this.isVertical ? innerItem[1].offsetWidth : innerItem[1].offsetHeight)) / 2;
        innerItem[1].removeAttribute('style');
        var mrgn = ((!this.isVertical ? innerItem[0].offsetWidth : innerItem[0].offsetHeight) + value) + 'px';
        if (this.isVertical) {
            this.enableRtl ? innerItem[1].style.marginBottom = mrgn : innerItem[1].style.marginTop = mrgn;
        }
        else {
            this.enableRtl ? innerItem[1].style.marginRight = mrgn : innerItem[1].style.marginLeft = mrgn;
        }
    };
    Toolbar.prototype.tbarItemAlign = function (item, itemEle, pos) {
        var _this = this;
        if (item.showAlwaysInPopup && item.overflow !== 'Show') {
            return;
        }
        var alignDiv = [];
        alignDiv.push(this.createElement('div', { className: CLS_TBARLEFT }));
        alignDiv.push(this.createElement('div', { className: CLS_TBARCENTER }));
        alignDiv.push(this.createElement('div', { className: CLS_TBARRIGHT }));
        if (pos === 0 && item.align !== 'Left') {
            alignDiv.forEach(function (ele) {
                itemEle.appendChild(ele);
            });
            this.tbarAlign = true;
            this.add(itemEle, CLS_TBARPOS);
        }
        else if (item.align !== 'Left') {
            var alignEle = itemEle.childNodes;
            var leftAlign_1 = alignDiv[0];
            [].slice.call(alignEle).forEach(function (el) {
                _this.tbarAlgEle.lefts.push(el);
                leftAlign_1.appendChild(el);
            });
            itemEle.appendChild(leftAlign_1);
            itemEle.appendChild(alignDiv[1]);
            itemEle.appendChild(alignDiv[2]);
            this.tbarAlign = true;
            this.add(itemEle, CLS_TBARPOS);
        }
    };
    Toolbar.prototype.ctrlTemplate = function () {
        var _this = this;
        this.ctrlTem = this.trgtEle.cloneNode(true);
        this.add(this.trgtEle, CLS_ITEMS);
        this.tbarEle = [];
        var innerEle = [].slice.call(this.trgtEle.children);
        innerEle.forEach(function (ele) {
            if (ele.tagName === 'DIV') {
                _this.tbarEle.push(ele);
                ele.setAttribute('aria-disabled', 'false');
                _this.add(ele, CLS_ITEM);
            }
        });
    };
    Toolbar.prototype.renderItems = function () {
        var ele = this.element;
        var items = this.items;
        if (this.trgtEle != null) {
            this.ctrlTemplate();
        }
        else if (ele && items.length > 0) {
            var itemEleDom = void 0;
            if (ele && ele.children.length > 0) {
                itemEleDom = ele.querySelector('.' + CLS_ITEMS);
            }
            if (!itemEleDom) {
                itemEleDom = this.createElement('div', { className: CLS_ITEMS });
            }
            this.itemsAlign(items, itemEleDom);
            ele.appendChild(itemEleDom);
        }
    };
    Toolbar.prototype.setAttr = function (attr, element) {
        var key = Object.keys(attr);
        var keyVal;
        for (var i = 0; i < key.length; i++) {
            keyVal = key[i];
            keyVal === 'class' ? this.add(element, attr[keyVal]) : element.setAttribute(keyVal, attr[keyVal]);
        }
    };
    /**
     * Enables or disables the specified Toolbar item.
     * @param  {number|HTMLElement|NodeList} items - DOM element or an array of items to be enabled or disabled.
     * @param  {boolean} isEnable  - Boolean value that determines whether the command should be enabled or disabled.
     * By default, `isEnable` is set to true.
     * @returns void.
     */
    Toolbar.prototype.enableItems = function (items, isEnable) {
        var elements = items;
        var len = elements.length;
        var ele;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(isEnable)) {
            isEnable = true;
        }
        var enable = function (isEnable, ele) {
            if (isEnable) {
                ele.classList.remove(CLS_DISABLE);
                ele.setAttribute('aria-disabled', 'false');
            }
            else {
                ele.classList.add(CLS_DISABLE);
                ele.setAttribute('aria-disabled', 'true');
            }
        };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(len) && len >= 1) {
            for (var a = 0, element = [].slice.call(elements); a < len; a++) {
                var itemElement = element[a];
                if (typeof (itemElement) === 'number') {
                    ele = this.getElementByIndex(itemElement);
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
                        return;
                    }
                    else {
                        elements[a] = ele;
                    }
                }
                else {
                    ele = itemElement;
                }
                enable(isEnable, ele);
            }
            isEnable ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(elements, CLS_DISABLE) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(elements, CLS_DISABLE);
        }
        else {
            if (typeof (elements) === 'number') {
                ele = this.getElementByIndex(elements);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
                    return;
                }
            }
            else {
                ele = items;
            }
            enable(isEnable, ele);
        }
    };
    Toolbar.prototype.getElementByIndex = function (index) {
        if (this.tbarEle[index]) {
            return this.tbarEle[index];
        }
        return null;
    };
    /**
     * Adds new items to the Toolbar that accepts an array as Toolbar items.
     * @param  {ItemsModel[]} items - DOM element or an array of items to be added to the Toolbar.
     * @param  {number} index - Number value that determines where the command is to be added. By default, index is 0.
     * @returns void.

     */
    Toolbar.prototype.addItems = function (items, index) {
        var innerItems;
        this.extendedOpen();
        var itemsDiv = this.element.querySelector('.' + CLS_ITEMS);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(itemsDiv)) {
            this.itemsRerender(items);
            return;
        }
        var innerEle;
        var itemAgn = 'Left';
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            index = 0;
        }
        items.forEach(function (e) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.align) && e.align !== 'Left' && itemAgn === 'Left') {
                itemAgn = e.align;
            }
        });
        for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
            var item = items_1[_i];
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(item.type)) {
                item.type = 'Button';
            }
            innerItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element);
            item.align = itemAgn;
            innerEle = this.renderSubComponent(item, index);
            if (this.tbarEle.length >= index && innerItems.length >= 0) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollModule)) {
                    this.destroyMode();
                }
                var algIndex = item.align[0] === 'L' ? 0 : item.align[0] === 'C' ? 1 : 2;
                var ele = void 0;
                if (!this.tbarAlign && itemAgn !== 'Left') {
                    this.tbarItemAlign(item, itemsDiv, 1);
                    this.tbarAlign = true;
                    ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(innerItems[0], '.' + CLS_ITEMS).children[algIndex];
                    ele.appendChild(innerEle);
                    this.tbarAlgEle[(item.align + 's').toLowerCase()].push(innerEle);
                    this.refreshPositioning();
                }
                else if (this.tbarAlign) {
                    ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(innerItems[0], '.' + CLS_ITEMS).children[algIndex];
                    ele.insertBefore(innerEle, ele.children[index]);
                    this.tbarAlgEle[(item.align + 's').toLowerCase()].splice(index, 0, innerEle);
                    this.refreshPositioning();
                }
                else if (innerItems.length === 0) {
                    innerItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEMS, this.element);
                    innerItems[0].appendChild(innerEle);
                }
                else {
                    innerItems[0].parentNode.insertBefore(innerEle, innerItems[index]);
                }
                this.items.splice(index, 0, item);
                this.tbarEle.splice(index, 0, innerEle);
                index++;
                this.offsetWid = itemsDiv.offsetWidth;
            }
        }
        itemsDiv.style.width = '';
        this.renderOverflowMode();
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    /**
     * Removes the items from the Toolbar. Acceptable arguments are index of item/HTMLElement/node list.
     * @param  {number|HTMLElement|NodeList|HTMLElement[]} args
     * Index or DOM element or an Array of item which is to be removed from the Toolbar.
     * @returns void.

     */
    Toolbar.prototype.removeItems = function (args) {
        var elements = args;
        var index;
        var innerItems = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element));
        if (typeof (elements) === 'number') {
            index = parseInt(args.toString(), 10);
            this.removeItemByIndex(index, innerItems);
        }
        else {
            if (elements && elements.length > 1) {
                for (var _i = 0, _a = [].slice.call(elements); _i < _a.length; _i++) {
                    var ele = _a[_i];
                    index = this.tbarEle.indexOf(ele);
                    this.removeItemByIndex(index, innerItems);
                    innerItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element);
                }
            }
            else {
                var ele = (elements && elements.length && elements.length === 1) ? elements[0] : args;
                index = innerItems.indexOf(ele);
                this.removeItemByIndex(index, innerItems);
            }
        }
        this.resize();
    };
    Toolbar.prototype.removeItemByIndex = function (index, innerItems) {
        if (this.tbarEle[index] && innerItems[index]) {
            var eleIdx = this.tbarEle.indexOf(innerItems[index]);
            if (this.tbarAlign) {
                var indexAgn = void 0;
                indexAgn = this.tbarAlgEle[(this.items[eleIdx].align + 's').toLowerCase()].indexOf(this.tbarEle[eleIdx]);
                this.tbarAlgEle[(this.items[eleIdx].align + 's').toLowerCase()].splice(indexAgn, 1);
            }
            // tslint:disable-next-line:no-any
            if (this.isReact) {
                this.clearTemplate();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(innerItems[index]);
            this.items.splice(eleIdx, 1);
            this.tbarEle.splice(eleIdx, 1);
        }
    };
    Toolbar.prototype.templateRender = function (templateProp, innerEle, item, index) {
        var itemType = item.type;
        var eleObj = templateProp;
        var isComponent;
        if (typeof (templateProp) === 'object') {
            isComponent = typeof (eleObj.appendTo) === 'function';
        }
        if (typeof (templateProp) === 'string' || !isComponent) {
            var templateFn = void 0;
            var val = templateProp;
            val = (typeof (templateProp) === 'string') ? templateProp.trim() : templateProp;
            var e = void 0;
            try {
                if (typeof (templateProp) === 'object' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateProp.tagName)) {
                    innerEle.appendChild(templateProp);
                }
                else if (document.querySelectorAll(val).length) {
                    var ele = document.querySelector(val);
                    var tempStr = ele.outerHTML.trim();
                    innerEle.appendChild(ele);
                    ele.style.display = '';
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tempStr)) {
                        this.tempId.push(val);
                    }
                }
            }
            catch (e) {
                templateFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(val);
            }
            var tempArray = void 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateFn)) {
                var toolbarTemplateID = this.element.id + index + '_template';
                tempArray = templateFn({}, this, 'template', toolbarTemplateID, this.isStringTemplate);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tempArray) && tempArray.length > 0) {
                [].slice.call(tempArray).forEach(function (ele) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele.tagName)) {
                        ele.style.display = '';
                    }
                    innerEle.appendChild(ele);
                });
            }
        }
        else if (itemType === 'Input') {
            var ele = this.createElement('input');
            item.id ? (ele.id = item.id) : (ele.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('tbr-ipt'));
            innerEle.appendChild(ele);
            eleObj.appendTo(ele);
        }
        this.add(innerEle, CLS_TEMPLATE);
        this.tbarEle.push(innerEle);
    };
    Toolbar.prototype.buttonRendering = function (item, innerEle) {
        var dom = this.createElement('button', { className: CLS_TBARBTN });
        dom.setAttribute('type', 'button');
        var textStr = item.text;
        var iconCss;
        var iconPos;
        item.id ? (dom.id = item.id) : dom.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-tbr-btn');
        var btnTxt = this.createElement('span', { className: 'e-tbar-btn-text' });
        if (textStr) {
            btnTxt.innerHTML = this.enableHtmlSanitizer ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(textStr) : textStr;
            dom.appendChild(btnTxt);
            dom.classList.add('e-tbtn-txt');
        }
        else {
            this.add(innerEle, 'e-tbtn-align');
        }
        if (item.prefixIcon || item.suffixIcon) {
            if ((item.prefixIcon && item.suffixIcon) || item.prefixIcon) {
                iconCss = item.prefixIcon + ' e-icons';
                iconPos = 'Left';
            }
            else {
                iconCss = item.suffixIcon + ' e-icons';
                iconPos = 'Right';
            }
        }
        var btnObj = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__["Button"]({ iconCss: iconCss, iconPosition: iconPos });
        btnObj.createElement = this.createElement;
        btnObj.appendTo(dom);
        if (item.width) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(dom, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(item.width) });
        }
        return dom;
    };
    Toolbar.prototype.renderSubComponent = function (item, index) {
        var innerEle;
        var dom;
        innerEle = this.createElement('div', { className: CLS_ITEM });
        innerEle.setAttribute('aria-disabled', 'false');
        var tempDom = this.createElement('div', {
            innerHTML: this.enableHtmlSanitizer ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(item.tooltipText) : item.tooltipText
        });
        if (!this.tbarEle) {
            this.tbarEle = [];
        }
        if (item.htmlAttributes) {
            this.setAttr(item.htmlAttributes, innerEle);
        }
        if (item.tooltipText) {
            innerEle.setAttribute('title', tempDom.textContent);
        }
        if (item.cssClass) {
            innerEle.className = innerEle.className + ' ' + item.cssClass;
        }
        if (item.template) {
            this.templateRender(item.template, innerEle, item, index);
        }
        else {
            switch (item.type) {
                case 'Button':
                    dom = this.buttonRendering(item, innerEle);
                    dom.setAttribute('tabindex', '-1');
                    dom.setAttribute('aria-label', (item.text || item.tooltipText));
                    innerEle.appendChild(dom);
                    innerEle.addEventListener('click', this.itemClick.bind(this));
                    break;
                case 'Separator':
                    this.add(innerEle, CLS_SEPARATOR);
                    break;
            }
        }
        if (item.showTextOn) {
            var sTxt = item.showTextOn;
            if (sTxt === 'Toolbar') {
                this.add(innerEle, CLS_POPUPTEXT);
                this.add(innerEle, 'e-tbtn-align');
            }
            else if (sTxt === 'Overflow') {
                this.add(innerEle, CLS_TBARTEXT);
            }
        }
        if (item.overflow) {
            var overflow = item.overflow;
            if (overflow === 'Show') {
                this.add(innerEle, CLS_TBAROVERFLOW);
            }
            else if (overflow === 'Hide') {
                if (!innerEle.classList.contains(CLS_SEPARATOR)) {
                    this.add(innerEle, CLS_POPOVERFLOW);
                }
            }
        }
        if (item.overflow !== 'Show' && item.showAlwaysInPopup && !innerEle.classList.contains(CLS_SEPARATOR)) {
            this.add(innerEle, CLS_POPPRI);
            this.popupPriCount++;
        }
        if (item.disabled) {
            this.add(innerEle, CLS_DISABLE);
        }
        if (item.visible === false) {
            this.add(innerEle, CLS_HIDDEN);
        }
        return innerEle;
    };
    Toolbar.prototype.itemClick = function (e) {
        this.activeEleSwitch(e.currentTarget);
    };
    Toolbar.prototype.activeEleSwitch = function (ele) {
        this.activeEleRemove(ele.firstElementChild);
        this.activeEle.focus();
    };
    Toolbar.prototype.activeEleRemove = function (curEle) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeEle)) {
            this.activeEle.setAttribute('tabindex', '-1');
        }
        this.activeEle = curEle;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.trgtEle) && !curEle.parentElement.classList.contains(CLS_TEMPLATE)) {
            curEle.removeAttribute('tabindex');
        }
        else {
            this.activeEle.setAttribute('tabindex', '0');
        }
    };
    Toolbar.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * Returns the current module name.
     * @returns string
     * @private
     */
    Toolbar.prototype.getModuleName = function () {
        return 'toolbar';
    };
    Toolbar.prototype.itemsRerender = function (newProp) {
        this.items = this.tbarItemsCol;
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
        this.destroyMode();
        this.destroyItems();
        this.items = newProp;
        this.tbarItemsCol = this.items;
        this.renderItems();
        this.renderOverflowMode();
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    Toolbar.prototype.resize = function () {
        var ele = this.element;
        this.tbResize = true;
        if (this.tbarAlign) {
            this.itemPositioning();
        }
        if (this.popObj && this.overflowMode === 'Popup') {
            this.popObj.hide();
        }
        var checkOverflow = this.checkOverflow(ele, ele.getElementsByClassName(CLS_ITEMS)[0]);
        if (!checkOverflow) {
            this.destroyScroll();
            var multirowele = ele.querySelector('.' + CLS_ITEMS);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(multirowele)) {
                this.remove(multirowele, CLS_MULTIROWPOS);
                if (this.tbarAlign) {
                    this.add(multirowele, CLS_TBARPOS);
                }
            }
        }
        if (checkOverflow && this.scrollModule && (this.offsetWid === ele.offsetWidth)) {
            return;
        }
        if (this.offsetWid > ele.offsetWidth || checkOverflow) {
            this.renderOverflowMode();
        }
        if (this.popObj) {
            if (this.overflowMode === 'Extended') {
                var eleStyles = window.getComputedStyle(this.element);
                this.popObj.width = parseFloat(eleStyles.width) + ((parseFloat(eleStyles.borderRightWidth)) * 2);
            }
            if (this.tbarAlign) {
                this.removePositioning();
            }
            this.popupRefresh(this.popObj.element, false);
            if (this.tbarAlign) {
                this.refreshPositioning();
            }
        }
        if (this.element.querySelector('.' + CLS_HSCROLLBAR)) {
            this.scrollStep = this.element.querySelector('.' + CLS_HSCROLLBAR).offsetWidth;
        }
        this.offsetWid = ele.offsetWidth;
        this.tbResize = false;
        this.separator();
    };
    Toolbar.prototype.extendedOpen = function () {
        var sib = this.element.querySelector('.' + CLS_EXTENDABLECLASS);
        if (this.overflowMode === 'Extended' && sib) {
            this.isExtendedOpen = sib.classList.contains(CLS_POPUPOPEN);
        }
    };
    /**
     * Gets called when the model property changes.The data that describes the old and new values of the property that changed.
     * @param  {ToolbarModel} newProp
     * @param  {ToolbarModel} oldProp
     * @returns void
     * @private
     */
    Toolbar.prototype.onPropertyChanged = function (newProp, oldProp) {
        var tEle = this.element;
        this.extendedOpen();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'items':
                    if (!(newProp.items instanceof Array && oldProp.items instanceof Array) && !this.isServerRendered) {
                        var changedProb = Object.keys(newProp.items);
                        for (var i = 0; i < changedProb.length; i++) {
                            var index = parseInt(Object.keys(newProp.items)[i], 10);
                            var property = Object.keys(newProp.items[index])[0];
                            var newProperty = Object(newProp.items[index])[property];
                            if (this.tbarAlign || property === 'align') {
                                this.refresh();
                                this.trigger('created');
                                break;
                            }
                            var popupPriCheck = property === 'showAlwaysInPopup' && !newProperty;
                            var booleanCheck = property === 'overflow' && this.popupPriCount !== 0;
                            if ((popupPriCheck) || (this.items[index].showAlwaysInPopup) && booleanCheck) {
                                --this.popupPriCount;
                            }
                            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollModule)) {
                                this.destroyMode();
                            }
                            var itemCol = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEMS + ' .' + CLS_ITEM, tEle));
                            // tslint:disable-next-line:no-any
                            if (this.isReact) {
                                this.clearTemplate();
                            }
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(itemCol[index]);
                            this.tbarEle.splice(index, 1);
                            this.addItems([this.items[index]], index);
                            this.items.splice(index, 1);
                            if (this.items[index].template) {
                                this.tbarEle.splice(this.items.length, 1);
                            }
                        }
                    }
                    else {
                        this.itemsRerender(newProp.items);
                    }
                    break;
                case 'width':
                    var wid = tEle.offsetWidth;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(tEle, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width) });
                    this.renderOverflowMode();
                    if (this.popObj && wid < tEle.offsetWidth) {
                        this.popupRefresh(this.popObj.element, false);
                    }
                    break;
                case 'height':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height) });
                    break;
                case 'overflowMode':
                    this.destroyMode();
                    this.renderOverflowMode();
                    if (this.enableRtl) {
                        this.add(tEle, CLS_RTL);
                    }
                    this.refreshOverflow();
                    break;
                case 'enableRtl':
                    newProp.enableRtl ? this.add(tEle, CLS_RTL) : this.remove(tEle, CLS_RTL);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.scrollModule)) {
                        newProp.enableRtl ? this.add(this.scrollModule.element, CLS_RTL) : this.remove(this.scrollModule.element, CLS_RTL);
                    }
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popObj)) {
                        newProp.enableRtl ? this.add(this.popObj.element, CLS_RTL) : this.remove(this.popObj.element, CLS_RTL);
                    }
                    if (this.tbarAlign) {
                        this.itemPositioning();
                    }
                    break;
                case 'scrollStep':
                    if (this.scrollModule) {
                        this.scrollModule.scrollStep = this.scrollStep;
                    }
                    break;
                case 'enableCollision':
                    if (this.popObj) {
                        this.popObj.collision = { Y: this.enableCollision ? 'flip' : 'none' };
                    }
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newProp.cssClass.split(' '));
                    }
                    break;
                case 'allowKeyboard':
                    this.unwireKeyboardEvent();
                    if (newProp.allowKeyboard) {
                        this.wireKeyboardEvent();
                    }
                    break;
            }
        }
    };
    /**
     * Shows or hides the Toolbar item that is in the specified index.
     * @param  {number | HTMLElement} index - Index value of target item or DOM element  of items to be hidden or shown.
     * @param  {boolean} value - Based on this Boolean value, item will be hide (true) or show (false). By default, value is false.
     * @returns void.
     */
    Toolbar.prototype.hideItem = function (index, value) {
        var isElement = (typeof (index) === 'object') ? true : false;
        var eleIndex = index;
        var initIndex;
        var ele;
        var innerItems = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element));
        if (isElement) {
            ele = index;
        }
        else if (this.tbarEle[eleIndex]) {
            var innerItems_1 = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element));
            ele = innerItems_1[eleIndex];
        }
        if (ele) {
            value ? ele.classList.add(CLS_HIDDEN) : ele.classList.remove(CLS_HIDDEN);
            if (value && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute('tabindex')) && !ele.classList.contains(CLS_SEPARATOR)) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele.firstElementChild.getAttribute('tabindex'))) {
                    ele.firstElementChild.setAttribute('tabindex', '-1');
                    var innerItems_2 = [].slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CLS_ITEM, this.element));
                    if (isElement) {
                        eleIndex = innerItems_2.indexOf(ele);
                    }
                    var nextEle = innerItems_2[++eleIndex];
                    while (nextEle) {
                        var skipEle = this.eleContains(nextEle);
                        if (!skipEle) {
                            nextEle.firstElementChild.removeAttribute('tabindex');
                            break;
                        }
                        nextEle = innerItems_2[++eleIndex];
                    }
                }
            }
            else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.getAttribute('tabindex')) && !ele.classList.contains(CLS_SEPARATOR)) {
                initIndex = 0;
                var setFlag = false;
                var removeFlag = false;
                var initELe = innerItems[initIndex];
                while (initELe) {
                    if (!initELe.classList.contains(CLS_SEPARATOR)) {
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(initELe.firstElementChild.getAttribute('tabindex'))) {
                            initELe.firstElementChild.setAttribute('tabindex', '-1');
                            setFlag = true;
                        }
                        else {
                            if (setFlag && removeFlag) {
                                break;
                            }
                            var skipEle = this.eleContains(initELe);
                            if (!skipEle) {
                                initELe.firstElementChild.removeAttribute('tabindex');
                                removeFlag = true;
                            }
                            initELe = innerItems[++initIndex];
                        }
                    }
                    else {
                        initELe = innerItems[++initIndex];
                    }
                }
            }
            this.refreshOverflow();
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], Item)
    ], Toolbar.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Toolbar.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Toolbar.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Toolbar.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Scrollable')
    ], Toolbar.prototype, "overflowMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Toolbar.prototype, "scrollStep", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Toolbar.prototype, "enableCollision", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Toolbar.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Toolbar.prototype, "allowKeyboard", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Toolbar.prototype, "clicked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Toolbar.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Toolbar.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Toolbar.prototype, "beforeCreate", void 0);
    Toolbar = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Toolbar);
    return Toolbar;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/index.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/index.js ***!
  \*************************************************************************/
/*! exports provided: FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _treeview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treeview */ "./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/treeview.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FieldsSettings", function() { return _treeview__WEBPACK_IMPORTED_MODULE_0__["FieldsSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionSettings", function() { return _treeview__WEBPACK_IMPORTED_MODULE_0__["ActionSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NodeAnimationSettings", function() { return _treeview__WEBPACK_IMPORTED_MODULE_0__["NodeAnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeView", function() { return _treeview__WEBPACK_IMPORTED_MODULE_0__["TreeView"]; });

/**
 * TreeView modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/treeview.js":
/*!****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-navigations/treeview/treeview.js ***!
  \****************************************************************************/
/*! exports provided: FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldsSettings", function() { return FieldsSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionSettings", function() { return ActionSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NodeAnimationSettings", function() { return NodeAnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeView", function() { return TreeView; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};













var ROOT = 'e-treeview';
var CONTROL = 'e-control';
var COLLAPSIBLE = 'e-icon-collapsible';
var EXPANDABLE = 'e-icon-expandable';
var LISTITEM = 'e-list-item';
var LISTTEXT = 'e-list-text';
var LISTICON = 'e-list-icon';
var LISTIMG = 'e-list-img';
var LISTURL = 'e-list-url';
var PARENTITEM = 'e-list-parent';
var HOVER = 'e-hover';
var ACTIVE = 'e-active';
var LOAD = 'e-icons-spinner';
var PROCESS = 'e-process';
var ICON = 'e-icons';
var TEXTWRAP = 'e-text-content';
var INPUT = 'e-input';
var INPUTGROUP = 'e-input-group';
var TREEINPUT = 'e-tree-input';
var EDITING = 'e-editing';
var RTL = 'e-rtl';
var INTERACTION = 'e-interaction';
var DRAGITEM = 'e-drag-item';
var DROPPABLE = 'e-droppable';
var DRAGGING = 'e-dragging';
var SIBLING = 'e-sibling';
var DROPIN = 'e-drop-in';
var DROPNEXT = 'e-drop-next';
var DROPOUT = 'e-drop-out';
var NODROP = 'e-no-drop';
var FULLROWWRAP = 'e-fullrow-wrap';
var FULLROW = 'e-fullrow';
var SELECTED = 'e-selected';
var EXPANDED = 'e-expanded';
var NODECOLLAPSED = 'e-node-collapsed';
var DISABLE = 'e-disable';
var CONTENT = 'e-content';
var DOWNTAIL = 'e-downtail';
var DROPCOUNT = 'e-drop-count';
var CHECK = 'e-check';
var INDETERMINATE = 'e-stop';
var CHECKBOXWRAP = 'e-checkbox-wrapper';
var CHECKBOXFRAME = 'e-frame';
var CHECKBOXRIPPLE = 'e-ripple-container';
var RIPPLE = 'e-ripple';
var RIPPLEELMENT = 'e-ripple-element';
var FOCUS = 'e-node-focus';
var IMAGE = 'e-list-img';
var BIGGER = 'e-bigger';
var SMALL = 'e-small';
var CHILD = 'e-has-child';
var ITEM_ANIMATION_ACTIVE = 'e-animation-active';
var DISABLED = 'e-disabled';
var treeAriaAttr = {
    treeRole: 'tree',
    itemRole: 'treeitem',
    listRole: 'group',
    itemText: '',
    wrapperRole: '',
};
/**
 * Configures the fields to bind to the properties of node in the TreeView component.
 */
var FieldsSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(FieldsSettings, _super);
    function FieldsSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('child')
    ], FieldsSettings.prototype, "child", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], FieldsSettings.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('expanded')
    ], FieldsSettings.prototype, "expanded", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('hasChildren')
    ], FieldsSettings.prototype, "hasChildren", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('htmlAttributes')
    ], FieldsSettings.prototype, "htmlAttributes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('iconCss')
    ], FieldsSettings.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('id')
    ], FieldsSettings.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('imageUrl')
    ], FieldsSettings.prototype, "imageUrl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('isChecked')
    ], FieldsSettings.prototype, "isChecked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('parentID')
    ], FieldsSettings.prototype, "parentID", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], FieldsSettings.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('selected')
    ], FieldsSettings.prototype, "selected", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], FieldsSettings.prototype, "tableName", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('text')
    ], FieldsSettings.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('tooltip')
    ], FieldsSettings.prototype, "tooltip", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('navigateUrl')
    ], FieldsSettings.prototype, "navigateUrl", void 0);
    return FieldsSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Configures animation settings for the TreeView component.
 */
var ActionSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(ActionSettings, _super);
    function ActionSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('SlideDown')
    ], ActionSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(400)
    ], ActionSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('linear')
    ], ActionSettings.prototype, "easing", void 0);
    return ActionSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Configures the animation settings for expanding and collapsing nodes in TreeView.
 */
var NodeAnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(NodeAnimationSettings, _super);
    function NodeAnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideUp', duration: 400, easing: 'linear' }, ActionSettings)
    ], NodeAnimationSettings.prototype, "collapse", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ effect: 'SlideDown', duration: 400, easing: 'linear' }, ActionSettings)
    ], NodeAnimationSettings.prototype, "expand", void 0);
    return NodeAnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * The TreeView component is used to represent hierarchical data in a tree like structure with advanced
 * functions to perform edit, drag and drop, selection with check-box, and more.
 * ```html
 *  <div id="tree"></div>
 * ```
 * ```typescript
 *  let treeObj: TreeView = new TreeView();
 *  treeObj.appendTo('#tree');
 * ```
 */
var TreeView = /** @__PURE__ @class */ (function (_super) {
    __extends(TreeView, _super);
    function TreeView(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isRefreshed = false;
        _this.preventExpand = false;
        _this.checkedElement = [];
        _this.disableNode = [];
        _this.validArr = [];
        _this.expandChildren = [];
        _this.isFieldChange = false;
        _this.changeDataSource = false;
        _this.isBlazorExpandedNodes = [];
        _this.mouseDownStatus = false;
        return _this;
    }
    TreeView_1 = TreeView;
    /**
     * Get component name.
     * @returns string
     * @private
     */
    TreeView.prototype.getModuleName = function () {
        return 'treeview';
    };
    /**
     * Initialize the event handler
     */
    TreeView.prototype.preRender = function () {
        var _this = this;
        this.isBlazorPlatform = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered);
        this.checkActionNodes = [];
        this.parentNodeCheck = [];
        this.dragStartAction = false;
        this.isAnimate = false;
        this.keyConfigs = {
            escape: 'escape',
            end: 'end',
            enter: 'enter',
            f2: 'f2',
            home: 'home',
            moveDown: 'downarrow',
            moveLeft: 'leftarrow',
            moveRight: 'rightarrow',
            moveUp: 'uparrow',
            ctrlDown: 'ctrl+downarrow',
            ctrlUp: 'ctrl+uparrow',
            ctrlEnter: 'ctrl+enter',
            ctrlHome: 'ctrl+home',
            ctrlEnd: 'ctrl+end',
            ctrlA: 'ctrl+A',
            shiftDown: 'shift+downarrow',
            shiftUp: 'shift+uparrow',
            shiftEnter: 'shift+enter',
            shiftHome: 'shift+home',
            shiftEnd: 'shift+end',
            csDown: 'ctrl+shift+downarrow',
            csUp: 'ctrl+shift+uparrow',
            csEnter: 'ctrl+shift+enter',
            csHome: 'ctrl+shift+home',
            csEnd: 'ctrl+shift+end',
            space: 'space',
        };
        this.listBaseOption = {
            expandCollapse: true,
            showIcon: true,
            expandIconClass: EXPANDABLE,
            ariaAttributes: treeAriaAttr,
            expandIconPosition: 'Left',
            itemCreated: function (e) {
                _this.beforeNodeCreate(e);
            },
            enableHtmlSanitizer: this.enableHtmlSanitizer,
            itemNavigable: this.fullRowNavigable,
        };
        this.updateListProp(this.fields);
        this.aniObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"]({});
        this.treeList = [];
        this.isLoaded = false;
        this.isInitalExpand = false;
        this.expandChildren = [];
        this.index = 0;
        this.setTouchClass();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.selectedNodes)) {
            this.setProperties({ selectedNodes: [] }, true);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkedNodes)) {
            this.setProperties({ checkedNodes: [] }, true);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.expandedNodes)) {
            this.setProperties({ expandedNodes: [] }, true);
        }
        else {
            this.isInitalExpand = true;
        }
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     * @hidden
     */
    TreeView.prototype.getPersistData = function () {
        var keyEntity = ['selectedNodes', 'checkedNodes', 'expandedNodes'];
        return this.addOnPersist(keyEntity);
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    TreeView.prototype.render = function () {
        this.initialRender = true;
        this.blazorInitialRender = false;
        this.initialize();
        this.setDataBinding(false);
        this.setDisabledMode();
        this.setExpandOnType();
        if (!this.disabled) {
            this.setRipple();
        }
        this.wireEditingEvents(this.allowEditing);
        this.setDragAndDrop(this.allowDragAndDrop);
        if (!this.disabled) {
            this.wireEvents();
        }
        if (!this.isBlazorPlatform) {
            this.initialRender = false;
        }
        this.renderComplete();
    };
    TreeView.prototype.initialize = function () {
        if (!this.isBlazorPlatform) {
            this.element.setAttribute('role', 'tree');
            this.element.setAttribute('tabindex', '0');
            this.element.setAttribute('aria-activedescendant', this.element.id + '_active');
            this.setCssClass(null, this.cssClass);
            this.setEnableRtl();
            this.setFullRow(this.fullRowSelect);
        }
        this.nodeTemplateFn = this.templateComplier(this.nodeTemplate);
    };
    TreeView.prototype.setDisabledMode = function () {
        if (this.disabled) {
            this.element.classList.add(DISABLED);
        }
        else {
            this.element.classList.remove(DISABLED);
        }
    };
    TreeView.prototype.setEnableRtl = function () {
        this.enableRtl ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], RTL) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], RTL);
    };
    TreeView.prototype.setRipple = function () {
        var tempStr = '.' + FULLROW + ',.' + TEXTWRAP;
        var rippleModel = {
            selector: tempStr,
            ignore: '.' + TEXTWRAP + ' > .' + ICON + ',.' + INPUTGROUP + ',.' + INPUT + ', .' + CHECKBOXWRAP
        };
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, rippleModel);
        var iconModel = {
            selector: '.' + TEXTWRAP + ' > .' + ICON,
            isCenterRipple: true,
        };
        this.rippleIconFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(this.element, iconModel);
    };
    TreeView.prototype.setFullRow = function (isEnabled) {
        isEnabled ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], FULLROWWRAP) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], FULLROWWRAP);
    };
    TreeView.prototype.setMultiSelect = function (isEnabled) {
        var firstUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, this.element);
        if (isEnabled) {
            firstUl.setAttribute('aria-multiselectable', 'true');
        }
        else {
            firstUl.removeAttribute('aria-multiselectable');
        }
    };
    TreeView.prototype.templateComplier = function (template) {
        if (template) {
            var e = void 0;
            this.element.classList.add(INTERACTION);
            try {
                if (document.querySelectorAll(template).length) {
                    return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(document.querySelector(template).innerHTML.trim());
                }
            }
            catch (e) {
                return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
            }
        }
        this.element.classList.remove(INTERACTION);
        return undefined;
    };
    TreeView.prototype.setDataBinding = function (changeDataSource) {
        var _this = this;
        this.treeList.push('false');
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]) {
            // tslint:disable
            this.isOffline = (this.isBlazorPlatform ? this.fields.dataSource.offline :
                this.fields.dataSource.dataSource.offline);
            if (this.fields.dataSource.ready) {
                this.fields.dataSource.ready.then(function (e) {
                    // tslint:disable
                    _this.isOffline = (_this.isBlazorPlatform ? _this.fields.dataSource.offline :
                        _this.fields.dataSource.dataSource.offline);
                    if (_this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && _this.isOffline) {
                        _this.treeList.pop();
                        _this.treeData = e.result;
                        _this.isNumberTypeId = _this.getType();
                        _this.setRootData();
                        _this.renderItems(true);
                        if (_this.treeList.length === 0 && !_this.isLoaded) {
                            _this.finalize();
                        }
                    }
                }).catch(function (e) {
                    _this.trigger('actionFailure', { error: e });
                });
            }
            else {
                this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function (e) {
                    _this.treeList.pop();
                    _this.treeData = e.result;
                    _this.isNumberTypeId = _this.getType();
                    _this.setRootData();
                    if (changeDataSource) {
                        _this.changeDataSource = true;
                    }
                    _this.renderItems(true);
                    _this.changeDataSource = false;
                    if (_this.treeList.length === 0 && !_this.isLoaded) {
                        _this.finalize();
                    }
                }).catch(function (e) {
                    _this.trigger('actionFailure', { error: e });
                });
            }
        }
        else {
            this.treeList.pop();
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.fields.dataSource)) {
                this.rootData = this.treeData = [];
            }
            else {
                this.treeData = JSON.parse(JSON.stringify(this.fields.dataSource));
                this.setRootData();
            }
            this.isNumberTypeId = this.getType();
            this.renderItems(false);
        }
        if (this.treeList.length === 0 && !this.isLoaded) {
            this.finalize();
        }
    };
    TreeView.prototype.getQuery = function (mapper, value) {
        if (value === void 0) { value = null; }
        var columns = [];
        var query;
        if (!mapper.query) {
            query = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]();
            var prop = this.getActualProperties(mapper);
            for (var _i = 0, _a = Object.keys(prop); _i < _a.length; _i++) {
                var col = _a[_i];
                if (col !== 'dataSource' && col !== 'tableName' && col !== 'child' && !!mapper[col]
                    && col !== 'url' && columns.indexOf(mapper[col]) === -1) {
                    columns.push(mapper[col]);
                }
            }
            query.select(columns);
            if (prop.hasOwnProperty('tableName')) {
                query.from(mapper.tableName);
            }
        }
        else {
            query = mapper.query.clone();
        }
        _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].addSorting(this.sortOrder, mapper.text, query);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(value) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.parentID)) {
            query.where(mapper.parentID, 'equal', (this.isNumberTypeId ? parseFloat(value) : value));
        }
        return query;
    };
    TreeView.prototype.getType = function () {
        return this.treeData[0] ? ((typeof Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, this.treeData[0]) === 'number') ? true : false) : false;
    };
    TreeView.prototype.setRootData = function () {
        this.dataType = this.getDataType(this.treeData, this.fields);
        if (this.dataType === 1) {
            this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
            var rootItems = this.getChildNodes(this.treeData, undefined, true);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rootItems)) {
                this.rootData = [];
            }
            else {
                this.rootData = rootItems;
            }
        }
        else {
            this.rootData = this.treeData;
        }
    };
    TreeView.prototype.renderItems = function (isSorted) {
        // tslint:disable
        if (!this.isBlazorPlatform || (this.isBlazorPlatform && this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) || this.changeDataSource) {
            this.listBaseOption.ariaAttributes.level = 1;
            var sortedData = this.getSortedData(this.rootData);
            this.ulElement = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createList(this.createElement, isSorted ? this.rootData : sortedData, this.listBaseOption);
            this.element.appendChild(this.ulElement);
            var rootNodes = this.ulElement.querySelectorAll('.e-list-item');
            if (this.loadOnDemand === false) {
                var i = 0;
                while (i < rootNodes.length) {
                    this.renderChildNodes(rootNodes[i], true, null, true);
                    i++;
                }
            }
            var parentEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + PARENTITEM, this.element);
            if ((parentEle.length === 1 && (rootNodes && rootNodes.length !== 0)) || this.loadOnDemand) {
                this.finalizeNode(this.element);
            }
        }
        this.updateTemplateForBlazor();
        this.parentNodeCheck = [];
        this.parentCheckData = [];
        this.updateCheckedStateFromDS();
        if (this.autoCheck && this.showCheckBox && !this.isLoaded) {
            this.updateParentCheckState();
        }
    };
    TreeView.prototype.updateTemplateForBlazor = function () {
        if (this.nodeTemplate && this.isBlazorPlatform && !this.isStringTemplate) {
            this.updateBlazorTemplate();
        }
    };
    /**
     * Update the checkedNodes from datasource at initial rendering
     */
    TreeView.prototype.updateCheckedStateFromDS = function (id) {
        if (this.treeData && this.showCheckBox) {
            if (this.dataType === 1) {
                var mapper = this.fields;
                var resultData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.isChecked, 'equal', true, false));
                for (var i = 0; i < resultData.length; i++) {
                    var resultId = resultData[i][this.fields.id] ? resultData[i][this.fields.id].toString() : null;
                    var resultPId = resultData[i][this.fields.parentID] ? resultData[i][this.fields.parentID].toString() : null;
                    if (this.checkedNodes.indexOf(resultId) === -1 && !(this.isLoaded)) {
                        this.checkedNodes.push(resultId);
                    }
                    if (resultData[i][this.fields.hasChildren]) {
                        var id_1 = resultData[i][this.fields.id];
                        var childData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).
                            executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.parentID, 'equal', id_1, false));
                        for (var child = 0; child < childData.length; child++) {
                            var childId = childData[child][this.fields.id] ? childData[child][this.fields.id].toString() : null;
                            if (this.checkedNodes.indexOf(childId) === -1 && this.autoCheck) {
                                this.checkedNodes.push(childId);
                            }
                        }
                    }
                }
                for (var i = 0; i < this.checkedNodes.length; i++) {
                    var mapper_1 = this.fields;
                    var checkState = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).
                        executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper_1.id, 'equal', this.checkedNodes[i], true));
                    if (checkState[0] && this.autoCheck) {
                        this.getCheckedNodeDetails(mapper_1, checkState);
                        this.checkIndeterminateState(checkState[0]);
                    }
                    var checkedData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).
                        executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper_1.parentID, 'equal', this.checkedNodes[i], true));
                    for (var index = 0; index < checkedData.length; index++) {
                        var checkedId = checkedData[index][this.fields.id] ? checkedData[index][this.fields.id].toString() : null;
                        if (this.checkedNodes.indexOf(checkedId) === -1 && this.autoCheck) {
                            this.checkedNodes.push(checkedId);
                        }
                    }
                }
            }
            else if (this.dataType === 2 || (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] &&
                this.isOffline)) {
                for (var index = 0; index < this.treeData.length; index++) {
                    var fieldId = this.treeData[index][this.fields.id] ? this.treeData[index][this.fields.id].toString() : '';
                    if (this.treeData[index][this.fields.isChecked] && !(this.isLoaded) && this.checkedNodes.indexOf(fieldId) === -1) {
                        this.checkedNodes.push(fieldId);
                    }
                    var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), this.treeData[index]);
                    if (childItems) {
                        this.updateChildCheckState(childItems, this.treeData[index]);
                    }
                }
            }
        }
    };
    /**
     * To check whether the list data has sub child and to change the parent check state accordingly
     */
    TreeView.prototype.getCheckedNodeDetails = function (mapper, checkNodes) {
        var id = checkNodes[0][this.fields.parentID] ? checkNodes[0][this.fields.parentID].toString() : null;
        var count = 0;
        var element = this.element.querySelector('[data-uid="' + checkNodes[0][this.fields.id] + '"]');
        var parentEle = this.element.querySelector('[data-uid="' + checkNodes[0][this.fields.parentID] + '"]');
        if (!element && !parentEle) {
            var len = this.parentNodeCheck.length;
            if (this.parentNodeCheck.indexOf(id) === -1) {
                this.parentNodeCheck.push(id);
            }
            var childNodes = this.getChildNodes(this.treeData, id);
            for (var i = 0; i < childNodes.length; i++) {
                var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;
                if (this.checkedNodes.indexOf(childId) !== -1) {
                    count++;
                }
                if (count === childNodes.length && this.checkedNodes.indexOf(id) === -1) {
                    this.checkedNodes.push(id);
                }
            }
            var preElement = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).
                executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.id, 'equal', id, true));
            this.getCheckedNodeDetails(mapper, preElement);
        }
        else if (parentEle) {
            var check = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECK, parentEle);
            if (!check) {
                this.changeState(parentEle, 'indeterminate', null, true, true);
            }
        }
    };
    /**
     * Update the checkedNodes and parent state when all the child Nodes are in checkedstate at initial rendering
     */
    TreeView.prototype.updateParentCheckState = function () {
        var indeterminate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + INDETERMINATE, this.element);
        var childCheckedElement;
        for (var i = 0; i < indeterminate.length; i++) {
            var node = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(indeterminate[i], '.' + LISTITEM);
            var nodeId = node.getAttribute('data-uid').toString();
            if (this.dataType === 1) {
                childCheckedElement = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).
                    executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(this.fields.parentID, 'equal', nodeId, true));
            }
            else {
                childCheckedElement = this.getChildNodes(this.treeData, nodeId);
            }
            var count = 0;
            if (childCheckedElement) {
                for (var j = 0; j < childCheckedElement.length; j++) {
                    var childId = childCheckedElement[j][this.fields.id].toString();
                    if (this.checkedNodes.indexOf(childId) !== -1) {
                        count++;
                    }
                }
                if (count === childCheckedElement.length) {
                    var nodeCheck = node.getAttribute('data-uid');
                    if (this.checkedNodes.indexOf(nodeCheck) === -1) {
                        this.checkedNodes.push(nodeCheck);
                    }
                    this.changeState(node, 'check', null, true, true);
                }
                else if (count === 0 && this.checkedNodes.length === 0) {
                    this.changeState(node, 'uncheck', null, true, true);
                }
            }
        }
    };
    /**
     * Change the parent to indeterminate state whenever the child is in checked state which is not rendered in DOM
     */
    TreeView.prototype.checkIndeterminateState = function (data) {
        var element;
        if (this.dataType === 1) {
            element = this.element.querySelector('[data-uid="' + data[this.fields.parentID] + '"]');
        }
        else {
            element = this.element.querySelector('[data-uid="' + data[this.fields.id] + '"]');
        }
        if (element) {
            var ariaChecked = element.querySelector('.' + CHECKBOXWRAP).getAttribute('aria-checked');
            if (ariaChecked !== 'true') {
                this.changeState(element, 'indeterminate', null, true, true);
            }
        }
        else if (this.dataType === 2) {
            var len = this.parentNodeCheck.length;
            if (this.parentNodeCheck.indexOf(data[this.fields.id].toString()) === -1) {
                this.parentNodeCheck.push(data[this.fields.id].toString());
            }
        }
    };
    /**
     * Update the checkedNodes for child and subchild from datasource (hierarchical datasource) at initial rendering
     */
    TreeView.prototype.updateChildCheckState = function (childItems, treeData) {
        var count = 0;
        var checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : '';
        for (var index = 0; index < childItems.length; index++) {
            var checkedChild = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : '';
            if (childItems[index][this.fields.isChecked] && !(this.isLoaded) && this.checkedNodes.indexOf(checkedChild) === -1) {
                this.checkedNodes.push(checkedChild);
            }
            if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1 && this.autoCheck) {
                this.checkedNodes.push(checkedChild);
            }
            if (this.checkedNodes.indexOf(checkedChild) !== -1 && this.autoCheck) {
                count++;
            }
            var subChildItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), childItems[index]);
            if (subChildItems) {
                this.parentCheckData.push(treeData);
                this.updateChildCheckState(subChildItems, childItems[index]);
            }
            if (count === childItems.length && this.autoCheck && this.checkedNodes.indexOf(checkedParent) === -1) {
                this.checkedNodes.push(checkedParent);
            }
        }
        if (count !== 0 && this.autoCheck) {
            this.checkIndeterminateState(treeData);
            for (var len = 0; len < this.parentCheckData.length; len++) {
                if ((treeData !== this.parentCheckData[len]) && (this.parentCheckData[len])) {
                    this.checkIndeterminateState(this.parentCheckData[len]);
                }
            }
        }
        this.parentCheckData = [];
    };
    TreeView.prototype.beforeNodeCreate = function (e) {
        if (this.showCheckBox) {
            var checkboxEle = Object(_ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["createCheckBox"])(this.createElement, true, { cssClass: this.touchClass });
            checkboxEle.setAttribute('role', 'checkbox');
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, e.item);
            var id = e.item.getAttribute('data-uid');
            e.item.childNodes[0].insertBefore(checkboxEle, e.item.childNodes[0].childNodes[Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon) ? 0 : 1]);
            var checkValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(e.fields.isChecked, e.curData);
            if (this.checkedNodes.indexOf(id) > -1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXFRAME, checkboxEle).classList.add(CHECK);
                checkboxEle.setAttribute('aria-checked', 'true');
                this.addCheck(e.item);
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(checkValue) && checkValue.toString() === 'true') {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXFRAME, checkboxEle).classList.add(CHECK);
                checkboxEle.setAttribute('aria-checked', 'true');
                this.addCheck(e.item);
            }
            else {
                checkboxEle.setAttribute('aria-checked', 'false');
            }
            var frame = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXFRAME, checkboxEle);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(frame, 'mousedown', this.frameMouseHandler, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(frame, 'mouseup', this.frameMouseHandler, this);
        }
        if (this.fullRowSelect) {
            this.createFullRow(e.item);
        }
        if (this.allowMultiSelection && !e.item.classList.contains(SELECTED)) {
            e.item.setAttribute('aria-selected', 'false');
        }
        var fields = e.fields;
        this.addActionClass(e, fields.selected, SELECTED);
        this.addActionClass(e, fields.expanded, EXPANDED);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.nodeTemplateFn)) {
            var textEle = e.item.querySelector('.' + LISTTEXT);
            var dataId = e.item.getAttribute('data-uid');
            textEle.innerHTML = '';
            this.renderNodeTemplate(e.curData, textEle, dataId);
        }
        var eventArgs = {
            node: e.item,
            nodeData: e.curData,
            text: e.text,
        };
        if (!this.isRefreshed) {
            this.trigger('drawNode', eventArgs);
        }
    };
    TreeView.prototype.frameMouseHandler = function (e) {
        var rippleSpan = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXRIPPLE, e.target.parentElement);
        Object(_ej2_buttons__WEBPACK_IMPORTED_MODULE_3__["rippleMouseHandler"])(e, rippleSpan);
    };
    TreeView.prototype.addActionClass = function (e, action, cssClass) {
        var data = e.curData;
        var actionValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(action, data);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(actionValue) && actionValue.toString() !== 'false') {
            e.item.classList.add(cssClass);
        }
    };
    TreeView.prototype.getDataType = function (ds, mapper) {
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
            for (var i = 0; i < ds.length; i++) {
                if (this.isOffline) {
                    if ((typeof mapper.child === 'string') && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, ds[i])) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.parentID, ds[i]))) {
                        return 1;
                    }
                }
                else if ((typeof mapper.child === 'string') && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, ds[i]))) {
                    return 1;
                }
            }
            return 2;
        }
        for (var i = 0, len = ds.length; i < len; i++) {
            if ((typeof mapper.child === 'string') && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, ds[i]))) {
                return 2;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.parentID, ds[i])) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.hasChildren, ds[i]))) {
                return 1;
            }
        }
        return 1;
    };
    TreeView.prototype.getGroupedData = function (dataSource, groupBy) {
        var cusQuery = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().group(groupBy);
        var ds = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].getDataSource(dataSource, cusQuery);
        var grpItem = [];
        for (var j = 0; j < ds.length; j++) {
            var itemObj = ds[j].items;
            grpItem.push(itemObj);
        }
        return grpItem;
    };
    TreeView.prototype.getSortedData = function (list) {
        if (list && this.sortOrder !== 'None') {
            list = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].getDataSource(list, _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].addSorting(this.sortOrder, this.fields.text));
        }
        return list;
    };
    TreeView.prototype.finalizeNode = function (element) {
        var iNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + IMAGE, element);
        for (var k = 0; k < iNodes.length; k++) {
            iNodes[k].setAttribute('alt', IMAGE);
        }
        if (this.isLoaded) {
            var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + SELECTED, element);
            for (var i = 0; i < sNodes.length; i++) {
                this.selectNode(sNodes[i], null);
                break;
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(sNodes, SELECTED);
        }
        var cNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM + ':not(.' + EXPANDED + ')', element);
        for (var j = 0; j < cNodes.length; j++) {
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, cNodes[j]);
            if (icon && icon.classList.contains(EXPANDABLE)) {
                this.disableExpandAttr(cNodes[j]);
            }
        }
        var eNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + EXPANDED, element);
        if (!this.isInitalExpand) {
            for (var i = 0; i < eNodes.length; i++) {
                this.renderChildNodes(eNodes[i]);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(eNodes, EXPANDED);
        this.updateList();
        if (this.isLoaded) {
            this.updateCheckedProp();
        }
    };
    TreeView.prototype.updateCheckedProp = function () {
        if (this.showCheckBox) {
            var nodes = [].concat([], this.checkedNodes);
            this.setProperties({ checkedNodes: nodes }, true);
        }
    };
    TreeView.prototype.ensureIndeterminate = function () {
        if (this.autoCheck) {
            var liElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('li', this.element);
            var ulElement = void 0;
            for (var i = 0; i < liElement.length; i++) {
                if (liElement[i].classList.contains(LISTITEM)) {
                    ulElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, liElement[i]);
                    if (ulElement) {
                        this.ensureParentCheckState(liElement[i]);
                    }
                    else {
                        this.ensureChildCheckState(liElement[i]);
                    }
                }
            }
        }
        else {
            var indeterminate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + INDETERMINATE, this.element);
            for (var i = 0; i < indeterminate.length; i++) {
                indeterminate[i].classList.remove(INDETERMINATE);
            }
        }
    };
    TreeView.prototype.ensureParentCheckState = function (element) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            if (element.classList.contains(ROOT)) {
                return;
            }
            var ulElement = element;
            if (element.classList.contains(LISTITEM)) {
                ulElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, element);
            }
            var checkedNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CHECK, ulElement);
            var indeterminateNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + INDETERMINATE, ulElement);
            var nodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM, ulElement);
            var checkBoxEle = element.getElementsByClassName(CHECKBOXWRAP)[0];
            if (nodes.length === checkedNodes.length) {
                this.changeState(checkBoxEle, 'check', null, true, true);
            }
            else if (checkedNodes.length > 0 || indeterminateNodes.length > 0) {
                this.changeState(checkBoxEle, 'indeterminate', null, true, true);
            }
            else if (checkedNodes.length === 0) {
                this.changeState(checkBoxEle, 'uncheck', null, true, true);
            }
            var parentUL = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, '.' + PARENTITEM);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentUL)) {
                var currentParent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(parentUL, '.' + LISTITEM);
                this.ensureParentCheckState(currentParent);
            }
        }
    };
    TreeView.prototype.ensureChildCheckState = function (element, e) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            var childElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, element);
            var checkBoxes = void 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(childElement)) {
                checkBoxes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CHECKBOXWRAP, childElement);
                var isChecked = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);
                var parentCheck = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(INDETERMINATE);
                var childCheck = childElement.querySelectorAll('li');
                var expandState = childElement.parentElement.getAttribute('aria-expanded');
                var checkedState = void 0;
                for (var index = 0; index < checkBoxes.length; index++) {
                    var childId = childCheck[index].getAttribute('data-uid');
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.currentLoadData) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.isChecked, this.currentLoadData[index]))) {
                        checkedState = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.isChecked, this.currentLoadData[index]) ? 'check' : 'uncheck';
                        if (this.ele !== -1) {
                            checkedState = isChecked ? 'check' : 'uncheck';
                        }
                        if ((checkedState === 'uncheck') && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.parentNodeCheck) && this.autoCheck
                            && this.parentNodeCheck.indexOf(childId) !== -1)) {
                            this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);
                            checkedState = 'indeterminate';
                        }
                    }
                    else {
                        var isNodeChecked = checkBoxes[index].getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);
                        if (isChecked) {
                            checkedState = 'check';
                        }
                        else if (isNodeChecked && !this.isLoaded) {
                            checkedState = 'check';
                        }
                        else if (this.checkedNodes.indexOf(childId) !== -1 && this.isLoaded && (parentCheck || isChecked)) {
                            checkedState = 'check';
                        }
                        else if (childCheck[index].classList.contains(CHILD) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.parentNodeCheck) && this.autoCheck
                            && (isChecked || parentCheck) && this.parentNodeCheck.indexOf(childId) !== -1)) {
                            checkedState = 'indeterminate';
                            this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);
                        }
                        else if (this.dataType === 1 && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(this.parentNodeCheck) && this.autoCheck &&
                            (isChecked || parentCheck) && this.parentNodeCheck.indexOf(childId) !== -1)) {
                            checkedState = 'indeterminate';
                            this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(childId), 1);
                        }
                        else {
                            checkedState = 'uncheck';
                        }
                    }
                    this.changeState(checkBoxes[index], checkedState, e, true, true);
                }
            }
            if (this.autoCheck && this.isLoaded) {
                this.updateParentCheckState();
            }
        }
    };
    TreeView.prototype.doCheckBoxAction = function (nodes, doCheck) {
        var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM, this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            for (var len = nodes.length; len >= 0; len--) {
                var liEle = void 0;
                if (nodes.length === 1) {
                    liEle = this.getElement(nodes[len - 1]);
                }
                else {
                    liEle = this.getElement(nodes[len]);
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
                    var node = void 0;
                    node = nodes[len - nodes.length] ? nodes[len - nodes.length].toString() : nodes[len] ? nodes[len].toString() : null;
                    if (node !== '' && doCheck && node) {
                        this.setValidCheckedNode(node);
                        this.dynamicCheckState(node, doCheck);
                    }
                    else if (this.checkedNodes.indexOf(node) !== -1 && node !== '' && !doCheck) {
                        this.checkedNodes.splice(this.checkedNodes.indexOf(node), 1);
                        var childItems = this.getChildNodes(this.treeData, node);
                        if (childItems) {
                            for (var i = 0; i < childItems.length; i++) {
                                var id = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;
                                if (this.checkedNodes.indexOf(id) !== -1) {
                                    this.checkedNodes.splice(this.checkedNodes.indexOf(id), 1);
                                }
                            }
                            if (this.parentNodeCheck.indexOf(node) !== -1) {
                                this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(node), 1);
                            }
                        }
                        if (node) {
                            this.dynamicCheckState(node, doCheck);
                        }
                        this.updateField(this.treeData, this.fields, node, 'isChecked', null);
                    }
                    continue;
                }
                var checkBox = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM + ' .' + CHECKBOXWRAP, liEle);
                this.validateCheckNode(checkBox, !doCheck, liEle, null);
            }
        }
        else {
            var checkBoxes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + CHECKBOXWRAP, this.element);
            if (this.loadOnDemand) {
                for (var index = 0; index < checkBoxes.length; index++) {
                    this.updateFieldChecked(checkBoxes[index], doCheck);
                    this.changeState(checkBoxes[index], doCheck ? 'check' : 'uncheck', null, null, null, doCheck);
                }
            }
            else {
                for (var index = 0; index < checkBoxes.length; index++) {
                    this.updateFieldChecked(checkBoxes[index], doCheck);
                    this.changeState(checkBoxes[index], doCheck ? 'check' : 'uncheck');
                }
            }
        }
        if (nodes) {
            for (var j = 0; j < nodes.length; j++) {
                var node = nodes[j] ? nodes[j].toString() : '';
                if (!doCheck) {
                    this.updateField(this.treeData, this.fields, node, 'isChecked', null);
                }
            }
        }
        if (this.autoCheck) {
            this.updateParentCheckState();
        }
    };
    TreeView.prototype.updateFieldChecked = function (checkbox, doCheck) {
        var currLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(checkbox, '.' + LISTITEM);
        var id = currLi.getAttribute('data-uid');
        var nodeDetails = this.getNodeData(currLi);
        if (nodeDetails.isChecked === 'true' && !doCheck) {
            this.updateField(this.treeData, this.fields, id, 'isChecked', null);
        }
    };
    /**
     * Changes the parent and child  check state while changing the checkedNodes via setmodel
     */
    TreeView.prototype.dynamicCheckState = function (node, doCheck) {
        if (this.dataType === 1) {
            var count = 0;
            var resultId = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(this.fields.id, 'equal', node, true));
            if (resultId[0]) {
                var id = resultId[0][this.fields.id] ? resultId[0][this.fields.id].toString() : null;
                var parent_1 = resultId[0][this.fields.parentID] ? resultId[0][this.fields.parentID].toString() : null;
                var parentElement = this.element.querySelector('[data-uid="' + parent_1 + '"]');
                var indeterminate = parentElement ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INDETERMINATE, parentElement) : null;
                var check = parentElement ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECK, parentElement) : null;
                var element = this.element.querySelector('[data-uid="' + id + '"]');
                var childNodes = this.getChildNodes(this.treeData, parent_1);
                if (childNodes) {
                    for (var i = 0; i < childNodes.length; i++) {
                        var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;
                        if (this.checkedNodes.indexOf(childId) !== -1) {
                            count++;
                        }
                    }
                }
                if (this.checkedNodes.indexOf(node) !== -1 && parentElement && (id === node) && this.autoCheck) {
                    this.changeState(parentElement, 'indeterminate', null);
                }
                else if (this.checkedNodes.indexOf(node) === -1 && element && (id === node) && !doCheck) {
                    this.changeState(element, 'uncheck', null);
                }
                else if (this.checkedNodes.indexOf(node) !== -1 && element && (id === node) && doCheck) {
                    this.changeState(element, 'check', null);
                }
                else if (this.checkedNodes.indexOf(node) === -1 && !element && parentElement && (id === node) && this.autoCheck
                    && count !== 0) {
                    this.changeState(parentElement, 'indeterminate', null);
                }
                else if (this.checkedNodes.indexOf(node) === -1 && !element && parentElement && (id === node) && this.autoCheck
                    && count === 0) {
                    this.changeState(parentElement, 'uncheck', null);
                }
                else if (!element && !parentElement && (id === node) && this.autoCheck) {
                    this.updateIndeterminate(node, doCheck);
                }
            }
        }
        else if (this.dataType === 2 || (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] &&
            this.isOffline)) {
            var id = void 0;
            var parentElement = void 0;
            var check = void 0;
            for (var i = 0; i < this.treeData.length; i++) {
                id = this.treeData[i][this.fields.id] ? this.treeData[i][this.fields.id].toString() : '';
                parentElement = this.element.querySelector('[data-uid="' + id + '"]');
                check = parentElement ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECK, parentElement) : null;
                if (this.checkedNodes.indexOf(id) === -1 && parentElement && check && !doCheck) {
                    this.changeState(parentElement, 'uncheck', null);
                }
                var subChild = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), this.treeData[i]);
                if (subChild) {
                    this.updateChildIndeterminate(subChild, id, node, doCheck, id);
                }
            }
        }
    };
    /**
     * updates the parent and child  check state while changing the checkedNodes via setmodel for listData
     */
    TreeView.prototype.updateIndeterminate = function (node, doCheck) {
        var indeterminateData = this.getTreeData(node);
        var count = 0;
        var parent;
        if (this.dataType === 1) {
            parent = indeterminateData[0][this.fields.parentID] ? indeterminateData[0][this.fields.parentID].toString() : null;
        }
        var childNodes = this.getChildNodes(this.treeData, parent);
        if (childNodes) {
            for (var i = 0; i < childNodes.length; i++) {
                var childId = childNodes[i][this.fields.id] ? childNodes[i][this.fields.id].toString() : null;
                if (this.checkedNodes.indexOf(childId) !== -1) {
                    count++;
                }
            }
        }
        var parentElement = this.element.querySelector('[data-uid="' + parent + '"]');
        if (parentElement && doCheck) {
            this.changeState(parentElement, 'indeterminate', null);
        }
        else if (!doCheck && parentElement && this.parentNodeCheck.indexOf(parent) === -1 && count !== 0) {
            this.changeState(parentElement, 'indeterminate', null);
        }
        else if (!doCheck && parentElement && this.parentNodeCheck.indexOf(parent) === -1 && count === 0) {
            this.changeState(parentElement, 'uncheck', null);
        }
        else if (!parentElement) {
            if (!doCheck && this.checkedNodes.indexOf(parent) === -1 && this.parentNodeCheck.indexOf(parent) !== -1) {
                this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(parent), 1);
            }
            else if (doCheck && this.checkedNodes.indexOf(parent) === -1 && this.parentNodeCheck.indexOf(parent) === -1) {
                this.parentNodeCheck.push(parent);
            }
            else if (!doCheck && this.checkedNodes.indexOf(parent) !== -1 && this.parentNodeCheck.indexOf(parent) === -1
                && count !== 0) {
                this.parentNodeCheck.push(parent);
            }
            this.updateIndeterminate(parent, doCheck);
            if (this.checkedNodes.indexOf(parent) !== -1 && !doCheck) {
                this.checkedNodes.splice(this.checkedNodes.indexOf(parent), 1);
            }
        }
    };
    /**
     * updates the parent and child  check state while changing the checkedNodes via setmodel for hierarchical data
     */
    TreeView.prototype.updateChildIndeterminate = function (subChild, parent, node, doCheck, child) {
        var count = 0;
        for (var j = 0; j < subChild.length; j++) {
            var subId = subChild[j][this.fields.id] ? subChild[j][this.fields.id].toString() : '';
            if (this.checkedNodes.indexOf(subId) !== -1) {
                count++;
            }
            var parentElement = this.element.querySelector('[data-uid="' + parent + '"]');
            var indeterminate = parentElement ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + INDETERMINATE, parentElement) : null;
            var check = parentElement ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECK, parentElement) : null;
            var element = this.element.querySelector('[data-uid="' + subId + '"]');
            var childElementCheck = element ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECK, element) : null;
            if (this.checkedNodes.indexOf(node) !== -1 && parentElement && (subId === node) && this.autoCheck) {
                this.changeState(parentElement, 'indeterminate', null);
            }
            else if (this.checkedNodes.indexOf(node) === -1 && parentElement && !element && (subId === node) && !doCheck) {
                if (this.autoCheck) {
                    this.changeState(parentElement, 'uncheck', null);
                }
                else {
                    if (count !== 0) {
                        this.changeState(parentElement, 'indeterminate', null);
                    }
                    else {
                        this.changeState(parentElement, 'uncheck', null);
                    }
                }
            }
            else if (this.checkedNodes.indexOf(node) === -1 && element && (subId === node) && !doCheck) {
                this.changeState(element, 'uncheck', null);
            }
            else if (this.checkedNodes.indexOf(node) === -1 && indeterminate && (subId === node) && this.autoCheck && count === 0
                && !doCheck) {
                indeterminate.classList.remove(INDETERMINATE);
            }
            else if (this.checkedNodes.indexOf(node) === -1 && !element && check && (subId === node) && count === 0) {
                this.changeState(parentElement, 'uncheck', null);
            }
            else if (this.checkedNodes.indexOf(subId) === -1 && element && childElementCheck && count === 0) {
                this.changeState(element, 'uncheck', null);
            }
            else if (!element && !parentElement && (subId === node) || (this.parentNodeCheck.indexOf(parent) !== -1) && this.autoCheck) {
                var childElement = this.element.querySelector('[data-uid="' + child + '"]');
                if (doCheck && count !== 0) {
                    this.changeState(childElement, 'indeterminate', null);
                }
                else if (doCheck && count === subChild.length && this.checkedNodes.indexOf(parent) === -1) {
                    this.checkedNodes.push(parent);
                }
                else if (!doCheck && count === 0 && this.parentNodeCheck.indexOf(parent) !== -1) {
                    this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(parent));
                }
                if (this.parentNodeCheck.indexOf(parent) === -1) {
                    this.parentNodeCheck.push(parent);
                }
            }
            var innerChild = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), subChild[j]);
            if (innerChild) {
                this.updateChildIndeterminate(innerChild, subId, node, doCheck, child);
            }
        }
    };
    TreeView.prototype.changeState = function (wrapper, state, e, isPrevent, isAdd, doCheck) {
        var _this = this;
        var eventArgs;
        var currLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(wrapper, '.' + LISTITEM);
        if (!isPrevent) {
            this.checkActionNodes = [];
            eventArgs = this.getCheckEvent(currLi, state, e);
            this.trigger('nodeChecking', eventArgs, function (observedArgs) {
                if (!observedArgs.cancel) {
                    _this.nodeCheckAction(wrapper, state, currLi, observedArgs, e, isPrevent, isAdd, doCheck);
                }
            });
        }
        else {
            this.nodeCheckAction(wrapper, state, currLi, eventArgs, e, isPrevent, isAdd, doCheck);
        }
    };
    TreeView.prototype.nodeCheckAction = function (wrapper, state, currLi, eventArgs, e, isPrevent, isAdd, doCheck) {
        var ariaState;
        var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME)[0];
        if (state === 'check' && !frameSpan.classList.contains(CHECK)) {
            frameSpan.classList.remove(INDETERMINATE);
            frameSpan.classList.add(CHECK);
            this.addCheck(currLi);
            ariaState = 'true';
        }
        else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK) || frameSpan.classList.contains(INDETERMINATE))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([frameSpan], [CHECK, INDETERMINATE]);
            this.removeCheck(currLi);
            ariaState = 'false';
        }
        else if (state === 'indeterminate' && !frameSpan.classList.contains(INDETERMINATE) && this.autoCheck) {
            frameSpan.classList.remove(CHECK);
            frameSpan.classList.add(INDETERMINATE);
            this.removeCheck(currLi);
            ariaState = 'mixed';
        }
        ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ariaState)) {
            wrapper.setAttribute('aria-checked', ariaState);
        }
        if (isAdd) {
            var data = [].concat([], this.checkActionNodes);
            eventArgs = this.getCheckEvent(currLi, state, e);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isUndefined"])(isPrevent)) {
                eventArgs.data = data;
            }
        }
        if (doCheck !== undefined) {
            this.ensureStateChange(currLi, doCheck);
        }
        if (!isPrevent) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ariaState)) {
                wrapper.setAttribute('aria-checked', ariaState);
                this.allowServerDataBinding = true;
                this.updateServerProperties("check");
                this.allowServerDataBinding = false;
                eventArgs.data[0].checked = ariaState;
                this.trigger('nodeChecked', eventArgs);
                this.checkActionNodes = [];
            }
        }
    };
    TreeView.prototype.addCheck = function (liEle) {
        var id = liEle.getAttribute('data-uid');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id) && this.checkedNodes.indexOf(id) === -1) {
            this.checkedNodes.push(id);
        }
    };
    TreeView.prototype.removeCheck = function (liEle) {
        var index = this.checkedNodes.indexOf(liEle.getAttribute('data-uid'));
        if (index > -1) {
            this.checkedNodes.splice(index, 1);
        }
    };
    TreeView.prototype.getCheckEvent = function (currLi, action, e) {
        this.checkActionNodes.push(this.getNodeData(currLi));
        var nodeData = this.checkActionNodes;
        return { action: action, cancel: false, isInteracted: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? false : true, node: currLi, data: nodeData };
    };
    TreeView.prototype.finalize = function () {
        var firstUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(firstUl)) {
            firstUl.setAttribute('role', treeAriaAttr.treeRole);
            this.setMultiSelect(this.allowMultiSelection);
            var firstNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTITEM, this.element);
            if (firstNode) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([firstNode], FOCUS);
                this.updateIdAttr(null, firstNode);
            }
            this.renderReactTemplates();
            this.hasPid = this.rootData[0] ? this.rootData[0].hasOwnProperty(this.fields.parentID) : false;
            this.doExpandAction();
        }
    };
    TreeView.prototype.doExpandAction = function () {
        var eUids = this.expandedNodes;
        if (this.isInitalExpand && eUids.length > 0) {
            this.setProperties({ expandedNodes: [] }, true);
            if (this.isBlazorPlatform && !this.initialRender) {
                return;
            }
            // tslint:disable
            if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
                this.expandGivenNodes(eUids);
            }
            else {
                for (var i = 0; i < eUids.length; i++) {
                    var eNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('[data-uid="' + eUids[i] + '"]', this.element);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eNode)) {
                        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + EXPANDABLE, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, eNode));
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon)) {
                            this.expandAction(eNode, icon, null);
                        }
                    }
                    else {
                        if (eUids[i] && this.expandChildren.indexOf(eUids[i]) === -1) {
                            this.expandChildren.push(eUids[i].toString());
                        }
                        continue;
                    }
                }
                this.afterFinalized();
            }
        }
        else {
            this.afterFinalized();
        }
    };
    TreeView.prototype.expandGivenNodes = function (arr) {
        var proxy = this;
        this.expandCallback(arr[this.index], function () {
            proxy.index++;
            if (proxy.index < arr.length) {
                proxy.expandGivenNodes(arr);
            }
            else {
                proxy.afterFinalized();
            }
        });
    };
    TreeView.prototype.expandCallback = function (eUid, callback) {
        var eNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('[data-uid="' + eUid + '"]', this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eNode)) {
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + EXPANDABLE, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, eNode));
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon)) {
                this.expandAction(eNode, icon, null, false, callback);
            }
            else {
                callback();
            }
        }
        else {
            callback();
        }
    };
    TreeView.prototype.afterFinalized = function () {
        if (!this.isBlazorPlatform || (this.isBlazorPlatform && !this.initialRender)) {
            this.doSelectionAction();
        }
        this.updateCheckedProp();
        if (this.isBlazorPlatform) {
            if (this.initialRender) {
                this.setCheckedNodes(this.checkedNodes);
            }
            this.updateInstance();
            this.initialRender = false;
        }
        this.isAnimate = true;
        this.isInitalExpand = false;
        if (!this.isLoaded || this.isFieldChange) {
            var eventArgs = { data: this.treeData };
            this.trigger('dataBound', eventArgs);
        }
        this.isLoaded = true;
    };
    TreeView.prototype.doSelectionAction = function () {
        var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + SELECTED, this.element);
        var sUids = this.selectedNodes;
        if (sUids.length > 0) {
            this.setProperties({ selectedNodes: [] }, true);
            for (var i = 0; i < sUids.length; i++) {
                var sNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('[data-uid="' + sUids[i] + '"]', this.element);
                if (sNode && !(sNode.classList.contains('e-active'))) {
                    this.selectNode(sNode, null, true);
                }
                else {
                    this.selectedNodes.push(sUids[i]);
                }
                if (!this.allowMultiSelection) {
                    break;
                }
            }
        }
        else {
            this.selectGivenNodes(sNodes);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(sNodes, SELECTED);
    };
    TreeView.prototype.selectGivenNodes = function (sNodes) {
        for (var i = 0; i < sNodes.length; i++) {
            if (!sNodes[i].classList.contains('e-disable')) {
                this.selectNode(sNodes[i], null, true);
            }
            if (!this.allowMultiSelection) {
                break;
            }
        }
    };
    TreeView.prototype.clickHandler = function (event) {
        var target = event.originalEvent.target;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'contextmenu', this.preventContextMenu);
        if (!target || this.dragStartAction) {
            return;
        }
        else {
            var classList = target.classList;
            var li = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
            if (!li) {
                return;
            }
            else if (event.originalEvent.which !== 3) {
                var rippleElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + RIPPLEELMENT, li);
                var rippleIcons = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + ICON, li);
                this.removeHover();
                this.setFocusElement(li);
                if (this.showCheckBox && !li.classList.contains('e-disable')) {
                    var checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + CHECKBOXWRAP);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(checkWrapper)) {
                        var checkElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXFRAME, checkWrapper);
                        this.validateCheckNode(checkWrapper, checkElement.classList.contains(CHECK), li, event.originalEvent);
                        this.triggerClickEvent(event.originalEvent, li);
                        return;
                    }
                }
                if (classList.contains(EXPANDABLE)) {
                    this.expandAction(li, target, event);
                }
                else if (classList.contains(COLLAPSIBLE)) {
                    this.collapseNode(li, target, event);
                }
                else if (rippleElement && rippleIcons) {
                    if (rippleIcons.classList.contains(RIPPLE) && rippleIcons.classList.contains(EXPANDABLE)) {
                        this.expandAction(li, rippleIcons, event);
                    }
                    else if (rippleIcons.classList.contains(RIPPLE) && rippleIcons.classList.contains(COLLAPSIBLE)) {
                        this.collapseNode(li, rippleIcons, event);
                    }
                    else if (!classList.contains(PARENTITEM) && !classList.contains(LISTITEM)) {
                        this.toggleSelect(li, event.originalEvent, false);
                    }
                }
                else {
                    if (!classList.contains(PARENTITEM) && !classList.contains(LISTITEM)) {
                        this.toggleSelect(li, event.originalEvent, false);
                    }
                }
            }
            this.triggerClickEvent(event.originalEvent, li);
        }
    };
    TreeView.prototype.nodeCheckedEvent = function (wrapper, isCheck, e) {
        var currLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(wrapper, '.' + LISTITEM);
        var eventArgs = this.getCheckEvent(wrapper, isCheck ? 'uncheck' : 'check', e);
        eventArgs.data = eventArgs.data.splice(0, eventArgs.data.length - 1);
        this.trigger('nodeChecked', eventArgs);
    };
    TreeView.prototype.triggerClickEvent = function (e, li) {
        var eventArgs = {
            event: e,
            node: li,
        };
        this.trigger('nodeClicked', eventArgs);
    };
    TreeView.prototype.expandNode = function (currLi, icon, loaded) {
        var _this = this;
        this.renderReactTemplates();
        if (icon.classList.contains(LOAD)) {
            this.hideSpinner(icon);
        }
        if (!this.initialRender) {
            icon.classList.add('interaction');
        }
        if (loaded !== true || (loaded === true && currLi.classList.contains('e-expanded'))) {
            if (this.preventExpand !== true) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], EXPANDABLE);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], COLLAPSIBLE);
                var start_1 = 0;
                var end_1 = 0;
                var proxy_1 = this;
                var ul_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, currLi);
                var liEle_1 = currLi;
                this.setHeight(liEle_1, ul_1);
                var activeElement_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTITEM + '.' + ACTIVE, currLi);
                if (this.isAnimate && !this.isRefreshed) {
                    this.aniObj.animate(ul_1, {
                        name: this.animation.expand.effect,
                        duration: this.animation.expand.duration,
                        timingFunction: this.animation.expand.easing,
                        begin: function (args) {
                            liEle_1.style.overflow = 'hidden';
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement_1) && activeElement_1 instanceof HTMLElement) {
                                activeElement_1.classList.add(ITEM_ANIMATION_ACTIVE);
                            }
                            start_1 = liEle_1.offsetHeight;
                            end_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, currLi).offsetHeight;
                        },
                        progress: function (args) {
                            args.element.style.display = 'block';
                            proxy_1.animateHeight(args, start_1, end_1);
                        },
                        end: function (args) {
                            args.element.style.display = 'block';
                            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement_1) && activeElement_1 instanceof HTMLElement) {
                                activeElement_1.classList.remove(ITEM_ANIMATION_ACTIVE);
                            }
                            _this.expandedNode(liEle_1, ul_1, icon);
                        }
                    });
                }
                else {
                    this.expandedNode(liEle_1, ul_1, icon);
                }
            }
        }
        else {
            var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, currLi);
            ul.style.display = 'none';
            if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] === true) {
                this.preventExpand = false;
            }
        }
        if (this.initialRender) {
            icon.classList.add('interaction');
        }
    };
    TreeView.prototype.expandedNode = function (currLi, ul, icon) {
        ul.style.display = 'block';
        currLi.style.display = 'block';
        currLi.style.overflow = '';
        currLi.style.height = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], PROCESS);
        this.addExpand(currLi);
        this.allowServerDataBinding = true;
        this.updateServerProperties("expand");
        this.allowServerDataBinding = false;
        if (this.isLoaded && this.expandArgs && !this.isRefreshed) {
            this.expandArgs = this.getExpandEvent(currLi, null);
            this.trigger('nodeExpanded', this.expandArgs);
        }
    };
    TreeView.prototype.addExpand = function (liEle) {
        liEle.setAttribute('aria-expanded', 'true');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([liEle], NODECOLLAPSED);
        var id = liEle.getAttribute('data-uid');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id) && this.expandedNodes.indexOf(id) === -1) {
            this.expandedNodes.push(id);
        }
    };
    TreeView.prototype.collapseNode = function (currLi, icon, e) {
        var _this = this;
        if (icon.classList.contains(PROCESS)) {
            return;
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], PROCESS);
        }
        var colArgs;
        if (this.isLoaded) {
            colArgs = this.getExpandEvent(currLi, e);
            this.trigger('nodeCollapsing', colArgs, function (observedArgs) {
                if (observedArgs.cancel) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], PROCESS);
                }
                else {
                    _this.nodeCollapseAction(currLi, icon, observedArgs);
                }
            });
        }
        else {
            this.nodeCollapseAction(currLi, icon, colArgs);
        }
    };
    TreeView.prototype.nodeCollapseAction = function (currLi, icon, colArgs) {
        var _this = this;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], COLLAPSIBLE);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], EXPANDABLE);
        var start = 0;
        var end = 0;
        var proxy = this;
        var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, currLi);
        var liEle = currLi;
        var activeElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTITEM + '.' + ACTIVE, currLi);
        if (this.isAnimate) {
            this.aniObj.animate(ul, {
                name: this.animation.collapse.effect,
                duration: this.animation.collapse.duration,
                timingFunction: this.animation.collapse.easing,
                begin: function (args) {
                    liEle.style.overflow = 'hidden';
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement) && activeElement instanceof HTMLElement) {
                        activeElement.classList.add(ITEM_ANIMATION_ACTIVE);
                    }
                    start = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, currLi).offsetHeight;
                    end = liEle.offsetHeight;
                },
                progress: function (args) {
                    proxy.animateHeight(args, start, end);
                },
                end: function (args) {
                    args.element.style.display = 'none';
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeElement) && activeElement instanceof HTMLElement) {
                        activeElement.classList.remove(ITEM_ANIMATION_ACTIVE);
                    }
                    _this.collapsedNode(liEle, ul, icon, colArgs);
                }
            });
        }
        else {
            this.collapsedNode(liEle, ul, icon, colArgs);
        }
    };
    TreeView.prototype.collapsedNode = function (liEle, ul, icon, colArgs) {
        ul.style.display = 'none';
        liEle.style.overflow = '';
        liEle.style.height = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], PROCESS);
        this.allowServerDataBinding = true;
        this.updateServerProperties("expand");
        this.allowServerDataBinding = false;
        this.removeExpand(liEle);
        if (this.isLoaded) {
            colArgs = this.getExpandEvent(liEle, null);
            this.trigger('nodeCollapsed', colArgs);
        }
    };
    TreeView.prototype.removeExpand = function (liEle, toRemove) {
        if (toRemove) {
            liEle.removeAttribute('aria-expanded');
        }
        else {
            this.disableExpandAttr(liEle);
        }
        var index = this.expandedNodes.indexOf(liEle.getAttribute('data-uid'));
        if (index > -1) {
            this.expandedNodes.splice(index, 1);
        }
    };
    TreeView.prototype.disableExpandAttr = function (liEle) {
        liEle.setAttribute('aria-expanded', 'false');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], NODECOLLAPSED);
    };
    TreeView.prototype.setHeight = function (currLi, ul) {
        ul.style.display = 'block';
        ul.style.visibility = 'hidden';
        currLi.style.height = currLi.offsetHeight + 'px';
        ul.style.display = 'none';
        ul.style.visibility = '';
    };
    TreeView.prototype.animateHeight = function (args, start, end) {
        var remaining = (args.duration - args.timeStamp) / args.duration;
        var currentHeight = (end - start) * remaining + start;
        args.element.parentElement.style.height = currentHeight + 'px';
    };
    TreeView.prototype.renderChildNodes = function (parentLi, expandChild, callback, loaded) {
        var _this = this;
        var eicon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, parentLi);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eicon)) {
            return;
        }
        this.showSpinner(eicon);
        var childItems;
        // tslint:disable
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
            var level = this.parents(parentLi, '.' + PARENTITEM).length;
            var mapper_2 = this.getChildFields(this.fields, level, 1);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper_2) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper_2.dataSource)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(eicon);
                this.removeExpand(parentLi, true);
                return;
            }
            this.treeList.push('false');
            if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && this.isOffline) {
                this.treeList.pop();
                childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'));
                this.loadChild(childItems, mapper_2, eicon, parentLi, expandChild, callback, loaded);
                this.updateTemplateForBlazor();
            }
            else {
                mapper_2.dataSource.executeQuery(this.getQuery(mapper_2, parentLi.getAttribute('data-uid'))).then(function (e) {
                    _this.treeList.pop();
                    childItems = e.result;
                    if (_this.dataType === 1) {
                        _this.dataType = 2;
                    }
                    _this.loadChild(childItems, mapper_2, eicon, parentLi, expandChild, callback, loaded);
                    _this.updateTemplateForBlazor();
                }).catch(function (e) {
                    _this.trigger('actionFailure', { error: e });
                });
            }
        }
        else {
            childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'));
            this.currentLoadData = childItems;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(childItems) || childItems.length === 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(eicon);
                this.removeExpand(parentLi, true);
                return;
            }
            else {
                if (!this.isBlazorPlatform || !this.initialRender) {
                    this.listBaseOption.ariaAttributes.level = parseFloat(parentLi.getAttribute('aria-level')) + 1;
                    parentLi.appendChild(_ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createList(this.createElement, this.getSortedData(childItems), this.listBaseOption));
                }
                this.expandNode(parentLi, eicon, loaded);
                this.setSelectionForChildNodes(childItems);
                this.ensureCheckNode(parentLi);
                this.finalizeNode(parentLi);
                if (this.loadOnDemand && this.nodeTemplate && this.isBlazorPlatform && !this.isStringTemplate) {
                    this.updateBlazorTemplate();
                }
                this.disableTreeNodes(childItems);
                this.renderSubChild(parentLi, expandChild, loaded);
            }
        }
    };
    TreeView.prototype.loadChild = function (childItems, mapper, eicon, parentLi, expandChild, callback, loaded) {
        this.currentLoadData = childItems;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(childItems) || childItems.length === 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(eicon);
            this.removeExpand(parentLi, true);
        }
        else {
            this.updateListProp(mapper);
            if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !this.isOffline) {
                var id = parentLi.getAttribute('data-uid');
                var nodeData = this.getNodeObject(id);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('child', childItems, nodeData);
            }
            this.listBaseOption.ariaAttributes.level = parseFloat(parentLi.getAttribute('aria-level')) + 1;
            parentLi.appendChild(_ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createList(this.createElement, childItems, this.listBaseOption));
            this.expandNode(parentLi, eicon, loaded);
            this.setSelectionForChildNodes(childItems);
            this.ensureCheckNode(parentLi);
            this.finalizeNode(parentLi);
            this.disableTreeNodes(childItems);
            this.renderSubChild(parentLi, expandChild, loaded);
        }
        if (callback) {
            callback();
        }
        if (this.treeList.length === 0 && !this.isLoaded) {
            this.finalize();
        }
    };
    TreeView.prototype.disableTreeNodes = function (childItems) {
        var i = 0;
        while (i < childItems.length) {
            var id = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;
            if (this.disableNode !== undefined && this.disableNode.indexOf(id) !== -1) {
                this.doDisableAction([id]);
            }
            i++;
        }
    };
    /**
     * Sets the child Item in selectedState while rendering the child node
     */
    TreeView.prototype.setSelectionForChildNodes = function (nodes) {
        var i;
        for (i = 0; i < nodes.length; i++) {
            var id = nodes[i][this.fields.id] ? nodes[i][this.fields.id].toString() : null;
            if (this.selectedNodes !== undefined && this.selectedNodes.indexOf(id) !== -1) {
                this.doSelectionAction();
            }
        }
    };
    TreeView.prototype.ensureCheckNode = function (element) {
        if (this.showCheckBox) {
            this.ele = (this.checkedElement) ? this.checkedElement.indexOf(element.getAttribute('data-uid')) : null;
            if (this.autoCheck) {
                this.ensureChildCheckState(element);
                this.ensureParentCheckState(element);
            }
        }
        this.currentLoadData = null;
    };
    TreeView.prototype.getFields = function (mapper, nodeLevel, dataLevel) {
        if (nodeLevel === dataLevel) {
            return mapper;
        }
        else {
            return this.getFields(this.getChildMapper(mapper), nodeLevel, dataLevel + 1);
        }
    };
    TreeView.prototype.getChildFields = function (mapper, nodeLevel, dataLevel) {
        var childData;
        if (nodeLevel === dataLevel) {
            return this.getChildMapper(mapper);
        }
        else {
            return this.getChildFields(this.getChildMapper(mapper), nodeLevel, dataLevel + 1);
        }
    };
    TreeView.prototype.getChildMapper = function (mapper) {
        return (typeof mapper.child === 'string' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.child)) ? mapper : mapper.child;
    };
    TreeView.prototype.getChildNodes = function (obj, parentId, isRoot) {
        if (isRoot === void 0) { isRoot = false; }
        var childNodes;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj)) {
            return childNodes;
        }
        else if (this.dataType === 1) {
            return this.getChildGroup(this.groupedData, parentId, isRoot);
        }
        else {
            if (typeof this.fields.child === 'string') {
                for (var i = 0, objlen = obj.length; i < objlen; i++) {
                    var dataId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, obj[i]);
                    if (dataId && dataId.toString() === parentId) {
                        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child, obj[i]);
                    }
                    else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child, obj[i]))) {
                        childNodes = this.getChildNodes(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child, obj[i]), parentId);
                        if (childNodes !== undefined) {
                            break;
                        }
                    }
                }
            }
        }
        return childNodes;
    };
    TreeView.prototype.getChildGroup = function (data, parentId, isRoot) {
        var childNodes;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data)) {
            return childNodes;
        }
        for (var i = 0, objlen = data.length; i < objlen; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[i][0]) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.parentID, data[i][0]))) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.parentID, data[i][0]).toString() === parentId) {
                    return data[i];
                }
            }
            else if (isRoot) {
                return data[i];
            }
            else {
                return [];
            }
        }
        return childNodes;
    };
    TreeView.prototype.renderSubChild = function (element, expandChild, loaded) {
        if (expandChild) {
            var cIcons = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + EXPANDABLE, element);
            for (var i = 0, len = cIcons.length; i < len; i++) {
                var icon = cIcons[i];
                if (element.querySelector('.e-icons') !== cIcons[i]) {
                    var curLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(icon, '.' + LISTITEM);
                    this.expandArgs = this.getExpandEvent(curLi, null);
                    if (loaded !== true) {
                        this.trigger('nodeExpanding', this.expandArgs);
                    }
                    this.renderChildNodes(curLi, expandChild, null, loaded);
                }
            }
        }
    };
    TreeView.prototype.toggleSelect = function (li, e, multiSelect) {
        if (!li.classList.contains('e-disable')) {
            if (this.allowMultiSelection && ((e && e.ctrlKey) || multiSelect) && this.isActive(li)) {
                this.unselectNode(li, e);
            }
            else {
                this.selectNode(li, e, multiSelect);
            }
        }
    };
    TreeView.prototype.isActive = function (li) {
        return li.classList.contains(ACTIVE) ? true : false;
    };
    TreeView.prototype.selectNode = function (li, e, multiSelect) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li) || (!this.allowMultiSelection && this.isActive(li) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e))) {
            this.setFocusElement(li);
            return;
        }
        var eventArgs;
        if (this.isLoaded) {
            eventArgs = this.getSelectEvent(li, 'select', e);
            this.trigger('nodeSelecting', eventArgs, function (observedArgs) {
                if (!observedArgs.cancel) {
                    _this.nodeSelectAction(li, e, observedArgs, multiSelect);
                }
            });
        }
        else {
            this.nodeSelectAction(li, e, eventArgs, multiSelect);
        }
    };
    TreeView.prototype.nodeSelectAction = function (li, e, eventArgs, multiSelect) {
        if (!this.allowMultiSelection || (!multiSelect && (!e || (e && !e.ctrlKey)))) {
            this.removeSelectAll();
        }
        if (this.allowMultiSelection && e && e.shiftKey) {
            if (!this.startNode) {
                this.startNode = li;
            }
            var startIndex = this.liList.indexOf(this.startNode);
            var endIndex = this.liList.indexOf(li);
            if (startIndex > endIndex) {
                var temp = startIndex;
                startIndex = endIndex;
                endIndex = temp;
            }
            for (var i = startIndex; i <= endIndex; i++) {
                var currNode = this.liList[i];
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(currNode) && !currNode.classList.contains('e-disable')) {
                    this.addSelect(currNode);
                }
            }
        }
        else {
            this.startNode = li;
            this.addSelect(li);
        }
        this.setFocusElement(li);
        if (this.isLoaded) {
            this.allowServerDataBinding = true;
            this.updateServerProperties("select");
            this.allowServerDataBinding = false;
            eventArgs.nodeData = this.getNodeData(li);
            this.trigger('nodeSelected', eventArgs);
        }
    };
    TreeView.prototype.unselectNode = function (li, e) {
        var _this = this;
        var eventArgs;
        if (this.isLoaded) {
            eventArgs = this.getSelectEvent(li, 'un-select', e);
            this.trigger('nodeSelecting', eventArgs, function (observedArgs) {
                if (!observedArgs.cancel) {
                    _this.allowServerDataBinding = true;
                    _this.updateServerProperties("select");
                    _this.allowServerDataBinding = false;
                    _this.nodeUnselectAction(li, observedArgs);
                }
            });
        }
        else {
            this.nodeUnselectAction(li, eventArgs);
        }
    };
    TreeView.prototype.nodeUnselectAction = function (li, eventArgs) {
        this.removeSelect(li);
        this.setFocusElement(li);
        if (this.isLoaded) {
            this.allowServerDataBinding = true;
            this.updateServerProperties("select");
            this.allowServerDataBinding = false;
            eventArgs.nodeData = this.getNodeData(li);
            this.trigger('nodeSelected', eventArgs);
        }
    };
    TreeView.prototype.setFocusElement = function (li) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(li)) {
            var focusedNode = this.getFocusedNode();
            if (focusedNode) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([focusedNode], FOCUS);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], FOCUS);
            this.updateIdAttr(focusedNode, li);
        }
    };
    TreeView.prototype.addSelect = function (liEle) {
        liEle.setAttribute('aria-selected', 'true');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], ACTIVE);
        var id = liEle.getAttribute('data-uid');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id) && this.selectedNodes.indexOf(id) === -1) {
            this.selectedNodes.push(id);
        }
    };
    TreeView.prototype.removeSelect = function (liEle) {
        if (this.allowMultiSelection) {
            liEle.setAttribute('aria-selected', 'false');
        }
        else {
            liEle.removeAttribute('aria-selected');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([liEle], ACTIVE);
        var index = this.selectedNodes.indexOf(liEle.getAttribute('data-uid'));
        if (index > -1) {
            this.selectedNodes.splice(index, 1);
        }
    };
    TreeView.prototype.removeSelectAll = function () {
        var selectedLI = this.element.querySelectorAll('.' + ACTIVE);
        for (var _i = 0, selectedLI_1 = selectedLI; _i < selectedLI_1.length; _i++) {
            var ele = selectedLI_1[_i];
            if (this.allowMultiSelection) {
                ele.setAttribute('aria-selected', 'false');
            }
            else {
                ele.removeAttribute('aria-selected');
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selectedLI, ACTIVE);
        this.setProperties({ selectedNodes: [] }, true);
    };
    TreeView.prototype.getSelectEvent = function (currLi, action, e) {
        var nodeData = this.getNodeData(currLi);
        return { action: action, cancel: false, isInteracted: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? false : true, node: currLi, nodeData: nodeData };
    };
    TreeView.prototype.setExpandOnType = function () {
        this.expandOnType = (this.expandOn === 'Auto') ? (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? 'Click' : 'DblClick') : this.expandOn;
    };
    TreeView.prototype.expandHandler = function (e) {
        var target = e.originalEvent.target;
        if (!target || target.classList.contains(INPUT) || target.classList.contains(ROOT) ||
            target.classList.contains(PARENTITEM) || target.classList.contains(LISTITEM) ||
            target.classList.contains(ICON) || this.showCheckBox && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + CHECKBOXWRAP)) {
            return;
        }
        else {
            this.expandCollapseAction(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM), e);
        }
    };
    TreeView.prototype.expandCollapseAction = function (currLi, e) {
        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, currLi);
        if (!icon || icon.classList.contains(PROCESS)) {
            return;
        }
        else {
            var classList = icon.classList;
            if (classList.contains(EXPANDABLE)) {
                this.expandAction(currLi, icon, e);
            }
            else if (classList.contains(COLLAPSIBLE)) {
                this.collapseNode(currLi, icon, e);
            }
        }
    };
    TreeView.prototype.expandAction = function (currLi, icon, e, expandChild, callback) {
        var _this = this;
        if (icon.classList.contains(PROCESS)) {
            return;
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], PROCESS);
        }
        if (this.isLoaded && !this.isRefreshed) {
            this.expandArgs = this.getExpandEvent(currLi, e);
            this.trigger('nodeExpanding', this.expandArgs, function (observedArgs) {
                if (observedArgs.cancel) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], PROCESS);
                }
                else {
                    _this.nodeExpandAction(currLi, icon, expandChild, callback);
                }
            });
        }
        else {
            this.nodeExpandAction(currLi, icon, expandChild, callback);
        }
    };
    TreeView.prototype.nodeExpandAction = function (currLi, icon, expandChild, callback) {
        var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, currLi);
        if (ul && ul.nodeName === 'UL') {
            this.expandNode(currLi, icon);
        }
        else {
            this.renderChildNodes(currLi, expandChild, callback);
            var liEles = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM, currLi);
            for (var i = 0; i < liEles.length; i++) {
                var id = this.getId(liEles[i]);
                if (this.expandChildren.indexOf(id) !== -1 && this.expandChildren !== undefined) {
                    var icon_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + EXPANDABLE, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, liEles[i]));
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon_1)) {
                        this.expandAction(liEles[i], icon_1, null);
                    }
                    this.expandChildren.splice(this.expandChildren.indexOf(id), 1);
                }
            }
        }
    };
    TreeView.prototype.keyActionHandler = function (e) {
        var _this = this;
        var target = e.target;
        var focusedNode = this.getFocusedNode();
        if (target && target.classList.contains(INPUT)) {
            var inpEle = target;
            if (e.action === 'enter') {
                inpEle.blur();
                this.element.focus();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([focusedNode], HOVER);
            }
            else if (e.action === 'escape') {
                inpEle.value = this.oldText;
                inpEle.blur();
                this.element.focus();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([focusedNode], HOVER);
            }
            return;
        }
        e.preventDefault();
        var eventArgs = {
            cancel: false,
            event: e,
            node: focusedNode,
        };
        this.trigger('keyPress', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                switch (e.action) {
                    case 'space':
                        if (_this.showCheckBox) {
                            _this.checkNode(e);
                        }
                        break;
                    case 'moveRight':
                        _this.openNode(_this.enableRtl ? false : true, e);
                        break;
                    case 'moveLeft':
                        _this.openNode(_this.enableRtl ? true : false, e);
                        break;
                    case 'shiftDown':
                        _this.shiftKeySelect(true, e);
                        break;
                    case 'moveDown':
                    case 'ctrlDown':
                    case 'csDown':
                        _this.navigateNode(true);
                        break;
                    case 'shiftUp':
                        _this.shiftKeySelect(false, e);
                        break;
                    case 'moveUp':
                    case 'ctrlUp':
                    case 'csUp':
                        _this.navigateNode(false);
                        break;
                    case 'home':
                    case 'shiftHome':
                    case 'ctrlHome':
                    case 'csHome':
                        _this.navigateRootNode(true);
                        break;
                    case 'end':
                    case 'shiftEnd':
                    case 'ctrlEnd':
                    case 'csEnd':
                        _this.navigateRootNode(false);
                        break;
                    case 'enter':
                    case 'ctrlEnter':
                    case 'shiftEnter':
                    case 'csEnter':
                        _this.toggleSelect(focusedNode, e);
                        break;
                    case 'f2':
                        if (_this.allowEditing && !focusedNode.classList.contains('e-disable')) {
                            _this.createTextbox(focusedNode, e);
                        }
                        break;
                    case 'ctrlA':
                        if (_this.allowMultiSelection) {
                            var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM + ':not(.' + ACTIVE + ')', _this.element);
                            _this.selectGivenNodes(sNodes);
                        }
                        break;
                }
            }
        });
    };
    TreeView.prototype.navigateToFocus = function (isUp) {
        var focusNode = this.getFocusedNode().querySelector('.' + TEXTWRAP);
        var pos = focusNode.getBoundingClientRect();
        var parent = this.getScrollParent(this.element);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parent)) {
            var parentPos = parent.getBoundingClientRect();
            if (pos.bottom > parentPos.bottom) {
                parent.scrollTop += pos.bottom - parentPos.bottom;
            }
            else if (pos.top < parentPos.top) {
                parent.scrollTop -= parentPos.top - pos.top;
            }
        }
        var isVisible = this.isVisibleInViewport(focusNode);
        if (!isVisible) {
            focusNode.scrollIntoView(isUp);
        }
    };
    TreeView.prototype.isVisibleInViewport = function (txtWrap) {
        var pos = txtWrap.getBoundingClientRect();
        return (pos.top >= 0 && pos.left >= 0 && pos.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
            pos.right <= (window.innerWidth || document.documentElement.clientWidth));
    };
    TreeView.prototype.getScrollParent = function (node) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(node)) {
            return null;
        }
        return (node.scrollHeight > node.clientHeight) ? node : this.getScrollParent(node.parentElement);
    };
    TreeView.prototype.shiftKeySelect = function (isTowards, e) {
        if (this.allowMultiSelection) {
            var focusedNode = this.getFocusedNode();
            var nextNode = isTowards ? this.getNextNode(focusedNode) : this.getPrevNode(focusedNode);
            this.removeHover();
            this.setFocusElement(nextNode);
            this.toggleSelect(nextNode, e, false);
            this.navigateToFocus(!isTowards);
        }
        else {
            this.navigateNode(isTowards);
        }
    };
    TreeView.prototype.checkNode = function (e) {
        var focusedNode = this.getFocusedNode();
        var checkWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXWRAP, focusedNode);
        var isChecked = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(' .' + CHECKBOXFRAME, checkWrap).classList.contains(CHECK);
        if (!focusedNode.classList.contains('e-disable')) {
            if (focusedNode.getElementsByClassName("e-checkbox-disabled").length == 0) {
                this.validateCheckNode(checkWrap, isChecked, focusedNode, e);
            }
        }
    };
    TreeView.prototype.validateCheckNode = function (checkWrap, isCheck, li, e) {
        var _this = this;
        var currLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(checkWrap, '.' + LISTITEM);
        this.checkActionNodes = [];
        var ariaState = !isCheck ? 'true' : 'false';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ariaState)) {
            checkWrap.setAttribute('aria-checked', ariaState);
        }
        var eventArgs = this.getCheckEvent(currLi, isCheck ? 'uncheck' : 'check', e);
        this.trigger('nodeChecking', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                _this.nodeCheckingAction(checkWrap, isCheck, li, observedArgs, e);
            }
        });
    };
    TreeView.prototype.nodeCheckingAction = function (checkWrap, isCheck, li, eventArgs, e) {
        if (this.checkedElement.indexOf(li.getAttribute('data-uid')) === -1) {
            this.checkedElement.push(li.getAttribute('data-uid'));
            var child = this.getChildNodes(this.treeData, li.getAttribute('data-uid'));
            (child !== null) ? this.allCheckNode(child, this.checkedElement, null, null, false) : child = null;
        }
        this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);
        if (this.autoCheck) {
            this.ensureChildCheckState(li);
            this.ensureParentCheckState(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(li, '.' + PARENTITEM), '.' + LISTITEM));
            var doCheck = void 0;
            if (eventArgs.action === 'check') {
                doCheck = true;
            }
            else if (eventArgs.action === 'uncheck') {
                doCheck = false;
            }
            this.ensureStateChange(li, doCheck);
        }
        this.allowServerDataBinding = true;
        this.updateServerProperties("check");
        this.allowServerDataBinding = false;
        this.nodeCheckedEvent(checkWrap, isCheck, e);
    };
    /**
     * Update checkedNodes when UI interaction happens before the child node renders in DOM
     */
    TreeView.prototype.ensureStateChange = function (li, doCheck) {
        var childElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, li);
        var parentIndex = li.getAttribute('data-uid');
        var mapper = this.fields;
        if (this.dataType === 1 && this.autoCheck) {
            var resultData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.parentID, 'equal', parentIndex, true));
            for (var i = 0; i < resultData.length; i++) {
                var resultId = resultData[i][this.fields.id] ? resultData[i][this.fields.id].toString() : null;
                var isCheck = resultData[i][this.fields.isChecked] ? resultData[i][this.fields.isChecked].toString() : null;
                if (this.checkedNodes.indexOf(parentIndex) !== -1 && this.checkedNodes.indexOf(resultId) === -1) {
                    this.checkedNodes.push(resultId);
                    var childItems = this.getChildNodes(this.treeData, resultId);
                    this.getChildItems(childItems, doCheck);
                    if (this.parentNodeCheck.indexOf(resultId) !== -1) {
                        this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(resultId), 1);
                    }
                }
                else if (this.checkedNodes.indexOf(parentIndex) === -1 && childElement === null &&
                    this.checkedNodes.indexOf(resultId) !== -1) {
                    this.checkedNodes.splice(this.checkedNodes.indexOf(resultId), 1);
                    if (isCheck === 'true') {
                        this.updateField(this.treeData, this.fields, resultId, 'isChecked', null);
                    }
                    if (this.checkedNodes.indexOf(parentIndex) === -1 && childElement === null ||
                        this.parentNodeCheck.indexOf(resultId) !== -1) {
                        var childNodes = this.getChildNodes(this.treeData, resultId);
                        this.getChildItems(childNodes, doCheck);
                        if (this.parentNodeCheck.indexOf(resultId) !== -1) {
                            this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(resultId), 1);
                        }
                    }
                }
                else {
                    var childItems = this.getChildNodes(this.treeData, resultId);
                    this.getChildItems(childItems, doCheck);
                }
            }
        }
        else if (this.dataType === 1 && !this.autoCheck) {
            if (!doCheck) {
                var checkedData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.isChecked, 'equal', true, false));
                for (var i = 0; i < checkedData.length; i++) {
                    var id = checkedData[i][this.fields.id] ? checkedData[i][this.fields.id].toString() : null;
                    if (this.checkedNodes.indexOf(id) !== -1) {
                        this.checkedNodes.splice(this.checkedNodes.indexOf(id), 1);
                    }
                    this.updateField(this.treeData, this.fields, id, 'isChecked', null);
                }
                this.checkedNodes = [];
            }
            else {
                for (var i = 0; i < this.treeData.length; i++) {
                    var checkedId = this.treeData[i][this.fields.id] ? this.treeData[i][this.fields.id].toString() : null;
                    if (this.checkedNodes.indexOf(checkedId) === -1) {
                        this.checkedNodes.push(checkedId);
                    }
                }
            }
        }
        else {
            var childItems = this.getChildNodes(this.treeData, parentIndex);
            if (childItems) {
                this.childStateChange(childItems, parentIndex, childElement, doCheck);
            }
        }
    };
    TreeView.prototype.getChildItems = function (childItems, doCheck) {
        for (var i = 0; i < childItems.length; i++) {
            var childId = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : null;
            var childIsCheck = childItems[i][this.fields.isChecked] ? childItems[i][this.fields.isChecked].toString() :
                null;
            if (this.checkedNodes.indexOf(childId) !== -1 && !doCheck) {
                this.checkedNodes.splice(this.checkedNodes.indexOf(childId), 1);
            }
            if (this.checkedNodes.indexOf(childId) === -1 && doCheck) {
                this.checkedNodes.push(childId);
            }
            if (childIsCheck === 'true' && !doCheck) {
                this.updateField(this.treeData, this.fields, childId, 'isChecked', null);
            }
            var subChildItems = this.getChildNodes(this.treeData, childId);
            if (subChildItems.length > 0) {
                this.getChildItems(subChildItems, doCheck);
            }
        }
    };
    /**
     * Update checkedNodes when UI interaction happens before the child node renders in DOM for hierarchical DS
     */
    TreeView.prototype.childStateChange = function (childItems, parent, childElement, doCheck) {
        for (var i = 0; i < childItems.length; i++) {
            var checkedChild = childItems[i][this.fields.id] ? childItems[i][this.fields.id].toString() : '';
            var isCheck = childItems[i][this.fields.isChecked] ? childItems[i][this.fields.isChecked].toString() : null;
            if (this.autoCheck) {
                if (this.checkedNodes.indexOf(parent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {
                    this.checkedNodes.push(checkedChild);
                    if (this.parentNodeCheck.indexOf(checkedChild) !== -1) {
                        this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(checkedChild), 1);
                    }
                }
                else if (this.checkedNodes.indexOf(parent) === -1 && this.checkedNodes.indexOf(checkedChild) !== -1 && !doCheck) {
                    this.checkedNodes.splice(this.checkedNodes.indexOf(checkedChild), 1);
                    if (isCheck === 'true') {
                        this.updateField(this.treeData, this.fields, checkedChild, 'isChecked', null);
                    }
                }
            }
            else if (!this.autoCheck) {
                if (!doCheck) {
                    if (this.checkedNodes.indexOf(checkedChild) !== -1) {
                        this.checkedNodes.splice(this.checkedNodes.indexOf(checkedChild), 1);
                    }
                    this.updateField(this.treeData, this.fields, checkedChild, 'isChecked', null);
                    this.checkedNodes = [];
                }
                else {
                    if (this.checkedNodes.indexOf(checkedChild) === -1) {
                        this.checkedNodes.push(checkedChild);
                    }
                }
            }
            var subChild = this.getChildNodes([childItems[i]], checkedChild);
            if (subChild) {
                this.childStateChange(subChild, parent, childElement, doCheck);
            }
        }
    };
    //This method can be used to get all child nodes of a parent by passing the children of a parent along with 'validateCheck' set to false
    TreeView.prototype.allCheckNode = function (child, newCheck, checked, childCheck, validateCheck) {
        if (child) {
            for (var length_1 = 0; length_1 < child.length; length_1++) {
                var childId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, child[length_1]);
                var check = this.element.querySelector('[data-uid="' + childId + '"]');
                //Validates isChecked case while no UI interaction has been performed on the node or it's parent
                if (validateCheck !== false && this.checkedElement.indexOf(childId.toString()) === -1) {
                    if (((check === null && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(child[length_1][this.fields.isChecked]) && newCheck.indexOf(childId.toString()) === -1)
                        || childCheck === 0 || checked === 2)) {
                        (child[length_1][this.fields.isChecked] !== false || checked === 2) ? newCheck.push(childId.toString())
                            : childCheck = null;
                        childCheck = (child[length_1][this.fields.isChecked] !== false || checked === 2) ? 0 : null;
                    }
                }
                //Pushes child checked node done thro' UI interaction
                if (newCheck.indexOf(childId.toString()) === -1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(checked)) {
                    newCheck.push(childId.toString());
                }
                //Gets if any next level children are available for child nodes
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.hasChildren, child[length_1]) === true ||
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), child[length_1])) {
                    var id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, child[length_1]);
                    var childId_1 = this.getChildNodes(this.treeData, id.toString());
                    if (childId_1) {
                        (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(validateCheck)) ? this.allCheckNode(childId_1, newCheck, checked, childCheck) :
                            this.allCheckNode(childId_1, newCheck, checked, childCheck, validateCheck);
                        childCheck = null;
                    }
                }
                childCheck = null;
            }
        }
    };
    TreeView.prototype.openNode = function (toBeOpened, e) {
        var focusedNode = this.getFocusedNode();
        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, focusedNode);
        if (toBeOpened) {
            if (!icon) {
                return;
            }
            else if (icon.classList.contains(EXPANDABLE)) {
                this.expandAction(focusedNode, icon, e);
            }
            else {
                this.focusNextNode(focusedNode, true);
            }
        }
        else {
            if (icon && icon.classList.contains(COLLAPSIBLE)) {
                this.collapseNode(focusedNode, icon, e);
            }
            else {
                var parentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(focusedNode, '.' + PARENTITEM), '.' + LISTITEM);
                if (!parentLi) {
                    return;
                }
                else {
                    if (!parentLi.classList.contains('e-disable')) {
                        this.setFocus(focusedNode, parentLi);
                        this.navigateToFocus(true);
                    }
                }
            }
        }
    };
    TreeView.prototype.navigateNode = function (isTowards) {
        var focusedNode = this.getFocusedNode();
        this.focusNextNode(focusedNode, isTowards);
    };
    TreeView.prototype.navigateRootNode = function (isBackwards) {
        var focusedNode = this.getFocusedNode();
        var rootNode = isBackwards ? this.getRootNode() : this.getEndNode();
        if (!rootNode.classList.contains('e-disable')) {
            this.setFocus(focusedNode, rootNode);
            this.navigateToFocus(isBackwards);
        }
    };
    TreeView.prototype.getFocusedNode = function () {
        var selectedItem;
        var fNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTITEM + '.' + FOCUS, this.element);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fNode)) {
            selectedItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTITEM, this.element);
        }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(fNode) ? (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedItem) ? this.element.firstElementChild : selectedItem) : fNode;
    };
    TreeView.prototype.focusNextNode = function (li, isTowards) {
        var nextNode = isTowards ? this.getNextNode(li) : this.getPrevNode(li);
        this.setFocus(li, nextNode);
        this.navigateToFocus(!isTowards);
        if (nextNode.classList.contains('e-disable')) {
            var lastChild = nextNode.lastChild;
            if (nextNode.previousSibling == null && nextNode.classList.contains('e-level-1')) {
                this.focusNextNode(nextNode, true);
            }
            else if (nextNode.nextSibling == null && nextNode.classList.contains('e-node-collapsed')) {
                this.focusNextNode(nextNode, false);
            }
            else if (nextNode.nextSibling == null && lastChild.classList.contains('e-text-content')) {
                this.focusNextNode(nextNode, false);
            }
            else {
                this.focusNextNode(nextNode, isTowards);
            }
        }
    };
    TreeView.prototype.getNextNode = function (li) {
        var index = this.liList.indexOf(li);
        var nextNode;
        do {
            index++;
            nextNode = this.liList[index];
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nextNode)) {
                return li;
            }
        } while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(nextNode));
        return nextNode;
    };
    TreeView.prototype.getPrevNode = function (li) {
        var index = this.liList.indexOf(li);
        var prevNode;
        do {
            index--;
            prevNode = this.liList[index];
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prevNode)) {
                return li;
            }
        } while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(prevNode));
        return prevNode;
    };
    TreeView.prototype.getRootNode = function () {
        var index = 0;
        var rootNode;
        do {
            rootNode = this.liList[index];
            index++;
        } while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(rootNode));
        return rootNode;
    };
    TreeView.prototype.getEndNode = function () {
        var index = this.liList.length - 1;
        var endNode;
        do {
            endNode = this.liList[index];
            index--;
        } while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(endNode));
        return endNode;
    };
    TreeView.prototype.setFocus = function (preNode, nextNode) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([preNode], [HOVER, FOCUS]);
        if (!nextNode.classList.contains('e-disable')) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([nextNode], [HOVER, FOCUS]);
            this.updateIdAttr(preNode, nextNode);
        }
    };
    TreeView.prototype.updateIdAttr = function (preNode, nextNode) {
        this.element.removeAttribute('aria-activedescendant');
        if (preNode) {
            preNode.removeAttribute('id');
        }
        nextNode.setAttribute('id', this.element.id + '_active');
        this.element.setAttribute('aria-activedescendant', this.element.id + '_active');
    };
    TreeView.prototype.focusIn = function () {
        if (!this.mouseDownStatus) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.getFocusedNode()], HOVER);
        }
        this.mouseDownStatus = false;
    };
    TreeView.prototype.focusOut = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.getFocusedNode()], HOVER);
    };
    TreeView.prototype.onMouseOver = function (e) {
        var target = e.target;
        var classList = target.classList;
        var currentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
        if (!currentLi || classList.contains(PARENTITEM) || classList.contains(LISTITEM)) {
            this.removeHover();
            return;
        }
        else {
            if (currentLi && !currentLi.classList.contains('e-disable')) {
                this.setHover(currentLi);
            }
        }
    };
    TreeView.prototype.setHover = function (li) {
        if (!li.classList.contains(HOVER)) {
            this.removeHover();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([li], HOVER);
        }
    };
    ;
    TreeView.prototype.onMouseLeave = function (e) {
        this.removeHover();
    };
    TreeView.prototype.removeHover = function () {
        var hoveredNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + HOVER, this.element);
        if (hoveredNode && hoveredNode.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(hoveredNode, HOVER);
        }
    };
    ;
    TreeView.prototype.getNodeData = function (currLi, fromDS) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currLi) && currLi.classList.contains(LISTITEM) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(currLi, '.' + CONTROL)) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(currLi, '.' + CONTROL).classList.contains(ROOT)) {
            var id = currLi.getAttribute('data-uid');
            var text = this.getText(currLi, fromDS);
            var pNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(currLi.parentNode, '.' + LISTITEM);
            var pid = pNode ? pNode.getAttribute('data-uid') : null;
            var selected = currLi.classList.contains(ACTIVE);
            var expanded = (currLi.getAttribute('aria-expanded') === 'true') ? true : false;
            var hasChildren = (currLi.getAttribute('aria-expanded') === null) ? false : true;
            if (this.isBlazorPlatform) {
                hasChildren = currLi.getAttribute('aria-expanded') === 'true' ? true : (currLi.querySelector('.e-icon-expandable') || currLi.querySelector('.e-icon-collapsible')) != null ? true : false;
            }
            var checked = null;
            if (this.showCheckBox) {
                checked = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + CHECKBOXWRAP, currLi).getAttribute('aria-checked');
            }
            return {
                id: id, text: text, parentID: pid, selected: selected, expanded: expanded,
                isChecked: checked, hasChildren: hasChildren
            };
        }
        return { id: '', text: '', parentID: '', selected: false, expanded: false, isChecked: '', hasChildren: false };
    };
    TreeView.prototype.getText = function (currLi, fromDS) {
        if (fromDS) {
            var nodeData = this.getNodeObject(currLi.getAttribute('data-uid'));
            var level = parseFloat(currLi.getAttribute('aria-level'));
            var nodeFields = this.getFields(this.fields, level, 1);
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nodeFields.text, nodeData);
        }
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTTEXT, currLi).textContent;
    };
    TreeView.prototype.getExpandEvent = function (currLi, e) {
        var nodeData = this.getNodeData(currLi);
        return { cancel: false, isInteracted: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) ? false : true, node: currLi, nodeData: nodeData, event: e };
    };
    TreeView.prototype.renderNodeTemplate = function (data, textEle, dataId) {
        var tempArr = this.nodeTemplateFn(data, this, 'nodeTemplate' + dataId, this.element.id + 'nodeTemplate', this.isStringTemplate, undefined, textEle);
        if (tempArr) {
            tempArr = Array.prototype.slice.call(tempArr);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tempArr, textEle);
        }
    };
    TreeView.prototype.destroyTemplate = function (liEle) {
        this.clearTemplate(['nodeTemplate' + liEle.getAttribute('data-uid')]);
    };
    TreeView.prototype.reRenderNodes = function () {
        this.updateListProp(this.fields);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.element.id + 'nodeTemplate', 'NodeTemplate');
        if (this.isBlazorPlatform) {
            this.ulElement = this.element.querySelector('.e-list-parent.e-ul');
            this.ulElement.parentElement.removeChild(this.ulElement);
        }
        else {
            this.element.innerHTML = '';
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.nodeTemplateFn)) {
            this.clearTemplate();
        }
        this.setTouchClass();
        this.setProperties({ selectedNodes: [], checkedNodes: [], expandedNodes: [] }, true);
        this.checkedElement = [];
        this.isLoaded = false;
        this.setDataBinding(true);
    };
    TreeView.prototype.setCssClass = function (oldClass, newClass) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldClass) && oldClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldClass.split(' '));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newClass) && newClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newClass.split(' '));
        }
    };
    TreeView.prototype.editingHandler = function (e) {
        var target = e.target;
        if (!target || target.classList.contains(ROOT) || target.classList.contains(PARENTITEM) ||
            target.classList.contains(LISTITEM) || target.classList.contains(ICON) ||
            target.classList.contains(INPUT) || target.classList.contains(INPUTGROUP)) {
            return;
        }
        else {
            var liEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
            this.createTextbox(liEle, e);
        }
    };
    TreeView.prototype.createTextbox = function (liEle, e) {
        var _this = this;
        var oldInpEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TREEINPUT, this.element);
        if (oldInpEle) {
            oldInpEle.blur();
        }
        var textEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTTEXT, liEle);
        this.updateOldText(liEle);
        var innerEle = this.createElement('input', { className: TREEINPUT, attrs: { value: this.oldText } });
        var eventArgs = this.getEditEvent(liEle, null, innerEle.outerHTML);
        this.trigger('nodeEditing', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                var inpWidth = textEle.offsetWidth + 5;
                var style = 'width:' + inpWidth + 'px';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], EDITING);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.nodeTemplateFn)) {
                    _this.destroyTemplate(liEle);
                }
                textEle.innerHTML = eventArgs.innerHtml;
                var inpEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TREEINPUT, textEle);
                _this.inputObj = _ej2_inputs__WEBPACK_IMPORTED_MODULE_4__["Input"].createInput({
                    element: inpEle,
                    properties: {
                        enableRtl: _this.enableRtl,
                    }
                }, _this.createElement);
                _this.inputObj.container.setAttribute('style', style);
                inpEle.focus();
                var inputEle = inpEle;
                inputEle.setSelectionRange(0, inputEle.value.length);
                _this.wireInputEvents(inpEle);
            }
        });
    };
    TreeView.prototype.updateOldText = function (liEle) {
        var id = liEle.getAttribute('data-uid');
        this.editData = this.getNodeObject(id);
        var level = parseFloat(liEle.getAttribute('aria-level'));
        this.editFields = this.getFields(this.fields, level, 1);
        this.oldText = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.editFields.text, this.editData);
    };
    TreeView.prototype.inputFocusOut = function (e) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TREEINPUT, this.element)) {
            return;
        }
        var target = e.target;
        var newText = target.value;
        var txtEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTTEXT);
        var liEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.inputObj.container);
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !this.isOffline && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
            this.crudOperation('update', null, liEle, newText, null, null, true);
        }
        else {
            this.appendNewText(liEle, txtEle, newText, true);
        }
    };
    TreeView.prototype.appendNewText = function (liEle, txtEle, newText, isInput) {
        var _this = this;
        var eventArgs = this.getEditEvent(liEle, newText, null);
        this.trigger('nodeEdited', eventArgs, function (observedArgs) {
            newText = observedArgs.cancel ? observedArgs.oldText : observedArgs.newText;
            _this.updateText(liEle, txtEle, newText, isInput);
            if (observedArgs.oldText !== newText) {
                _this.triggerEvent();
            }
        });
    };
    TreeView.prototype.updateText = function (liEle, txtEle, newText, isInput) {
        var newData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.editFields.text, newText, this.editData);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.nodeTemplateFn)) {
            txtEle.innerText = '';
            var dataId = liEle.getAttribute('data-uid');
            this.renderNodeTemplate(newData, txtEle, dataId);
            this.updateBlazorTemplate();
            this.renderReactTemplates();
        }
        else {
            txtEle.innerText = newText;
        }
        if (isInput) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([liEle], EDITING);
            txtEle.focus();
        }
    };
    TreeView.prototype.getElement = function (ele) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
            return null;
        }
        else if (typeof ele === 'string') {
            return this.element.querySelector('[data-uid="' + ele + '"]');
        }
        else if (typeof ele === 'object') {
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(ele);
        }
        else {
            return null;
        }
    };
    TreeView.prototype.getId = function (ele) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele)) {
            return null;
        }
        else if (typeof ele === 'string') {
            return ele;
        }
        else if (typeof ele === 'object') {
            return (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(ele)).getAttribute('data-uid');
        }
        else {
            return null;
        }
    };
    TreeView.prototype.getEditEvent = function (liEle, newText, inpEle) {
        var data = this.getNodeData(liEle);
        return { cancel: false, newText: newText, node: liEle, nodeData: data, oldText: this.oldText, innerHtml: inpEle };
    };
    TreeView.prototype.getNodeObject = function (id) {
        var childNodes;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
            return childNodes;
        }
        else if (this.dataType === 1) {
            for (var i = 0, objlen = this.treeData.length; i < objlen; i++) {
                var dataId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, this.treeData[i]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.treeData[i]) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dataId) && dataId.toString() === id) {
                    return this.treeData[i];
                }
            }
        }
        else {
            return this.getChildNodeObject(this.treeData, this.fields, id);
        }
        return childNodes;
    };
    TreeView.prototype.getChildNodeObject = function (obj, mapper, id) {
        var newList;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj)) {
            return newList;
        }
        for (var i = 0, objlen = obj.length; i < objlen; i++) {
            var dataId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.id, obj[i]);
            if (obj[i] && dataId && dataId.toString() === id) {
                return obj[i];
            }
            else if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]))) {
                var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]);
                newList = this.getChildNodeObject(childData, this.getChildMapper(mapper), id);
                if (newList !== undefined) {
                    break;
                }
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]))) {
                var child = 'child';
                newList = this.getChildNodeObject(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(child, obj[i]), this.getChildMapper(mapper), id);
                if (newList !== undefined) {
                    break;
                }
            }
        }
        return newList;
    };
    TreeView.prototype.setDragAndDrop = function (toBind) {
        if (toBind && !this.disabled) {
            this.initializeDrag();
        }
        else {
            this.destroyDrag();
        }
    };
    // tslint:disable-next-line:max-func-body-length
    TreeView.prototype.initializeDrag = function () {
        var _this = this;
        var virtualEle;
        var proxy = this;
        this.dragObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"](this.element, {
            enableTailMode: true, enableAutoScroll: true,
            dragArea: this.dragArea,
            dragTarget: '.' + TEXTWRAP,
            helper: function (e) {
                _this.dragTarget = e.sender.target;
                var dragRoot = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(_this.dragTarget, '.' + ROOT);
                var dragWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(_this.dragTarget, '.' + TEXTWRAP);
                _this.dragLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(_this.dragTarget, '.' + LISTITEM);
                if (_this.fullRowSelect && !dragWrap && _this.dragTarget.classList.contains(FULLROW)) {
                    dragWrap = _this.dragTarget.nextElementSibling;
                }
                if (!_this.dragTarget || !e.element.isSameNode(dragRoot) || !dragWrap ||
                    _this.dragTarget.classList.contains(ROOT) || _this.dragTarget.classList.contains(PARENTITEM) ||
                    _this.dragTarget.classList.contains(LISTITEM) || _this.dragLi.classList.contains('e-disable')) {
                    return false;
                }
                var cloneEle = (dragWrap.cloneNode(true));
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, cloneEle))) {
                    var icon = proxy.createElement('div', { className: ICON + ' ' + EXPANDABLE });
                    cloneEle.insertBefore(icon, cloneEle.children[0]);
                }
                var cssClass = DRAGITEM + ' ' + ROOT + ' ' + _this.cssClass + ' ' + (_this.enableRtl ? RTL : '');
                virtualEle = proxy.createElement('div', { className: cssClass });
                virtualEle.appendChild(cloneEle);
                var nLen = _this.selectedNodes.length;
                if (nLen > 1 && _this.allowMultiSelection && _this.dragLi.classList.contains(ACTIVE)) {
                    var cNode = proxy.createElement('span', { className: DROPCOUNT, innerHTML: '' + nLen });
                    virtualEle.appendChild(cNode);
                }
                document.body.appendChild(virtualEle);
                document.body.style.cursor = '';
                _this.dragData = _this.getNodeData(_this.dragLi);
                return virtualEle;
            },
            dragStart: function (e) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], DRAGGING);
                var listItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-list-item');
                var level;
                if (listItem) {
                    level = parseInt(listItem.getAttribute('aria-level'), 10);
                }
                var eventArgs = _this.getDragEvent(e.event, _this, null, e.target, null, virtualEle, level);
                if (eventArgs.draggedNode.classList.contains(EDITING)) {
                    _this.dragObj.intDestroy(e.event);
                    _this.dragCancelAction(virtualEle);
                }
                else {
                    _this.trigger('nodeDragStart', eventArgs, function (observedArgs) {
                        if (observedArgs.cancel) {
                            _this.dragObj.intDestroy(e.event);
                            _this.dragCancelAction(virtualEle);
                        }
                        else {
                            _this.dragStartAction = true;
                        }
                        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                            e.bindEvents(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(e.dragElement));
                        }
                    });
                }
            },
            drag: function (e) {
                _this.dragObj.setProperties({ cursorAt: { top: (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.event.targetTouches) || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) ? 60 : -20 } });
                _this.dragAction(e, virtualEle);
            },
            dragStop: function (e) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], DRAGGING);
                _this.removeVirtualEle();
                var dropTarget = e.target;
                var preventTargetExpand = false;
                var dropRoot = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropTarget, '.' + DROPPABLE));
                var isHelperElement = true;
                if (!dropTarget || !dropRoot) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(e.helper);
                    document.body.style.cursor = '';
                    isHelperElement = false;
                }
                var listItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropTarget, '.e-list-item');
                var level;
                if (listItem) {
                    level = parseInt(listItem.getAttribute('aria-level'), 10);
                }
                var eventArgs = _this.getDragEvent(e.event, _this, dropTarget, dropTarget, null, e.helper, level);
                eventArgs.preventTargetExpand = preventTargetExpand;
                if ((_this.isBlazorPlatform && _this.dragStartAction) || !_this.isBlazorPlatform) {
                    _this.trigger('nodeDragStop', eventArgs, function (observedArgs) {
                        _this.dragParent = observedArgs.draggedParentNode;
                        _this.preventExpand = observedArgs.preventTargetExpand;
                        if (observedArgs.cancel) {
                            if (e.helper.parentNode) {
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(e.helper);
                            }
                            document.body.style.cursor = '';
                            isHelperElement = false;
                        }
                        _this.dragStartAction = false;
                        if (_this.isBlazorPlatform && isHelperElement) {
                            _this.dropAction(e, true);
                        }
                    });
                }
            }
        });
        this.dropObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Droppable"](this.element, {
            out: function (e) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e) && !e.target.classList.contains(SIBLING)) {
                    document.body.style.cursor = 'not-allowed';
                }
            },
            over: function (e) {
                document.body.style.cursor = '';
            },
            drop: function (e) {
                if (!_this.isBlazorPlatform) {
                    _this.dropAction(e);
                }
            }
        });
    };
    TreeView.prototype.dragCancelAction = function (virtualEle) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(virtualEle);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], DRAGGING);
        this.dragStartAction = false;
    };
    TreeView.prototype.dragAction = function (e, virtualEle) {
        var dropRoot = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + DROPPABLE);
        var dropWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + TEXTWRAP);
        var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, virtualEle);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], [DROPIN, DROPNEXT, DROPOUT, NODROP]);
        this.removeVirtualEle();
        document.body.style.cursor = '';
        var classList = e.target.classList;
        if (this.fullRowSelect && !dropWrap && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(classList) && classList.contains(FULLROW)) {
            dropWrap = e.target.nextElementSibling;
        }
        if (dropRoot) {
            var dropLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + LISTITEM);
            var checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + CHECKBOXWRAP);
            var collapse = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + COLLAPSIBLE);
            var expand = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + EXPANDABLE);
            if (!dropRoot.classList.contains(ROOT) || (dropWrap &&
                (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi)))) {
                if ((dropLi && e && (!expand && !collapse) && (e.event.offsetY < 7) && !checkWrapper) || (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPNEXT);
                    var virEle = this.createElement('div', { className: SIBLING });
                    var index = this.fullRowSelect ? (1) : (0);
                    dropLi.insertBefore(virEle, dropLi.children[index]);
                }
                else if ((dropLi && e && (!expand && !collapse) && (e.target.offsetHeight > 0 && e.event.offsetY > (e.target.offsetHeight - 10)) && !checkWrapper) || (((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19)))) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPNEXT);
                    var virEle = this.createElement('div', { className: SIBLING });
                    var index = this.fullRowSelect ? (2) : (1);
                    dropLi.insertBefore(virEle, dropLi.children[index]);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPIN);
                }
            }
            else if (e.target.nodeName === 'LI' && (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi))) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPNEXT);
                this.renderVirtualEle(e);
            }
            else if (e.target.classList.contains(SIBLING)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPNEXT);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], DROPOUT);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], NODROP);
            document.body.style.cursor = 'not-allowed';
        }
        var listItem = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-list-item');
        var level;
        if (listItem) {
            level = parseInt(listItem.getAttribute('aria-level'), 10);
        }
        var eventArgs = this.getDragEvent(e.event, this, e.target, e.target, null, virtualEle, level);
        if (eventArgs.dropIndicator) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], eventArgs.dropIndicator);
        }
        this.trigger('nodeDragging', eventArgs);
        if (eventArgs.dropIndicator) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([icon], eventArgs.dropIndicator);
        }
    };
    // tslint:disable
    TreeView.prototype.dropAction = function (e, isBlazorDrop) {
        var offsetY = e.event.offsetY;
        var dropTarget = e.target;
        var dragObj;
        var level;
        var drop = false;
        var dragInstance;
        if (!isBlazorDrop) {
            dragInstance = e.dragData.draggable;
        }
        else {
            dragInstance = e.element;
        }
        for (var i = 0; i < dragInstance.ej2_instances.length; i++) {
            if (dragInstance.ej2_instances[i] instanceof TreeView_1) {
                dragObj = dragInstance.ej2_instances[i];
                break;
            }
        }
        if (dragObj && dragObj.dragTarget) {
            var dragTarget = dragObj.dragTarget;
            var dragLi = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragTarget, '.' + LISTITEM));
            var dropLi = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropTarget, '.' + LISTITEM));
            if (dropLi == null && dropTarget.classList.contains(ROOT)) {
                dropLi = dropTarget.firstElementChild;
            }
            if (!isBlazorDrop) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(e.droppedElement);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(e.helper);
            }
            document.body.style.cursor = '';
            if (!dropLi || dropLi.isSameNode(dragLi) || this.isDescendant(dragLi, dropLi)) {
                if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] === false) {
                    this.preventExpand = false;
                }
                return;
            }
            if (dragObj.allowMultiSelection && dragLi.classList.contains(ACTIVE)) {
                var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + ACTIVE, dragObj.element);
                if (e.target.offsetHeight <= 33 && offsetY > e.target.offsetHeight - 10 && offsetY > 6) {
                    for (var i = sNodes.length - 1; i >= 0; i--) {
                        if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {
                            continue;
                        }
                        this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);
                    }
                }
                else {
                    for (var i = 0; i < sNodes.length; i++) {
                        if (dropLi.isSameNode(sNodes[i]) || this.isDescendant(sNodes[i], dropLi)) {
                            continue;
                        }
                        this.appendNode(dropTarget, sNodes[i], dropLi, e, dragObj, offsetY);
                    }
                }
            }
            else {
                this.appendNode(dropTarget, dragLi, dropLi, e, dragObj, offsetY);
            }
            level = parseInt(dragLi.getAttribute('aria-level'), 10);
            drop = true;
        }
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] === false) {
            this.preventExpand = false;
        }
        if (!isBlazorDrop) {
            this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
        }
        else {
            this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.element, null, level, drop));
        }
        this.triggerEvent();
    };
    TreeView.prototype.appendNode = function (dropTarget, dragLi, dropLi, e, dragObj, offsetY) {
        var checkWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropTarget, '.' + CHECKBOXWRAP);
        var collapse = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + COLLAPSIBLE);
        var expand = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + EXPANDABLE);
        if (!dragLi.classList.contains('e-disable') && !checkWrapper && ((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3) || (expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19) || (!expand && !collapse))) {
            if (dropTarget.nodeName === 'LI') {
                this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);
            }
            else if (dropTarget.firstElementChild && dropTarget.classList.contains(ROOT)) {
                if (dropTarget.firstElementChild.nodeName === 'UL') {
                    this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);
                }
            }
            else if ((dropTarget.classList.contains('e-icon-collapsible')) || (dropTarget.classList.contains('e-icon-expandable'))) {
                this.dropAsSiblingNode(dragLi, dropLi, e, dragObj);
            }
            else {
                this.dropAsChildNode(dragLi, dropLi, dragObj, null, e, offsetY);
            }
        }
        else {
            this.dropAsChildNode(dragLi, dropLi, dragObj, null, e, offsetY, true);
        }
    };
    TreeView.prototype.dropAsSiblingNode = function (dragLi, dropLi, e, dragObj) {
        var dropUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropLi, '.' + PARENTITEM);
        var dragParentUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragLi, '.' + PARENTITEM);
        var dragParentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragParentUl, '.' + LISTITEM);
        var pre;
        if (e.target.offsetHeight > 0 && e.event.offsetY > e.target.offsetHeight - 2) {
            pre = false;
        }
        else if (e.event.offsetY < 2) {
            pre = true;
        }
        else if (e.target.classList.contains('e-icon-expandable') || (e.target.classList.contains('e-icon-collapsible'))) {
            if ((e.event.offsetY < 5) || (e.event.offsetX < 3)) {
                pre = true;
            }
            else if ((e.event.offsetY > 15) || (e.event.offsetX > 17)) {
                pre = false;
            }
        }
        if ((e.target.classList.contains('e-icon-expandable')) || (e.target.classList.contains('e-icon-collapsible'))) {
            var target = e.target.closest('li');
            dropUl.insertBefore(dragLi, pre ? target : target.nextElementSibling);
        }
        else {
            dropUl.insertBefore(dragLi, pre ? e.target : e.target.nextElementSibling);
        }
        this.moveData(dragLi, dropLi, dropUl, pre, dragObj);
        this.updateElement(dragParentUl, dragParentLi);
        this.updateAriaLevel(dragLi);
        if (dragObj.element.id === this.element.id) {
            this.updateList();
        }
        else {
            dragObj.updateInstance();
            this.updateInstance();
        }
    };
    TreeView.prototype.dropAsChildNode = function (dragLi, dropLi, dragObj, index, e, pos, isCheck) {
        var dragParentUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragLi, '.' + PARENTITEM);
        var dragParentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragParentUl, '.' + LISTITEM);
        var dropParentUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropLi, '.' + PARENTITEM);
        if (e && (pos < 7) && !isCheck) {
            dropParentUl.insertBefore(dragLi, dropLi);
            this.moveData(dragLi, dropLi, dropParentUl, true, dragObj);
        }
        else if (e && (e.target.offsetHeight > 0 && pos > (e.target.offsetHeight - 10)) && !isCheck) {
            dropParentUl.insertBefore(dragLi, dropLi.nextElementSibling);
            this.moveData(dragLi, dropLi, dropParentUl, false, dragObj);
        }
        else {
            var dropUl = this.expandParent(dropLi);
            var childLi = dropUl.childNodes[index];
            dropUl.insertBefore(dragLi, childLi);
            this.moveData(dragLi, childLi, dropUl, true, dragObj);
        }
        this.updateElement(dragParentUl, dragParentLi);
        this.updateAriaLevel(dragLi);
        if (dragObj.element.id === this.element.id) {
            this.updateList();
        }
        else {
            dragObj.updateInstance();
            this.updateInstance();
        }
    };
    TreeView.prototype.moveData = function (dragLi, dropLi, dropUl, pre, dragObj) {
        var dropParentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropUl, '.' + LISTITEM);
        var id = this.getId(dragLi);
        var removedData = dragObj.updateChildField(dragObj.treeData, dragObj.fields, id, null, null, true);
        var refId = this.getId(dropLi);
        var index = this.getDataPos(this.treeData, this.fields, refId);
        var parentId = this.getId(dropParentLi);
        if (this.dataType === 1) {
            this.updateField(this.treeData, this.fields, parentId, 'hasChildren', true);
            var pos = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) ? this.treeData.length : (pre ? index : index + 1);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentId) && !this.hasPid) {
                delete removedData[0][this.fields.parentID];
            }
            else {
                var currPid = this.isNumberTypeId ? parseFloat(parentId) : parentId;
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.fields.parentID, currPid, removedData[0]);
            }
            this.treeData.splice(pos, 0, removedData[0]);
            if (dragObj.element.id !== this.element.id) {
                var childData = dragObj.removeChildNodes(id);
                pos++;
                for (var i = 0, len = childData.length; i < len; i++) {
                    this.treeData.splice(pos, 0, childData[i]);
                    pos++;
                }
                dragObj.groupedData = dragObj.getGroupedData(dragObj.treeData, dragObj.fields.parentID);
            }
            this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
        }
        else {
            this.addChildData(this.treeData, this.fields, parentId, removedData, pre ? index : index + 1);
        }
    };
    TreeView.prototype.expandParent = function (dropLi) {
        var dropIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, dropLi);
        if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && this.preventExpand !== true) {
            this.expandAction(dropLi, dropIcon, null);
        }
        var dropUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, dropLi);
        if (this.preventExpand === true && !dropUl && dropIcon) {
            this.renderChildNodes(dropLi);
        }
        dropUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, dropLi);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropUl) && this.preventExpand === true) {
            dropUl.style.display = 'none';
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropUl) && this.preventExpand === false) {
            dropUl.style.display = 'block';
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropUl) && this.preventExpand === true) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropIcon)) {
                _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateIcon(this.createElement, dropLi, EXPANDABLE, this.listBaseOption);
            }
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, dropLi);
            if (icon) {
                icon.classList.add('e-icon-expandable');
            }
            dropUl = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateUL(this.createElement, [], null, this.listBaseOption);
            dropLi.appendChild(dropUl);
            if (icon) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], COLLAPSIBLE);
            }
            else {
                _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateIcon(this.createElement, dropLi, EXPANDABLE, this.listBaseOption);
            }
            dropLi.setAttribute('aria-expanded', 'false');
            dropUl.style.display = 'none';
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropUl)) {
            this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropIcon)) {
                _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);
            }
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, dropLi);
            if (icon) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], EXPANDABLE);
            }
            else {
                _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);
                icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, dropLi);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([icon], EXPANDABLE);
            }
            dropUl = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].generateUL(this.createElement, [], null, this.listBaseOption);
            dropLi.appendChild(dropUl);
            this.addExpand(dropLi);
            this.trigger('nodeExpanded', this.getExpandEvent(dropLi, null));
        }
        return dropUl;
    };
    TreeView.prototype.updateElement = function (dragParentUl, dragParentLi) {
        if (dragParentLi && dragParentUl.childElementCount === 0) {
            var dragIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, dragParentLi);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(dragParentUl);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(dragIcon);
            var parentId = this.getId(dragParentLi);
            this.updateField(this.treeData, this.fields, parentId, 'hasChildren', false);
            this.removeExpand(dragParentLi, true);
        }
    };
    TreeView.prototype.updateAriaLevel = function (dragLi) {
        var level = this.parents(dragLi, '.' + PARENTITEM).length;
        dragLi.setAttribute('aria-level', '' + level);
        this.updateChildAriaLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, dragLi), level + 1);
    };
    TreeView.prototype.updateChildAriaLevel = function (element, level) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            var cNodes = element.childNodes;
            for (var i = 0, len = cNodes.length; i < len; i++) {
                var liEle = cNodes[i];
                liEle.setAttribute('aria-level', '' + level);
                this.updateChildAriaLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, liEle), level + 1);
            }
        }
    };
    TreeView.prototype.renderVirtualEle = function (e) {
        var pre;
        if (e.event.offsetY > e.target.offsetHeight - 2) {
            pre = false;
        }
        else if (e.event.offsetY < 2) {
            pre = true;
        }
        var virEle = this.createElement('div', { className: SIBLING });
        var index = this.fullRowSelect ? (pre ? 1 : 2) : (pre ? 0 : 1);
        e.target.insertBefore(virEle, e.target.children[index]);
    };
    TreeView.prototype.removeVirtualEle = function () {
        var sibEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + SIBLING);
        if (sibEle) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(sibEle);
        }
    };
    TreeView.prototype.destroyDrag = function () {
        if (this.dragObj && this.dropObj) {
            this.dragObj.destroy();
            this.dropObj.destroy();
        }
    };
    TreeView.prototype.getDragEvent = function (event, obj, dropTarget, target, dragNode, cloneEle, level, drop) {
        var dropLi = dropTarget ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dropTarget, '.' + LISTITEM) : null;
        var dropData = dropLi ? this.getNodeData(dropLi) : null;
        var draggedNode = obj ? obj.dragLi : dragNode;
        var draggedNodeData = obj ? obj.dragData : null;
        var newParent = dropTarget ? this.parents(dropTarget, '.' + LISTITEM) : null;
        var dragLiParent = obj.dragLi.parentElement;
        var dragParent = obj.dragLi ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragLiParent, '.' + LISTITEM) : null;
        var targetParent = null;
        var indexValue = null;
        var iconCss = [DROPNEXT, DROPIN, DROPOUT, NODROP];
        var iconClass = null;
        var node = (drop === true) ? draggedNode : dropLi;
        var index = node ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(node, '.e-list-parent') : null;
        var i = 0;
        var position = null;
        dragParent = (obj.dragLi && dragParent === null) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragLiParent, '.' + ROOT) : dragParent;
        dragParent = (drop === true) ? this.dragParent : dragParent;
        if (cloneEle) {
            while (i < 4) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + ICON, cloneEle).classList.contains(iconCss[i])) {
                    iconClass = iconCss[i];
                    break;
                }
                i++;
            }
        }
        if (index) {
            var dropTar = 0;
            for (i = 0; i < index.childElementCount; i++) {
                dropTar = (drop !== true && index.children[i] === draggedNode && dropLi !== draggedNode) ? ++dropTar : dropTar;
                if ((drop !== true && index.children[i].classList.contains('e-hover'))) {
                    indexValue = (event.offsetY >= 23) ? i + 1 : i;
                    break;
                }
                else if (index.children[i] === node) {
                    indexValue = (event.offsetY >= 23) ? i : i;
                    break;
                }
            }
            indexValue = (dropTar !== 0) ? --indexValue : indexValue;
            position = (iconClass == "e-drop-in") ? "Inside" : ((event.offsetY < 7) ? "Before" : "After");
        }
        if (dropTarget) {
            if (newParent.length === 0) {
                targetParent = null;
            }
            else if (dropTarget.classList.contains(LISTITEM)) {
                targetParent = newParent[0];
            }
            else {
                targetParent = newParent[1];
            }
        }
        if (dropLi === draggedNode) {
            targetParent = dropLi;
        }
        if (dropTarget && target.offsetHeight <= 33 && event.offsetY < target.offsetHeight - 10 && event.offsetY > 6) {
            targetParent = dropLi;
            if (drop !== true) {
                level = ++level;
                var parent_2 = targetParent ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.e-list-parent', targetParent) : null;
                indexValue = (parent_2) ? parent_2.children.length : 0;
                if (!(this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]) && parent_2 === null && targetParent) {
                    var parent_3 = targetParent.hasAttribute('data-uid') ?
                        this.getChildNodes(this.fields.dataSource, targetParent.getAttribute('data-uid').toString()) : null;
                    indexValue = (parent_3) ? parent_3.length : 0;
                }
            }
        }
        return {
            cancel: false,
            clonedNode: cloneEle,
            event: event,
            draggedNode: draggedNode,
            draggedNodeData: draggedNodeData,
            droppedNode: dropLi,
            droppedNodeData: dropData,
            dropIndex: indexValue,
            dropLevel: level,
            draggedParentNode: dragParent,
            dropTarget: targetParent,
            dropIndicator: iconClass,
            target: target,
            position: position,
        };
    };
    TreeView.prototype.addFullRow = function (toAdd) {
        var len = this.liList.length;
        if (toAdd) {
            for (var i = 0; i < len; i++) {
                this.createFullRow(this.liList[i]);
            }
        }
        else {
            for (var i = 0; i < len; i++) {
                var rowDiv = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + FULLROW, this.liList[i]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(rowDiv);
            }
        }
    };
    TreeView.prototype.createFullRow = function (item) {
        var rowDiv = this.createElement('div', { className: FULLROW });
        item.insertBefore(rowDiv, item.childNodes[0]);
    };
    TreeView.prototype.addMultiSelect = function (toAdd) {
        if (toAdd) {
            var liEles = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM + ':not([aria-selected="true"])', this.element);
            for (var _i = 0, liEles_1 = liEles; _i < liEles_1.length; _i++) {
                var ele = liEles_1[_i];
                ele.setAttribute('aria-selected', 'false');
            }
        }
        else {
            var liEles = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM + '[aria-selected="false"]', this.element);
            for (var _a = 0, liEles_2 = liEles; _a < liEles_2.length; _a++) {
                var ele = liEles_2[_a];
                ele.removeAttribute('aria-selected');
            }
        }
    };
    TreeView.prototype.collapseByLevel = function (element, level, excludeHiddenNodes) {
        if (level > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            var cNodes = this.getVisibleNodes(excludeHiddenNodes, element.childNodes);
            for (var i = 0, len = cNodes.length; i < len; i++) {
                var liEle = cNodes[i];
                var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + COLLAPSIBLE, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, liEle));
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon)) {
                    this.collapseNode(liEle, icon, null);
                }
                this.collapseByLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, liEle), level - 1, excludeHiddenNodes);
            }
        }
    };
    TreeView.prototype.collapseAllNodes = function (excludeHiddenNodes) {
        var cIcons = this.getVisibleNodes(excludeHiddenNodes, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + COLLAPSIBLE, this.element));
        for (var i = 0, len = cIcons.length; i < len; i++) {
            var icon = cIcons[i];
            var liEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(icon, '.' + LISTITEM);
            this.collapseNode(liEle, icon, null);
        }
    };
    TreeView.prototype.expandByLevel = function (element, level, excludeHiddenNodes) {
        if (level > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            var eNodes = this.getVisibleNodes(excludeHiddenNodes, element.childNodes);
            for (var i = 0, len = eNodes.length; i < len; i++) {
                var liEle = eNodes[i];
                var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + EXPANDABLE, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, liEle));
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon)) {
                    this.expandAction(liEle, icon, null);
                }
                this.expandByLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, liEle), level - 1, excludeHiddenNodes);
            }
        }
    };
    TreeView.prototype.expandAllNodes = function (excludeHiddenNodes) {
        var eIcons = this.getVisibleNodes(excludeHiddenNodes, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + EXPANDABLE, this.element));
        for (var i = 0, len = eIcons.length; i < len; i++) {
            var icon = eIcons[i];
            var liEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(icon, '.' + LISTITEM);
            this.expandAction(liEle, icon, null, true);
        }
    };
    TreeView.prototype.getVisibleNodes = function (excludeHiddenNodes, nodes) {
        var vNodes = Array.prototype.slice.call(nodes);
        if (excludeHiddenNodes) {
            for (var i = 0; i < vNodes.length; i++) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isVisible"])(vNodes[i])) {
                    vNodes.splice(i, 1);
                    i--;
                }
            }
        }
        return vNodes;
    };
    TreeView.prototype.removeNode = function (node) {
        var dragParentUl = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(node, '.' + PARENTITEM);
        var dragParentLi = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(dragParentUl, '.' + LISTITEM);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.nodeTemplateFn)) {
            this.destroyTemplate(node);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(node);
        this.updateElement(dragParentUl, dragParentLi);
        this.updateInstance();
        this.removeData(node);
    };
    TreeView.prototype.updateInstance = function () {
        this.updateList();
        this.updateSelectedNodes();
        this.updateExpandedNodes();
        this.allowServerDataBinding = false;
        this.updateServerProperties("expand");
        this.updateServerProperties("check");
        this.updateServerProperties("select");
        this.allowServerDataBinding = true;
    };
    TreeView.prototype.updateServerProperties = function (action) {
        if (this.isBlazorPlatform) {
            if (action == "expand") {
                this.isBlazorExpandedNodes = this.expandedNodes;
                this.setProperties({ expandedNodes: [] }, true);
            }
            else if (action == "check") {
                this.setProperties({ checkedNodes: this.checkedNodes }, true);
            }
            else {
                this.setProperties({ selectedNodes: this.selectedNodes }, true);
            }
        }
    };
    TreeView.prototype.updateList = function () {
        this.liList = Array.prototype.slice.call(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + LISTITEM, this.element));
    };
    TreeView.prototype.updateSelectedNodes = function () {
        if (!this.isBlazorPlatform || (this.isBlazorPlatform && !this.initialRender)) {
            this.setProperties({ selectedNodes: [] }, true);
            var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + ACTIVE, this.element);
            this.selectGivenNodes(sNodes);
        }
        else if (this.isBlazorPlatform && this.initialRender) {
            var sNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('.' + ACTIVE, this.element);
            for (var a = 0; a < sNodes.length; a++) {
                var id = sNodes[a].getAttribute("data-uid").toString();
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id) && this.selectedNodes.indexOf(id) === -1) {
                    this.selectedNodes.push(id);
                }
            }
        }
    };
    TreeView.prototype.updateExpandedNodes = function () {
        if (!this.isBlazorPlatform || (this.isBlazorPlatform && !this.initialRender)) {
            this.setProperties({ expandedNodes: [] }, true);
            var eNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('[aria-expanded="true"]', this.element);
            for (var i = 0, len = eNodes.length; i < len; i++) {
                this.addExpand(eNodes[i]);
            }
        }
        else if (this.isBlazorPlatform && this.initialRender) {
            var eNodes = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('[aria-expanded="true"]', this.element);
            for (var a = 0; a < eNodes.length; a++) {
                var id = eNodes[a].getAttribute("data-uid").toString();
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id) && this.expandedNodes.indexOf(id) === -1) {
                    this.expandedNodes.push(id);
                }
            }
        }
    };
    TreeView.prototype.removeData = function (node) {
        if (this.dataType === 1) {
            var dm = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData);
            var id = this.getId(node);
            var data = {};
            var newId = this.isNumberTypeId ? parseFloat(id) : id;
            data[this.fields.id] = newId;
            dm.remove(this.fields.id, data);
            this.removeChildNodes(id);
        }
        else {
            var id = this.getId(node);
            this.updateChildField(this.treeData, this.fields, id, null, null, true);
        }
    };
    TreeView.prototype.removeChildNodes = function (parentId) {
        var cNodes = this.getChildGroup(this.groupedData, parentId, false);
        var childData = [];
        if (cNodes) {
            for (var i = 0, len = cNodes.length; i < len; i++) {
                var dm = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData);
                var id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.id, cNodes[i]).toString();
                var data = {};
                var currId = this.isNumberTypeId ? parseFloat(id) : id;
                data[this.fields.id] = currId;
                var nodeData = dm.remove(this.fields.id, data);
                childData.push(nodeData[0]);
                this.removeChildNodes(id);
            }
        }
        return childData;
    };
    TreeView.prototype.doGivenAction = function (nodes, selector, toExpand) {
        for (var i = 0, len = nodes.length; i < len; i++) {
            var liEle = this.getElement(nodes[i]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
                continue;
            }
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + selector, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, liEle));
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(icon)) {
                toExpand ? this.expandAction(liEle, icon, null) : this.collapseNode(liEle, icon, null);
            }
        }
    };
    TreeView.prototype.addGivenNodes = function (nodes, dropLi, index, isRemote, dropEle) {
        if (nodes.length === 0) {
            return;
        }
        var sNodes = this.getSortedData(nodes);
        var level = dropLi ? parseFloat(dropLi.getAttribute('aria-level')) + 1 : 1;
        if (isRemote) {
            this.updateMapper(level);
        }
        var li = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromJson(this.createElement, sNodes, this.listBaseOption, level);
        var dropUl;
        if (!dropEle) {
            dropUl = dropLi ? this.expandParent(dropLi) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, this.element);
        }
        else {
            dropUl = dropEle;
        }
        var refNode = dropUl.childNodes[index];
        for (var i = 0; i < li.length; i++) {
            dropUl.insertBefore(li[i], refNode);
        }
        if (this.nodeTemplate && this.isBlazorPlatform && !this.isStringTemplate) {
            this.updateBlazorTemplate();
        }
        var id = this.getId(dropLi);
        if (this.dataType === 1) {
            this.updateField(this.treeData, this.fields, id, 'hasChildren', true);
            var refId = this.getId(refNode);
            var pos = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(refId) ? this.treeData.length : this.getDataPos(this.treeData, this.fields, refId);
            for (var j = 0; j < nodes.length; j++) {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
                    var currId = this.isNumberTypeId ? parseFloat(id) : id;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.fields.parentID, currId, nodes[j]);
                }
                this.treeData.splice(pos, 0, nodes[j]);
                pos++;
            }
        }
        else {
            this.addChildData(this.treeData, this.fields, id, nodes, index);
        }
        this.finalizeNode(dropUl);
    };
    TreeView.prototype.updateMapper = function (level) {
        var mapper = (level === 1) ? this.fields : this.getChildFields(this.fields, level - 1, 1);
        this.updateListProp(mapper);
    };
    TreeView.prototype.updateListProp = function (mapper) {
        var prop = this.getActualProperties(mapper);
        this.listBaseOption.fields = prop;
        this.listBaseOption.fields.url = prop.hasOwnProperty('navigateUrl') ? prop.navigateUrl : 'navigateUrl';
    };
    TreeView.prototype.getDataPos = function (obj, mapper, id) {
        var pos = null;
        for (var i = 0, objlen = obj.length; i < objlen; i++) {
            var nodeId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.id, obj[i]);
            if (obj[i] && nodeId && nodeId.toString() === id) {
                return i;
            }
            else if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]))) {
                var data = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]);
                pos = this.getDataPos(data, this.getChildMapper(mapper), id);
                if (pos !== null) {
                    break;
                }
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]))) {
                var items = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]);
                pos = this.getDataPos(items, this.getChildMapper(mapper), id);
                if (pos !== null) {
                    break;
                }
            }
        }
        return pos;
    };
    TreeView.prototype.addChildData = function (obj, mapper, id, data, index) {
        var updated;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
            index = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) ? obj.length : index;
            for (var k = 0, len = data.length; k < len; k++) {
                obj.splice(index, 0, data[k]);
                index++;
            }
            return updated;
        }
        for (var i = 0, objlen = obj.length; i < objlen; i++) {
            var nodeId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.id, obj[i]);
            if (obj[i] && nodeId && nodeId.toString() === id) {
                if ((typeof mapper.child === 'string' && (obj[i].hasOwnProperty(mapper.child) && obj[i][mapper.child] !== null)) ||
                    ((this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) && obj[i].hasOwnProperty('child'))) {
                    var key = (typeof mapper.child === 'string') ? mapper.child : 'child';
                    var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(key, obj[i]);
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(childData)) {
                        childData = [];
                    }
                    index = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) ? childData.length : index;
                    for (var k = 0, len = data.length; k < len; k++) {
                        childData.splice(index, 0, data[k]);
                        index++;
                    }
                }
                else {
                    var key = (typeof mapper.child === 'string') ? mapper.child : 'child';
                    obj[i][key] = data;
                }
                return true;
            }
            else if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]))) {
                var childObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]);
                updated = this.addChildData(childObj, this.getChildMapper(mapper), id, data, index);
                if (updated !== undefined) {
                    break;
                }
            }
            else if ((this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]))) {
                var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]);
                updated = this.addChildData(childData, this.getChildMapper(mapper), id, data, index);
                if (updated !== undefined) {
                    break;
                }
            }
        }
        return updated;
    };
    TreeView.prototype.doDisableAction = function (nodes) {
        var validNodes = this.nodeType(nodes);
        var validID = this.checkValidId(validNodes);
        this.validArr = [];
        for (var i = 0, len = validID.length; i < len; i++) {
            var id = validID[i][this.fields.id].toString();
            if (id && this.disableNode.indexOf(id) === -1) {
                this.disableNode.push(id);
            }
            var liEle = this.getElement(id);
            if (liEle) {
                liEle.setAttribute('aria-disabled', 'true');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], DISABLE);
            }
        }
    };
    TreeView.prototype.doEnableAction = function (nodes) {
        var strNodes = this.nodeType(nodes);
        for (var i = 0, len = strNodes.length; i < len; i++) {
            var liEle = this.getElement(strNodes[i]);
            var id = strNodes[i];
            if (id && this.disableNode.indexOf(id) !== -1) {
                this.disableNode.splice(this.disableNode.indexOf(id), 1);
            }
            if (liEle) {
                liEle.removeAttribute('aria-disabled');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([liEle], DISABLE);
            }
        }
    };
    TreeView.prototype.nodeType = function (nodes) {
        var validID = [];
        for (var i = 0, len = nodes.length; i < len; i++) {
            var id = void 0;
            if (typeof nodes[i] == "string") {
                id = (nodes[i]) ? nodes[i].toString() : null;
            }
            else if (typeof nodes[i] === "object") {
                id = nodes[i] ? nodes[i].getAttribute("data-uid").toString() : null;
            }
            if (validID.indexOf(id) == -1) {
                validID.push(id);
            }
        }
        return validID;
    };
    TreeView.prototype.checkValidId = function (node) {
        var _this = this;
        if (this.dataType === 1) {
            this.validArr = this.treeData.filter(function (data) {
                return node.indexOf(data[_this.fields.id] ? data[_this.fields.id].toString() : null) !== -1;
            });
        }
        else if (this.dataType === 2) {
            for (var k = 0; k < this.treeData.length; k++) {
                var id = this.treeData[k][this.fields.id] ? this.treeData[k][this.fields.id].toString() : null;
                if (node.indexOf(id) !== -1) {
                    this.validArr.push(this.treeData[k]);
                }
                var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), this.treeData[k]);
                if (childItems) {
                    this.filterNestedChild(childItems, node);
                }
            }
        }
        return this.validArr;
    };
    TreeView.prototype.filterNestedChild = function (treeData, nodes) {
        for (var k = 0; k < treeData.length; k++) {
            var id = treeData[k][this.fields.id] ? treeData[k][this.fields.id].toString() : null;
            if (nodes.indexOf(id) !== -1) {
                this.validArr.push(treeData[k]);
            }
            var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), treeData[k]);
            if (childItems) {
                this.filterNestedChild(childItems, nodes);
            }
        }
    };
    TreeView.prototype.setTouchClass = function () {
        var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.element, '.' + BIGGER);
        this.touchClass = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) ? '' : SMALL;
    };
    TreeView.prototype.updatePersistProp = function () {
        this.removeField(this.treeData, this.fields, ['selected', 'expanded']);
        var sleNodes = this.selectedNodes;
        for (var l = 0, slelen = sleNodes.length; l < slelen; l++) {
            this.updateField(this.treeData, this.fields, sleNodes[l], 'selected', true);
        }
        var enodes = this.expandedNodes;
        if (this.isBlazorPlatform) {
            enodes = this.isBlazorExpandedNodes;
        }
        for (var k = 0, nodelen = enodes.length; k < nodelen; k++) {
            this.updateField(this.treeData, this.fields, enodes[k], 'expanded', true);
        }
        if (this.showCheckBox) {
            this.removeField(this.treeData, this.fields, ['isChecked']);
            var cnodes = this.checkedNodes;
            for (var m = 0, nodelen = cnodes.length; m < nodelen; m++) {
                this.updateField(this.treeData, this.fields, cnodes[m], 'isChecked', true);
            }
        }
    };
    TreeView.prototype.removeField = function (obj, mapper, names) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper)) {
            return;
        }
        for (var i = 0, objlen = obj.length; i < objlen; i++) {
            for (var j = 0; j < names.length; j++) {
                var field = this.getMapperProp(mapper, names[j]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj[i][field])) {
                    delete obj[i][field];
                }
            }
            if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]))) {
                this.removeField(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]), this.getChildMapper(mapper), names);
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]))) {
                this.removeField(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]), this.getChildMapper(mapper), names);
            }
        }
    };
    TreeView.prototype.getMapperProp = function (mapper, fieldName) {
        switch (fieldName) {
            case 'selected':
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.selected) ? mapper.selected : 'selected';
            case 'expanded':
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.expanded) ? mapper.expanded : 'expanded';
            case 'isChecked':
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.isChecked) ? mapper.isChecked : 'isChecked';
            case 'hasChildren':
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(mapper.hasChildren) ? mapper.hasChildren : 'hasChildren';
            default:
                return fieldName;
        }
    };
    TreeView.prototype.updateField = function (obj, mapper, id, key, value) {
        var childNodes;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
            return;
        }
        else if (this.dataType === 1) {
            var newId = this.isNumberTypeId ? parseFloat(id) : id;
            var resultData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.id, 'equal', newId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.getMapperProp(mapper, key), value, resultData[0]);
        }
        else {
            this.updateChildField(obj, mapper, id, key, value);
        }
    };
    TreeView.prototype.updateChildField = function (obj, mapper, id, key, value, remove) {
        var removedData;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj)) {
            return removedData;
        }
        for (var i = 0, objlen = obj.length; i < objlen; i++) {
            var nodeId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.id, obj[i]);
            if (obj[i] && nodeId && nodeId.toString() === id) {
                if (remove) {
                    removedData = obj.splice(i, 1);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])(this.getMapperProp(mapper, key), value, obj[i]);
                    removedData = [];
                }
                return removedData;
            }
            else if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]))) {
                var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, obj[i]);
                removedData = this.updateChildField(childData, this.getChildMapper(mapper), id, key, value, remove);
                if (removedData !== undefined) {
                    break;
                }
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]))) {
                var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', obj[i]);
                removedData = this.updateChildField(childItems, this.getChildMapper(mapper), id, key, value, remove);
                if (removedData !== undefined) {
                    break;
                }
            }
        }
        return removedData;
    };
    TreeView.prototype.triggerEvent = function () {
        this.updateTemplateForBlazor();
        this.renderReactTemplates();
        var eventArgs = { data: this.treeData };
        this.trigger('dataSourceChanged', eventArgs);
    };
    TreeView.prototype.updateBlazorTemplate = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.element.id + 'nodeTemplate', 'NodeTemplate', this, false);
    };
    TreeView.prototype.clientUpdateInitial = function () {
        this.blazorInitialRender = true;
    };
    TreeView.prototype.wireInputEvents = function (inpEle) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(inpEle, 'blur', this.inputFocusOut, this);
    };
    TreeView.prototype.wireEditingEvents = function (toBind) {
        var _this = this;
        if (toBind && !this.disabled) {
            var proxy_2 = this;
            this.touchEditObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, {
                tap: function (e) {
                    if (_this.isDoubleTapped(e) && e.tapCount === 2) {
                        e.originalEvent.preventDefault();
                        proxy_2.editingHandler(e.originalEvent);
                    }
                }
            });
        }
        else {
            if (this.touchEditObj) {
                this.touchEditObj.destroy();
            }
        }
    };
    TreeView.prototype.wireClickEvent = function (toBind) {
        if (toBind) {
            var proxy_3 = this;
            this.touchClickObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, {
                tap: function (e) {
                    proxy_3.clickHandler(e);
                }
            });
        }
        else {
            if (this.touchClickObj) {
                this.touchClickObj.destroy();
            }
        }
    };
    TreeView.prototype.wireExpandOnEvent = function (toBind) {
        var _this = this;
        if (toBind) {
            var proxy_4 = this;
            this.touchExpandObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, {
                tap: function (e) {
                    if ((_this.expandOnType === 'Click' || (_this.expandOnType === 'DblClick' && _this.isDoubleTapped(e) && e.tapCount === 2))
                        && e.originalEvent.which !== 3) {
                        proxy_4.expandHandler(e);
                    }
                }
            });
        }
        else {
            if (this.touchExpandObj) {
                this.touchExpandObj.destroy();
            }
        }
    };
    TreeView.prototype.mouseDownHandler = function (e) {
        this.mouseDownStatus = true;
        if (e.shiftKey || e.ctrlKey) {
            e.preventDefault();
        }
        if (e.ctrlKey && this.allowMultiSelection) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'contextmenu', this.preventContextMenu, this);
        }
    };
    ;
    TreeView.prototype.preventContextMenu = function (e) {
        e.preventDefault();
    };
    TreeView.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mousedown', this.mouseDownHandler, this);
        this.wireClickEvent(true);
        if (this.expandOnType !== 'None') {
            this.wireExpandOnEvent(true);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.focusIn, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'blur', this.focusOut, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseover', this.onMouseOver, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseout', this.onMouseLeave, this);
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
            keyAction: this.keyActionHandler.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown',
        });
    };
    TreeView.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mousedown', this.mouseDownHandler);
        this.wireClickEvent(false);
        this.wireExpandOnEvent(false);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.focusIn);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'blur', this.focusOut);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseover', this.onMouseOver);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseout', this.onMouseLeave);
        if (!this.disabled) {
            this.keyboardModule.destroy();
        }
    };
    TreeView.prototype.parents = function (element, selector) {
        var matched = [];
        var el = element.parentNode;
        while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(el)) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["matches"])(el, selector)) {
                matched.push(el);
            }
            el = el.parentNode;
        }
        return matched;
    };
    TreeView.prototype.isDoubleTapped = function (e) {
        var target = e.originalEvent.target;
        var secondTap;
        if (target && e.tapCount) {
            if (e.tapCount === 1) {
                this.firstTap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
            }
            else if (e.tapCount === 2) {
                secondTap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + LISTITEM);
            }
        }
        return (this.firstTap === secondTap);
    };
    TreeView.prototype.isDescendant = function (parent, child) {
        var node = child.parentNode;
        while (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(node)) {
            if (node === parent) {
                return true;
            }
            node = node.parentNode;
        }
        return false;
    };
    TreeView.prototype.showSpinner = function (element) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], LOAD);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["createSpinner"])({
            target: element,
            width: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? 16 : 14
        }, this.createElement);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["showSpinner"])(element);
    };
    TreeView.prototype.hideSpinner = function (element) {
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_5__["hideSpinner"])(element);
        element.innerHTML = '';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], LOAD);
    };
    TreeView.prototype.setCheckedNodes = function (nodes) {
        nodes = JSON.parse(JSON.stringify(nodes));
        this.uncheckAll(this.checkedNodes);
        this.setIndeterminate(nodes);
        if (nodes.length > 0) {
            this.checkAll(nodes);
        }
    };
    /**
     * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel
     */
    TreeView.prototype.setValidCheckedNode = function (node) {
        if (this.dataType === 1) {
            var mapper = this.fields;
            var resultData = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](this.treeData).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(mapper.id, 'equal', node, true));
            if (resultData[0]) {
                this.setChildCheckState(resultData, node, resultData[0]);
                if (this.autoCheck) {
                    var parent_4 = resultData[0][this.fields.parentID] ? resultData[0][this.fields.parentID].toString() : null;
                    var childNodes = this.getChildNodes(this.treeData, parent_4);
                    var count = 0;
                    for (var len = 0; len < childNodes.length; len++) {
                        var childId = childNodes[len][this.fields.id].toString();
                        if (this.checkedNodes.indexOf(childId) !== -1) {
                            count++;
                        }
                    }
                    if (count === childNodes.length && this.checkedNodes.indexOf(parent_4) === -1 && parent_4) {
                        this.checkedNodes.push(parent_4);
                    }
                }
            }
        }
        else if (this.dataType === 2) {
            for (var a = 0; a < this.treeData.length; a++) {
                var index = this.treeData[a][this.fields.id] ? this.treeData[a][this.fields.id].toString() : '';
                if (index === node && this.checkedNodes.indexOf(node) === -1) {
                    this.checkedNodes.push(node);
                    break;
                }
                var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), this.treeData[a]);
                if (childItems) {
                    this.setChildCheckState(childItems, node, this.treeData[a]);
                }
            }
        }
    };
    /**
     * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)
     */
    TreeView.prototype.setChildCheckState = function (childItems, node, treeData) {
        var checkedParent;
        var count = 0;
        if (this.dataType === 1) {
            if (treeData) {
                checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : null;
            }
            for (var index = 0; index < childItems.length; index++) {
                var checkNode = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : null;
                if (treeData && checkedParent && this.autoCheck) {
                    if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkNode) === -1) {
                        this.checkedNodes.push(checkNode);
                    }
                }
                if (checkNode === node && this.checkedNodes.indexOf(node) === -1) {
                    this.checkedNodes.push(node);
                }
                var subChildItems = this.getChildNodes(this.treeData, checkNode);
                if (subChildItems) {
                    this.setChildCheckState(subChildItems, node, treeData);
                }
            }
        }
        else {
            if (treeData) {
                checkedParent = treeData[this.fields.id] ? treeData[this.fields.id].toString() : '';
            }
            for (var index = 0; index < childItems.length; index++) {
                var checkedChild = childItems[index][this.fields.id] ? childItems[index][this.fields.id].toString() : '';
                if (treeData && checkedParent && this.autoCheck) {
                    if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {
                        this.checkedNodes.push(checkedChild);
                    }
                }
                if (checkedChild === node && this.checkedNodes.indexOf(node) === -1) {
                    this.checkedNodes.push(node);
                }
                var subChildItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), childItems[index]);
                if (subChildItems) {
                    this.setChildCheckState(subChildItems, node, childItems[index]);
                }
                if (this.checkedNodes.indexOf(checkedChild) !== -1 && this.autoCheck) {
                    count++;
                }
                if (count === childItems.length && this.checkedNodes.indexOf(checkedParent) === -1 && this.autoCheck) {
                    this.checkedNodes.push(checkedParent);
                }
            }
        }
    };
    TreeView.prototype.setIndeterminate = function (nodes) {
        for (var i = 0; i < nodes.length; i++) {
            this.setValidCheckedNode(nodes[i]);
        }
    };
    TreeView.prototype.updatePosition = function (id, newData, isRefreshChild, childValue) {
        if (this.dataType === 1) {
            var pos = this.getDataPos(this.treeData, this.fields, id);
            this.treeData.splice(pos, 1, newData);
            if (isRefreshChild) {
                this.removeChildNodes(id);
                for (var j = 0; j < childValue.length; j++) {
                    this.treeData.splice(pos, 0, childValue[j]);
                    pos++;
                }
            }
            this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
        }
        else {
            this.updateChildPosition(this.treeData, this.fields, id, [newData], undefined);
        }
    };
    TreeView.prototype.updateChildPosition = function (treeData, mapper, currID, newData, index) {
        var found;
        for (var i = 0, objlen = treeData.length; i < objlen; i++) {
            var nodeId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.id, treeData[i]);
            if (treeData[i] && nodeId && nodeId.toString() === currID) {
                treeData[i] = newData[0];
                return true;
            }
            else if (typeof mapper.child === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, treeData[i]))) {
                var childObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(mapper.child, treeData[i]);
                found = this.updateChildPosition(childObj, this.getChildMapper(mapper), currID, newData, index);
                if (found !== undefined) {
                    break;
                }
            }
            else if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', treeData[i]))) {
                var childData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('child', treeData[i]);
                found = this.updateChildPosition(childData, this.getChildMapper(mapper), currID, newData, index);
                if (found !== undefined) {
                    break;
                }
            }
        }
        return found;
    };
    TreeView.prototype.dynamicState = function () {
        this.setDragAndDrop(this.allowDragAndDrop);
        this.wireEditingEvents(this.allowEditing);
        if (!this.disabled) {
            this.wireEvents();
            this.setRipple();
        }
        else {
            this.unWireEvents();
            this.rippleFn();
            this.rippleIconFn();
        }
    };
    TreeView.prototype.crudOperation = function (operation, nodes, target, newText, newNode, index, prevent) {
        var _this = this;
        var data = this.fields.dataSource;
        var matchedArr = [];
        var query = this.getQuery(this.fields);
        var key = this.fields.id;
        var crud;
        var changes = {
            addedRecords: [],
            deletedRecords: [],
            changedRecords: []
        };
        var nodesID = [];
        if (nodes) {
            nodesID = this.nodeType(nodes);
        }
        else if (target) {
            if (typeof target == "string") {
                nodesID[0] = target.toString();
            }
            else if (typeof target === "object") {
                nodesID[0] = target.getAttribute("data-uid").toString();
            }
        }
        for (var i = 0, len = nodesID.length; i < len; i++) {
            var liEle = this.getElement(nodesID[i]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
                continue;
            }
            var removedData = this.getNodeObject(nodesID[i]);
            matchedArr.push(removedData);
        }
        switch (operation) {
            case 'delete':
                if (nodes.length == 1) {
                    crud = data.remove(key, matchedArr[0], query.fromTable, query);
                }
                else {
                    changes.deletedRecords = matchedArr;
                    crud = data.saveChanges(changes, key, query.fromTable, query);
                }
                crud.then(function (e) { return _this.deleteSuccess(nodesID); })
                    .catch(function (e) { return _this.dmFailure(e); });
                break;
            case 'update':
                matchedArr[0][this.fields.text] = newText;
                crud = data.update(key, matchedArr[0], query.fromTable, query);
                crud.then(function (e) { return _this.editSucess(target, newText, prevent); })
                    .catch(function (e) { return _this.dmFailure(e, target, prevent); });
                break;
            case 'insert':
                if (newNode.length == 1) {
                    crud = data.insert(newNode[0], query.fromTable, query);
                }
                else {
                    var arr = [];
                    for (var i = 0, len = newNode.length; i < len; i++) {
                        arr.push(newNode[i]);
                    }
                    changes.addedRecords = arr;
                    crud = data.saveChanges(changes, key, query.fromTable, query);
                }
                crud.then(function (e) {
                    var dropLi = _this.getElement(target);
                    _this.addSuccess(newNode, dropLi, index);
                    _this.preventExpand = false;
                }).catch(function (e) { return _this.dmFailure(e); });
                break;
        }
    };
    TreeView.prototype.deleteSuccess = function (nodes) {
        for (var i = 0, len = nodes.length; i < len; i++) {
            var liEle = this.getElement(nodes[i]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
                continue;
            }
            this.removeNode(liEle);
        }
        if (this.dataType === 1) {
            this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
        }
        this.triggerEvent();
    };
    TreeView.prototype.editSucess = function (target, newText, prevent) {
        var liEle = this.getElement(target);
        var txtEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTTEXT, liEle);
        this.appendNewText(liEle, txtEle, newText, prevent);
    };
    TreeView.prototype.addSuccess = function (nodes, dropLi, index) {
        var dropUl;
        var icon = dropLi ? dropLi.querySelector('.' + ICON) : null;
        var proxy = this;
        if (dropLi && icon && icon.classList.contains(EXPANDABLE) &&
            dropLi.querySelector('.' + PARENTITEM) === null) {
            proxy.renderChildNodes(dropLi, null, function () {
                dropUl = dropLi.querySelector('.' + PARENTITEM);
                proxy.addGivenNodes(nodes, dropLi, index, true, dropUl);
                proxy.triggerEvent();
            });
        }
        else {
            this.addGivenNodes(nodes, dropLi, index, true);
            this.triggerEvent();
        }
    };
    TreeView.prototype.dmFailure = function (e, target, prevent) {
        if (target) {
            this.updatePreviousText(target, prevent);
        }
        this.trigger('actionFailure', { error: e });
    };
    TreeView.prototype.updatePreviousText = function (target, prevent) {
        var liEle = this.getElement(target);
        var txtEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTTEXT, liEle);
        this.updateText(liEle, txtEle, this.oldText, prevent);
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {TreeView} newProp
     * @param  {TreeView} oldProp
     * @returns void
     * @private
     */
    // tslint:disable-next-line:max-func-body-length
    TreeView.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'allowDragAndDrop':
                    this.setDragAndDrop(this.allowDragAndDrop);
                    break;
                case 'dragArea':
                    if (this.allowDragAndDrop) {
                        this.dragObj.dragArea = this.dragArea;
                    }
                    break;
                case 'allowEditing':
                    this.wireEditingEvents(this.allowEditing);
                    break;
                case 'allowMultiSelection':
                    if (this.selectedNodes.length > 1) {
                        var sNode = this.getElement(this.selectedNodes[0]);
                        this.isLoaded = false;
                        this.removeSelectAll();
                        this.selectNode(sNode, null);
                        this.isLoaded = true;
                    }
                    this.setMultiSelect(this.allowMultiSelection);
                    this.addMultiSelect(this.allowMultiSelection);
                    break;
                case 'checkedNodes':
                    if (this.showCheckBox) {
                        this.checkedNodes = oldProp.checkedNodes;
                        this.setCheckedNodes(newProp.checkedNodes);
                    }
                    break;
                case 'autoCheck':
                    if (this.showCheckBox) {
                        this.autoCheck = newProp.autoCheck;
                        this.ensureIndeterminate();
                    }
                    break;
                case 'cssClass':
                    this.setCssClass(oldProp.cssClass, newProp.cssClass);
                    break;
                case 'enableRtl':
                    this.setEnableRtl();
                    break;
                case 'expandedNodes':
                    this.isAnimate = false;
                    if (!this.isBlazorPlatform) {
                        this.setProperties({ expandedNodes: [] }, true);
                    }
                    this.collapseAll();
                    this.isInitalExpand = true;
                    if (!this.isBlazorPlatform) {
                        this.setProperties({ expandedNodes: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newProp.expandedNodes) ? [] : newProp.expandedNodes }, true);
                    }
                    this.doExpandAction();
                    this.isInitalExpand = false;
                    this.isAnimate = true;
                    break;
                case 'expandOn':
                    this.wireExpandOnEvent(false);
                    this.setExpandOnType();
                    if (this.expandOnType !== 'None' && !this.disabled) {
                        this.wireExpandOnEvent(true);
                    }
                    break;
                case 'disabled':
                    this.setDisabledMode();
                    this.dynamicState();
                    break;
                case 'fields':
                    this.isAnimate = false;
                    this.isFieldChange = true;
                    this.initialRender = true;
                    if (!this.blazorInitialRender) {
                        this.reRenderNodes();
                    }
                    this.blazorInitialRender = false;
                    this.initialRender = false;
                    this.isAnimate = true;
                    this.isFieldChange = false;
                    break;
                case 'fullRowSelect':
                    this.setFullRow(this.fullRowSelect);
                    this.addFullRow(this.fullRowSelect);
                    break;
                case 'loadOnDemand':
                    if (this.loadOnDemand === false && !this.onLoaded) {
                        var nodes = this.element.querySelectorAll('li');
                        var i = 0;
                        while (i < nodes.length) {
                            if (nodes[i].getAttribute('aria-expanded') !== 'true') {
                                this.renderChildNodes(nodes[i], true, null, true);
                            }
                            i++;
                        }
                        this.onLoaded = true;
                    }
                    break;
                case 'nodeTemplate':
                    this.nodeTemplateFn = this.templateComplier(this.nodeTemplate);
                    this.reRenderNodes();
                    break;
                case 'selectedNodes':
                    this.removeSelectAll();
                    this.setProperties({ selectedNodes: newProp.selectedNodes }, true);
                    this.doSelectionAction();
                    break;
                case 'showCheckBox':
                    this.reRenderNodes();
                    break;
                case 'sortOrder':
                    this.reRenderNodes();
                    break;
                case 'fullRowNavigable':
                    this.setProperties({ fullRowNavigable: newProp.fullRowNavigable }, true);
                    this.listBaseOption.itemNavigable = newProp.fullRowNavigable;
                    this.reRenderNodes();
                    break;
            }
        }
    };
    /**
     * Removes the component from the DOM and detaches all its related event handlers. It also removes the attributes and classes.
     */
    TreeView.prototype.destroy = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.element.id + 'nodeTemplate', 'NodeTemplate');
        this.clearTemplate();
        this.element.removeAttribute('aria-activedescendant');
        this.element.removeAttribute('tabindex');
        this.unWireEvents();
        this.wireEditingEvents(false);
        if (!this.disabled) {
            this.rippleFn();
            this.rippleIconFn();
        }
        this.setCssClass(this.cssClass, null);
        this.setDragAndDrop(false);
        this.setFullRow(false);
        if (this.isBlazorPlatform) {
            this.ulElement = this.element.querySelector('.e-list-parent.e-ul');
        }
        if (this.ulElement && this.ulElement.parentElement) {
            this.ulElement.parentElement.removeChild(this.ulElement);
        }
        if (!this.isBlazorPlatform) {
            _super.prototype.destroy.call(this);
        }
    };
    /**
     * Adds the collection of TreeView nodes based on target and index position. If target node is not specified,
     * then the nodes are added as children of the given parentID or in the root level of TreeView.
     * @param  { { [key: string]: Object }[] } nodes - Specifies the array of JSON data that has to be added.
     * @param  { string | Element } target - Specifies ID of TreeView node/TreeView node as target element.
     * @param  { number } index - Specifies the index to place the newly added nodes in the target element.
     * @param { boolean } preventTargetExpand - If set to true, the target parent node will be prevented from auto expanding.
     */
    TreeView.prototype.addNodes = function (nodes, target, index, preventTargetExpand) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            return;
        }
        nodes = JSON.parse(JSON.stringify(nodes));
        var dropLi = this.getElement(target);
        this.preventExpand = preventTargetExpand;
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
            if (!this.isOffline) {
                this.crudOperation('insert', null, target, null, nodes, index, this.preventExpand);
            }
            else {
                this.addSuccess(nodes, dropLi, index);
            }
        }
        else if (this.dataType === 2) {
            this.addGivenNodes(nodes, dropLi, index);
        }
        else {
            if (dropLi) {
                this.addGivenNodes(nodes, dropLi, index);
            }
            else {
                nodes = this.getSortedData(nodes);
                for (var i = 0; i < nodes.length; i++) {
                    var pid = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.parentID, nodes[i]);
                    dropLi = pid ? this.getElement(pid.toString()) : pid;
                    this.addGivenNodes([nodes[i]], dropLi, index);
                }
            }
            this.groupedData = this.getGroupedData(this.treeData, this.fields.parentID);
        }
        this.updateCheckedStateFromDS();
        if (this.showCheckBox && dropLi) {
            this.ensureParentCheckState(dropLi);
        }
        if ((this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] === false) || (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]) && (this.fields.dataSource.adaptorName === 'BlazorAdaptor')) {
            this.preventExpand = false;
            this.triggerEvent();
        }
    };
    /**
     * Instead of clicking on the TreeView node for editing, we can enable it by using
     * `beginEdit` property. On passing the node ID or element through this property, the edit textBox
     * will be created for the particular node thus allowing us to edit it.
     * @param  {string | Element} node - Specifies ID of TreeView node/TreeView node.
     */
    TreeView.prototype.beginEdit = function (node) {
        var ele = this.getElement(node);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ele) || this.disabled) {
            return;
        }
        this.createTextbox(ele, null);
    };
    /**
     * Checks all the unchecked nodes. You can also check specific nodes by passing array of unchecked nodes
     * as argument to this method.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.
     */
    TreeView.prototype.checkAll = function (nodes) {
        if (this.showCheckBox) {
            this.doCheckBoxAction(nodes, true);
        }
    };
    /**
     * Collapses all the expanded TreeView nodes. You can collapse specific nodes by passing array of nodes as argument to this method.
     * You can also collapse all the nodes excluding the hidden nodes by setting **excludeHiddenNodes** to true. If you want to collapse
     * a specific level of nodes, set **level** as argument to collapseAll method.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/ array of TreeView node.
     * @param  {number} level - TreeView nodes will collapse up to the given level.
     * @param  {boolean} excludeHiddenNodes - Whether or not to exclude hidden nodes of TreeView when collapsing all nodes.
     */
    TreeView.prototype.collapseAll = function (nodes, level, excludeHiddenNodes) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            this.doGivenAction(nodes, COLLAPSIBLE, false);
        }
        else {
            if (level > 0) {
                this.collapseByLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, this.element), level, excludeHiddenNodes);
            }
            else {
                this.collapseAllNodes(excludeHiddenNodes);
            }
        }
    };
    /**
     * Disables the collection of nodes by passing the ID of nodes or node elements in the array.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.
     */
    TreeView.prototype.disableNodes = function (nodes) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            this.doDisableAction(nodes);
        }
    };
    /**
     * Enables the collection of disabled nodes by passing the ID of nodes or node elements in the array.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.
     */
    TreeView.prototype.enableNodes = function (nodes) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            this.doEnableAction(nodes);
        }
    };
    /**
     * Ensures visibility of the TreeView node by using node ID or node element.
     * When many TreeView nodes are present and we need to find a particular node, `ensureVisible` property
     * helps bring the node to visibility by expanding the TreeView and scrolling to the specific node.
     * @param  {string | Element} node - Specifies ID of TreeView node/TreeView nodes.
     */
    TreeView.prototype.ensureVisible = function (node) {
        var liEle = this.getElement(node);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
            return;
        }
        var parents = this.parents(liEle, '.' + LISTITEM);
        this.expandAll(parents);
        setTimeout(function () { liEle.scrollIntoView(true); }, 450);
    };
    /**
     * Expands all the collapsed TreeView nodes. You can expand the specific nodes by passing the array of collapsed nodes
     * as argument to this method. You can also expand all the collapsed nodes by excluding the hidden nodes by setting
     * **excludeHiddenNodes** to true to this method. To expand a specific level of nodes, set **level** as argument to expandAll method.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView nodes.
     * @param  {number} level - TreeView nodes will expand up to the given level.
     * @param  {boolean} excludeHiddenNodes - Whether or not to exclude hidden nodes when expanding all nodes.
     */
    TreeView.prototype.expandAll = function (nodes, level, excludeHiddenNodes) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            this.doGivenAction(nodes, EXPANDABLE, true);
        }
        else {
            if (level > 0) {
                this.expandByLevel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, this.element), level, excludeHiddenNodes);
            }
            else {
                this.expandAllNodes(excludeHiddenNodes);
            }
        }
    };
    /**
     * Gets all the checked nodes including child, whether it is loaded or not.
     */
    TreeView.prototype.getAllCheckedNodes = function () {
        var checkNodes = this.checkedNodes;
        return checkNodes;
    };
    /**
    * Gets all the disabled nodes including child, whether it is loaded or not.
    */
    TreeView.prototype.getDisabledNodes = function () {
        var disabledNodes = this.disableNode;
        return disabledNodes;
    };
    /**
     * Get the node's data such as id, text, parentID, selected, isChecked, and expanded by passing the node element or it's ID.
     * @param  {string | Element} node - Specifies ID of TreeView node/TreeView node.
     * @BlazorType NodeData
     */
    TreeView.prototype.getNode = function (node) {
        var ele = this.getElement(node);
        return this.getNodeData(ele, true);
    };
    /**
     * To get the updated data source of TreeView after performing some operation like drag and drop, node editing,
     * node selecting/unSelecting, node expanding/collapsing, node checking/unChecking, adding and removing node.
     * * If you pass the ID of TreeView node as arguments for this method then it will return the updated data source
     * of the corresponding node otherwise it will return the entire updated data source of TreeView.
     * * The updated data source also contains custom attributes if you specified in data source.
     * @param  {string | Element} node - Specifies ID of TreeView node/TreeView node.
     * @isGenericType true
     */
    TreeView.prototype.getTreeData = function (node) {
        var id = this.getId(node);
        this.updatePersistProp();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(id)) {
            return this.treeData;
        }
        else {
            var data = this.getNodeObject(id);
            return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data) ? [] : [data];
        }
    };
    /**
     * Moves the collection of nodes within the same TreeView based on target or its index position.
     * @param  {string[] | Element[]} sourceNodes - Specifies the array of TreeView nodes ID/array of TreeView node.
     * @param  {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.
     * @param  {number} index - Specifies the index to place the moved nodes in the target element.
     * @param { boolean } preventTargetExpand - If set to true, the target parent node will be prevented from auto expanding.
     */
    TreeView.prototype.moveNodes = function (sourceNodes, target, index, preventTargetExpand) {
        var dropLi = this.getElement(target);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dropLi)) {
            return;
        }
        for (var i = 0; i < sourceNodes.length; i++) {
            var dragLi = this.getElement(sourceNodes[i]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dragLi) || dropLi.isSameNode(dragLi) || this.isDescendant(dragLi, dropLi)) {
                continue;
            }
            this.preventExpand = preventTargetExpand;
            this.dropAsChildNode(dragLi, dropLi, this, index);
        }
        if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] === false) {
            this.preventExpand = false;
        }
        this.triggerEvent();
    };
    /**
     * Refreshes a particular node of the TreeView.
     * @param  {string | Element} target - Specifies the ID of TreeView node or TreeView node as target element.
     * @param  {{ [key: string]: Object }[]} newData - Specifies the new data of TreeView node.
     */
    TreeView.prototype.refreshNode = function (target, newData) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newData)) {
            return;
        }
        var id;
        var isRefreshChild = false;
        if (this.dataType == 1 && newData.length > 1) {
            isRefreshChild = true;
        }
        else if (this.dataType == 2 && newData.length === 1) {
            var updatedChildValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), newData[0]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(updatedChildValue)) {
                isRefreshChild = true;
            }
        }
        var liEle = this.getElement(target);
        id = liEle ? liEle.getAttribute('data-uid') : ((target) ? target.toString() : null);
        this.refreshData = this.getNodeObject(id);
        newData = JSON.parse(JSON.stringify(newData));
        // tslint:disable
        var newNodeData;
        var parentData;
        if (this.dataType == 1 && isRefreshChild) {
            for (var k = 0; k < newData.length; k++) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newData[k][this.fields.parentID])) {
                    parentData = newData[k];
                    newData.splice(k, 1);
                    break;
                }
            }
            newNodeData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.refreshData, parentData);
        }
        else {
            newNodeData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.refreshData, newData[0]);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
            this.updatePosition(id, newNodeData, isRefreshChild, newData);
            return;
        }
        this.isRefreshed = true;
        var level = parseFloat(liEle.getAttribute('aria-level'));
        var newliEle = _ej2_lists__WEBPACK_IMPORTED_MODULE_2__["ListBase"].createListItemFromJson(this.createElement, [newNodeData], this.listBaseOption, level);
        var ul = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + PARENTITEM, liEle);
        var childItems = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(this.fields.child.toString(), newNodeData);
        if ((isRefreshChild && ul) || (isRefreshChild && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(childItems))) {
            var parentEle = liEle.parentElement;
            var index = Array.prototype.indexOf.call(parentEle.childNodes, liEle);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(liEle);
            parentEle.insertBefore(newliEle[0], parentEle.childNodes[index]);
            this.updatePosition(id, newNodeData, isRefreshChild, newData);
            if (isRefreshChild && ul) {
                this.expandAll([id]);
            }
        }
        else {
            var txtEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, liEle);
            var newTextEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + TEXTWRAP, newliEle[0]);
            var icon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, txtEle);
            var newIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('div.' + ICON, newTextEle);
            if (icon && newIcon) {
                if (newIcon.classList.contains(EXPANDABLE) && icon.classList.contains(COLLAPSIBLE)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([newIcon], EXPANDABLE);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([newIcon], COLLAPSIBLE);
                }
                else if (newIcon.classList.contains(COLLAPSIBLE) && icon.classList.contains(EXPANDABLE)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([newIcon], COLLAPSIBLE);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([newIcon], EXPANDABLE);
                }
                else if (icon.classList.contains('interaction')) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([newIcon], 'interaction');
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(txtEle);
            var fullEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + FULLROW, liEle);
            fullEle.parentNode.insertBefore(newTextEle, fullEle.nextSibling);
            this.updatePosition(id, newNodeData, isRefreshChild, newData);
        }
        liEle = this.getElement(target);
        if (newNodeData[this.fields.tooltip]) {
            liEle.setAttribute("title", newNodeData[this.fields.tooltip]);
        }
        if (newNodeData.hasOwnProperty(this.fields.htmlAttributes) && newNodeData[this.fields.htmlAttributes]) {
            var attr = {};
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["merge"])(attr, newNodeData[this.fields.htmlAttributes]);
            if (attr.class) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], attr.class.split(' '));
                delete attr.class;
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(liEle, attr);
            }
        }
        if (this.selectedNodes.indexOf(id) !== -1) {
            liEle.setAttribute('aria-selected', 'true');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([liEle], ACTIVE);
        }
        this.isRefreshed = false;
        this.triggerEvent();
    };
    /**
     * Removes the collection of TreeView nodes by passing the array of node details as argument to this method.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.
     */
    TreeView.prototype.removeNodes = function (nodes) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nodes)) {
            if (this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !this.isOffline && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
                this.crudOperation('delete', nodes);
            }
            else {
                this.deleteSuccess(nodes);
            }
        }
    };
    /**
     * Replaces the text of the TreeView node with the given text.
     * @param  {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.
     * @param  {string} newText - Specifies the new text of TreeView node.
     */
    TreeView.prototype.updateNode = function (target, newText) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newText) || !this.allowEditing) {
            return;
        }
        var liEle = this.getElement(target);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(liEle)) {
            return;
        }
        var txtEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])('.' + LISTTEXT, liEle);
        this.updateOldText(liEle);
        var eventArgs = this.getEditEvent(liEle, null, null);
        this.trigger('nodeEditing', eventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                if (_this.fields.dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"] && !_this.isOffline && (_this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
                    _this.crudOperation('update', null, target, newText, null, null, false);
                }
                else {
                    _this.appendNewText(liEle, txtEle, newText, false);
                }
            }
        });
    };
    /**
     * Unchecks all the checked nodes. You can also uncheck the specific nodes by passing array of checked nodes
     * as argument to this method.
     * @param  {string[] | Element[]} nodes - Specifies the array of TreeView nodes ID/array of TreeView node.
     */
    TreeView.prototype.uncheckAll = function (nodes) {
        if (this.showCheckBox) {
            this.doCheckBoxAction(nodes, false);
        }
    };
    var TreeView_1;
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "allowDragAndDrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "allowEditing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "allowMultiSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, NodeAnimationSettings)
    ], TreeView.prototype, "animation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TreeView.prototype, "checkedNodes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], TreeView.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], TreeView.prototype, "dragArea", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "enablePersistence", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TreeView.prototype, "expandedNodes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Auto')
    ], TreeView.prototype, "expandOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, FieldsSettings)
    ], TreeView.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TreeView.prototype, "fullRowSelect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TreeView.prototype, "loadOnDemand", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TreeView.prototype, "locale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TreeView.prototype, "nodeTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TreeView.prototype, "selectedNodes", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('None')
    ], TreeView.prototype, "sortOrder", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "showCheckBox", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TreeView.prototype, "autoCheck", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], TreeView.prototype, "fullRowNavigable", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "actionFailure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "dataBound", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "dataSourceChanged", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "drawNode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "keyPress", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeChecked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeChecking", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeClicked", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeCollapsed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeCollapsing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeDragging", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeDragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeDragStop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeDropped", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeEdited", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeEditing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeExpanded", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeExpanding", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeSelected", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], TreeView.prototype, "nodeSelecting", void 0);
    TreeView = TreeView_1 = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], TreeView);
    return TreeView;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/common/collision.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/common/collision.js ***!
  \**********************************************************************/
/*! exports provided: fit, isCollide, flip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fit", function() { return fit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCollide", function() { return isCollide; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return flip; });
/* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/**
 * Collision module.
 */


var parentDocument;
var targetContainer;
function fit(element, viewPortElement, axis, position) {
    if (viewPortElement === void 0) { viewPortElement = null; }
    if (axis === void 0) { axis = { X: false, Y: false }; }
    if (!axis.Y && !axis.X) {
        return { left: 0, top: 0 };
    }
    var elemData = element.getBoundingClientRect();
    targetContainer = viewPortElement;
    parentDocument = element.ownerDocument;
    if (!position) {
        position = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(element, 'left', 'top');
    }
    if (axis.X) {
        var containerWidth = targetContainer ? getTargetContainerWidth() : getViewPortWidth();
        var containerLeft = ContainerLeft();
        var containerRight = ContainerRight();
        var overLeft = containerLeft - position.left;
        var overRight = position.left + elemData.width - containerRight;
        if (elemData.width > containerWidth) {
            if (overLeft > 0 && overRight <= 0) {
                position.left = containerRight - elemData.width;
            }
            else if (overRight > 0 && overLeft <= 0) {
                position.left = containerLeft;
            }
            else {
                position.left = overLeft > overRight ? (containerRight - elemData.width) : containerLeft;
            }
        }
        else if (overLeft > 0) {
            position.left += overLeft;
        }
        else if (overRight > 0) {
            position.left -= overRight;
        }
    }
    if (axis.Y) {
        var containerHeight = targetContainer ? getTargetContainerHeight() : getViewPortHeight();
        var containerTop = ContainerTop();
        var containerBottom = ContainerBottom();
        var overTop = containerTop - position.top;
        var overBottom = position.top + elemData.height - containerBottom;
        if (elemData.height > containerHeight) {
            if (overTop > 0 && overBottom <= 0) {
                position.top = containerBottom - elemData.height;
            }
            else if (overBottom > 0 && overTop <= 0) {
                position.top = containerTop;
            }
            else {
                position.top = overTop > overBottom ? (containerBottom - elemData.height) : containerTop;
            }
        }
        else if (overTop > 0) {
            position.top += overTop;
        }
        else if (overBottom > 0) {
            position.top -= overBottom;
        }
    }
    return position;
}
function isCollide(element, viewPortElement, x, y) {
    if (viewPortElement === void 0) { viewPortElement = null; }
    var elemOffset = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(element, 'left', 'top');
    if (x) {
        elemOffset.left = x;
    }
    if (y) {
        elemOffset.top = y;
    }
    var data = [];
    targetContainer = viewPortElement;
    parentDocument = element.ownerDocument;
    var elementRect = element.getBoundingClientRect();
    var top = elemOffset.top;
    var left = elemOffset.left;
    var right = elemOffset.left + elementRect.width;
    var bottom = elemOffset.top + elementRect.height;
    var topData = '';
    var leftData = '';
    var yAxis = topCollideCheck(top, bottom);
    var xAxis = leftCollideCheck(left, right);
    if (yAxis.topSide) {
        data.push('top');
    }
    if (xAxis.rightSide) {
        data.push('right');
    }
    if (xAxis.leftSide) {
        data.push('left');
    }
    if (yAxis.bottomSide) {
        data.push('bottom');
    }
    return data;
}
function flip(element, target, offsetX, offsetY, positionX, positionY, viewPortElement, axis, fixedParent) {
    if (viewPortElement === void 0) { viewPortElement = null; }
    if (axis === void 0) { axis = { X: true, Y: true }; }
    if (!target || !element || !positionX || !positionY || (!axis.X && !axis.Y)) {
        return;
    }
    var tEdge = { TL: null,
        TR: null,
        BL: null,
        BR: null };
    var eEdge = {
        TL: null,
        TR: null,
        BL: null,
        BR: null
    };
    var oldVisibility = element.style.visibility;
    element.style.visibility = 'hidden';
    element.style.display = 'block';
    var elementRect = element.getBoundingClientRect();
    element.style.removeProperty('display');
    element.style.visibility = oldVisibility;
    var pos = {
        posX: positionX, posY: positionY, offsetX: offsetX, offsetY: offsetY, position: { left: 0, top: 0 }
    };
    targetContainer = viewPortElement;
    parentDocument = target.ownerDocument;
    updateElementData(target, tEdge, pos, fixedParent, elementRect);
    setPosition(eEdge, pos, elementRect);
    if (axis.X) {
        leftFlip(target, eEdge, tEdge, pos, elementRect, true);
    }
    if (axis.Y && tEdge.TL.top > -1) {
        topFlip(target, eEdge, tEdge, pos, elementRect, true);
    }
    setPopup(element, pos, elementRect);
}
function setPopup(element, pos, elementRect) {
    var left = 0;
    var top = 0;
    if (element.offsetParent != null
        && (getComputedStyle(element.offsetParent).position === 'absolute' ||
            getComputedStyle(element.offsetParent).position === 'relative')) {
        var data = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(element.offsetParent, 'left', 'top', false, elementRect);
        left = data.left;
        top = data.top;
    }
    element.style.top = (pos.position.top + pos.offsetY - (top)) + 'px';
    element.style.left = (pos.position.left + pos.offsetX - (left)) + 'px';
}
function updateElementData(target, edge, pos, fixedParent, elementRect) {
    pos.position = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, pos.posX, pos.posY, fixedParent, elementRect);
    edge.TL = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, 'left', 'top', fixedParent, elementRect);
    edge.TR = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, 'right', 'top', fixedParent, elementRect);
    edge.BR = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, 'left', 'bottom', fixedParent, elementRect);
    edge.BL = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, 'right', 'bottom', fixedParent, elementRect);
}
function setPosition(eStatus, pos, elementRect) {
    eStatus.TL = { top: pos.position.top + pos.offsetY, left: pos.position.left + pos.offsetX };
    eStatus.TR = { top: eStatus.TL.top, left: eStatus.TL.left + elementRect.width };
    eStatus.BL = { top: eStatus.TL.top + elementRect.height,
        left: eStatus.TL.left };
    eStatus.BR = { top: eStatus.TL.top + elementRect.height,
        left: eStatus.TL.left + elementRect.width };
}
function leftCollideCheck(left, right) {
    var leftSide = false;
    var rightSide = false;
    if (((left - getBodyScrollLeft()) < ContainerLeft())) {
        leftSide = true;
    }
    if (right > ContainerRight()) {
        rightSide = true;
    }
    return { leftSide: leftSide, rightSide: rightSide };
}
function leftFlip(target, edge, tEdge, pos, elementRect, deepCheck) {
    var collideSide = leftCollideCheck(edge.TL.left, edge.TR.left);
    if ((tEdge.TL.left - getBodyScrollLeft()) <= ContainerLeft()) {
        collideSide.leftSide = false;
    }
    if (tEdge.TR.left >= ContainerRight()) {
        collideSide.rightSide = false;
    }
    if ((collideSide.leftSide && !collideSide.rightSide) || (!collideSide.leftSide && collideSide.rightSide)) {
        if (pos.posX === 'right') {
            pos.posX = 'left';
        }
        else {
            pos.posX = 'right';
        }
        pos.offsetX = pos.offsetX + elementRect.width;
        pos.offsetX = -1 * pos.offsetX;
        pos.position = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, pos.posX, pos.posY, false);
        setPosition(edge, pos, elementRect);
        if (deepCheck) {
            leftFlip(target, edge, tEdge, pos, elementRect, false);
        }
    }
}
function topFlip(target, edge, tEdge, pos, elementRect, deepCheck) {
    var collideSide = topCollideCheck(edge.TL.top, edge.BL.top);
    if ((tEdge.TL.top - getBodyScrollTop()) <= ContainerTop()) {
        collideSide.topSide = false;
    }
    if (tEdge.BL.top >= ContainerBottom() && target.getBoundingClientRect().bottom < window.innerHeight) {
        collideSide.bottomSide = false;
    }
    if ((collideSide.topSide && !collideSide.bottomSide) || (!collideSide.topSide && collideSide.bottomSide)) {
        if (pos.posY === 'top') {
            pos.posY = 'bottom';
        }
        else {
            pos.posY = 'top';
        }
        pos.offsetY = pos.offsetY + elementRect.height;
        pos.offsetY = -1 * pos.offsetY;
        pos.position = Object(_position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"])(target, pos.posX, pos.posY, false, elementRect);
        setPosition(edge, pos, elementRect);
        if (deepCheck) {
            topFlip(target, edge, tEdge, pos, elementRect, false);
        }
    }
}
function topCollideCheck(top, bottom) {
    var topSide = false;
    var bottomSide = false;
    if ((top - getBodyScrollTop()) < ContainerTop()) {
        topSide = true;
    }
    if (bottom > ContainerBottom()) {
        bottomSide = true;
    }
    return { topSide: topSide, bottomSide: bottomSide };
}
function getTargetContainerWidth() {
    return targetContainer.getBoundingClientRect().width;
}
function getTargetContainerHeight() {
    return targetContainer.getBoundingClientRect().height;
}
function getTargetContainerLeft() {
    return targetContainer.getBoundingClientRect().left;
}
function getTargetContainerTop() {
    return targetContainer.getBoundingClientRect().top;
}
function ContainerTop() {
    if (targetContainer) {
        return getTargetContainerTop();
    }
    return 0;
}
function ContainerLeft() {
    if (targetContainer) {
        return getTargetContainerLeft();
    }
    return 0;
}
function ContainerRight() {
    if (targetContainer) {
        return (getBodyScrollLeft() + getTargetContainerLeft() + getTargetContainerWidth());
    }
    return (getBodyScrollLeft() + getViewPortWidth());
}
function ContainerBottom() {
    if (targetContainer) {
        return (getBodyScrollTop() + getTargetContainerTop() + getTargetContainerHeight());
    }
    return (getBodyScrollTop() + getViewPortHeight());
}
function getBodyScrollTop() {
    // if(targetContainer)
    //     return targetContainer.scrollTop;
    return parentDocument.documentElement.scrollTop || parentDocument.body.scrollTop;
}
function getBodyScrollLeft() {
    // if(targetContainer)
    //     return targetContainer.scrollLeft;
    return parentDocument.documentElement.scrollLeft || parentDocument.body.scrollLeft;
}
function getViewPortHeight() {
    return window.innerHeight;
}
function getViewPortWidth() {
    var windowWidth = window.innerWidth;
    var offsetWidth = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isNullOrUndefined"])(document.documentElement)) ? 0 : document.documentElement.offsetWidth;
    return windowWidth - (windowWidth - offsetWidth);
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/common/index.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/common/index.js ***!
  \******************************************************************/
/*! exports provided: calculateRelativeBasedPosition, calculatePosition, fit, isCollide, flip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "calculateRelativeBasedPosition", function() { return _position__WEBPACK_IMPORTED_MODULE_0__["calculateRelativeBasedPosition"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "calculatePosition", function() { return _position__WEBPACK_IMPORTED_MODULE_0__["calculatePosition"]; });

/* harmony import */ var _collision__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collision */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/collision.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fit", function() { return _collision__WEBPACK_IMPORTED_MODULE_1__["fit"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollide", function() { return _collision__WEBPACK_IMPORTED_MODULE_1__["isCollide"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _collision__WEBPACK_IMPORTED_MODULE_1__["flip"]; });

/**
 * Popup Components
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js ***!
  \*********************************************************************/
/*! exports provided: calculateRelativeBasedPosition, calculatePosition */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateRelativeBasedPosition", function() { return calculateRelativeBasedPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculatePosition", function() { return calculatePosition; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/**
 * Position library
 */

var elementRect;
var popupRect;
var element;
var parentDocument;
var fixedParent = false;
function calculateRelativeBasedPosition(anchor, element) {
    var fixedElement = false;
    var anchorPos = { left: 0, top: 0 };
    var tempAnchor = anchor;
    if (!anchor || !element) {
        return anchorPos;
    }
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.offsetParent) && element.style.position === 'fixed') {
        fixedElement = true;
    }
    while ((element.offsetParent || fixedElement) && anchor && element.offsetParent !== anchor) {
        anchorPos.left += anchor.offsetLeft;
        anchorPos.top += anchor.offsetTop;
        anchor = anchor.offsetParent;
    }
    anchor = tempAnchor;
    while ((element.offsetParent || fixedElement) && anchor && element.offsetParent !== anchor) {
        anchorPos.left -= anchor.scrollLeft;
        anchorPos.top -= anchor.scrollTop;
        anchor = anchor.parentElement;
    }
    return anchorPos;
}
function calculatePosition(currentElement, positionX, positionY, parentElement, targetValues) {
    (positionY + positionX === 'topright') ? popupRect = undefined : popupRect = targetValues;
    popupRect = targetValues;
    fixedParent = parentElement ? true : false;
    if (!currentElement) {
        return { left: 0, top: 0 };
    }
    if (!positionX) {
        positionX = 'left';
    }
    if (!positionY) {
        positionY = 'top';
    }
    parentDocument = currentElement.ownerDocument;
    element = currentElement;
    var pos = { left: 0, top: 0 };
    return updatePosition(positionX.toLowerCase(), positionY.toLowerCase(), pos);
}
function setPosx(value, pos) {
    pos.left = value;
}
function setPosy(value, pos) {
    pos.top = value;
}
function updatePosition(posX, posY, pos) {
    elementRect = element.getBoundingClientRect();
    switch (posY + posX) {
        case 'topcenter':
            setPosx(getElementHCenter(), pos);
            setPosy(getElementTop(), pos);
            break;
        case 'topright':
            setPosx(getElementRight(), pos);
            setPosy(getElementTop(), pos);
            break;
        case 'centercenter':
            setPosx(getElementHCenter(), pos);
            setPosy(getElementVCenter(), pos);
            break;
        case 'centerright':
            setPosx(getElementRight(), pos);
            setPosy(getElementVCenter(), pos);
            break;
        case 'centerleft':
            setPosx(getElementLeft(), pos);
            setPosy(getElementVCenter(), pos);
            break;
        case 'bottomcenter':
            setPosx(getElementHCenter(), pos);
            setPosy(getElementBottom(), pos);
            break;
        case 'bottomright':
            setPosx(getElementRight(), pos);
            setPosy(getElementBottom(), pos);
            break;
        case 'bottomleft':
            setPosx(getElementLeft(), pos);
            setPosy(getElementBottom(), pos);
            break;
        default:
        case 'topleft':
            setPosx(getElementLeft(), pos);
            setPosy(getElementTop(), pos);
            break;
    }
    return pos;
}
function getBodyScrollTop() {
    return parentDocument.documentElement.scrollTop || parentDocument.body.scrollTop;
}
function getBodyScrollLeft() {
    return parentDocument.documentElement.scrollLeft || parentDocument.body.scrollLeft;
}
function getElementBottom() {
    return fixedParent ? elementRect.bottom : elementRect.bottom + getBodyScrollTop();
}
function getElementVCenter() {
    return getElementTop() + (elementRect.height / 2);
}
function getElementTop() {
    return fixedParent ? elementRect.top : elementRect.top + getBodyScrollTop();
}
function getElementLeft() {
    return elementRect.left + getBodyScrollLeft();
}
function getElementRight() {
    return elementRect.right + getBodyScrollLeft() - (popupRect ? popupRect.width : 0);
}
function getElementHCenter() {
    return getElementLeft() + (elementRect.width / 2);
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/common/resize.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/common/resize.js ***!
  \*******************************************************************/
/*! exports provided: createResize, setMinHeight, setMaxWidth, setMaxHeight, removeResize */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createResize", function() { return createResize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMinHeight", function() { return setMinHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMaxWidth", function() { return setMaxWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMaxHeight", function() { return setMaxHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeResize", function() { return removeResize; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/**
 * Resize library
 */

var elementClass = ['north-west', 'north', 'north-east', 'west', 'east', 'south-west', 'south', 'south-east'];
var targetElement;
var selectedHandler;
var originalWidth = 0;
var originalHeight = 0;
var originalX = 0;
var originalY = 0;
var originalMouseX = 0;
var originalMouseY = 0;
var RESIZE_HANDLER = 'e-resize-handle';
var FOCUSED_HANDLER = 'e-focused-handle';
var RESTRICT_LEFT = ['e-restrict-left'];
var RESIZE_WITHIN_VIEWPORT = 'e-resize-viewport';
var minHeight;
var maxHeight;
var minWidth;
var maxWidth;
var containerElement;
var resizeStart = null;
var resize = null;
var resizeEnd = null;
var resizeWestWidth;
var setLeft = true;
var previousWidth = 0;
var setWidth = true;
// tslint:disable-next-line
var proxy;
var dialogBorderResize = ['north', 'west', 'east', 'south'];
function createResize(args) {
    resizeStart = args.resizeBegin;
    resize = args.resizing;
    resizeEnd = args.resizeComplete;
    targetElement = getDOMElement(args.element);
    containerElement = getDOMElement(args.boundary);
    var directions = args.direction.split(' ');
    for (var i = 0; i < directions.length; i++) {
        if (dialogBorderResize.indexOf(directions[i]) >= 0 && directions[i]) {
            setBorderResizeElm(directions[i]);
        }
        else if (directions[i].trim() !== '') {
            var resizeHandler = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-icons ' + RESIZE_HANDLER + ' ' + 'e-' + directions[i] });
            targetElement.appendChild(resizeHandler);
        }
    }
    minHeight = args.minHeight;
    minWidth = args.minWidth;
    maxWidth = args.maxWidth;
    maxHeight = args.maxHeight;
    if (args.proxy && args.proxy.element && args.proxy.element.classList.contains('e-dialog')) {
        wireEvents(args.proxy);
    }
    else {
        wireEvents();
    }
}
function setBorderResizeElm(direction) {
    calculateValues();
    var borderBottom = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', {
        attrs: {
            'unselectable': 'on', 'contenteditable': 'false'
        }
    });
    borderBottom.setAttribute('class', 'e-dialog-border-resize e-' + direction);
    if (direction === 'south') {
        borderBottom.style.height = '2px';
        borderBottom.style.width = '100%';
        borderBottom.style.bottom = '0px';
        borderBottom.style.left = '0px';
    }
    if (direction === 'north') {
        borderBottom.style.height = '2px';
        borderBottom.style.width = '100%';
        borderBottom.style.top = '0px';
        borderBottom.style.left = '0px';
    }
    if (direction === 'east') {
        borderBottom.style.height = '100%';
        borderBottom.style.width = '2px';
        borderBottom.style.right = '0px';
        borderBottom.style.top = '0px';
    }
    if (direction === 'west') {
        borderBottom.style.height = '100%';
        borderBottom.style.width = '2px';
        borderBottom.style.left = '0px';
        borderBottom.style.top = '0px';
    }
    targetElement.appendChild(borderBottom);
}
function getDOMElement(element) {
    var domElement;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
        if (typeof (element) === 'string') {
            domElement = document.querySelector(element);
        }
        else {
            domElement = element;
        }
    }
    return domElement;
}
// tslint:disable-next-line
function wireEvents(args) {
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args)) {
        args = this;
    }
    var resizers = targetElement.querySelectorAll('.' + RESIZE_HANDLER);
    for (var i = 0; i < resizers.length; i++) {
        selectedHandler = resizers[i];
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(selectedHandler, 'mousedown', onMouseDown, args);
        var eventName = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointerdown' : 'touchstart';
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(selectedHandler, eventName, onTouchStart, args);
    }
    var borderResizers = targetElement.querySelectorAll('.e-dialog-border-resize');
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(borderResizers)) {
        for (var i = 0; i < borderResizers.length; i++) {
            selectedHandler = borderResizers[i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(selectedHandler, 'mousedown', onMouseDown, args);
            var eventName = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointerdown' : 'touchstart';
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(selectedHandler, eventName, onTouchStart, args);
        }
    }
}
/* istanbul ignore next */
function getEventType(e) {
    return (e.indexOf('mouse') > -1) ? 'mouse' : 'touch';
}
/* istanbul ignore next */
function onMouseDown(e) {
    e.preventDefault();
    targetElement = e.target.parentElement;
    calculateValues();
    originalMouseX = e.pageX;
    originalMouseY = e.pageY;
    e.target.classList.add(FOCUSED_HANDLER);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resizeStart)) {
        proxy = this;
        if (resizeStart(e, proxy) === true) {
            return;
        }
    }
    var target = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) ? document : containerElement;
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'mousemove', onMouseMove, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mouseup', onMouseUp, this);
    for (var i = 0; i < RESTRICT_LEFT.length; i++) {
        if (targetElement.classList.contains(RESTRICT_LEFT[i])) {
            setLeft = false;
        }
        else {
            setLeft = true;
        }
    }
}
/* istanbul ignore next */
function onMouseUp(e) {
    var touchMoveEvent = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointermove' : 'touchmove';
    var touchEndEvent = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointerup' : 'touchend';
    var target = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) ? document : containerElement;
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mousemove', onMouseMove);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, touchMoveEvent, onMouseMove);
    var eventName = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointerdown' : 'touchstart';
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, eventName, onMouseMove);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(document.body.querySelector('.' + FOCUSED_HANDLER))) {
        document.body.querySelector('.' + FOCUSED_HANDLER).classList.remove(FOCUSED_HANDLER);
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resizeEnd)) {
        proxy = this;
        resizeEnd(e, proxy);
    }
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mouseup', onMouseUp);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, touchEndEvent, onMouseUp);
}
/* istanbul ignore next */
function calculateValues() {
    originalWidth = parseFloat(getComputedStyle(targetElement, null).getPropertyValue('width').replace('px', ''));
    originalHeight = parseFloat(getComputedStyle(targetElement, null).getPropertyValue('height').replace('px', ''));
    originalX = targetElement.getBoundingClientRect().left;
    originalY = targetElement.getBoundingClientRect().top;
}
/* istanbul ignore next */
function onTouchStart(e) {
    targetElement = e.target.parentElement;
    calculateValues();
    var coordinates = e.touches ? e.changedTouches[0] : e;
    originalMouseX = coordinates.pageX;
    originalMouseY = coordinates.pageY;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resizeStart)) {
        proxy = this;
        if (resizeStart(e, proxy) === true) {
            return;
        }
    }
    var touchMoveEvent = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointermove' : 'touchmove';
    var touchEndEvent = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].info.name === 'msie') ? 'pointerup' : 'touchend';
    var target = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) ? document : containerElement;
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, touchMoveEvent, onMouseMove, this);
    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, touchEndEvent, onMouseUp);
}
/* istanbul ignore next */
function onMouseMove(e) {
    if (e.target.classList.contains(RESIZE_HANDLER) && e.target.classList.contains(FOCUSED_HANDLER)) {
        selectedHandler = e.target;
    }
    else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(document.body.querySelector('.' + FOCUSED_HANDLER))) {
        selectedHandler = document.body.querySelector('.' + FOCUSED_HANDLER);
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedHandler)) {
        var resizeTowards = '';
        for (var i = 0; i < elementClass.length; i++) {
            if (selectedHandler.classList.contains('e-' + elementClass[i])) {
                resizeTowards = elementClass[i];
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resize)) {
            proxy = this;
            resize(e, proxy);
        }
        switch (resizeTowards) {
            case 'south':
                resizeSouth(e);
                break;
            case 'north':
                resizeNorth(e);
                break;
            case 'west':
                resizeWest(e);
                break;
            case 'east':
                resizeEast(e);
                break;
            case 'south-east':
                resizeSouth(e);
                resizeEast(e);
                break;
            case 'south-west':
                resizeSouth(e);
                resizeWest(e);
                break;
            case 'north-east':
                resizeNorth(e);
                resizeEast(e);
                break;
            case 'north-west':
                resizeNorth(e);
                resizeWest(e);
                break;
            default: break;
        }
    }
}
/* istanbul ignore next */
function getClientRectValues(element) {
    return element.getBoundingClientRect();
}
/* istanbul ignore next */
// tslint:disable-next-line
function resizeSouth(e) {
    var documentHeight = document.documentElement.clientHeight;
    var calculateValue = false;
    var containerRectValues;
    var coordinates = e.touches ? e.changedTouches[0] : e;
    var currentpageY = coordinates.pageY;
    var targetRectValues = getClientRectValues(targetElement);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        containerRectValues = getClientRectValues(containerElement);
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        calculateValue = true;
    }
    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {
        calculateValue = true;
    }
    var calculatedHeight = originalHeight + (currentpageY - originalMouseY);
    calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;
    var containerTop = 0;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        containerTop = containerRectValues.top;
    }
    var borderValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;
    var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);
    topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;
    if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {
        calculateValue = false;
        if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {
            return;
        }
        targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';
        return;
    }
    var targetTop = 0;
    if (calculateValue) {
        if (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {
            targetTop = targetRectValues.top;
            if ((calculatedHeight + targetTop) <= 30) {
                calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;
            }
        }
        if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {
            targetElement.style.height = targetRectValues.height +
                (documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';
        }
        var calculatedTop = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) ? targetTop : topWithoutborder;
        if (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {
            targetElement.style.height = calculatedHeight + 'px';
        }
    }
}
/* istanbul ignore next */
// tslint:disable-next-line
function resizeNorth(e) {
    var calculateValue = false;
    var boundaryRectValues;
    var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;
    var targetRectValues = getClientRectValues(targetElement);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        boundaryRectValues = getClientRectValues(containerElement);
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {
        calculateValue = true;
    }
    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && pageY > 0) {
        calculateValue = true;
    }
    var currentHeight = originalHeight - (pageY - originalMouseY);
    if (calculateValue) {
        if (currentHeight >= minHeight && currentHeight <= maxHeight) {
            var containerTop = 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
                containerTop = boundaryRectValues.top;
            }
            var top_1 = (originalY - containerTop) + (pageY - originalMouseY);
            top_1 = top_1 > 0 ? top_1 : 1;
            targetElement.style.height = currentHeight + 'px';
            targetElement.style.top = top_1 + 'px';
        }
    }
}
/* istanbul ignore next */
// tslint:disable-next-line
function resizeWest(e) {
    var documentWidth = document.documentElement.clientWidth;
    var calculateValue = false;
    var rectValues;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        rectValues = getClientRectValues(containerElement);
    }
    var pageX = (getEventType(e.type) === 'mouse') ? e.pageX : e.touches[0].pageX;
    var targetRectValues = getClientRectValues(targetElement);
    var borderValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) ? 0 : containerElement.offsetWidth - containerElement.clientWidth;
    var left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) ? 0 : rectValues.left;
    var containerWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) ? 0 : rectValues.width;
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resizeWestWidth)) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
            resizeWestWidth = (((targetRectValues.left - left) - borderValue / 2)) + targetRectValues.width;
            resizeWestWidth = resizeWestWidth + (containerWidth - borderValue - resizeWestWidth);
        }
        else {
            resizeWestWidth = documentWidth;
        }
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) &&
        (Math.floor((targetRectValues.left - rectValues.left) + targetRectValues.width +
            (rectValues.right - targetRectValues.right)) - borderValue) <= maxWidth) {
        calculateValue = true;
    }
    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && pageX >= 0) {
        calculateValue = true;
    }
    var calculatedWidth = originalWidth - (pageX - originalMouseX);
    if (setLeft) {
        calculatedWidth = (calculatedWidth > resizeWestWidth) ? resizeWestWidth : calculatedWidth;
    }
    if (calculateValue) {
        if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {
            var containerLeft = 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
                containerLeft = rectValues.left;
            }
            var left_1 = (originalX - containerLeft) + (pageX - originalMouseX);
            left_1 = (left_1 > 0) ? left_1 : 1;
            if (calculatedWidth !== previousWidth && setWidth) {
                targetElement.style.width = calculatedWidth + 'px';
            }
            if (setLeft) {
                targetElement.style.left = left_1 + 'px';
                if (left_1 === 1) {
                    setWidth = false;
                }
                else {
                    setWidth = true;
                }
            }
        }
    }
    previousWidth = calculatedWidth;
}
/* istanbul ignore next */
// tslint:disable-next-line
function resizeEast(e) {
    var documentWidth = document.documentElement.clientWidth;
    var calculateValue = false;
    var containerRectValues;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        containerRectValues = getClientRectValues(containerElement);
    }
    var coordinates = e.touches ? e.changedTouches[0] : e;
    var pageX = coordinates.pageX;
    var targetRectValues = getClientRectValues(targetElement);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && (((targetRectValues.left - containerRectValues.left) + targetRectValues.width) < maxWidth
        || (targetRectValues.right - containerRectValues.left) > targetRectValues.width)) {
        calculateValue = true;
    }
    else if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement) && (documentWidth - pageX) > 0) {
        calculateValue = true;
    }
    var calculatedWidth = originalWidth + (pageX - originalMouseX);
    var containerLeft = 0;
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(containerElement)) {
        containerLeft = containerRectValues.left;
    }
    if (((targetRectValues.left - containerLeft) + calculatedWidth) > maxWidth) {
        calculateValue = false;
        if (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {
            return;
        }
        targetElement.style.width = maxWidth - (targetRectValues.left - containerLeft) + 'px';
    }
    if (calculateValue) {
        if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {
            targetElement.style.width = calculatedWidth + 'px';
        }
    }
}
/* istanbul ignore next */
function setMinHeight(minimumHeight) {
    minHeight = minimumHeight;
}
function setMaxWidth(value) {
    maxWidth = value;
}
function setMaxHeight(value) {
    maxHeight = value;
}
function removeResize() {
    var handlers = targetElement.querySelectorAll('.' + RESIZE_HANDLER);
    for (var i = 0; i < handlers.length; i++) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(handlers[i]);
    }
    var borderResizers = targetElement.querySelectorAll('.e-dialog-border-resize');
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(borderResizers)) {
        for (var i = 0; i < borderResizers.length; i++) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(borderResizers[i]);
        }
    }
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/dialog/dialog.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/dialog/dialog.js ***!
  \*******************************************************************/
/*! exports provided: ButtonProps, AnimationSettings, Dialog, DialogUtility */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonProps", function() { return ButtonProps; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return AnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dialog", function() { return Dialog; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DialogUtility", function() { return DialogUtility; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _popup_popup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../popup/popup */ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/popup.js");
/* harmony import */ var _common_resize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/resize */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/resize.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








var ButtonProps = /** @__PURE__ @class */ (function (_super) {
    __extends(ButtonProps, _super);
    function ButtonProps() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], ButtonProps.prototype, "buttonModel", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Button')
    ], ButtonProps.prototype, "type", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], ButtonProps.prototype, "click", void 0);
    return ButtonProps;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Configures the animation properties for both open and close the dialog.
 */
var AnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(AnimationSettings, _super);
    function AnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Fade')
    ], AnimationSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(400)
    ], AnimationSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], AnimationSettings.prototype, "delay", void 0);
    return AnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

var ROOT = 'e-dialog';
var RTL = 'e-rtl';
var DLG_HEADER_CONTENT = 'e-dlg-header-content';
var DLG_HEADER = 'e-dlg-header';
var DLG_FOOTER_CONTENT = 'e-footer-content';
var MODAL_DLG = 'e-dlg-modal';
var DLG_CONTENT = 'e-dlg-content';
var DLG_CLOSE_ICON = 'e-icon-dlg-close';
var DLG_OVERLAY = 'e-dlg-overlay';
var DLG_TARGET = 'e-dlg-target';
var DLG_CONTAINER = 'e-dlg-container';
var SCROLL_DISABLED = 'e-scroll-disabled';
var DLG_PRIMARY_BUTTON = 'e-primary';
var ICON = 'e-icons';
var POPUP_ROOT = 'e-popup';
var DEVICE = 'e-device';
var FULLSCREEN = 'e-dlg-fullscreen';
var DLG_CLOSE_ICON_BTN = 'e-dlg-closeicon-btn';
var DLG_HIDE = 'e-popup-close';
var DLG_SHOW = 'e-popup-open';
var DLG_UTIL_DEFAULT_TITLE = 'Information';
var DLG_UTIL_ROOT = 'e-scroll-disabled';
var DLG_UTIL_ALERT = 'e-alert-dialog';
var DLG_UTIL_CONFIRM = 'e-confirm-dialog';
var DLG_RESIZABLE = 'e-dlg-resizable';
var DLG_RESTRICT_LEFT_VALUE = 'e-restrict-left';
var DLG_RESTRICT_WIDTH_VALUE = 'e-resize-viewport';
var DLG_REF_ELEMENT = 'e-dlg-ref-element';
/**
 * Represents the dialog component that displays the information and get input from the user.
 * Two types of dialog components are `Modal and Modeless (non-modal)` depending on its interaction with parent application.
 * ```html
 * <div id="dialog"></div>
 * ```
 * ```typescript
 * <script>
 *   var dialogObj = new Dialog({ header: 'Dialog' });
 *   dialogObj.appendTo("#dialog");
 * </script>
 * ```
 */
var Dialog = /** @__PURE__ @class */ (function (_super) {
    __extends(Dialog, _super);
    /**
     * Constructor for creating the widget
     * @hidden
     */
    function Dialog(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Initialize the control rendering
     * @private
     */
    Dialog.prototype.render = function () {
        this.initialize();
        this.initRender();
        this.wireEvents();
        if (this.width === '100%') {
            this.element.style.width = '';
        }
        if (this.minHeight !== '') {
            this.element.style.minHeight = this.minHeight.toString();
        }
        if (this.enableResize) {
            this.setResize();
            if (this.animationSettings.effect === 'None') {
                this.getMinHeight();
            }
        }
        this.renderComplete();
    };
    /**
     * Initialize the event handler
     * @private
     */
    Dialog.prototype.preRender = function () {
        var _this = this;
        this.headerContent = null;
        this.allowMaxHeight = true;
        this.preventVisibility = true;
        this.clonedEle = this.element.cloneNode(true);
        this.closeIconClickEventHandler = function (event) {
            _this.hide(event);
        };
        this.dlgOverlayClickEventHandler = function (event) {
            event.preventFocus = false;
            _this.trigger('overlayClick', event, function (overlayClickEventArgs) {
                if (!overlayClickEventArgs.preventFocus) {
                    _this.focusContent();
                }
            });
        };
        var localeText = { close: 'Close' };
        this.l10n = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"]('dialog', localeText, this.locale);
        this.checkPositionData();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) {
            var prevOnChange = this.isProtectedOnChange;
            this.isProtectedOnChange = true;
            this.target = document.body;
            this.isProtectedOnChange = prevOnChange;
        }
    };
    ;
    Dialog.prototype.isNumberValue = function (value) {
        var isNumber = /^[-+]?\d*\.?\d+$/.test(value);
        return isNumber;
    };
    Dialog.prototype.checkPositionData = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.position)) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.position.X) && (typeof (this.position.X) !== 'number')) {
                var isNumber = this.isNumberValue(this.position.X);
                if (isNumber) {
                    var prevOnChange = this.isProtectedOnChange;
                    this.isProtectedOnChange = true;
                    this.position.X = parseFloat(this.position.X);
                    this.isProtectedOnChange = prevOnChange;
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.position.Y) && (typeof (this.position.Y) !== 'number')) {
                var isNumber = this.isNumberValue(this.position.Y);
                if (isNumber) {
                    var prevOnChange = this.isProtectedOnChange;
                    this.isProtectedOnChange = true;
                    this.position.Y = parseFloat(this.position.Y);
                    this.isProtectedOnChange = prevOnChange;
                }
            }
        }
    };
    Dialog.prototype.getEle = function (list, selector) {
        var element = undefined;
        for (var i = 0; i < list.length; i++) {
            if (list[i].classList.contains(selector)) {
                element = list[i];
                break;
            }
        }
        return element;
    };
    /* istanbul ignore next */
    Dialog.prototype.getMinHeight = function () {
        var computedHeaderHeight = '0px';
        var computedFooterHeight = '0px';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.' + DLG_HEADER_CONTENT))) {
            computedHeaderHeight = getComputedStyle(this.headerContent).height;
        }
        var footerEle = this.getEle(this.element.children, DLG_FOOTER_CONTENT);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(footerEle)) {
            computedFooterHeight = getComputedStyle(footerEle).height;
        }
        var headerHeight = parseInt(computedHeaderHeight.slice(0, computedHeaderHeight.indexOf('p')), 10);
        var footerHeight = parseInt(computedFooterHeight.slice(0, computedFooterHeight.indexOf('p')), 10);
        Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["setMinHeight"])(headerHeight + 30 + (isNaN(footerHeight) ? 0 : footerHeight));
        return (headerHeight + 30 + footerHeight);
    };
    Dialog.prototype.onResizeStart = function (args, dialogObj) {
        dialogObj.trigger('resizeStart', args);
        return args.cancel;
    };
    Dialog.prototype.onResizing = function (args, dialogObj) {
        dialogObj.trigger('resizing', args);
    };
    Dialog.prototype.onResizeComplete = function (args, dialogObj) {
        dialogObj.trigger('resizeStop', args);
    };
    Dialog.prototype.setResize = function () {
        if (this.enableResize) {
            if (this.isBlazorServerRender() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.e-icons.e-resize-handle'))) {
                return;
            }
            this.element.classList.add(DLG_RESIZABLE);
            var computedHeight = getComputedStyle(this.element).minHeight;
            var computedWidth = getComputedStyle(this.element).minWidth;
            var direction = '';
            for (var i = 0; i < this.resizeHandles.length; i++) {
                if (this.resizeHandles[i] === 'All') {
                    direction = 'south north east west north-east north-west south-east south-west';
                    break;
                }
                else {
                    var directionValue = '';
                    switch (this.resizeHandles[i].toString()) {
                        case 'SouthEast':
                            directionValue = 'south-east';
                            break;
                        case 'SouthWest':
                            directionValue = 'south-west';
                            break;
                        case 'NorthEast':
                            directionValue = 'north-east';
                            break;
                        case 'NorthWest':
                            directionValue = 'north-west';
                            break;
                        default:
                            directionValue = this.resizeHandles[i].toString();
                            break;
                    }
                    direction += directionValue.toLocaleLowerCase() + ' ';
                }
            }
            if (this.enableRtl && direction.trim() === 'south-east') {
                direction = 'south-west';
            }
            else if (this.enableRtl && direction.trim() === 'south-west') {
                direction = 'south-east';
            }
            if (this.isModal && this.enableRtl) {
                this.element.classList.add(DLG_RESTRICT_LEFT_VALUE);
            }
            else if (this.isModal && this.target === document.body) {
                this.element.classList.add(DLG_RESTRICT_WIDTH_VALUE);
            }
            Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["createResize"])({
                element: this.element,
                direction: direction,
                minHeight: parseInt(computedHeight.slice(0, computedWidth.indexOf('p')), 10),
                maxHeight: this.targetEle.clientHeight,
                minWidth: parseInt(computedWidth.slice(0, computedWidth.indexOf('p')), 10),
                maxWidth: this.targetEle.clientWidth,
                boundary: this.target === document.body ? null : this.targetEle,
                resizeBegin: this.onResizeStart.bind(this),
                resizeComplete: this.onResizeComplete.bind(this),
                resizing: this.onResizing.bind(this),
                proxy: this
            });
            this.wireWindowResizeEvent();
        }
        else {
            Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["removeResize"])();
            this.unWireWindowResizeEvent();
            if (this.isModal) {
                this.element.classList.remove(DLG_RESTRICT_LEFT_VALUE);
            }
            else {
                this.element.classList.remove(DLG_RESTRICT_WIDTH_VALUE);
            }
            this.element.classList.remove(DLG_RESIZABLE);
        }
    };
    Dialog.prototype.getFocusElement = function (target) {
        var value = 'input,select,textarea,button:enabled,a,[contenteditable="true"],[tabindex]';
        var items = target.querySelectorAll(value);
        return { element: items[items.length - 1] };
    };
    /* istanbul ignore next */
    Dialog.prototype.keyDown = function (event) {
        var _this = this;
        if (event.keyCode === 9) {
            if (this.isModal) {
                var buttonObj = void 0;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.btnObj)) {
                    buttonObj = this.btnObj[this.btnObj.length - 1];
                }
                if ((Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.btnObj)) && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ftrTemplateContent))) {
                    buttonObj = this.getFocusElement(this.ftrTemplateContent);
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.btnObj) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ftrTemplateContent) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentEle)) {
                    buttonObj = this.getFocusElement(this.contentEle);
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(buttonObj) && document.activeElement === buttonObj.element && !event.shiftKey) {
                    event.preventDefault();
                    this.focusableElements(this.element).focus();
                }
                if (document.activeElement === this.focusableElements(this.element) && event.shiftKey) {
                    event.preventDefault();
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(buttonObj)) {
                        buttonObj.element.focus();
                    }
                }
            }
        }
        var element = document.activeElement;
        var isTagName = (['input', 'textarea'].indexOf(element.tagName.toLowerCase()) > -1);
        var isContentEdit = false;
        if (!isTagName) {
            isContentEdit = element.hasAttribute('contenteditable') && element.getAttribute('contenteditable') === 'true';
        }
        if (event.keyCode === 27 && this.closeOnEscape) {
            this.hide(event);
        }
        if ((event.keyCode === 13 && !event.ctrlKey && element.tagName.toLowerCase() !== 'textarea' &&
            isTagName && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.primaryButtonEle)) ||
            (event.keyCode === 13 && event.ctrlKey && (element.tagName.toLowerCase() === 'textarea' ||
                isContentEdit)) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.primaryButtonEle)) {
            var buttonIndex_1;
            var firstPrimary = this.buttons.some(function (data, index) {
                buttonIndex_1 = index;
                var buttonModel = data.buttonModel;
                return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(buttonModel) && buttonModel.isPrimary === true;
            });
            if (firstPrimary && typeof (this.buttons[buttonIndex_1].click) === 'function') {
                setTimeout(function () {
                    _this.buttons[buttonIndex_1].click.call(_this, event);
                });
            }
        }
    };
    /**
     * Initialize the control rendering
     * @private
     */
    Dialog.prototype.initialize = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) {
            this.targetEle = ((typeof this.target) === 'string') ?
                document.querySelector(this.target) : this.target;
        }
        if (!this.isBlazorServerRender()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], ROOT);
        }
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], DEVICE);
        }
        if (!this.isBlazorServerRender()) {
            this.setCSSClass();
        }
        this.setMaxHeight();
    };
    /**
     * Initialize the rendering
     * @private
     */
    Dialog.prototype.initRender = function () {
        var _this = this;
        this.initialRender = true;
        if (!this.isBlazorServerRender()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { role: 'dialog' });
        }
        if (this.zIndex === 1000) {
            this.setzIndex(this.element, false);
            this.calculatezIndex = true;
        }
        else {
            this.calculatezIndex = false;
        }
        if (this.isBlazorServerRender() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent)) {
            this.headerContent = this.element.getElementsByClassName('e-dlg-header-content')[0];
        }
        if (this.isBlazorServerRender() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentEle)) {
            this.contentEle = this.element.querySelector('#' + this.element.id + '_dialog-content');
        }
        if (!this.isBlazorServerRender()) {
            this.setTargetContent();
            if (this.header !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.header)) {
                this.setHeader();
            }
            if (this.showCloseIcon) {
                this.renderCloseIcon();
            }
            this.setContent();
            if (this.footerTemplate !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.footerTemplate)) {
                this.setFooterTemplate();
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons[0].buttonModel)) {
                this.setButton();
            }
        }
        if (this.isBlazorServerRender()) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons[0].buttonModel) && this.footerTemplate === '') {
                this.setButton();
            }
        }
        if (this.allowDragging && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent))) {
            this.setAllowDragging();
        }
        if (!this.isBlazorServerRender()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-modal': (this.isModal ? 'true' : 'false') });
            if (this.isModal) {
                this.setIsModal();
            }
        }
        if (this.isBlazorServerRender() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dlgContainer)) {
            this.dlgContainer = this.element.parentElement;
            for (var i = 0, childNodes = this.dlgContainer.children; i < childNodes.length; i++) {
                if (childNodes[i].classList.contains('e-dlg-overlay')) {
                    this.dlgOverlay = childNodes[i];
                }
            }
        }
        if (this.element.classList.contains(DLG_UTIL_ALERT) !== true && this.element.classList.contains(DLG_UTIL_CONFIRM) !== true
            && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.parentElement)) {
            var parentEle = this.isModal ? this.dlgContainer.parentElement : this.element.parentElement;
            this.refElement = this.createElement('div', { className: DLG_REF_ELEMENT });
            parentEle.insertBefore(this.refElement, (this.isModal ? this.dlgContainer : this.element));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetEle)) {
            this.isModal ? this.targetEle.appendChild(this.dlgContainer) : this.targetEle.appendChild(this.element);
        }
        this.popupObj = new _popup_popup__WEBPACK_IMPORTED_MODULE_2__["Popup"](this.element, {
            height: this.height,
            width: this.width,
            zIndex: this.zIndex,
            relateTo: this.target,
            actionOnScroll: 'none',
            enableRtl: this.enableRtl,
            open: function (event) {
                var eventArgs = {
                    container: _this.isModal ? _this.dlgContainer : _this.element,
                    element: _this.element,
                    target: _this.target,
                    preventFocus: false
                };
                if (_this.enableResize) {
                    _this.resetResizeIcon();
                }
                _this.trigger('open', eventArgs, function (openEventArgs) {
                    if (!openEventArgs.preventFocus) {
                        _this.focusContent();
                    }
                });
            },
            close: function (event) {
                if (_this.isModal) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.dlgOverlay], 'e-fade');
                }
                _this.unBindEvent(_this.element);
                if (_this.isModal) {
                    _this.dlgContainer.style.display = 'none';
                }
                _this.trigger('close', _this.closeArgs);
                var activeEle = document.activeElement;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeEle) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])((activeEle).blur)) {
                    activeEle.blur();
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.storeActiveElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.storeActiveElement.focus)) {
                    _this.storeActiveElement.focus();
                }
            }
        });
        this.positionChange();
        this.setEnableRTL();
        if (!this.isBlazorServerRender()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], DLG_HIDE);
            if (this.isModal) {
                this.setOverlayZindex();
            }
        }
        if (this.visible) {
            this.show();
        }
        else {
            if (this.isModal) {
                this.dlgOverlay.style.display = 'none';
            }
        }
        this.initialRender = false;
    };
    Dialog.prototype.resetResizeIcon = function () {
        var dialogConHeight = this.getMinHeight();
        if (this.targetEle.offsetHeight < dialogConHeight) {
            var className = this.enableRtl ? 'e-south-west' : 'e-south-east';
            var resizeIcon = this.element.querySelector('.' + className);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resizeIcon)) {
                resizeIcon.style.bottom = '-' + dialogConHeight.toString() + 'px';
            }
        }
    };
    Dialog.prototype.setOverlayZindex = function (zIndexValue) {
        var zIndex;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(zIndexValue)) {
            zIndex = parseInt(this.element.style.zIndex, 10) ? parseInt(this.element.style.zIndex, 10) : this.zIndex;
        }
        else {
            zIndex = zIndexValue;
        }
        this.dlgOverlay.style.zIndex = (zIndex - 1).toString();
        this.dlgContainer.style.zIndex = zIndex.toString();
    };
    Dialog.prototype.positionChange = function () {
        if (this.isModal) {
            if (!isNaN(parseFloat(this.position.X)) && !isNaN(parseFloat(this.position.Y))) {
                this.setPopupPosition();
            }
            else if ((!isNaN(parseFloat(this.position.X)) && isNaN(parseFloat(this.position.Y)))
                || (isNaN(parseFloat(this.position.X)) && !isNaN(parseFloat(this.position.Y)))) {
                this.setPopupPosition();
            }
            else {
                this.element.style.top = '0px';
                this.element.style.left = '0px';
                this.dlgContainer.classList.add('e-dlg-' + this.position.X + '-' + this.position.Y);
            }
        }
        else {
            this.setPopupPosition();
        }
    };
    Dialog.prototype.setPopupPosition = function () {
        this.popupObj.setProperties({
            position: {
                X: this.position.X, Y: this.position.Y
            }
        });
    };
    Dialog.prototype.setAllowDragging = function () {
        var _this = this;
        var handleContent = '.' + DLG_HEADER_CONTENT;
        this.dragObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"](this.element, {
            clone: false,
            isDragScroll: true,
            abort: '.e-dlg-closeicon-btn',
            handle: handleContent,
            dragStart: function (event) {
                _this.trigger('dragStart', event, function (dragEventArgs) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                        dragEventArgs.bindEvents(event.dragElement);
                    }
                });
            },
            dragStop: function (event) {
                if (_this.isModal) {
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.position)) {
                        _this.dlgContainer.classList.remove('e-dlg-' + _this.position.X + '-' + _this.position.Y);
                    }
                    // Reset the dialog position after drag completion.
                    _this.element.style.position = 'relative';
                }
                _this.trigger('dragStop', event);
                _this.element.classList.remove(DLG_RESTRICT_LEFT_VALUE);
            },
            drag: function (event) {
                _this.trigger('drag', event);
            }
        });
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetEle)) {
            this.dragObj.dragArea = this.targetEle;
        }
    };
    Dialog.prototype.setButton = function () {
        if (!this.isBlazorServerRender()) {
            this.buttonContent = [];
            this.btnObj = [];
            var primaryBtnFlag = true;
            for (var i = 0; i < this.buttons.length; i++) {
                var buttonType = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons[i].type) ? this.buttons[i].type.toLowerCase() : 'button';
                var btn = this.createElement('button', { attrs: { type: buttonType } });
                this.buttonContent.push(btn.outerHTML);
            }
            this.setFooterTemplate();
        }
        var footerBtn;
        for (var i = 0, childNodes = this.element.children; i < childNodes.length; i++) {
            if (childNodes[i].classList.contains(DLG_FOOTER_CONTENT)) {
                footerBtn = childNodes[i].querySelectorAll('button');
            }
        }
        for (var i = 0; i < this.buttons.length; i++) {
            if (!this.isBlazorServerRender()) {
                this.btnObj[i] = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["Button"](this.buttons[i].buttonModel);
            }
            if (this.isBlazorServerRender()) {
                this.ftrTemplateContent = this.element.querySelector('.' + DLG_FOOTER_CONTENT);
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ftrTemplateContent) && typeof (this.buttons[i].click) === 'function' && footerBtn.length > 0) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(footerBtn[i], 'click', this.buttons[i].click, this);
            }
            if (!this.isBlazorServerRender() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ftrTemplateContent)) {
                this.btnObj[i].appendTo(this.ftrTemplateContent.children[i]);
                this.btnObj[i].element.classList.add('e-flat');
                this.primaryButtonEle = this.element.getElementsByClassName('e-primary')[0];
            }
        }
    };
    Dialog.prototype.setContent = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-describedby': this.element.id + '_dialog-content' });
        this.contentEle = this.createElement('div', { className: DLG_CONTENT, id: this.element.id + '_dialog-content' });
        if (this.innerContentElement) {
            this.contentEle.appendChild(this.innerContentElement);
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content) && this.content !== '' || !this.initialRender) {
            var blazorContain = Object.keys(window);
            if (typeof (this.content) === 'string' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                this.contentEle.innerHTML = this.sanitizeHelper(this.content);
            }
            else if (this.content instanceof HTMLElement) {
                this.contentEle.appendChild(this.content);
            }
            else {
                this.setTemplate(this.content, this.contentEle, 'content');
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent)) {
            this.element.insertBefore(this.contentEle, this.element.children[1]);
        }
        else {
            this.element.insertBefore(this.contentEle, this.element.children[0]);
        }
        if (this.height === 'auto') {
            if (!this.isBlazorServerRender() && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE && this.element.style.width === '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.width)) {
                this.element.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
            }
            this.setMaxHeight();
        }
    };
    Dialog.prototype.setTemplate = function (template, toElement, prop) {
        var templateFn;
        var templateProps;
        var blazorContain = Object.keys(window);
        if (toElement.classList.contains(DLG_HEADER)) {
            templateProps = this.element.id + 'header';
        }
        else if (toElement.classList.contains(DLG_FOOTER_CONTENT)) {
            templateProps = this.element.id + 'footerTemplate';
        }
        else {
            templateProps = this.element.id + 'content';
        }
        var templateValue;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(template.outerHTML)) {
            toElement.appendChild(template);
        }
        else if ((typeof template !== 'string') || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && !this.isStringTemplate)) {
            templateFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
            templateValue = template;
        }
        else {
            toElement.innerHTML = this.sanitizeHelper(template);
        }
        var fromElements = [];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(templateFn)) {
            var isString = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() &&
                !this.isStringTemplate && (templateValue).indexOf('<div>Blazor') === 0) ?
                this.isStringTemplate : true;
            for (var _i = 0, _a = templateFn({}, this, prop, templateProps, isString); _i < _a.length; _i++) {
                var item = _a[_i];
                fromElements.push(item);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(fromElements), toElement);
        }
    };
    /**
     * @hidden
     */
    Dialog.prototype.sanitizeHelper = function (value) {
        if (this.enableHtmlSanitizer) {
            var dialogItem = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].beforeSanitize();
            var beforeEvent = {
                cancel: false,
                helper: null
            };
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(dialogItem, dialogItem, beforeEvent);
            this.trigger('beforeSanitizeHtml', dialogItem);
            if (dialogItem.cancel && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dialogItem.helper)) {
                value = dialogItem.helper(value);
            }
            else if (!dialogItem.cancel) {
                value = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].serializeValue(dialogItem, value);
            }
        }
        return value;
    };
    Dialog.prototype.setMaxHeight = function () {
        if (!this.allowMaxHeight) {
            return;
        }
        var display = this.element.style.display;
        this.element.style.display = 'none';
        this.element.style.maxHeight = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) && (this.targetEle.offsetHeight < window.innerHeight) ?
            (this.targetEle.offsetHeight - 20) + 'px' : (window.innerHeight - 20) + 'px';
        this.element.style.display = display;
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isIE && this.height === 'auto' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentEle)
            && this.element.offsetHeight < this.contentEle.offsetHeight) {
            this.element.style.height = 'inherit';
        }
    };
    Dialog.prototype.setEnableRTL = function () {
        if (!this.isBlazorServerRender()) {
            this.enableRtl ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], RTL) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], RTL);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.e-resize-handle'))) {
            Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["removeResize"])();
            this.setResize();
        }
    };
    Dialog.prototype.setTargetContent = function () {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content) || this.content === '') {
            var isContent = this.element.innerHTML.replace(/\s|<(\/?|\!?)(!--!--)>/g, '') !== '';
            if (this.element.children.length > 0 || isContent) {
                this.innerContentElement = document.createDocumentFragment();
                [].slice.call(this.element.childNodes).forEach(function (el) {
                    if (el.nodeType !== 8) {
                        _this.innerContentElement.appendChild(el);
                    }
                });
            }
        }
    };
    Dialog.prototype.setHeader = function () {
        if (this.headerEle) {
            this.headerEle.innerHTML = '';
        }
        else {
            this.headerEle = this.createElement('div', { id: this.element.id + '_title', className: DLG_HEADER });
        }
        this.createHeaderContent();
        this.headerContent.appendChild(this.headerEle);
        this.setTemplate(this.header, this.headerEle, 'header');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, { 'aria-labelledby': this.element.id + '_title' });
        this.element.insertBefore(this.headerContent, this.element.children[0]);
    };
    Dialog.prototype.setFooterTemplate = function () {
        if (this.ftrTemplateContent) {
            this.ftrTemplateContent.innerHTML = '';
        }
        else {
            this.ftrTemplateContent = this.createElement('div', {
                className: DLG_FOOTER_CONTENT
            });
        }
        if (this.footerTemplate !== '' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.footerTemplate)) {
            this.setTemplate(this.footerTemplate, this.ftrTemplateContent, 'footerTemplate');
        }
        else {
            this.ftrTemplateContent.innerHTML = this.buttonContent.join('');
        }
        this.element.appendChild(this.ftrTemplateContent);
    };
    Dialog.prototype.createHeaderContent = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent)) {
            this.headerContent = this.createElement('div', { id: this.element.id + '_dialog-header', className: DLG_HEADER_CONTENT });
        }
    };
    Dialog.prototype.renderCloseIcon = function () {
        this.closeIcon = this.createElement('button', { className: DLG_CLOSE_ICON_BTN, attrs: { type: 'button' } });
        this.closeIconBtnObj = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["Button"]({ cssClass: 'e-flat', iconCss: DLG_CLOSE_ICON + ' ' + ICON });
        this.closeIconTitle();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.closeIcon], this.headerContent);
        }
        else {
            this.createHeaderContent();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.closeIcon], this.headerContent);
            this.element.insertBefore(this.headerContent, this.element.children[0]);
        }
        this.closeIconBtnObj.appendTo(this.closeIcon);
    };
    Dialog.prototype.closeIconTitle = function () {
        this.l10n.setLocale(this.locale);
        var closeIconTitle = this.l10n.getConstant('close');
        this.closeIcon.setAttribute('title', closeIconTitle);
        this.closeIcon.setAttribute('aria-label', closeIconTitle);
    };
    Dialog.prototype.setCSSClass = function (oldCSSClass) {
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.cssClass.split(' '));
        }
        if (oldCSSClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldCSSClass.split(' '));
        }
    };
    Dialog.prototype.setIsModal = function () {
        this.dlgContainer = this.createElement('div', { className: DLG_CONTAINER });
        this.element.classList.remove(DLG_SHOW);
        this.element.parentNode.insertBefore(this.dlgContainer, this.element);
        this.dlgContainer.appendChild(this.element);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], MODAL_DLG);
        this.dlgOverlay = this.createElement('div', { className: DLG_OVERLAY });
        this.dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
        this.dlgContainer.appendChild(this.dlgOverlay);
    };
    Dialog.prototype.getValidFocusNode = function (items) {
        var node;
        for (var u = 0; u < items.length; u++) {
            node = items[u];
            if ((node.clientHeight > 0 || (node.tagName.toLowerCase() === 'a' && node.hasAttribute('href'))) && node.tabIndex > -1 &&
                !node.disabled && !this.disableElement(node, '[disabled],[aria-disabled="true"],[type="hidden"]')) {
                return node;
            }
            else {
                node = null;
            }
        }
        return node;
    };
    Dialog.prototype.focusableElements = function (content) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(content)) {
            var value = 'input,select,textarea,button,a,[contenteditable="true"],[tabindex]';
            var items = content.querySelectorAll(value);
            return this.getValidFocusNode(items);
        }
        return null;
    };
    Dialog.prototype.getAutoFocusNode = function (container) {
        var node = container.querySelector('.' + DLG_CLOSE_ICON_BTN);
        var value = '[autofocus]';
        var items = container.querySelectorAll(value);
        var validNode = this.getValidFocusNode(items);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            this.primaryButtonEle = this.element.getElementsByClassName('e-primary')[0];
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(validNode)) {
            node = validNode;
        }
        else {
            validNode = this.focusableElements(this.contentEle);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(validNode)) {
                return node = validNode;
            }
            else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.primaryButtonEle)) {
                return this.element.querySelector('.' + DLG_PRIMARY_BUTTON);
            }
        }
        return node;
    };
    Dialog.prototype.disableElement = function (element, t) {
        var elementMatch = element ? element.matches || element.webkitMatchesSelector || element.msMatchesSelector : null;
        if (elementMatch) {
            for (; element; element = element.parentNode) {
                if (element instanceof Element && elementMatch.call(element, t)) {
                    /* istanbul ignore next */
                    return element;
                }
            }
        }
        return null;
    };
    Dialog.prototype.focusContent = function () {
        var element = this.getAutoFocusNode(this.element);
        var node = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element) ? element : this.element;
        var userAgent = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].userAgent;
        if (userAgent.indexOf('MSIE ') > 0 || userAgent.indexOf('Trident/') > 0) {
            this.element.focus();
        }
        node.focus();
        this.bindEvent(this.element);
    };
    Dialog.prototype.bindEvent = function (element) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'keydown', this.keyDown, this);
    };
    Dialog.prototype.unBindEvent = function (element) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(element, 'keydown', this.keyDown);
    };
    Dialog.prototype.updateSanitizeContent = function () {
        if (!this.isBlazorServerRender()) {
            this.contentEle.innerHTML = this.sanitizeHelper(this.content);
        }
    };
    Dialog.prototype.isBlazorServerRender = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered;
    };
    /**
     * Module required function
     * @private
     */
    Dialog.prototype.getModuleName = function () {
        return 'dialog';
    };
    /**
     * Called internally if any of the property value changed
     * @private
     */
    Dialog.prototype.onPropertyChanged = function (newProp, oldProp) {
        if (!this.element.classList.contains(ROOT)) {
            return;
        }
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'content':
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content) && this.content !== '') {
                        if (this.isBlazorServerRender()) {
                            this.contentEle = this.element.querySelector('.e-dlg-content');
                        }
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentEle) && this.contentEle.getAttribute('role') !== 'dialog') {
                            if (!this.isBlazorServerRender()) {
                                this.contentEle.innerHTML = '';
                            }
                            if (typeof (this.content) === 'function') {
                                this.clearTemplate(['content']);
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.contentEle);
                                this.contentEle = null;
                                this.setContent();
                            }
                            else {
                                typeof (this.content) === 'string' ? (this.isBlazorServerRender() && (this.contentEle.innerText === '')) ?
                                    this.contentEle.insertAdjacentHTML('beforeend', this.sanitizeHelper(this.content)) :
                                    this.updateSanitizeContent() : this.contentEle.appendChild(this.content);
                            }
                            this.setMaxHeight();
                        }
                        else {
                            if (!this.isBlazorServerRender() ||
                                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.e-dlg-content'))) {
                                this.setContent();
                            }
                        }
                    }
                    else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.contentEle)) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.contentEle);
                        this.contentEle = null;
                    }
                    break;
                case 'header':
                    if (this.header === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.header)) {
                        if (this.headerEle) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.headerEle);
                            this.headerEle = null;
                        }
                    }
                    else {
                        if (!this.isBlazorServerRender() ||
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.e-dlg-header-content'))) {
                            this.setHeader();
                        }
                    }
                    break;
                case 'footerTemplate':
                    if (this.footerTemplate === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.footerTemplate)) {
                        if (!this.ftrTemplateContent) {
                            return;
                        }
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.ftrTemplateContent);
                        this.ftrTemplateContent = null;
                        this.buttons = [{}];
                    }
                    else {
                        if (!this.isBlazorServerRender() ||
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.querySelector('.e-footer-content'))) {
                            this.setFooterTemplate();
                        }
                        this.buttons = [{}];
                    }
                    break;
                case 'showCloseIcon':
                    if (this.element.getElementsByClassName(DLG_CLOSE_ICON).length > 0) {
                        if (!this.showCloseIcon && (this.header === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.header))) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.headerContent);
                            this.headerContent = null;
                        }
                        else if (!this.showCloseIcon) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.closeIcon);
                        }
                        else {
                            if (this.isBlazorServerRender()) {
                                this.wireEvents();
                            }
                        }
                    }
                    else {
                        if (!this.isBlazorServerRender()) {
                            this.renderCloseIcon();
                        }
                        this.wireEvents();
                    }
                    break;
                case 'locale':
                    if (this.showCloseIcon) {
                        this.closeIconTitle();
                    }
                    break;
                case 'visible':
                    this.visible ? this.show() : this.hide();
                    break;
                case 'isModal':
                    this.updateIsModal();
                    break;
                case 'height':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height) });
                    break;
                case 'width':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width) });
                    break;
                case 'zIndex':
                    this.popupObj.zIndex = this.zIndex;
                    if (this.isModal) {
                        this.setOverlayZindex(this.zIndex);
                    }
                    if (this.element.style.zIndex !== this.zIndex.toString()) {
                        this.calculatezIndex = false;
                    }
                    break;
                case 'cssClass':
                    this.setCSSClass(oldProp.cssClass);
                    break;
                case 'buttons':
                    var buttonCount = this.buttons.length;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.ftrTemplateContent) && !this.isBlazorServerRender()) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.ftrTemplateContent);
                        this.ftrTemplateContent = null;
                    }
                    for (var i = 0; i < buttonCount; i++) {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons[i].buttonModel)) {
                            this.footerTemplate = '';
                            this.setButton();
                        }
                    }
                    break;
                case 'allowDragging':
                    if (this.allowDragging && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent))) {
                        this.setAllowDragging();
                    }
                    else {
                        this.dragObj.destroy();
                    }
                    break;
                case 'target':
                    this.setTarget(newProp.target);
                    break;
                case 'position':
                    this.checkPositionData();
                    if (this.isModal) {
                        var positionX = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.position.X) ? this.position.X : oldProp.position.X;
                        var positionY = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(oldProp.position.Y) ? this.position.Y : oldProp.position.Y;
                        if (this.dlgContainer.classList.contains('e-dlg-' + positionX + '-' + positionY)) {
                            this.dlgContainer.classList.remove('e-dlg-' + positionX + '-' + positionY);
                        }
                    }
                    this.positionChange();
                    break;
                case 'enableRtl':
                    this.setEnableRTL();
                    break;
                case 'enableResize':
                    this.setResize();
                    break;
            }
        }
    };
    Dialog.prototype.setTarget = function (target) {
        this.popupObj.relateTo = target;
        this.target = target;
        this.targetEle = ((typeof this.target) === 'string') ?
            document.querySelector(this.target) : this.target;
        if (this.dragObj) {
            this.dragObj.dragArea = this.targetEle;
        }
        this.setMaxHeight();
        if (this.isModal) {
            this.updateIsModal();
        }
        if (this.enableResize) {
            this.setResize();
        }
    };
    Dialog.prototype.updateIsModal = function () {
        this.element.setAttribute('aria-modal', this.isModal ? 'true' : 'false');
        if (this.isModal) {
            this.setIsModal();
            this.element.style.top = '0px';
            this.element.style.left = '0px';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetEle)) {
                this.targetEle.appendChild(this.dlgContainer);
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], MODAL_DLG);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.dlgOverlay);
            while (this.dlgContainer.firstChild) {
                this.dlgContainer.parentElement.insertBefore(this.dlgContainer.firstChild, this.dlgContainer);
            }
            this.dlgContainer.parentElement.removeChild(this.dlgContainer);
        }
        if (this.visible) {
            this.show();
        }
        this.positionChange();
        if (this.isModal && this.dlgOverlay) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler, this);
        }
    };
    Dialog.prototype.setzIndex = function (zIndexElement, setPopupZindex) {
        var prevOnChange = this.isProtectedOnChange;
        this.isProtectedOnChange = true;
        this.zIndex = Object(_popup_popup__WEBPACK_IMPORTED_MODULE_2__["getZindexPartial"])(zIndexElement);
        this.isProtectedOnChange = prevOnChange;
        if (setPopupZindex) {
            this.popupObj.zIndex = this.zIndex;
        }
    };
    Dialog.prototype.windowResizeHandler = function () {
        Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["setMaxWidth"])(this.targetEle.clientWidth);
        Object(_common_resize__WEBPACK_IMPORTED_MODULE_3__["setMaxHeight"])(this.targetEle.clientHeight);
        this.setMaxHeight();
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @private
     */
    Dialog.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * To destroy the widget
     * @method destroy
     * @return {void}
     * @memberof dialog
     */
    Dialog.prototype.destroy = function () {
        if (this.isDestroyed) {
            return;
        }
        var classArray = [RTL, MODAL_DLG, DLG_RESIZABLE, DLG_RESTRICT_LEFT_VALUE, FULLSCREEN, DEVICE];
        var attrs = ['role', 'aria-modal', 'aria-labelledby', 'aria-describedby', 'aria-grabbed', 'tabindex', 'style'];
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.targetEle], [DLG_TARGET, SCROLL_DISABLED]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element) && this.element.classList.contains(FULLSCREEN)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
        }
        if (this.isModal) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([(!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.targetEle) ? this.targetEle : document.body)], SCROLL_DISABLED);
        }
        this.unWireEvents();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.btnObj)) {
            for (var i = 0; i < this.btnObj.length; i++) {
                this.btnObj[i].destroy();
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dragObj)) {
            this.dragObj.destroy();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.popupObj.element) && this.popupObj.element.classList.contains(POPUP_ROOT)) {
            this.popupObj.destroy();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], classArray);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass) && this.cssClass !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], this.cssClass.split(' '));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.refElement) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.refElement.parentElement)) {
            this.refElement.parentElement.insertBefore((this.isModal ? this.dlgContainer : this.element), this.refElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.refElement);
            this.refElement = undefined;
        }
        if (this.isModal && !this.isBlazorServerRender()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.dlgOverlay);
            this.dlgContainer.parentNode.insertBefore(this.element, this.dlgContainer);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.dlgContainer);
        }
        if (!this.isBlazorServerRender()) {
            this.element.innerHTML = this.clonedEle.innerHTML;
        }
        if (this.isBlazorServerRender()) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.children)) {
                for (var i = 0; i <= this.element.children.length; i++) {
                    i = i - i;
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.children[i]);
                }
            }
        }
        for (var i = 0; i < attrs.length; i++) {
            this.element.removeAttribute(attrs[i]);
        }
        if (!this.isBlazorServerRender()) {
            _super.prototype.destroy.call(this);
        }
        else {
            this.isDestroyed = true;
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate();
        }
    };
    Dialog.prototype.wireWindowResizeEvent = function () {
        window.addEventListener('resize', this.windowResizeHandler.bind(this));
    };
    Dialog.prototype.unWireWindowResizeEvent = function () {
        window.removeEventListener('resize', this.windowResizeHandler.bind(this));
    };
    /**
     * Binding event to the element while widget creation
     * @hidden
     */
    Dialog.prototype.wireEvents = function () {
        if (this.isBlazorServerRender() && this.showCloseIcon) {
            this.closeIcon = this.element.getElementsByClassName('e-dlg-closeicon-btn')[0];
        }
        if (this.showCloseIcon) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.closeIcon, 'click', this.closeIconClickEventHandler, this);
        }
        if (this.isModal && this.dlgOverlay) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler, this);
        }
    };
    /**
     * Unbinding event to the element while widget destroy
     * @hidden
     */
    Dialog.prototype.unWireEvents = function () {
        if (this.showCloseIcon) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.closeIcon, 'click', this.closeIconClickEventHandler);
        }
        if (this.isModal) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.dlgOverlay, 'click', this.dlgOverlayClickEventHandler);
        }
        if (this.buttons.length > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.buttons[0].buttonModel) && this.footerTemplate === '') {
            for (var i = 0; i < this.buttons.length; i++) {
                if (typeof (this.buttons[i].click) === 'function') {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.ftrTemplateContent.children[i], 'click', this.buttons[i].click);
                }
            }
        }
    };
    /**
     * Refreshes the dialog's position when the user changes its header and footer height/width dynamically.
     * @return {void}
     */
    Dialog.prototype.refreshPosition = function () {
        this.popupObj.refreshPosition();
    };
    /**
     * Opens the dialog if it is in hidden state.
     * To open the dialog with full screen width, set the parameter to true.
     * @param { boolean } isFullScreen - Enable the fullScreen Dialog.
     * @return {void}
     */
    Dialog.prototype.show = function (isFullScreen) {
        var _this = this;
        if (!this.element.classList.contains(ROOT)) {
            return;
        }
        if (!this.element.classList.contains(DLG_SHOW) || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(isFullScreen))) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(isFullScreen)) {
                this.fullScreen(isFullScreen);
            }
            var eventArgs_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? {
                cancel: false,
                element: this.element,
                container: this.isModal ? this.dlgContainer : this.element,
                maxHeight: this.element.style.maxHeight
            } : {
                cancel: false,
                element: this.element,
                container: this.isModal ? this.dlgContainer : this.element,
                target: this.target,
                maxHeight: this.element.style.maxHeight
            };
            this.trigger('beforeOpen', eventArgs_1, function (beforeOpenArgs) {
                if (!beforeOpenArgs.cancel) {
                    if (_this.element.style.maxHeight !== eventArgs_1.maxHeight) {
                        _this.allowMaxHeight = false;
                        _this.element.style.maxHeight = eventArgs_1.maxHeight;
                    }
                    _this.storeActiveElement = document.activeElement;
                    _this.element.tabIndex = -1;
                    if (_this.isModal && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.dlgOverlay))) {
                        _this.dlgOverlay.style.display = 'block';
                        _this.dlgContainer.style.display = 'flex';
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.dlgOverlay], 'e-fade');
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.targetEle)) {
                            if (_this.targetEle === document.body) {
                                _this.dlgContainer.style.position = 'fixed';
                            }
                            else {
                                _this.dlgContainer.style.position = 'absolute';
                            }
                            _this.dlgOverlay.style.position = 'absolute';
                            _this.element.style.position = 'relative';
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.targetEle], [DLG_TARGET, SCROLL_DISABLED]);
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
                        }
                    }
                    var openAnimation = {
                        name: _this.animationSettings.effect + 'In',
                        duration: _this.animationSettings.duration,
                        delay: _this.animationSettings.delay
                    };
                    var zIndexElement = (_this.isModal) ? _this.element.parentElement : _this.element;
                    if (_this.calculatezIndex) {
                        _this.setzIndex(zIndexElement, true);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(_this.element, { 'zIndex': _this.zIndex });
                        if (_this.isModal) {
                            _this.setOverlayZindex(_this.zIndex);
                        }
                    }
                    _this.animationSettings.effect === 'None' ? _this.popupObj.show() : _this.popupObj.show(openAnimation);
                    _this.dialogOpen = true;
                    var prevOnChange = _this.isProtectedOnChange;
                    _this.isProtectedOnChange = true;
                    _this.visible = true;
                    _this.preventVisibility = true;
                    _this.isProtectedOnChange = prevOnChange;
                }
            });
        }
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    /**
     * Closes the dialog if it is in visible state.
     * @return {void}
     */
    Dialog.prototype.hide = function (event) {
        var _this = this;
        if (!this.element.classList.contains(ROOT)) {
            return;
        }
        if (this.preventVisibility) {
            var eventArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? {
                cancel: false,
                isInteracted: event ? true : false,
                element: this.element,
                container: this.isModal ? this.dlgContainer : this.element,
                event: event
            } : {
                cancel: false,
                isInteracted: event ? true : false,
                element: this.element,
                target: this.target,
                container: this.isModal ? this.dlgContainer : this.element,
                event: event
            };
            this.closeArgs = eventArgs;
            this.trigger('beforeClose', eventArgs, function (beforeCloseArgs) {
                if (!beforeCloseArgs.cancel) {
                    if (_this.isModal) {
                        !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.targetEle) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.targetEle], [DLG_TARGET, SCROLL_DISABLED]) :
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
                    }
                    var closeAnimation = {
                        name: _this.animationSettings.effect + 'Out',
                        duration: _this.animationSettings.duration,
                        delay: _this.animationSettings.delay
                    };
                    _this.animationSettings.effect === 'None' ? _this.popupObj.hide() : _this.popupObj.hide(closeAnimation);
                    _this.dialogOpen = false;
                    var prevOnChange = _this.isProtectedOnChange;
                    _this.isProtectedOnChange = true;
                    _this.visible = false;
                    _this.preventVisibility = false;
                    _this.isProtectedOnChange = prevOnChange;
                }
            });
        }
    };
    /**
     * Specifies to view the Full screen Dialog.
     * @private
     */
    Dialog.prototype.fullScreen = function (args) {
        var top = this.element.offsetTop;
        var left = this.element.offsetLeft;
        if (args) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], FULLSCREEN);
            var display = this.element.style.display;
            this.element.style.display = 'none';
            this.element.style.maxHeight = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) ?
                (this.targetEle.offsetHeight) + 'px' : (window.innerHeight) + 'px';
            this.element.style.display = display;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
            if (this.allowDragging && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dragObj)) {
                this.dragObj.destroy();
            }
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], FULLSCREEN);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([document.body], [DLG_TARGET, SCROLL_DISABLED]);
            if (this.allowDragging && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.headerContent))) {
                this.setAllowDragging();
            }
        }
        return args;
    };
    /**
     * Returns the dialog button instances.
     * Based on that, you can dynamically change the button states.
     * @param { number } index - Index of the button.
     * @return {Button}
     */
    Dialog.prototype.getButtons = function (index) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            return this.btnObj[index];
        }
        return this.btnObj;
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Dialog.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Dialog.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Dialog.prototype, "showCloseIcon", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Dialog.prototype, "isModal", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Dialog.prototype, "header", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Dialog.prototype, "visible", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Dialog.prototype, "enableResize", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(['South-East'])
    ], Dialog.prototype, "resizeHandles", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Dialog.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Dialog.prototype, "minHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('100%')
    ], Dialog.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Dialog.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], Dialog.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Dialog.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Dialog.prototype, "footerTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Dialog.prototype, "allowDragging", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([{}], ButtonProps)
    ], Dialog.prototype, "buttons", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Dialog.prototype, "closeOnEscape", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, AnimationSettings)
    ], Dialog.prototype, "animationSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ X: 'center', Y: 'center' }, _popup_popup__WEBPACK_IMPORTED_MODULE_2__["PositionData"])
    ], Dialog.prototype, "position", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "beforeSanitizeHtml", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "dragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "dragStop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "drag", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "overlayClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "resizeStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "resizing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "resizeStop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Dialog.prototype, "destroyed", void 0);
    Dialog = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Dialog);
    return Dialog;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));

/**
 * Base for creating Alert and Confirmation Dialog through util method.
 */
var DialogUtility;
(function (DialogUtility) {
    /**
     * An alert dialog box is used to display warning like messages to the users.
     * ```
     * Eg : DialogUtility.alert('Alert message');
     *
     * ```
     */
    /* istanbul ignore next */
    function alert(args) {
        var dialogComponent;
        var dialogElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { 'className': DLG_UTIL_ALERT });
        document.body.appendChild(dialogElement);
        var alertDialogObj;
        var okButtonModel = [{
                buttonModel: { isPrimary: true, content: 'OK' },
                click: function () {
                    this.hide();
                }
            }];
        if (typeof (args) === 'string') {
            alertDialogObj = createDialog({ content: args,
                position: { X: 'center', Y: 'top' },
                isModal: true, header: DLG_UTIL_DEFAULT_TITLE,
                buttons: okButtonModel }, dialogElement);
        }
        else {
            alertDialogObj = createDialog(alertOptions(args), dialogElement);
        }
        alertDialogObj.close = function () {
            if (args && args.close) {
                args.close.apply(alertDialogObj);
            }
            alertDialogObj.destroy();
            if (alertDialogObj.element.classList.contains('e-dlg-modal')) {
                alertDialogObj.element.parentElement.remove();
                alertDialogObj.target.classList.remove(DLG_UTIL_ROOT);
            }
            else {
                alertDialogObj.element.remove();
            }
        };
        return alertDialogObj;
    }
    DialogUtility.alert = alert;
    /**
     * A confirm dialog displays a specified message along with ‘OK’ and ‘Cancel’ button.
     * ```
     * Eg : DialogUtility.confirm('Confirm dialog message');
     *
     * ```
     */
    /* istanbul ignore next */
    function confirm(args) {
        var dialogComponent;
        var dialogElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { 'className': DLG_UTIL_CONFIRM });
        document.body.appendChild(dialogElement);
        var confirmDialogObj;
        var okCancelButtonModel = [{
                buttonModel: { isPrimary: true, content: 'OK' },
                click: function () {
                    this.hide();
                }
            }, {
                buttonModel: { content: 'Cancel' },
                click: function () {
                    this.hide();
                }
            }];
        if (typeof (args) === 'string') {
            confirmDialogObj = createDialog({ position: { X: 'center', Y: 'top' }, content: args, isModal: true,
                header: DLG_UTIL_DEFAULT_TITLE, buttons: okCancelButtonModel
            }, dialogElement);
        }
        else {
            confirmDialogObj = createDialog(confirmOptions(args), dialogElement);
        }
        confirmDialogObj.close = function () {
            if (args && args.close) {
                args.close.apply(confirmDialogObj);
            }
            confirmDialogObj.destroy();
            if (confirmDialogObj.element.classList.contains('e-dlg-modal')) {
                confirmDialogObj.element.parentElement.remove();
                confirmDialogObj.target.classList.remove(DLG_UTIL_ROOT);
            }
            else {
                confirmDialogObj.element.remove();
            }
        };
        return confirmDialogObj;
    }
    DialogUtility.confirm = confirm;
    function createDialog(options, element) {
        var dialogObject = new Dialog(options);
        dialogObject.appendTo(element);
        return dialogObject;
    }
    function alertOptions(option) {
        var options = {};
        options.buttons = [];
        options = formOptions(options, option);
        options = setAlertButtonModel(options, option);
        return options;
    }
    function confirmOptions(option) {
        var options = {};
        options.buttons = [];
        options = formOptions(options, option);
        options = setConfirmButtonModel(options, option);
        return options;
    }
    function formOptions(options, option) {
        options.header = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.title) ? option.title : DLG_UTIL_DEFAULT_TITLE;
        options.content = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.content) ? option.content : '';
        options.isModal = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.isModal) ? option.isModal : true;
        options.showCloseIcon = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.showCloseIcon) ? option.showCloseIcon : false;
        options.allowDragging = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.isDraggable) ? option.isDraggable : false;
        options.closeOnEscape = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.closeOnEscape) ? option.closeOnEscape : false;
        options.position = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.position) ? option.position : { X: 'center', Y: 'top' };
        options.animationSettings = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.animationSettings) ? option.animationSettings :
            { effect: 'Fade', duration: 400, delay: 0 };
        options.cssClass = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.cssClass) ? option.cssClass : '';
        options.zIndex = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.zIndex) ? option.zIndex : 1000;
        options.open = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.open) ? option.open : null;
        return options;
    }
    function setAlertButtonModel(options, option) {
        var alertButtonModel = [{
                buttonModel: { isPrimary: true, content: 'OK' },
                click: function () {
                    this.hide();
                }
            }];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.okButton)) {
            options.buttons[0] = formButtonModel(options.buttons[0], option.okButton, alertButtonModel[0]);
        }
        else {
            options.buttons = alertButtonModel;
        }
        return options;
    }
    function setConfirmButtonModel(options, option) {
        var okButtonModel = {
            buttonModel: { isPrimary: true, content: 'OK' },
            click: function () {
                this.hide();
            }
        };
        var cancelButtonModel = {
            buttonModel: { content: 'Cancel' },
            click: function () {
                this.hide();
            }
        };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.okButton)) {
            options.buttons[0] = formButtonModel(options.buttons[0], option.okButton, okButtonModel);
        }
        else {
            options.buttons[0] = okButtonModel;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.cancelButton)) {
            options.buttons[1] = formButtonModel(options.buttons[1], option.cancelButton, cancelButtonModel);
        }
        else {
            options.buttons[1] = cancelButtonModel;
        }
        return options;
    }
    function formButtonModel(buttonModel, option, buttonPropModel) {
        var buttonProps = buttonPropModel;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.text)) {
            buttonProps.buttonModel.content = option.text;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.icon)) {
            buttonProps.buttonModel.iconCss = option.icon;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.cssClass)) {
            buttonProps.buttonModel.cssClass = option.cssClass;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(option.click)) {
            buttonProps.click = option.click;
        }
        return buttonProps;
    }
})(DialogUtility || (DialogUtility = {}));


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/dialog/index.js":
/*!******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/dialog/index.js ***!
  \******************************************************************/
/*! exports provided: ButtonProps, AnimationSettings, Dialog, DialogUtility */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dialog */ "./ej2-resources/18.4.46/scripts/ej2-popups/dialog/dialog.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonProps", function() { return _dialog__WEBPACK_IMPORTED_MODULE_0__["ButtonProps"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return _dialog__WEBPACK_IMPORTED_MODULE_0__["AnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dialog", function() { return _dialog__WEBPACK_IMPORTED_MODULE_0__["Dialog"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DialogUtility", function() { return _dialog__WEBPACK_IMPORTED_MODULE_0__["DialogUtility"]; });

/**
 * Dialog Component
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js":
/*!***********************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/index.js ***!
  \***********************************************************/
/*! exports provided: PositionData, Popup, getScrollableParent, getZindexPartial, getMaxZindex, calculateRelativeBasedPosition, calculatePosition, fit, isCollide, flip, ButtonProps, AnimationSettings, Dialog, DialogUtility, Animation, Tooltip, Spinner, createSpinner, showSpinner, hideSpinner, setSpinner */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _popup_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./popup/index */ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PositionData", function() { return _popup_index__WEBPACK_IMPORTED_MODULE_0__["PositionData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popup", function() { return _popup_index__WEBPACK_IMPORTED_MODULE_0__["Popup"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getScrollableParent", function() { return _popup_index__WEBPACK_IMPORTED_MODULE_0__["getScrollableParent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getZindexPartial", function() { return _popup_index__WEBPACK_IMPORTED_MODULE_0__["getZindexPartial"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaxZindex", function() { return _popup_index__WEBPACK_IMPORTED_MODULE_0__["getMaxZindex"]; });

/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "calculateRelativeBasedPosition", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["calculateRelativeBasedPosition"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "calculatePosition", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["calculatePosition"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fit", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["fit"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isCollide", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["isCollide"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _common_index__WEBPACK_IMPORTED_MODULE_1__["flip"]; });

/* harmony import */ var _dialog_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dialog/index */ "./ej2-resources/18.4.46/scripts/ej2-popups/dialog/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonProps", function() { return _dialog_index__WEBPACK_IMPORTED_MODULE_2__["ButtonProps"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return _dialog_index__WEBPACK_IMPORTED_MODULE_2__["AnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dialog", function() { return _dialog_index__WEBPACK_IMPORTED_MODULE_2__["Dialog"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DialogUtility", function() { return _dialog_index__WEBPACK_IMPORTED_MODULE_2__["DialogUtility"]; });

/* harmony import */ var _tooltip_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tooltip/index */ "./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return _tooltip_index__WEBPACK_IMPORTED_MODULE_3__["Animation"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _tooltip_index__WEBPACK_IMPORTED_MODULE_3__["Tooltip"]; });

/* harmony import */ var _spinner_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./spinner/index */ "./ej2-resources/18.4.46/scripts/ej2-popups/spinner/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return _spinner_index__WEBPACK_IMPORTED_MODULE_4__["Spinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createSpinner", function() { return _spinner_index__WEBPACK_IMPORTED_MODULE_4__["createSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showSpinner", function() { return _spinner_index__WEBPACK_IMPORTED_MODULE_4__["showSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hideSpinner", function() { return _spinner_index__WEBPACK_IMPORTED_MODULE_4__["hideSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSpinner", function() { return _spinner_index__WEBPACK_IMPORTED_MODULE_4__["setSpinner"]; });

/**
 * Popup Components
 */







/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/index.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/popup/index.js ***!
  \*****************************************************************/
/*! exports provided: PositionData, Popup, getScrollableParent, getZindexPartial, getMaxZindex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./popup */ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/popup.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PositionData", function() { return _popup__WEBPACK_IMPORTED_MODULE_0__["PositionData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popup", function() { return _popup__WEBPACK_IMPORTED_MODULE_0__["Popup"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getScrollableParent", function() { return _popup__WEBPACK_IMPORTED_MODULE_0__["getScrollableParent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getZindexPartial", function() { return _popup__WEBPACK_IMPORTED_MODULE_0__["getZindexPartial"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaxZindex", function() { return _popup__WEBPACK_IMPORTED_MODULE_0__["getMaxZindex"]; });

/**
 * Popup Components
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/popup.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/popup/popup.js ***!
  \*****************************************************************/
/*! exports provided: PositionData, Popup, getScrollableParent, getZindexPartial, getMaxZindex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PositionData", function() { return PositionData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Popup", function() { return Popup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollableParent", function() { return getScrollableParent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZindexPartial", function() { return getZindexPartial; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxZindex", function() { return getMaxZindex; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _common_position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/position */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js");
/* harmony import */ var _common_collision__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/collision */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/collision.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








/**
 * Specifies the offset position values.
 */
var PositionData = /** @__PURE__ @class */ (function (_super) {
    __extends(PositionData, _super);
    function PositionData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('left')
    ], PositionData.prototype, "X", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('top')
    ], PositionData.prototype, "Y", void 0);
    return PositionData;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

// don't use space in classNames
var CLASSNAMES = {
    ROOT: 'e-popup',
    RTL: 'e-rtl',
    OPEN: 'e-popup-open',
    CLOSE: 'e-popup-close'
};
/**
 * Represents the Popup Component
 * ```html
 * <div id="popup" style="position:absolute;height:100px;width:100px;">
 * <div style="margin:35px 25px;">Popup Content</div></div>
 * ```
 * ```typescript
 * <script>
 *   var popupObj = new Popup();
 *   popupObj.appendTo("#popup");
 * </script>
 * ```
 */
var Popup = /** @__PURE__ @class */ (function (_super) {
    __extends(Popup, _super);
    function Popup(element, options) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Called internally if any of the property value changed.
     * @private
     */
    Popup.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'width':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width) });
                    break;
                case 'height':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height) });
                    break;
                case 'zIndex':
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'zIndex': newProp.zIndex });
                    break;
                case 'enableRtl':
                    this.setEnableRtl();
                    break;
                case 'position':
                case 'relateTo':
                    this.refreshPosition();
                    break;
                case 'offsetX':
                    var x = newProp.offsetX - oldProp.offsetX;
                    this.element.style.left = (parseInt(this.element.style.left, 10) + (x)).toString() + 'px';
                    break;
                case 'offsetY':
                    var y = newProp.offsetY - oldProp.offsetY;
                    this.element.style.top = (parseInt(this.element.style.top, 10) + (y)).toString() + 'px';
                    break;
                case 'content':
                    this.setContent();
                    break;
                case 'actionOnScroll':
                    if (newProp.actionOnScroll !== 'none') {
                        this.wireScrollEvents();
                    }
                    else {
                        this.unwireScrollEvents();
                    }
                    break;
            }
        }
    };
    /**
     * gets the Component module name.
     * @private
     */
    Popup.prototype.getModuleName = function () {
        return 'popup';
    };
    /**
     * To resolve if any collision occurs.
     */
    Popup.prototype.resolveCollision = function () {
        this.checkCollision();
    };
    /**
     * gets the persisted state properties of the Component.
     */
    Popup.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * To destroy the control.
     */
    Popup.prototype.destroy = function () {
        this.element.classList.remove(CLASSNAMES.ROOT, CLASSNAMES.RTL, CLASSNAMES.OPEN, CLASSNAMES.CLOSE);
        this.unwireEvents();
        _super.prototype.destroy.call(this);
    };
    /**
     * To Initialize the control rendering
     * @private
     */
    Popup.prototype.render = function () {
        this.element.classList.add(CLASSNAMES.ROOT);
        var styles = {};
        if (this.zIndex !== 1000) {
            styles.zIndex = this.zIndex;
        }
        if (this.width !== 'auto') {
            styles.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width);
        }
        if (this.height !== 'auto') {
            styles.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, styles);
        this.fixedParent = false;
        this.setEnableRtl();
        this.setContent();
    };
    Popup.prototype.wireEvents = function () {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(window, 'orientationchange', this.orientationOnChange, this);
        }
        if (this.actionOnScroll !== 'none') {
            this.wireScrollEvents();
        }
    };
    Popup.prototype.wireScrollEvents = function () {
        if (this.getRelateToElement()) {
            for (var _i = 0, _a = this.getScrollableParent(this.getRelateToElement()); _i < _a.length; _i++) {
                var parent_1 = _a[_i];
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(parent_1, 'scroll', this.scrollRefresh, this);
            }
        }
    };
    Popup.prototype.unwireEvents = function () {
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(window, 'orientationchange', this.orientationOnChange);
        }
        if (this.actionOnScroll !== 'none') {
            this.unwireScrollEvents();
        }
    };
    Popup.prototype.unwireScrollEvents = function () {
        if (this.getRelateToElement()) {
            for (var _i = 0, _a = this.getScrollableParent(this.getRelateToElement()); _i < _a.length; _i++) {
                var parent_2 = _a[_i];
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(parent_2, 'scroll', this.scrollRefresh);
            }
        }
    };
    Popup.prototype.getRelateToElement = function () {
        var relateToElement = this.relateTo === '' || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.relateTo) ?
            document.body : this.relateTo;
        this.setProperties({ relateTo: relateToElement }, true);
        return ((typeof this.relateTo) === 'string') ?
            document.querySelector(this.relateTo) : this.relateTo;
    };
    Popup.prototype.scrollRefresh = function (e) {
        if (this.actionOnScroll === 'reposition') {
            if (!(this.element.offsetParent === e.target ||
                (this.element.offsetParent && this.element.offsetParent.tagName === 'BODY' &&
                    e.target.parentElement == null))) {
                this.refreshPosition();
            }
        }
        else if (this.actionOnScroll === 'hide') {
            this.hide();
        }
        if (this.actionOnScroll !== 'none') {
            if (this.getRelateToElement()) {
                var targetVisible = this.isElementOnViewport(this.getRelateToElement(), e.target);
                if (!targetVisible && !this.targetInvisibleStatus) {
                    this.trigger('targetExitViewport');
                    this.targetInvisibleStatus = true;
                }
                else if (targetVisible) {
                    this.targetInvisibleStatus = false;
                }
            }
        }
    };
    /**
     * This method is to get the element visibility on viewport when scroll
     * the page. This method will returns true even though 1 px of element
     * part is in visible.
     */
    Popup.prototype.isElementOnViewport = function (relateToElement, scrollElement) {
        var scrollParents = this.getScrollableParent(relateToElement);
        for (var parent_3 = 0; parent_3 < scrollParents.length; parent_3++) {
            if (this.isElementVisible(relateToElement, scrollParents[parent_3])) {
                continue;
            }
            else {
                return false;
            }
        }
        return true;
    };
    Popup.prototype.isElementVisible = function (relateToElement, scrollElement) {
        var rect = this.checkGetBoundingClientRect(relateToElement);
        if (!rect.height || !rect.width) {
            return false;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.checkGetBoundingClientRect(scrollElement))) {
            var parent_4 = scrollElement.getBoundingClientRect();
            return !(rect.bottom < parent_4.top) &&
                (!(rect.bottom > parent_4.bottom) &&
                    (!(rect.right > parent_4.right) &&
                        !(rect.left < parent_4.left)));
        }
        else {
            var win = window;
            var windowView = {
                top: win.scrollY,
                left: win.scrollX,
                right: win.scrollX + win.outerWidth,
                bottom: win.scrollY + win.outerHeight
            };
            var off = Object(_common_position__WEBPACK_IMPORTED_MODULE_1__["calculatePosition"])(relateToElement);
            var ele = {
                top: off.top,
                left: off.left,
                right: off.left + rect.width,
                bottom: off.top + rect.height
            };
            var elementView = {
                top: windowView.bottom - ele.top,
                left: windowView.right - ele.left,
                bottom: ele.bottom - windowView.top,
                right: ele.right - windowView.left
            };
            return elementView.top > 0
                && elementView.left > 0
                && elementView.right > 0
                && elementView.bottom > 0;
        }
    };
    /**
     * Initialize the event handler
     * @private
     */
    Popup.prototype.preRender = function () {
        //There is no event handler
    };
    Popup.prototype.setEnableRtl = function () {
        this.reposition();
        this.enableRtl ? this.element.classList.add(CLASSNAMES.RTL) : this.element.classList.remove(CLASSNAMES.RTL);
    };
    Popup.prototype.setContent = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content)) {
            this.element.innerHTML = '';
            if (typeof (this.content) === 'string') {
                this.element.textContent = this.content;
            }
            else {
                this.element.appendChild(this.content);
            }
        }
    };
    Popup.prototype.orientationOnChange = function () {
        var _this = this;
        setTimeout(function () {
            _this.refreshPosition();
        }, 200);
    };
    /**
     * Based on the `relative` element and `offset` values, `Popup` element position will refreshed.
     */
    Popup.prototype.refreshPosition = function (target, collision) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            this.checkFixedParent(target);
        }
        this.reposition();
        if (!collision) {
            this.checkCollision();
        }
    };
    Popup.prototype.reposition = function () {
        var pos;
        var position;
        var relateToElement = this.getRelateToElement();
        if (typeof this.position.X === 'number' && typeof this.position.Y === 'number') {
            pos = { left: this.position.X, top: this.position.Y };
        }
        else if ((typeof this.position.X === 'string' && typeof this.position.Y === 'number') ||
            (typeof this.position.X === 'number' && typeof this.position.Y === 'string')) {
            var display = this.element.style.display;
            var parentDisplay = void 0;
            this.element.style.display = 'block';
            if (this.element.classList.contains('e-dlg-modal')) {
                parentDisplay = this.element.parentElement.style.display;
                this.element.parentElement.style.display = 'block';
            }
            position = this.getAnchorPosition(relateToElement, this.element, this.position, this.offsetX, this.offsetY);
            if (typeof this.position.X === 'string') {
                pos = { left: position.left, top: this.position.Y };
            }
            else {
                pos = { left: this.position.X, top: position.top };
            }
            this.element.style.display = display;
            if (this.element.classList.contains('e-dlg-modal')) {
                this.element.parentElement.style.display = parentDisplay;
            }
        }
        else if (relateToElement) {
            var display = this.element.style.display;
            this.element.style.display = 'block';
            pos = this.getAnchorPosition(relateToElement, this.element, this.position, this.offsetX, this.offsetY);
            this.element.style.display = display;
        }
        else {
            pos = { left: 0, top: 0 };
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(pos)) {
            this.element.style.left = pos.left + 'px';
            this.element.style.top = pos.top + 'px';
        }
    };
    Popup.prototype.checkGetBoundingClientRect = function (ele) {
        var eleRect;
        try {
            eleRect = ele.getBoundingClientRect();
            return eleRect;
        }
        catch (error) {
            return null;
        }
    };
    Popup.prototype.getAnchorPosition = function (anchorEle, ele, position, offsetX, offsetY) {
        var eleRect = this.checkGetBoundingClientRect(ele);
        var anchorRect = this.checkGetBoundingClientRect(anchorEle);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eleRect) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(anchorRect)) {
            return null;
        }
        var anchor = anchorEle;
        var anchorPos = { left: 0, top: 0 };
        if (ele.offsetParent && ele.offsetParent.tagName === 'BODY' && anchorEle.tagName === 'BODY') {
            anchorPos = Object(_common_position__WEBPACK_IMPORTED_MODULE_1__["calculatePosition"])(anchorEle);
        }
        else {
            if ((ele.classList.contains('e-dlg-modal') && anchor.tagName !== 'BODY')) {
                ele = ele.parentElement;
            }
            anchorPos = Object(_common_position__WEBPACK_IMPORTED_MODULE_1__["calculateRelativeBasedPosition"])(anchor, ele);
        }
        switch (position.X) {
            default:
            case 'left':
                break;
            case 'center':
                if ((ele.classList.contains('e-dlg-modal') && anchor.tagName === 'BODY' && this.targetType === 'container')) {
                    anchorPos.left += (window.innerWidth / 2 - eleRect.width / 2);
                }
                else if (this.targetType === 'container') {
                    anchorPos.left += (anchorRect.width / 2 - eleRect.width / 2);
                }
                else {
                    anchorPos.left += (anchorRect.width / 2);
                }
                break;
            case 'right':
                if ((ele.classList.contains('e-dlg-modal') && anchor.tagName === 'BODY' && this.targetType === 'container')) {
                    anchorPos.left += (window.innerWidth - eleRect.width);
                }
                else if (this.targetType === 'container') {
                    anchorPos.left += (anchorRect.width - eleRect.width);
                }
                else {
                    anchorPos.left += (anchorRect.width);
                }
                break;
        }
        switch (position.Y) {
            default:
            case 'top':
                break;
            case 'center':
                if ((ele.classList.contains('e-dlg-modal') && anchor.tagName === 'BODY' && this.targetType === 'container')) {
                    anchorPos.top += (window.innerHeight / 2 - eleRect.height / 2);
                }
                else if (this.targetType === 'container') {
                    anchorPos.top += (anchorRect.height / 2 - eleRect.height / 2);
                }
                else {
                    anchorPos.top += (anchorRect.height / 2);
                }
                break;
            case 'bottom':
                if ((ele.classList.contains('e-dlg-modal') && anchor.tagName === 'BODY' && this.targetType === 'container')) {
                    anchorPos.top += (window.innerHeight - eleRect.height);
                }
                else if (this.targetType === 'container') {
                    anchorPos.top += (anchorRect.height - eleRect.height);
                }
                else {
                    anchorPos.top += (anchorRect.height);
                }
                break;
        }
        anchorPos.left += offsetX;
        anchorPos.top += offsetY;
        return anchorPos;
    };
    Popup.prototype.callFlip = function (param) {
        var relateToElement = this.getRelateToElement();
        Object(_common_collision__WEBPACK_IMPORTED_MODULE_2__["flip"])(this.element, relateToElement, this.offsetX, this.offsetY, this.position.X, this.position.Y, this.viewPortElement, param, this.fixedParent);
    };
    Popup.prototype.callFit = function (param) {
        if (Object(_common_collision__WEBPACK_IMPORTED_MODULE_2__["isCollide"])(this.element, this.viewPortElement).length !== 0) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.viewPortElement)) {
                var data = Object(_common_collision__WEBPACK_IMPORTED_MODULE_2__["fit"])(this.element, this.viewPortElement, param);
                if (param.X) {
                    this.element.style.left = data.left + 'px';
                }
                if (param.Y) {
                    this.element.style.top = data.top + 'px';
                }
            }
            else {
                var elementRect = this.checkGetBoundingClientRect(this.element);
                var viewPortRect = this.checkGetBoundingClientRect(this.viewPortElement);
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(elementRect) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(viewPortRect)) {
                    return null;
                }
                if (param && param.Y === true) {
                    if (viewPortRect.top > elementRect.top) {
                        this.element.style.top = '0px';
                    }
                    else if (viewPortRect.bottom < elementRect.bottom) {
                        this.element.style.top = parseInt(this.element.style.top, 10) - (elementRect.bottom - viewPortRect.bottom) + 'px';
                    }
                }
                if (param && param.X === true) {
                    if (viewPortRect.right < elementRect.right) {
                        this.element.style.left = parseInt(this.element.style.left, 10) - (elementRect.right - viewPortRect.right) + 'px';
                    }
                    else if (viewPortRect.left > elementRect.left) {
                        this.element.style.left = parseInt(this.element.style.left, 10) + (viewPortRect.left - elementRect.left) + 'px';
                    }
                }
            }
        }
    };
    Popup.prototype.checkCollision = function () {
        var horz = this.collision.X;
        var vert = this.collision.Y;
        if (horz === 'none' && vert === 'none') {
            return;
        }
        if (horz === 'flip' && vert === 'flip') {
            this.callFlip({ X: true, Y: true });
        }
        else if (horz === 'fit' && vert === 'fit') {
            this.callFit({ X: true, Y: true });
        }
        else {
            if (horz === 'flip') {
                this.callFlip({ X: true, Y: false });
            }
            else if (vert === 'flip') {
                this.callFlip({ Y: true, X: false });
            }
            if (horz === 'fit') {
                this.callFit({ X: true, Y: false });
            }
            else if (vert === 'fit') {
                this.callFit({ X: false, Y: true });
            }
        }
    };
    /**
     * Shows the popup element from screen.
     * @param { AnimationModel | Function } collisionOrAnimationOptions? - To pass animation options or collision function.
     * @param { Function } collision? - To pass the collision function.
     * @param { HTMLElement } relativeElement? - To calculate the zIndex value dynamically.
     */
    Popup.prototype.show = function (animationOptions, relativeElement) {
        var _this = this;
        this.wireEvents();
        if (this.zIndex === 1000 || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(relativeElement)) {
            var zIndexElement = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(relativeElement)) ? this.element : relativeElement;
            this.zIndex = getZindexPartial(zIndexElement);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.element, { 'zIndex': this.zIndex });
        }
        animationOptions = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animationOptions) && typeof animationOptions === 'object') ?
            animationOptions : this.showAnimation;
        if (this.collision.X !== 'none' || this.collision.Y !== 'none') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], CLASSNAMES.CLOSE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], CLASSNAMES.OPEN);
            this.checkCollision();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], CLASSNAMES.OPEN);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], CLASSNAMES.CLOSE);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animationOptions)) {
            animationOptions.begin = function () {
                if (!_this.isDestroyed) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], CLASSNAMES.CLOSE);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], CLASSNAMES.OPEN);
                }
            };
            animationOptions.end = function () {
                if (!_this.isDestroyed) {
                    _this.trigger('open');
                }
            };
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animationOptions).animate(this.element);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], CLASSNAMES.CLOSE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], CLASSNAMES.OPEN);
            this.trigger('open');
        }
    };
    /**
     * Hides the popup element from screen.
     * @param { AnimationModel } animationOptions? - To give the animation options.
     */
    Popup.prototype.hide = function (animationOptions) {
        var _this = this;
        animationOptions = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animationOptions) && typeof animationOptions === 'object') ?
            animationOptions : this.hideAnimation;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animationOptions)) {
            animationOptions.end = function () {
                if (!_this.isDestroyed) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([_this.element], CLASSNAMES.OPEN);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], CLASSNAMES.CLOSE);
                    _this.trigger('close');
                }
            };
            new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"](animationOptions).animate(this.element);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], CLASSNAMES.OPEN);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], CLASSNAMES.CLOSE);
            this.trigger('close');
        }
        this.unwireEvents();
    };
    /**
     * Gets scrollable parent elements for the given element.
     * @param { HTMLElement } element - Specify the element to get the scrollable parents of it.
     */
    Popup.prototype.getScrollableParent = function (element) {
        this.checkFixedParent(element);
        return getScrollableParent(element, this.fixedParent);
    };
    Popup.prototype.checkFixedParent = function (element) {
        var parent = element.parentElement;
        while (parent && parent.tagName !== 'HTML') {
            var parentStyle = getComputedStyle(parent);
            if (parentStyle.position === 'fixed' && this.element.offsetParent && this.element.offsetParent.tagName === 'BODY') {
                this.element.style.position = 'fixed';
                this.fixedParent = true;
            }
            parent = parent.parentElement;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.element.offsetParent) && parentStyle.position === 'fixed'
                && this.element.style.position === 'fixed') {
                this.fixedParent = true;
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Popup.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Popup.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Popup.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('container')
    ], Popup.prototype, "targetType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Popup.prototype, "viewPortElement", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({ X: 'none', Y: 'none' })
    ], Popup.prototype, "collision", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Popup.prototype, "relateTo", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, PositionData)
    ], Popup.prototype, "position", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Popup.prototype, "offsetX", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Popup.prototype, "offsetY", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(1000)
    ], Popup.prototype, "zIndex", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Popup.prototype, "enableRtl", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('reposition')
    ], Popup.prototype, "actionOnScroll", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Popup.prototype, "showAnimation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(null)
    ], Popup.prototype, "hideAnimation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Popup.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Popup.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Popup.prototype, "targetExitViewport", void 0);
    Popup = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Popup);
    return Popup;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));

/**
 * Gets scrollable parent elements for the given element.
 * @param { HTMLElement } element - Specify the element to get the scrollable parents of it.
 * @private
 */
function getScrollableParent(element, fixedParent) {
    var eleStyle = getComputedStyle(element);
    var scrollParents = [];
    var overflowRegex = /(auto|scroll)/;
    var parent = element.parentElement;
    while (parent && parent.tagName !== 'HTML') {
        var parentStyle = getComputedStyle(parent);
        if (!(eleStyle.position === 'absolute' && parentStyle.position === 'static')
            && overflowRegex.test(parentStyle.overflow + parentStyle.overflowY + parentStyle.overflowX)) {
            scrollParents.push(parent);
        }
        parent = parent.parentElement;
    }
    if (!fixedParent) {
        scrollParents.push(document);
    }
    return scrollParents;
}
/**
 * Gets the maximum z-index of the given element.
 * @param { HTMLElement } element - Specify the element to get the maximum z-index of it.
 * @private
 */
function getZindexPartial(element) {
    // upto body traversal
    var parent = element.parentElement;
    var parentZindex = [];
    while (parent) {
        if (parent.tagName !== 'BODY') {
            var index = document.defaultView.getComputedStyle(parent, null).getPropertyValue('z-index');
            var position = document.defaultView.getComputedStyle(parent, null).getPropertyValue('position');
            if (index !== 'auto' && position !== 'static') {
                parentZindex.push(index);
            }
            parent = parent.parentElement;
        }
        else {
            break;
        }
    }
    //Body direct children element traversal
    var childrenZindex = [];
    for (var i = 0; i < document.body.children.length; i++) {
        if (!element.isEqualNode(document.body.children[i])) {
            var index = document.defaultView.getComputedStyle(document.body.children[i], null).getPropertyValue('z-index');
            var position = document.defaultView.getComputedStyle(document.body.children[i], null).getPropertyValue('position');
            if (index !== 'auto' && position !== 'static') {
                childrenZindex.push(index);
            }
        }
    }
    childrenZindex.push('999');
    var siblingsZindex = [];
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.parentElement) && element.parentElement.tagName !== 'BODY') {
        var childNodes = [].slice.call(element.parentElement.children);
        for (var i = 0; i < childNodes.length; i++) {
            var index = document.defaultView.getComputedStyle(childNodes[i], null).getPropertyValue('z-index');
            var position = document.defaultView.getComputedStyle(childNodes[i], null).getPropertyValue('position');
            if (index !== 'auto' && position !== 'static') {
                siblingsZindex.push(index);
            }
        }
    }
    var finalValue = parentZindex.concat(childrenZindex, siblingsZindex);
    var currentZindexValue = Math.max.apply(Math, finalValue) + 1;
    // Checking the max-zindex value
    return currentZindexValue > 2147483647 ? 2147483647 : currentZindexValue;
}
/**
 * Gets the maximum z-index of the page.
 * @param { HTMLElement } tagName - Specify the tagName to get the maximum z-index of it.
 * @private
 */
function getMaxZindex(tagName) {
    if (tagName === void 0) { tagName = ['*']; }
    var maxZindex = [];
    for (var i = 0; i < tagName.length; i++) {
        var elements = document.getElementsByTagName(tagName[i]);
        for (var i_1 = 0; i_1 < elements.length; i_1++) {
            var index = document.defaultView.getComputedStyle(elements[i_1], null).getPropertyValue('z-index');
            var position = document.defaultView.getComputedStyle(elements[i_1], null).getPropertyValue('position');
            if (index !== 'auto' && position !== 'static') {
                maxZindex.push(index);
            }
        }
    }
    var currentZindexValue = Math.max.apply(Math, maxZindex) + 1;
    return currentZindexValue > 2147483647 ? 2147483647 : currentZindexValue;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/spinner/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/spinner/index.js ***!
  \*******************************************************************/
/*! exports provided: Spinner, createSpinner, showSpinner, hideSpinner, setSpinner */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./spinner */ "./ej2-resources/18.4.46/scripts/ej2-popups/spinner/spinner.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_0__["Spinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createSpinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_0__["createSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "showSpinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_0__["showSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hideSpinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_0__["hideSpinner"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSpinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_0__["setSpinner"]; });

/**
 * spinner modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/spinner/spinner.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/spinner/spinner.js ***!
  \*********************************************************************/
/*! exports provided: Spinner, createSpinner, showSpinner, hideSpinner, setSpinner */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return Spinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSpinner", function() { return createSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showSpinner", function() { return showSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideSpinner", function() { return hideSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setSpinner", function() { return setSpinner; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");

var globalTimeOut = {};
var spinTemplate = null;
var spinCSSClass = null;
var DEFT_MAT_WIDTH = 30;
var DEFT_FAB_WIDTH = 30;
var DEFT_BOOT_WIDTH = 30;
var DEFT_BOOT4_WIDTH = 36;
var CLS_SHOWSPIN = 'e-spin-show';
var CLS_HIDESPIN = 'e-spin-hide';
var CLS_MATERIALSPIN = 'e-spin-material';
var CLS_FABRICSPIN = 'e-spin-fabric';
var CLS_BOOTSPIN = 'e-spin-bootstrap';
var CLS_BOOT4SPIN = 'e-spin-bootstrap4';
var CLS_HIGHCONTRASTSPIN = 'e-spin-high-contrast';
var CLS_SPINWRAP = 'e-spinner-pane';
var CLS_SPININWRAP = 'e-spinner-inner';
var CLS_SPINCIRCLE = 'e-path-circle';
var CLS_SPINARC = 'e-path-arc';
var CLS_SPINLABEL = 'e-spin-label';
var CLS_SPINTEMPLATE = 'e-spin-template';
/**
 * Function to change the Spinners in a page globally from application end.
 * ```
 * E.g : blazorSpinner({ action: "Create", options: {target: targetElement}, type: "" });
 * ```
 * @param args
 * @private
 */
function Spinner(action, options, target, type) {
    switch (action) {
        case 'Create':
            var element = document.querySelector(options.target);
            var args = { type: type, target: element, cssClass: options.cssClass,
                label: options.label, width: options.width };
            createSpinner(args);
            break;
        case 'Show':
            showSpinner(document.querySelector(target));
            break;
        case 'Hide':
            hideSpinner(document.querySelector(target));
            break;
        case 'Set':
            var setArgs = { cssClass: options.cssClass, type: type };
            setSpinner(setArgs);
            break;
    }
}
/**
 * Create a spinner for the specified target element.
 * ```
 * E.g : createSpinner({ target: targetElement, width: '34px', label: 'Loading..' });
 * ```
 * @param args
 * @private
 */
function createSpinner(args, internalCreateElement) {
    if (!args.target) {
        return;
    }
    var radius;
    var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
    var container = create_spinner_container(args.target, makeElement);
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.cssClass)) {
        container.wrap.classList.add(args.cssClass);
    }
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.template) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(spinTemplate)) {
        var template = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.template) ? args.template : spinTemplate;
        container.wrap.classList.add(CLS_SPINTEMPLATE);
        replaceContent(container.wrap, template, spinCSSClass);
    }
    else {
        var theme = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.type) ? args.type : getTheme(container.wrap);
        var width = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.width) ? args.width : undefined;
        radius = calculateRadius(width, theme);
        setTheme(theme, container.wrap, radius, makeElement);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.label)) {
            createLabel(container.inner_wrap, args.label, makeElement);
        }
    }
    container.wrap.classList.add(CLS_HIDESPIN);
    container = null;
}
function createLabel(container, label, makeElement) {
    var labelEle = makeElement('div', {});
    labelEle.classList.add(CLS_SPINLABEL);
    labelEle.textContent = label;
    container.appendChild(labelEle);
    return labelEle;
}
function createMaterialSpinner(container, radius, makeElement) {
    var uniqueID = random_generator();
    globalTimeOut[uniqueID] = { timeOut: 0, type: 'Material', radius: radius };
    create_material_element(container, uniqueID, makeElement, CLS_MATERIALSPIN);
    mat_calculate_attributes(radius, container, 'Material', CLS_MATERIALSPIN);
}
function createBootstrap4Spinner(container, radius, makeElement) {
    var uniqueID = random_generator();
    globalTimeOut[uniqueID] = { timeOut: 0, type: 'Bootstrap4', radius: radius };
    create_material_element(container, uniqueID, makeElement, CLS_BOOT4SPIN);
    mat_calculate_attributes(radius, container, 'Bootstrap4', CLS_BOOT4SPIN);
}
function startMatAnimate(container, uniqueID, radius) {
    var globalObject = {};
    var timeOutVar = 0;
    globalTimeOut[uniqueID].timeOut = 0;
    globalObject[uniqueID] = globalVariables(uniqueID, radius, 0, 0);
    var spinnerInfo = { uniqueID: uniqueID, container: container, globalInfo: globalObject, timeOutVar: timeOutVar };
    animateMaterial(spinnerInfo);
}
function createFabricSpinner(container, radius, makeElement) {
    var uniqueID = random_generator();
    globalTimeOut[uniqueID] = { timeOut: 0, type: 'Fabric', radius: radius };
    create_fabric_element(container, uniqueID, CLS_FABRICSPIN, makeElement);
    fb_calculate_attributes(radius, container, CLS_FABRICSPIN);
}
function createHighContrastSpinner(container, radius, makeElement) {
    var uniqueID = random_generator();
    globalTimeOut[uniqueID] = { timeOut: 0, type: 'HighContrast', radius: radius };
    create_fabric_element(container, uniqueID, CLS_HIGHCONTRASTSPIN, makeElement);
    fb_calculate_attributes(radius, container, CLS_HIGHCONTRASTSPIN);
}
function getTheme(container) {
    var theme = window.getComputedStyle(container, ':after').getPropertyValue('content');
    return theme.replace(/['"]+/g, '');
}
function setTheme(theme, container, radius, makeElement) {
    var innerContainer = container.querySelector('.' + CLS_SPININWRAP);
    var svg = innerContainer.querySelector('svg');
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(svg)) {
        innerContainer.removeChild(svg);
    }
    switch (theme) {
        case 'Material':
            createMaterialSpinner(innerContainer, radius, makeElement);
            break;
        case 'Fabric':
            createFabricSpinner(innerContainer, radius, makeElement);
            break;
        case 'Bootstrap':
            createBootstrapSpinner(innerContainer, radius, makeElement);
            break;
        case 'HighContrast':
            createHighContrastSpinner(innerContainer, radius, makeElement);
            break;
        case 'Bootstrap4':
            createBootstrap4Spinner(innerContainer, radius, makeElement);
            break;
    }
}
function createBootstrapSpinner(innerContainer, radius, makeElement) {
    var uniqueID = random_generator();
    globalTimeOut[uniqueID] = { timeOut: 0, type: 'Bootstrap', radius: radius };
    create_bootstrap_element(innerContainer, uniqueID, makeElement);
    boot_calculate_attributes(innerContainer, radius);
}
function create_bootstrap_element(innerContainer, uniqueID, makeElement) {
    var svgBoot = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    var viewBoxValue = 64;
    var trans = 32;
    var defaultRadius = 2;
    svgBoot.setAttribute('id', uniqueID);
    svgBoot.setAttribute('class', CLS_BOOTSPIN);
    svgBoot.setAttribute('viewBox', '0 0 ' + viewBoxValue + ' ' + viewBoxValue);
    innerContainer.insertBefore(svgBoot, innerContainer.firstChild);
    for (var item = 0; item <= 7; item++) {
        var bootCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
        bootCircle.setAttribute('class', CLS_SPINCIRCLE + '_' + item);
        bootCircle.setAttribute('r', defaultRadius + '');
        bootCircle.setAttribute('transform', 'translate(' + trans + ',' + trans + ')');
        svgBoot.appendChild(bootCircle);
    }
}
function boot_calculate_attributes(innerContainer, radius) {
    var svg = innerContainer.querySelector('svg.e-spin-bootstrap');
    svg.style.width = svg.style.height = radius + 'px';
    var x = 0;
    var y = 0;
    var rad = 24;
    var startArc = 90;
    for (var item = 0; item <= 7; item++) {
        var start = defineArcPoints(x, y, rad, startArc);
        var circleEle = svg.querySelector('.' + CLS_SPINCIRCLE + '_' + item);
        circleEle.setAttribute('cx', start.x + '');
        circleEle.setAttribute('cy', start.y + '');
        startArc = startArc >= 360 ? 0 : startArc;
        startArc = startArc + 45;
    }
}
function generateSeries(begin, stop) {
    var series = [];
    var start = begin;
    var end = stop;
    var increment = false;
    var count = 1;
    formSeries(start);
    function formSeries(i) {
        series.push(i);
        if (i !== end || count === 1) {
            if (i <= start && i > 1 && !increment) {
                i = parseFloat((i - 0.2).toFixed(2));
            }
            else if (i === 1) {
                i = 7;
                i = parseFloat((i + 0.2).toFixed(2));
                increment = true;
            }
            else if (i < 8 && increment) {
                i = parseFloat((i + 0.2).toFixed(2));
                if (i === 8) {
                    increment = false;
                }
            }
            else if (i <= 8 && !increment) {
                i = parseFloat((i - 0.2).toFixed(2));
            }
            ++count;
            formSeries(i);
        }
    }
    return series;
}
function animateBootstrap(innerContainer) {
    var svg = innerContainer.querySelector('svg.e-spin-bootstrap');
    var id = svg.getAttribute('id');
    for (var i = 1; i <= 8; i++) {
        var circleEle = (innerContainer.getElementsByClassName('e-path-circle_' +
            (i === 8 ? 0 : i))[0]);
        rotation(circleEle, i, i, generateSeries(i, i), id);
    }
    function rotation(circle, start, end, series, id) {
        var count = 0;
        boot_animate(start);
        function boot_animate(radius) {
            if (globalTimeOut[id].isAnimate) {
                ++count;
                circle.setAttribute('r', radius + '');
                if (count >= series.length) {
                    count = 0;
                }
                globalTimeOut[id].timeOut = setTimeout(boot_animate.bind(null, series[count]), 18);
            }
        }
    }
}
function replaceContent(container, template, cssClass) {
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClass)) {
        container.classList.add(cssClass);
    }
    var inner = container.querySelector('.e-spinner-inner');
    inner.innerHTML = template;
}
function calculateRadius(width, theme) {
    var defaultSize;
    switch (theme) {
        case 'Material':
            defaultSize = DEFT_MAT_WIDTH;
            break;
        case 'Fabric':
            defaultSize = DEFT_FAB_WIDTH;
            break;
        case 'Bootstrap4':
            defaultSize = DEFT_BOOT4_WIDTH;
            break;
        default:
            defaultSize = DEFT_BOOT_WIDTH;
    }
    width = width ? parseFloat(width + '') : defaultSize;
    return theme === 'Bootstrap' ? width : width / 2;
}
function globalVariables(id, radius, count, previousId) {
    return {
        radius: radius,
        count: count,
        previousId: previousId
    };
}
function random_generator() {
    var random = '';
    var combine = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    for (var i = 0; i < 5; i++) {
        random += combine.charAt(Math.floor(Math.random() * combine.length));
    }
    return random;
}
function create_fabric_element(innerCon, uniqueID, themeClass, makeElement) {
    var svgFabric = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    svgFabric.setAttribute('id', uniqueID);
    svgFabric.setAttribute('class', themeClass);
    var fabricCirclePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
    fabricCirclePath.setAttribute('class', CLS_SPINCIRCLE);
    var fabricCircleArc = document.createElementNS('http://www.w3.org/2000/svg', 'path');
    fabricCircleArc.setAttribute('class', CLS_SPINARC);
    innerCon.insertBefore(svgFabric, innerCon.firstChild);
    svgFabric.appendChild(fabricCirclePath);
    svgFabric.appendChild(fabricCircleArc);
}
function create_material_element(innerContainer, uniqueID, makeElement, cls) {
    var svgMaterial = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    svgMaterial.setAttribute('class', cls);
    svgMaterial.setAttribute('id', uniqueID);
    var matCirclePath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
    matCirclePath.setAttribute('class', CLS_SPINCIRCLE);
    innerContainer.insertBefore(svgMaterial, innerContainer.firstChild);
    svgMaterial.appendChild(matCirclePath);
}
function create_spinner_container(target, makeElement) {
    var spinnerContainer = makeElement('div', {});
    spinnerContainer.classList.add(CLS_SPINWRAP);
    var spinnerInnerContainer = makeElement('div', {});
    spinnerInnerContainer.classList.add(CLS_SPININWRAP);
    target.appendChild(spinnerContainer);
    spinnerContainer.appendChild(spinnerInnerContainer);
    return { wrap: spinnerContainer, inner_wrap: spinnerInnerContainer };
}
function animateMaterial(spinnerInfo) {
    var start = 1;
    var end = 149;
    var duration = 1333;
    var max = 75;
    createCircle(start, end, easeAnimation, duration, spinnerInfo.globalInfo[spinnerInfo.uniqueID].count, max, spinnerInfo);
    spinnerInfo.globalInfo[spinnerInfo.uniqueID].count = ++spinnerInfo.globalInfo[spinnerInfo.uniqueID].count % 4;
}
function createCircle(start, end, easing, duration, count, max, spinnerInfo) {
    var id = ++spinnerInfo.globalInfo[spinnerInfo.uniqueID].previousId;
    var startTime = new Date().getTime();
    var change = end - start;
    var diameter = getSize((spinnerInfo.globalInfo[spinnerInfo.uniqueID].radius * 2) + '');
    var strokeSize = getStrokeSize(diameter);
    var rotate = -90 * (spinnerInfo.globalInfo[spinnerInfo.uniqueID].count || 0);
    mat_animation(spinnerInfo);
    function mat_animation(spinnerInfo) {
        var currentTime = Math.max(0, Math.min(new Date().getTime() - startTime, duration));
        updatePath(easing(currentTime, start, change, duration), spinnerInfo.container);
        if (id === spinnerInfo.globalInfo[spinnerInfo.uniqueID].previousId && currentTime < duration) {
            globalTimeOut[spinnerInfo.uniqueID].timeOut = setTimeout(mat_animation.bind(null, spinnerInfo), 1);
        }
        else {
            animateMaterial(spinnerInfo);
        }
    }
    function updatePath(value, container) {
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(container.querySelector('svg.e-spin-material')))
            && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(container.querySelector('svg.e-spin-material').querySelector('path.e-path-circle')))) {
            var svg = container.querySelector('svg.e-spin-material');
            var path = svg.querySelector('path.e-path-circle');
            path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, value, max) + '');
            path.setAttribute('transform', 'rotate(' + (rotate) + ' ' + diameter / 2 + ' ' + diameter / 2 + ')');
        }
    }
}
function mat_calculate_attributes(radius, container, type, cls) {
    var diameter = radius * 2;
    var svg = container.querySelector('svg.' + cls);
    var path = svg.querySelector('path.e-path-circle');
    var strokeSize = getStrokeSize(diameter);
    var transformOrigin = (diameter / 2) + 'px';
    svg.setAttribute('viewBox', '0 0 ' + diameter + ' ' + diameter);
    svg.style.width = svg.style.height = diameter + 'px';
    svg.style.transformOrigin = transformOrigin + ' ' + transformOrigin + ' ' + transformOrigin;
    path.setAttribute('d', drawArc(diameter, strokeSize));
    if (type === 'Material') {
        path.setAttribute('stroke-width', strokeSize + '');
        path.setAttribute('stroke-dasharray', ((diameter - strokeSize) * Math.PI * 0.75) + '');
        path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, 1, 75) + '');
    }
}
function getSize(value) {
    var parsed = parseFloat(value);
    return parsed;
}
function drawArc(diameter, strokeSize) {
    var radius = diameter / 2;
    var offset = strokeSize / 2;
    return 'M' + radius + ',' + offset
        + 'A' + (radius - offset) + ',' + (radius - offset) + ' 0 1 1 ' + offset + ',' + radius;
}
function getStrokeSize(diameter) {
    return 10 / 100 * diameter;
}
function getDashOffset(diameter, strokeSize, value, max) {
    return (diameter - strokeSize) * Math.PI * ((3 * (max) / 100) - (value / 100));
}
function easeAnimation(current, start, change, duration) {
    var timestamp = (current /= duration) * current;
    var timecount = timestamp * current;
    return start + change * (6 * timecount * timestamp + -15 * timestamp * timestamp + 10 * timecount);
}
function fb_calculate_attributes(radius, innerConainer, trgClass) {
    var centerX = radius;
    var centerY = radius;
    var diameter = radius * 2;
    var startArc = 315;
    var endArc = 45;
    var svg = innerConainer.querySelector('.' + trgClass);
    var circle = svg.querySelector('.e-path-circle');
    var path = svg.querySelector('.e-path-arc');
    var transformOrigin = (diameter / 2) + 'px';
    circle.setAttribute('d', defineCircle(centerX, centerY, radius));
    path.setAttribute('d', defineArc(centerX, centerY, radius, startArc, endArc));
    svg.setAttribute('viewBox', '0 0 ' + diameter + ' ' + diameter);
    svg.style.transformOrigin = transformOrigin + ' ' + transformOrigin + ' ' + transformOrigin;
    svg.style.width = svg.style.height = diameter + 'px';
}
function defineArcPoints(centerX, centerY, radius, angle) {
    var radians = (angle - 90) * Math.PI / 180.0;
    return {
        x: centerX + (radius * Math.cos(radians)),
        y: centerY + (radius * Math.sin(radians))
    };
}
function defineArc(x, y, radius, startArc, endArc) {
    var start = defineArcPoints(x, y, radius, endArc);
    var end = defineArcPoints(x, y, radius, startArc);
    var d = [
        'M', start.x, start.y,
        'A', radius, radius, 0, 0, 0, end.x, end.y
    ].join(' ');
    return d;
}
function defineCircle(x, y, radius) {
    var d = [
        'M', x, y,
        'm', -radius, 0,
        'a', radius, radius, 0, 1, 0, radius * 2, 0,
        'a', radius, radius, 0, 1, 0, -radius * 2, 0,
    ].join(' ');
    return d;
}
/**
 * Function to show the Spinner.
 * @param container - Specify the target of the Spinner.
 * @private
 */
function showSpinner(container) {
    showHideSpinner(container, false);
    container = null;
}
function showHideSpinner(container, isHide) {
    var spinnerWrap;
    if (container) {
        spinnerWrap = container.classList.contains(CLS_SPINWRAP) ? container :
            container.querySelector('.' + CLS_SPINWRAP);
    }
    if (container && spinnerWrap) {
        var inner = spinnerWrap.querySelector('.' + CLS_SPININWRAP);
        var spinCheck = void 0;
        spinCheck = isHide ? !spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_HIDESPIN) :
            !spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_SHOWSPIN);
        if (spinCheck) {
            var svgEle = spinnerWrap.querySelector('svg');
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(svgEle)) {
                return;
            }
            var id = svgEle.getAttribute('id');
            globalTimeOut[id].isAnimate = !isHide;
            switch (globalTimeOut[id].type) {
                case 'Material':
                    isHide ? clearTimeout(globalTimeOut[id].timeOut) : startMatAnimate(inner, id, globalTimeOut[id].radius);
                    break;
                case 'Bootstrap':
                    isHide ? clearTimeout(globalTimeOut[id].timeOut) : animateBootstrap(inner);
                    break;
            }
        }
        isHide ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(spinnerWrap, [CLS_HIDESPIN], [CLS_SHOWSPIN]) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(spinnerWrap, [CLS_SHOWSPIN], [CLS_HIDESPIN]);
        container = null;
    }
}
/**
 * Function to hide the Spinner.
 * @param container - Specify the target of the Spinner.
 * @private
 */
function hideSpinner(container) {
    showHideSpinner(container, true);
    container = null;
}
/**
 * Function to change the Spinners in a page globally from application end.
 * ```
 * E.g : setSpinner({ cssClass: 'custom-css'; type: 'Material' });
 * ```
 * @param args
 * @private
 */
function setSpinner(args, internalCreateElement) {
    var makeElement = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(internalCreateElement) ? internalCreateElement : _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
    if (args.template !== undefined) {
        spinTemplate = args.template;
        if (args.template !== undefined) {
            spinCSSClass = args.cssClass;
        }
    }
    var container = document.querySelectorAll('.' + CLS_SPINWRAP);
    for (var index = 0; index < container.length; index++) {
        ensureTemplate(args.template, container[index], args.type, args.cssClass, makeElement);
    }
}
function ensureTemplate(template, container, theme, cssClass, makeEle) {
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(template) && !container.classList.contains(CLS_SPINTEMPLATE)) {
        replaceTheme(container, theme, cssClass, makeEle);
        if (container.classList.contains(CLS_SHOWSPIN)) {
            container.classList.remove(CLS_SHOWSPIN);
            showSpinner(container);
        }
        else {
            container.classList.remove(CLS_HIDESPIN);
            hideSpinner(container);
        }
    }
    else {
        spinTemplate = template;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClass)) {
            spinCSSClass = cssClass;
        }
    }
}
function replaceTheme(container, theme, cssClass, makeEle) {
    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cssClass)) {
        container.classList.add(cssClass);
    }
    var svgElement = container.querySelector('svg');
    var radius = theme === 'Bootstrap' ? parseFloat(svgElement.style.height) : parseFloat(svgElement.style.height) / 2;
    var classNames = svgElement.getAttribute('class');
    var svgClassList = classNames.split(/\s/);
    if (svgClassList.indexOf('e-spin-material') >= 0) {
        var id = svgElement.getAttribute('id');
        clearTimeout(globalTimeOut[id].timeOut);
    }
    setTheme(theme, container, radius, makeEle);
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/index.js":
/*!*******************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/index.js ***!
  \*******************************************************************/
/*! exports provided: Animation, Tooltip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tooltip */ "./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/tooltip.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return _tooltip__WEBPACK_IMPORTED_MODULE_0__["Animation"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _tooltip__WEBPACK_IMPORTED_MODULE_0__["Tooltip"]; });

/**
 * Tooltip modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/tooltip.js":
/*!*********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-popups/tooltip/tooltip.js ***!
  \*********************************************************************/
/*! exports provided: Animation, Tooltip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return Animation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _popup_popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../popup/popup */ "./ej2-resources/18.4.46/scripts/ej2-popups/popup/popup.js");
/* harmony import */ var _common_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/position */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/position.js");
/* harmony import */ var _common_collision__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/collision */ "./ej2-resources/18.4.46/scripts/ej2-popups/common/collision.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








var TOUCHEND_HIDE_DELAY = 1500;
var TAPHOLD_THRESHOLD = 500;
var SHOW_POINTER_TIP_GAP = 0;
var HIDE_POINTER_TIP_GAP = 8;
var MOUSE_TRAIL_GAP = 2;
var POINTER_ADJUST = 2;
var ROOT = 'e-tooltip';
var RTL = 'e-rtl';
var DEVICE = 'e-bigger';
var ICON = 'e-icons';
var CLOSE = 'e-tooltip-close';
var TOOLTIP_WRAP = 'e-tooltip-wrap';
var CONTENT = 'e-tip-content';
var ARROW_TIP = 'e-arrow-tip';
var ARROW_TIP_OUTER = 'e-arrow-tip-outer';
var ARROW_TIP_INNER = 'e-arrow-tip-inner';
var TIP_BOTTOM = 'e-tip-bottom';
var TIP_TOP = 'e-tip-top';
var TIP_LEFT = 'e-tip-left';
var TIP_RIGHT = 'e-tip-right';
var POPUP_ROOT = 'e-popup';
var POPUP_OPEN = 'e-popup-open';
var POPUP_CLOSE = 'e-popup-close';
var POPUP_LIB = 'e-lib';
var HIDE_POPUP = 'e-hidden';
var Animation = /** @__PURE__ @class */ (function (_super) {
    __extends(Animation, _super);
    function Animation() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({ effect: 'FadeIn', duration: 150, delay: 0 })
    ], Animation.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({ effect: 'FadeOut', duration: 150, delay: 0 })
    ], Animation.prototype, "close", void 0);
    return Animation;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));

/**
 * Represents the Tooltip component that displays a piece of information about the target element on mouse hover.
 * ```html
 * <div id="tooltip">Show Tooltip</div>
 * ```
 * ```typescript
 * <script>
 *   var tooltipObj = new Tooltip({ content: 'Tooltip text' });
 *   tooltipObj.appendTo("#tooltip");
 * </script>
 * ```
 */
var Tooltip = /** @__PURE__ @class */ (function (_super) {
    __extends(Tooltip, _super);
    /**
     * Constructor for creating the Tooltip Component
     */
    function Tooltip(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.isBlazorTooltip = false;
        _this.contentTargetValue = null;
        _this.contentEvent = null;
        _this.contentAnimation = null;
        return _this;
    }
    Tooltip.prototype.initialize = function () {
        this.formatPosition();
        if (!(this.isServerRender())) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], ROOT);
        }
    };
    Tooltip.prototype.isServerRender = function () {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isServerRendered;
    };
    Tooltip.prototype.formatPosition = function () {
        var _a, _b;
        if (this.position.indexOf('Top') === 0 || this.position.indexOf('Bottom') === 0) {
            _a = this.position.split(/(?=[A-Z])/), this.tooltipPositionY = _a[0], this.tooltipPositionX = _a[1];
        }
        else {
            _b = this.position.split(/(?=[A-Z])/), this.tooltipPositionX = _b[0], this.tooltipPositionY = _b[1];
        }
    };
    Tooltip.prototype.renderArrow = function () {
        this.setTipClass(this.position);
        if (!(this.isServerRender())) {
            var tip = this.createElement('div', { className: ARROW_TIP + ' ' + this.tipClass });
            tip.appendChild(this.createElement('div', { className: ARROW_TIP_OUTER + ' ' + this.tipClass }));
            tip.appendChild(this.createElement('div', { className: ARROW_TIP_INNER + ' ' + this.tipClass }));
            this.tooltipEle.appendChild(tip);
        }
        else {
            var tip = this.tooltipEle.querySelector('.' + ARROW_TIP);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tip.querySelector('.' + ARROW_TIP_OUTER)], this.tipClass);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tip.querySelector('.' + ARROW_TIP_INNER)], this.tipClass);
            this.tooltipEle.appendChild(tip);
        }
    };
    Tooltip.prototype.setTipClass = function (position) {
        if (position.indexOf('Right') === 0) {
            this.tipClass = TIP_LEFT;
        }
        else if (position.indexOf('Bottom') === 0) {
            this.tipClass = TIP_TOP;
        }
        else if (position.indexOf('Left') === 0) {
            this.tipClass = TIP_RIGHT;
        }
        else {
            this.tipClass = TIP_BOTTOM;
        }
    };
    Tooltip.prototype.renderPopup = function (target) {
        var elePos = this.mouseTrail ? { top: 0, left: 0 } : this.getTooltipPosition(target);
        this.tooltipEle.classList.remove(POPUP_LIB);
        this.popupObj = new _popup_popup__WEBPACK_IMPORTED_MODULE_1__["Popup"](this.tooltipEle, {
            height: this.height,
            width: this.width,
            position: { X: elePos.left, Y: elePos.top },
            enableRtl: this.enableRtl,
            open: this.openPopupHandler.bind(this),
            close: this.closePopupHandler.bind(this)
        });
    };
    Tooltip.prototype.getTooltipPosition = function (target) {
        this.tooltipEle.style.display = 'block';
        var pos = Object(_common_position__WEBPACK_IMPORTED_MODULE_2__["calculatePosition"])(target, this.tooltipPositionX, this.tooltipPositionY);
        var offsetPos = this.calculateTooltipOffset(this.position);
        var elePos = this.collisionFlipFit(target, pos.left + offsetPos.left, pos.top + offsetPos.top);
        this.tooltipEle.style.display = '';
        return elePos;
    };
    Tooltip.prototype.reposition = function (target) {
        var elePos = this.getTooltipPosition(target);
        this.popupObj.position = { X: elePos.left, Y: elePos.top };
        this.popupObj.dataBind();
    };
    Tooltip.prototype.openPopupHandler = function () {
        if (!this.mouseTrail && this.needTemplateReposition()) {
            this.reposition(this.findTarget());
        }
        this.trigger('afterOpen', this.tooltipEventArgs);
    };
    Tooltip.prototype.closePopupHandler = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.element.id + 'content', 'Content');
        this.clearTemplate(['content']);
        this.clear();
        this.trigger('afterClose', this.tooltipEventArgs);
    };
    Tooltip.prototype.calculateTooltipOffset = function (position) {
        var pos = { top: 0, left: 0 };
        var tooltipEleWidth = this.tooltipEle.offsetWidth;
        var tooltipEleHeight = this.tooltipEle.offsetHeight;
        var arrowEle = this.tooltipEle.querySelector('.' + ARROW_TIP);
        var tipWidth = arrowEle ? arrowEle.offsetWidth : 0;
        var tipHeight = arrowEle ? arrowEle.offsetHeight : 0;
        var tipAdjust = (this.showTipPointer ? SHOW_POINTER_TIP_GAP : HIDE_POINTER_TIP_GAP);
        var tipHeightAdjust = (tipHeight / 2) + POINTER_ADJUST + (this.tooltipEle.offsetHeight - this.tooltipEle.clientHeight);
        var tipWidthAdjust = (tipWidth / 2) + POINTER_ADJUST + (this.tooltipEle.offsetWidth - this.tooltipEle.clientWidth);
        if (this.mouseTrail) {
            tipAdjust += MOUSE_TRAIL_GAP;
        }
        switch (position) {
            case 'RightTop':
                pos.left += tipWidth + tipAdjust;
                pos.top -= tooltipEleHeight - tipHeightAdjust;
                break;
            case 'RightCenter':
                pos.left += tipWidth + tipAdjust;
                pos.top -= (tooltipEleHeight / 2);
                break;
            case 'RightBottom':
                pos.left += tipWidth + tipAdjust;
                pos.top -= (tipHeightAdjust);
                break;
            case 'BottomRight':
                pos.top += (tipHeight + tipAdjust);
                pos.left -= (tipWidthAdjust);
                break;
            case 'BottomCenter':
                pos.top += (tipHeight + tipAdjust);
                pos.left -= (tooltipEleWidth / 2);
                break;
            case 'BottomLeft':
                pos.top += (tipHeight + tipAdjust);
                pos.left -= (tooltipEleWidth - tipWidthAdjust);
                break;
            case 'LeftBottom':
                pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);
                pos.top -= (tipHeightAdjust);
                break;
            case 'LeftCenter':
                pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);
                pos.top -= (tooltipEleHeight / 2);
                break;
            case 'LeftTop':
                pos.left -= (tipWidth + tooltipEleWidth + tipAdjust);
                pos.top -= (tooltipEleHeight - tipHeightAdjust);
                break;
            case 'TopLeft':
                pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);
                pos.left -= (tooltipEleWidth - tipWidthAdjust);
                break;
            case 'TopRight':
                pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);
                pos.left -= (tipWidthAdjust);
                break;
            default:
                pos.top -= (tooltipEleHeight + tipHeight + tipAdjust);
                pos.left -= (tooltipEleWidth / 2);
                break;
        }
        pos.left += this.offsetX;
        pos.top += this.offsetY;
        return pos;
    };
    Tooltip.prototype.updateTipPosition = function (position) {
        var selEle = this.tooltipEle.querySelectorAll('.' + ARROW_TIP + ',.' + ARROW_TIP_OUTER + ',.' + ARROW_TIP_INNER);
        var removeList = [TIP_BOTTOM, TIP_TOP, TIP_LEFT, TIP_RIGHT];
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selEle, removeList);
        this.setTipClass(position);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(selEle, this.tipClass);
    };
    Tooltip.prototype.adjustArrow = function (target, position, tooltipPositionX, tooltipPositionY) {
        if (this.showTipPointer === false) {
            return;
        }
        this.updateTipPosition(position);
        var leftValue;
        var topValue;
        this.tooltipEle.style.display = 'block';
        var tooltipWidth = this.tooltipEle.clientWidth;
        var tooltipHeight = this.tooltipEle.clientHeight;
        var arrowEle = this.tooltipEle.querySelector('.' + ARROW_TIP);
        var arrowInnerELe = this.tooltipEle.querySelector('.' + ARROW_TIP_INNER);
        var tipWidth = arrowEle.offsetWidth;
        var tipHeight = arrowEle.offsetHeight;
        this.tooltipEle.style.display = '';
        if (this.tipClass === TIP_BOTTOM || this.tipClass === TIP_TOP) {
            if (this.tipClass === TIP_BOTTOM) {
                topValue = '99.9%';
                // Arrow icon aligned -2px height from ArrowOuterTip div
                arrowInnerELe.style.top = '-' + (tipHeight - 2) + 'px';
            }
            else {
                topValue = -(tipHeight - 1) + 'px';
                // Arrow icon aligned -6px height from ArrowOuterTip div
                arrowInnerELe.style.top = '-' + (tipHeight - 6) + 'px';
            }
            if (target) {
                var tipPosExclude = tooltipPositionX !== 'Center' || (tooltipWidth > target.offsetWidth) || this.mouseTrail;
                if ((tipPosExclude && tooltipPositionX === 'Left') || (!tipPosExclude && this.tipPointerPosition === 'End')) {
                    leftValue = (tooltipWidth - tipWidth - POINTER_ADJUST) + 'px';
                }
                else if ((tipPosExclude && tooltipPositionX === 'Right') || (!tipPosExclude && this.tipPointerPosition === 'Start')) {
                    leftValue = POINTER_ADJUST + 'px';
                }
                else {
                    leftValue = ((tooltipWidth / 2) - (tipWidth / 2)) + 'px';
                }
            }
        }
        else {
            if (this.tipClass === TIP_RIGHT) {
                leftValue = '99.9%';
                // Arrow icon aligned -2px left from ArrowOuterTip div
                arrowInnerELe.style.left = '-' + (tipWidth - 2) + 'px';
            }
            else {
                leftValue = -(tipWidth - 1) + 'px';
                // Arrow icon aligned -2px from ArrowOuterTip width
                arrowInnerELe.style.left = (-(tipWidth) + (tipWidth - 2)) + 'px';
            }
            var tipPosExclude = tooltipPositionY !== 'Center' || (tooltipHeight > target.offsetHeight) || this.mouseTrail;
            if ((tipPosExclude && tooltipPositionY === 'Top') || (!tipPosExclude && this.tipPointerPosition === 'End')) {
                topValue = (tooltipHeight - tipHeight - POINTER_ADJUST) + 'px';
            }
            else if ((tipPosExclude && tooltipPositionY === 'Bottom') || (!tipPosExclude && this.tipPointerPosition === 'Start')) {
                topValue = POINTER_ADJUST + 'px';
            }
            else {
                topValue = ((tooltipHeight / 2) - (tipHeight / 2)) + 'px';
            }
        }
        arrowEle.style.top = topValue;
        arrowEle.style.left = leftValue;
    };
    Tooltip.prototype.renderContent = function (target) {
        var tooltipContent = this.tooltipEle.querySelector('.' + CONTENT);
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], this.cssClass.split(' '));
        }
        if (target && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target.getAttribute('title'))) {
            target.setAttribute('data-content', target.getAttribute('title'));
            target.removeAttribute('title');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.content)) {
            if (this.isBlazorTooltip || !(this.isServerRender())) {
                tooltipContent.innerHTML = '';
                if (this.content instanceof HTMLElement) {
                    tooltipContent.appendChild(this.content);
                }
                else if (typeof this.content === 'string' && this.content.indexOf('<div>Blazor') < 0) {
                    if (this.enableHtmlSanitizer) {
                        this.setProperties({ content: _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(this.content) }, true);
                    }
                    tooltipContent[this.enableHtmlParse ? 'innerHTML' : 'textContent'] = this.content;
                }
                else {
                    var templateFunction = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(this.content);
                    var tempArr = templateFunction({}, this, 'content', this.element.id + 'content', undefined, undefined, tooltipContent);
                    if (tempArr) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tempArr, tooltipContent);
                    }
                    this.renderReactTemplates();
                    if (typeof this.content === 'string' && this.content.indexOf('<div>Blazor') >= 0) {
                        this.isBlazorTemplate = true;
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.element.id + 'content', 'Content', this);
                    }
                }
            }
        }
        else {
            if (target && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target.getAttribute('data-content'))) {
                tooltipContent.innerHTML = target.getAttribute('data-content');
            }
        }
    };
    Tooltip.prototype.renderCloseIcon = function () {
        if (!this.isSticky) {
            return;
        }
        var tipClose = this.createElement('div', { className: ICON + ' ' + CLOSE });
        this.tooltipEle.appendChild(tipClose);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(tipClose, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.onStickyClose, this);
    };
    Tooltip.prototype.addDescribedBy = function (target, id) {
        var describedby = (target.getAttribute('aria-describedby') || '').split(/\s+/);
        if (describedby.indexOf(id) < 0) {
            describedby.push(id);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(target, { 'aria-describedby': describedby.join(' ').trim(), 'data-tooltip-id': id });
    };
    Tooltip.prototype.removeDescribedBy = function (target) {
        var id = target.getAttribute('data-tooltip-id');
        var describedby = (target.getAttribute('aria-describedby') || '').split(/\s+/);
        var index = describedby.indexOf(id);
        if (index !== -1) {
            describedby.splice(index, 1);
        }
        target.removeAttribute('data-tooltip-id');
        var orgdescribedby = describedby.join(' ').trim();
        if (orgdescribedby) {
            target.setAttribute('aria-describedby', orgdescribedby);
        }
        else {
            target.removeAttribute('aria-describedby');
        }
    };
    Tooltip.prototype.tapHoldHandler = function (evt) {
        clearTimeout(this.autoCloseTimer);
        this.targetHover(evt.originalEvent);
    };
    Tooltip.prototype.touchEndHandler = function (e) {
        var _this = this;
        if (this.isSticky) {
            return;
        }
        var close = function () {
            _this.close();
        };
        this.autoCloseTimer = setTimeout(close, TOUCHEND_HIDE_DELAY);
    };
    Tooltip.prototype.targetClick = function (e) {
        var target;
        if (this.target) {
            target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, this.target);
        }
        else {
            target = this.element;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            return;
        }
        if (target.getAttribute('data-tooltip-id') === null) {
            this.targetHover(e);
        }
        else if (!this.isSticky) {
            this.hideTooltip(this.animation.close, e, target);
        }
    };
    Tooltip.prototype.targetHover = function (e) {
        var target;
        if (this.target) {
            target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, this.target);
        }
        else {
            target = this.element;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) || (target.getAttribute('data-tooltip-id') !== null && this.closeDelay === 0)) {
            return;
        }
        var targetList = [].slice.call(document.querySelectorAll('[data-tooltip-id= ' + this.ctrlId + '_content]'));
        for (var _i = 0, targetList_1 = targetList; _i < targetList_1.length; _i++) {
            var target_1 = targetList_1[_i];
            this.restoreElement(target_1);
        }
        this.showTooltip(target, this.animation.open, e);
    };
    Tooltip.prototype.showTooltip = function (target, showAnimation, e) {
        var _this = this;
        clearTimeout(this.showTimer);
        clearTimeout(this.hideTimer);
        this.tooltipEventArgs = {
            type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,
            element: this.tooltipEle, isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)
        };
        var observeCallback = function (beforeRenderArgs) {
            _this.beforeRenderCallback(beforeRenderArgs, target, e, showAnimation);
        };
        this.trigger('beforeRender', this.tooltipEventArgs, observeCallback.bind(this));
    };
    Tooltip.prototype.beforeRenderCallback = function (beforeRenderArgs, target, e, showAnimation) {
        var isBlazorTooltipRendered = false;
        if (beforeRenderArgs.cancel) {
            this.isHidden = true;
            this.clear();
        }
        else {
            this.isHidden = false;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltipEle)) {
                if (this.isServerRender()) {
                    this.contentTargetValue = target;
                    this.contentEvent = e;
                    this.contentAnimation = showAnimation;
                    var args = { 'enableTooltip': 'true' };
                    // tslint:disable
                    this.interopAdaptor.invokeMethodAsync('OnTooltipServerCall', args);
                    // tslint:enable
                    isBlazorTooltipRendered = true;
                }
                else {
                    this.ctrlId = this.element.getAttribute('id') ?
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])(this.element.getAttribute('id')) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('tooltip');
                    this.tooltipEle = this.createElement('div', {
                        className: TOOLTIP_WRAP + ' ' + POPUP_ROOT + ' ' + POPUP_LIB, attrs: {
                            role: 'tooltip', 'aria-hidden': 'false', 'id': this.ctrlId + '_content'
                        }, styles: 'width:' +
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width) + ';height:' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height) + ';position:absolute;'
                    });
                    this.beforeRenderBlazor(target, this);
                }
                if (!isBlazorTooltipRendered) {
                    this.afterRenderBlazor(target, e, showAnimation, this);
                }
            }
            else {
                if (this.isServerRender()) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], POPUP_OPEN);
                    document.body.appendChild(this.tooltipEle);
                    this.renderCloseIcon();
                    this.renderPopup(target);
                }
                if (target) {
                    this.adjustArrow(target, this.position, this.tooltipPositionX, this.tooltipPositionY);
                    this.addDescribedBy(target, this.ctrlId + '_content');
                    this.renderContent(target);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"].stop(this.tooltipEle);
                    this.reposition(target);
                    this.afterRenderBlazor(target, e, showAnimation, this);
                }
            }
        }
    };
    ;
    Tooltip.prototype.contentUpdated = function (args) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.tooltipEle)) {
            if (this.isServerRender()) {
                this.ctrlId = this.element.id;
                this.tooltipEle = document.querySelector('#' + this.ctrlId + '_content');
                if (this.tooltipEle) {
                    this.tooltipEle.setAttribute('style', 'width:' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.width) +
                        ';height:' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.height) + ';position:absolute;');
                    this.beforeRenderBlazor(this.contentTargetValue, this);
                    this.afterRenderBlazor(this.contentTargetValue, this.contentEvent, this.contentAnimation, this);
                    this.contentTargetValue = this.contentEvent = this.contentAnimation = null;
                }
            }
        }
    };
    ;
    Tooltip.prototype.beforeRenderBlazor = function (target, ctrlObj) {
        if (target) {
            if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ctrlObj.tooltipEle], DEVICE);
            }
            if (ctrlObj.width !== 'auto') {
                ctrlObj.tooltipEle.style.maxWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(ctrlObj.width);
            }
            if (!(this.isServerRender())) {
                ctrlObj.tooltipEle.appendChild(ctrlObj.createElement('div', { className: CONTENT }));
            }
            document.body.appendChild(ctrlObj.tooltipEle);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ctrlObj.tooltipEle], HIDE_POPUP);
            ctrlObj.addDescribedBy(target, ctrlObj.ctrlId + '_content');
            ctrlObj.renderContent(target);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ctrlObj.tooltipEle], POPUP_OPEN);
            if (ctrlObj.showTipPointer) {
                ctrlObj.renderArrow();
            }
            ctrlObj.renderCloseIcon();
            ctrlObj.renderPopup(target);
            ctrlObj.adjustArrow(target, ctrlObj.position, ctrlObj.tooltipPositionX, ctrlObj.tooltipPositionY);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"].stop(ctrlObj.tooltipEle);
            ctrlObj.reposition(target);
        }
    };
    Tooltip.prototype.afterRenderBlazor = function (target, e, showAnimation, ctrlObj) {
        if (target) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([ctrlObj.tooltipEle], POPUP_OPEN);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ctrlObj.tooltipEle], POPUP_CLOSE);
            ctrlObj.tooltipEventArgs = {
                type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,
                element: ctrlObj.tooltipEle, isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)
            };
            if (ctrlObj.needTemplateReposition() && !ctrlObj.mouseTrail) {
                ctrlObj.tooltipEle.style.display = 'none';
            }
            var observeCallback = function (observedArgs) {
                ctrlObj.beforeOpenCallback(observedArgs, target, showAnimation, e);
            };
            ctrlObj.trigger('beforeOpen', ctrlObj.tooltipEventArgs, observeCallback.bind(ctrlObj));
        }
    };
    Tooltip.prototype.beforeOpenCallback = function (observedArgs, target, showAnimation, e) {
        var _this = this;
        if (observedArgs.cancel) {
            this.isHidden = true;
            this.clear();
            this.restoreElement(target);
        }
        else {
            var openAnimation_1 = {
                name: showAnimation.effect,
                duration: showAnimation.duration,
                delay: showAnimation.delay,
                timingFunction: 'easeOut'
            };
            if (showAnimation.effect === 'None') {
                openAnimation_1 = undefined;
            }
            if (this.openDelay > 0) {
                var show = function () {
                    if (_this.mouseTrail) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'mousemove touchstart mouseenter', _this.onMouseMove, _this);
                    }
                    if (_this.popupObj) {
                        _this.popupObj.show(openAnimation_1, target);
                    }
                };
                this.showTimer = setTimeout(show, this.openDelay);
            }
            else {
                if (this.popupObj) {
                    this.popupObj.show(openAnimation_1, target);
                }
            }
        }
        if (e) {
            this.wireMouseEvents(e, target);
        }
    };
    Tooltip.prototype.needTemplateReposition = function () {
        // tslint:disable-next-line:no-any
        var tooltip = this;
        return !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tooltip.viewContainerRef)
            && typeof tooltip.viewContainerRef !== 'string'
            || (this.isServerRender()) && this.isBlazorTemplate;
    };
    Tooltip.prototype.checkCollision = function (target, x, y) {
        var elePos = {
            left: x, top: y, position: this.position,
            horizontal: this.tooltipPositionX, vertical: this.tooltipPositionY
        };
        var affectedPos = Object(_common_collision__WEBPACK_IMPORTED_MODULE_3__["isCollide"])(this.tooltipEle, this.checkCollideTarget(), x, y);
        if (affectedPos.length > 0) {
            elePos.horizontal = affectedPos.indexOf('left') >= 0 ? 'Right' : affectedPos.indexOf('right') >= 0 ? 'Left' :
                this.tooltipPositionX;
            elePos.vertical = affectedPos.indexOf('top') >= 0 ? 'Bottom' : affectedPos.indexOf('bottom') >= 0 ? 'Top' :
                this.tooltipPositionY;
        }
        return elePos;
    };
    Tooltip.prototype.collisionFlipFit = function (target, x, y) {
        var elePos = this.checkCollision(target, x, y);
        var newpos = elePos.position;
        if (this.tooltipPositionY !== elePos.vertical) {
            newpos = ((this.position.indexOf('Bottom') === 0 || this.position.indexOf('Top') === 0) ?
                elePos.vertical + this.tooltipPositionX : this.tooltipPositionX + elePos.vertical);
        }
        if (this.tooltipPositionX !== elePos.horizontal) {
            if (newpos.indexOf('Left') === 0) {
                elePos.vertical = (newpos === 'LeftTop' || newpos === 'LeftCenter') ? 'Top' : 'Bottom';
                newpos = (elePos.vertical + 'Left');
            }
            if (newpos.indexOf('Right') === 0) {
                elePos.vertical = (newpos === 'RightTop' || newpos === 'RightCenter') ? 'Top' : 'Bottom';
                newpos = (elePos.vertical + 'Right');
            }
            elePos.horizontal = this.tooltipPositionX;
        }
        this.tooltipEventArgs = {
            type: null, cancel: false, target: target, event: null,
            element: this.tooltipEle, collidedPosition: newpos
        };
        this.trigger('beforeCollision', this.tooltipEventArgs);
        if (elePos.position !== newpos) {
            var pos = Object(_common_position__WEBPACK_IMPORTED_MODULE_2__["calculatePosition"])(target, elePos.horizontal, elePos.vertical);
            this.adjustArrow(target, newpos, elePos.horizontal, elePos.vertical);
            var offsetPos = this.calculateTooltipOffset(newpos);
            offsetPos.top -= (('TopBottom'.indexOf(this.position.split(/(?=[A-Z])/)[0]) !== -1) &&
                ('TopBottom'.indexOf(newpos.split(/(?=[A-Z])/)[0]) !== -1)) ? (2 * this.offsetY) : 0;
            offsetPos.left -= (('RightLeft'.indexOf(this.position.split(/(?=[A-Z])/)[0]) !== -1) &&
                ('RightLeft'.indexOf(newpos.split(/(?=[A-Z])/)[0]) !== -1)) ? (2 * this.offsetX) : 0;
            elePos.position = newpos;
            elePos.left = pos.left + offsetPos.left;
            elePos.top = pos.top + offsetPos.top;
        }
        else {
            this.adjustArrow(target, newpos, elePos.horizontal, elePos.vertical);
        }
        var eleOffset = { left: elePos.left, top: elePos.top };
        var left = Object(_common_collision__WEBPACK_IMPORTED_MODULE_3__["fit"])(this.tooltipEle, this.checkCollideTarget(), { X: true, Y: false }, eleOffset).left;
        this.tooltipEle.style.display = 'block';
        if (this.showTipPointer && (newpos.indexOf('Bottom') === 0 || newpos.indexOf('Top') === 0)) {
            var arrowEle = this.tooltipEle.querySelector('.' + ARROW_TIP);
            var arrowleft = parseInt(arrowEle.style.left, 10) - (left - elePos.left);
            if (arrowleft < 0) {
                arrowleft = 0;
            }
            else if ((arrowleft + arrowEle.offsetWidth) > this.tooltipEle.clientWidth) {
                arrowleft = this.tooltipEle.clientWidth - arrowEle.offsetWidth;
            }
            arrowEle.style.left = arrowleft.toString() + 'px';
        }
        this.tooltipEle.style.display = '';
        eleOffset.left = left;
        return eleOffset;
    };
    Tooltip.prototype.checkCollideTarget = function () {
        return !this.windowCollision && this.target ? this.element : null;
    };
    Tooltip.prototype.hideTooltip = function (hideAnimation, e, targetElement) {
        var _this = this;
        if (this.closeDelay > 0) {
            clearTimeout(this.hideTimer);
            clearTimeout(this.showTimer);
            var hide = function () {
                if (_this.closeDelay && _this.tooltipEle && _this.isTooltipOpen) {
                    return;
                }
                _this.tooltipHide(hideAnimation, e, targetElement);
            };
            this.hideTimer = setTimeout(hide, this.closeDelay);
        }
        else {
            this.tooltipHide(hideAnimation, e, targetElement);
        }
    };
    Tooltip.prototype.tooltipHide = function (hideAnimation, e, targetElement) {
        var _this = this;
        var target;
        if (e) {
            target = this.target ? (targetElement || e.target) : this.element;
        }
        else {
            target = document.querySelector('[data-tooltip-id= ' + this.ctrlId + '_content]');
        }
        this.tooltipEventArgs = {
            type: e ? e.type : null, cancel: false, target: target, event: e ? e : null,
            element: this.tooltipEle, isInteracted: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e)
        };
        // this line commented for close the tooltip popup element even the target element destroyed in a page.
        //if (isNullOrUndefined(target)) { return; }
        this.trigger('beforeClose', this.tooltipEventArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                if (_this.isServerRender()) {
                    _this.blazorHide(hideAnimation, target);
                }
                else {
                    _this.popupHide(hideAnimation, target);
                }
            }
            else {
                _this.isHidden = false;
            }
        });
    };
    /* istanbul ignore next */
    Tooltip.prototype.blazorHide = function (hideAnimation, target) {
        var proxy = this;
        var hide = function () {
            proxy.popupHide(hideAnimation, target);
        };
        if (this.popupObj) {
            this.popupHide(hideAnimation, target);
        }
        else {
            setTimeout(hide, 200);
        }
    };
    Tooltip.prototype.popupHide = function (hideAnimation, target) {
        if (target) {
            this.restoreElement(target);
        }
        this.isHidden = true;
        var closeAnimation = {
            name: hideAnimation.effect,
            duration: hideAnimation.duration,
            delay: hideAnimation.delay,
            timingFunction: 'easeIn'
        };
        if (hideAnimation.effect === 'None') {
            closeAnimation = undefined;
        }
        if (this.popupObj) {
            this.popupObj.hide(closeAnimation);
        }
    };
    Tooltip.prototype.restoreElement = function (target) {
        this.unwireMouseEvents(target);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target.getAttribute('data-content'))) {
            target.setAttribute('title', target.getAttribute('data-content'));
            target.removeAttribute('data-content');
        }
        this.removeDescribedBy(target);
    };
    Tooltip.prototype.clear = function () {
        if (this.tooltipEle) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.tooltipEle], POPUP_CLOSE);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], POPUP_OPEN);
        }
        if (this.isHidden) {
            if (this.popupObj) {
                this.popupObj.destroy();
            }
            if (this.isServerRender() && this.tooltipEle) {
                this.tooltipEle.style.display = 'none';
                var args = { 'enableTooltip': 'false' };
                // tslint:disable
                this.interopAdaptor.invokeMethodAsync('OnTooltipServerCall', args);
                // tslint:enable
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tooltipEle);
            }
            else if (this.tooltipEle) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tooltipEle);
            }
            this.tooltipEle = null;
            this.popupObj = null;
        }
    };
    Tooltip.prototype.tooltipHover = function (e) {
        if (this.tooltipEle) {
            this.isTooltipOpen = true;
        }
    };
    Tooltip.prototype.tooltipMouseOut = function (e) {
        this.isTooltipOpen = false;
        this.hideTooltip(this.animation.close, e, this.findTarget());
    };
    Tooltip.prototype.onMouseOut = function (e) {
        var enteredElement = e.relatedTarget;
        // don't close the tooltip only if it is tooltip content element
        if (enteredElement && !this.mouseTrail) {
            var checkForTooltipElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(enteredElement, "." + TOOLTIP_WRAP + "." + POPUP_LIB + "." + POPUP_ROOT);
            if (checkForTooltipElement) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(checkForTooltipElement, 'mouseleave', this.tooltipElementMouseOut, this);
            }
            else {
                this.hideTooltip(this.animation.close, e, this.findTarget());
                if (this.closeDelay === 0) {
                    this.clear();
                }
            }
        }
        else {
            this.hideTooltip(this.animation.close, e, this.findTarget());
            this.clear();
        }
    };
    Tooltip.prototype.tooltipElementMouseOut = function (e) {
        this.hideTooltip(this.animation.close, e, this.findTarget());
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseleave', this.tooltipElementMouseOut);
        this.clear();
    };
    Tooltip.prototype.onStickyClose = function (e) {
        this.close();
    };
    Tooltip.prototype.onMouseMove = function (event) {
        var eventPageX = 0;
        var eventPageY = 0;
        if (event.type.indexOf('touch') > -1) {
            event.preventDefault();
            eventPageX = event.touches[0].pageX;
            eventPageY = event.touches[0].pageY;
        }
        else {
            eventPageX = event.pageX;
            eventPageY = event.pageY;
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"].stop(this.tooltipEle);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.tooltipEle], POPUP_CLOSE);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], POPUP_OPEN);
        this.adjustArrow(event.target, this.position, this.tooltipPositionX, this.tooltipPositionY);
        var pos = this.calculateTooltipOffset(this.position);
        var x = eventPageX + pos.left + this.offsetX;
        var y = eventPageY + pos.top + this.offsetY;
        var elePos = this.checkCollision(event.target, x, y);
        if (this.tooltipPositionX !== elePos.horizontal || this.tooltipPositionY !== elePos.vertical) {
            var newpos = (this.position.indexOf('Bottom') === 0 || this.position.indexOf('Top') === 0) ?
                elePos.vertical + elePos.horizontal : elePos.horizontal + elePos.vertical;
            elePos.position = newpos;
            this.adjustArrow(event.target, elePos.position, elePos.horizontal, elePos.vertical);
            var colpos = this.calculateTooltipOffset(elePos.position);
            elePos.left = eventPageX + colpos.left - this.offsetX;
            elePos.top = eventPageY + colpos.top - this.offsetY;
        }
        this.tooltipEle.style.left = elePos.left + 'px';
        this.tooltipEle.style.top = elePos.top + 'px';
    };
    Tooltip.prototype.keyDown = function (event) {
        if (this.tooltipEle && event.keyCode === 27) {
            this.close();
        }
    };
    Tooltip.prototype.touchEnd = function (e) {
        if (this.tooltipEle && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + ROOT) === null && !this.isSticky) {
            this.close();
        }
    };
    Tooltip.prototype.scrollHandler = function (e) {
        if (this.tooltipEle) {
            if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, "." + TOOLTIP_WRAP + "." + POPUP_LIB + "." + POPUP_ROOT))) {
                this.close();
            }
        }
    };
    /**
     * Core method that initializes the control rendering.
     * @private
     */
    Tooltip.prototype.render = function () {
        this.initialize();
        this.wireEvents(this.opensOn);
        this.renderComplete();
    };
    /**
     * Initializes the values of private members.
     * @private
     */
    Tooltip.prototype.preRender = function () {
        this.tipClass = TIP_BOTTOM;
        this.tooltipPositionX = 'Center';
        this.tooltipPositionY = 'Top';
        this.isHidden = true;
    };
    /**
     * Binding events to the Tooltip element.
     * @hidden
     */
    Tooltip.prototype.wireEvents = function (trigger) {
        var triggerList = this.getTriggerList(trigger);
        for (var _i = 0, triggerList_1 = triggerList; _i < triggerList_1.length; _i++) {
            var opensOn = triggerList_1[_i];
            if (opensOn === 'Custom') {
                return;
            }
            if (opensOn === 'Focus') {
                this.wireFocusEvents();
            }
            if (opensOn === 'Click') {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.targetClick, this);
            }
            if (opensOn === 'Hover') {
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    this.touchModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, {
                        tapHoldThreshold: TAPHOLD_THRESHOLD,
                        tapHold: this.tapHoldHandler.bind(this)
                    });
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.touchEndHandler, this);
                }
                else {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseover', this.targetHover, this);
                    if (this.isServerRender() && !this.isSticky) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'mouseleave', this.onMouseOut, this);
                    }
                }
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'touchend', this.touchEnd, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'scroll wheel', this.scrollHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'keydown', this.keyDown, this);
    };
    Tooltip.prototype.getTriggerList = function (trigger) {
        if (trigger === 'Auto') {
            trigger = (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) ? 'Hover' : 'Hover Focus';
        }
        return trigger.split(' ');
    };
    Tooltip.prototype.wireFocusEvents = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) {
            var targetList = [].slice.call(this.element.querySelectorAll(this.target));
            for (var _i = 0, targetList_2 = targetList; _i < targetList_2.length; _i++) {
                var target = targetList_2[_i];
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'focus', this.targetHover, this);
            }
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'focus', this.targetHover, this);
        }
    };
    Tooltip.prototype.wireMouseEvents = function (e, target) {
        if (this.tooltipEle) {
            if (!this.isSticky) {
                if (e.type === 'focus') {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'blur', this.onMouseOut, this);
                }
                if (e.type === 'mouseover') {
                    if (!this.isServerRender()) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'mouseleave', this.onMouseOut, this);
                    }
                }
                if (this.closeDelay) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.tooltipEle, 'mouseenter', this.tooltipHover, this);
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.tooltipEle, 'mouseleave', this.tooltipMouseOut, this);
                }
            }
            if (this.mouseTrail && this.openDelay === 0) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(target, 'mousemove touchstart mouseenter', this.onMouseMove, this);
            }
        }
    };
    /**
     * Unbinding events from the element on widget destroy.
     * @hidden
     */
    Tooltip.prototype.unwireEvents = function (trigger) {
        var triggerList = this.getTriggerList(trigger);
        for (var _i = 0, triggerList_2 = triggerList; _i < triggerList_2.length; _i++) {
            var opensOn = triggerList_2[_i];
            if (opensOn === 'Custom') {
                return;
            }
            if (opensOn === 'Focus') {
                this.unwireFocusEvents();
            }
            if (opensOn === 'Click') {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.targetClick);
            }
            if (opensOn === 'Hover') {
                if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    if (this.touchModule) {
                        this.touchModule.destroy();
                    }
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.touchEndHandler);
                }
                else {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseover', this.targetHover);
                    if (this.isServerRender() && !this.isSticky) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'mouseleave', this.onMouseOut);
                    }
                }
            }
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'touchend', this.touchEnd);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'scroll wheel', this.scrollHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'keydown', this.keyDown);
    };
    Tooltip.prototype.unwireFocusEvents = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.target)) {
            var targetList = [].slice.call(this.element.querySelectorAll(this.target));
            for (var _i = 0, targetList_3 = targetList; _i < targetList_3.length; _i++) {
                var target = targetList_3[_i];
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'focus', this.targetHover);
            }
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'focus', this.targetHover);
        }
    };
    Tooltip.prototype.unwireMouseEvents = function (target) {
        if (!this.isSticky) {
            var triggerList = this.getTriggerList(this.opensOn);
            for (var _i = 0, triggerList_3 = triggerList; _i < triggerList_3.length; _i++) {
                var opensOn = triggerList_3[_i];
                if (opensOn === 'Focus') {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'blur', this.onMouseOut);
                }
                if (opensOn === 'Hover' && !_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice) {
                    if (!this.isServerRender()) {
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mouseleave', this.onMouseOut);
                    }
                }
            }
            if (this.closeDelay) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mouseenter', this.tooltipHover);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mouseleave', this.tooltipMouseOut);
            }
        }
        if (this.mouseTrail) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(target, 'mousemove touchstart mouseenter', this.onMouseMove);
        }
    };
    Tooltip.prototype.findTarget = function () {
        var target = document.querySelector('[data-tooltip-id= ' + this.ctrlId + '_content]');
        return target;
    };
    /**
     * Core method to return the component name.
     * @private
     */
    Tooltip.prototype.getModuleName = function () {
        return 'tooltip';
    };
    /**
     * Returns the properties to be maintained in the persisted state.
     * @private
     */
    Tooltip.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * Called internally, if any of the property value changed.
     * @private
     */
    Tooltip.prototype.onPropertyChanged = function (newProp, oldProp) {
        var targetElement = this.findTarget();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'width':
                    if (this.tooltipEle && targetElement) {
                        this.tooltipEle.style.width = this.tooltipEle.style.maxWidth = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.width);
                        this.reposition(targetElement);
                    }
                    break;
                case 'height':
                    if (this.tooltipEle && targetElement) {
                        this.tooltipEle.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(newProp.height);
                        this.reposition(targetElement);
                    }
                    break;
                case 'content':
                    if (this.tooltipEle) {
                        if (this.isServerRender()) {
                            this.isBlazorTooltip = true;
                        }
                        this.renderContent();
                    }
                    else if (this.isServerRender()) {
                        var args = { 'content': newProp.content };
                        // tslint:disable
                        this.interopAdaptor.invokeMethodAsync('OnTooltipServerCall', args);
                        // tslint:enable
                    }
                    break;
                case 'opensOn':
                    this.unwireEvents(oldProp.opensOn);
                    this.wireEvents(newProp.opensOn);
                    break;
                case 'position':
                    this.formatPosition();
                    if (this.tooltipEle && targetElement) {
                        var arrowInnerELe = this.tooltipEle.querySelector('.' + ARROW_TIP_INNER);
                        arrowInnerELe.style.top = arrowInnerELe.style.left = null;
                        this.reposition(targetElement);
                    }
                    break;
                case 'tipPointerPosition':
                    if (this.tooltipEle && targetElement) {
                        this.reposition(targetElement);
                    }
                    break;
                case 'offsetX':
                    if (this.tooltipEle) {
                        var x = newProp.offsetX - oldProp.offsetX;
                        this.tooltipEle.style.left = (parseInt(this.tooltipEle.style.left, 10) + (x)).toString() + 'px';
                    }
                    break;
                case 'offsetY':
                    if (this.tooltipEle) {
                        var y = newProp.offsetY - oldProp.offsetY;
                        this.tooltipEle.style.top = (parseInt(this.tooltipEle.style.top, 10) + (y)).toString() + 'px';
                    }
                    break;
                case 'cssClass':
                    if (this.tooltipEle) {
                        if (oldProp.cssClass) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.tooltipEle], oldProp.cssClass.split(' '));
                        }
                        if (newProp.cssClass) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], newProp.cssClass.split(' '));
                        }
                    }
                    break;
                case 'enableRtl':
                    if (this.tooltipEle) {
                        if (this.enableRtl) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.tooltipEle], RTL);
                        }
                        else {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.tooltipEle], RTL);
                        }
                    }
                    break;
            }
        }
    };
    /**
     * It is used to show the Tooltip on the specified target with specific animation settings.
     * @param element Target element where the Tooltip is to be displayed. (It is an optional parameter)
     * @param animation Sets the specific animation, while showing the Tooltip on the screen. (It is an optional parameter)
     * @return {void}
     */
    Tooltip.prototype.open = function (element, animation) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(animation)) {
            animation = this.animation.open;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            element = this.element;
        }
        if (element.style.display === 'none') {
            return;
        }
        this.showTooltip(element, animation);
    };
    /**
     * It is used to hide the Tooltip with specific animation effect.
     * @param animation Sets the specific animation when hiding Tooltip from the screen. (It is an optional parameter)
     * @return {void}
     */
    Tooltip.prototype.close = function (animation) {
        if (!animation) {
            animation = this.animation.close;
        }
        this.hideTooltip(animation);
    };
    /**
     * It is used to refresh the Tooltip content and its position.
     * @param target Target element where the Tooltip content or position needs to be refreshed.
     * @return {void}
     */
    Tooltip.prototype.refresh = function (target) {
        if (this.tooltipEle) {
            this.renderContent(target);
        }
        if (this.popupObj && target) {
            this.reposition(target);
        }
    };
    /**
     * It is used to destroy the Tooltip component.
     * @method destroy
     * @return {void}
     * @memberof Tooltip
     */
    Tooltip.prototype.destroy = function () {
        if (!this.isServerRender()) {
            _super.prototype.destroy.call(this);
            if (this.tooltipEle) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.tooltipEle);
            }
        }
        if (this.isServerRender() && this.tooltipEle) {
            var placeholder = document.querySelector('#' + this.ctrlId + '_content_placeholder');
            if (placeholder) {
                placeholder.appendChild(this.tooltipEle);
            }
        }
        if (this.popupObj) {
            this.popupObj.destroy();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], ROOT);
        this.unwireEvents(this.opensOn);
        this.unwireMouseEvents(this.element);
        this.tooltipEle = null;
        this.popupObj = null;
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Tooltip.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Tooltip.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Tooltip.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Tooltip.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('TopCenter')
    ], Tooltip.prototype, "position", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Tooltip.prototype, "offsetX", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Tooltip.prototype, "offsetY", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Tooltip.prototype, "showTipPointer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Tooltip.prototype, "enableHtmlParse", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tooltip.prototype, "windowCollision", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Auto')
    ], Tooltip.prototype, "tipPointerPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Auto')
    ], Tooltip.prototype, "opensOn", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tooltip.prototype, "mouseTrail", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tooltip.prototype, "isSticky", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, Animation)
    ], Tooltip.prototype, "animation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Tooltip.prototype, "openDelay", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Tooltip.prototype, "closeDelay", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Tooltip.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Tooltip.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "beforeRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "afterOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "afterClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "beforeCollision", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Tooltip.prototype, "destroyed", void 0);
    Tooltip = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Tooltip);
    return Tooltip;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/calendar-util.js":
/*!****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/common/calendar-util.js ***!
  \****************************************************************************/
/*! exports provided: Gregorian, Islamic */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Gregorian", function() { return Gregorian; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return Islamic; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");

/** @hidden */
var Gregorian = /** @__PURE__ @class */ (function () {
    function Gregorian() {
    }
    Gregorian.prototype.firstDateOfMonth = function (date) {
        return new Date(date.getFullYear(), date.getMonth());
    };
    Gregorian.prototype.lastDateOfMonth = function (dt) {
        return new Date(dt.getFullYear(), dt.getMonth() + 1, 0);
    };
    Gregorian.prototype.isMonthStart = function (date) {
        return (date.getDate() === 1);
    };
    Gregorian.prototype.getLeapYearDaysCount = function () {
        return 366;
    };
    Gregorian.prototype.getYearDaysCount = function (date, interval) {
        return ((date.getFullYear() + interval) % 4 === 0) ? 366 : 365;
    };
    Gregorian.prototype.getDate = function (date) {
        return date.getDate();
    };
    Gregorian.prototype.getMonth = function (date) {
        return (date.getMonth() + 1);
    };
    Gregorian.prototype.getFullYear = function (date) {
        return date.getFullYear();
    };
    Gregorian.prototype.getYearLastDate = function (date, interval) {
        return new Date(date.getFullYear() + interval, 0, 0);
    };
    Gregorian.prototype.getMonthDaysCount = function (date) {
        return this.lastDateOfMonth(date).getDate();
    };
    Gregorian.prototype.getMonthStartDate = function (date) {
        return new Date(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes());
    };
    Gregorian.prototype.getMonthEndDate = function (date) {
        date.setDate(1);
        return new Date(date.setMonth(date.getMonth() + 1));
    };
    Gregorian.prototype.getExpectedDays = function (date, days) {
        return days;
    };
    Gregorian.prototype.setDate = function (dateObj, date) {
        dateObj.setDate(date);
    };
    Gregorian.prototype.setValidDate = function (date, interval, startDate, monthValue, beginDate) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(beginDate)) {
            date.setMonth((beginDate ? monthValue : date.getMonth()) + interval);
        }
        else {
            date.setMonth(date.getMonth() + interval, startDate);
        }
    };
    Gregorian.prototype.setMonth = function (date, interval, startDate) {
        date.setFullYear(date.getFullYear());
        date.setMonth(interval - 1);
        date.setDate(startDate);
    };
    Gregorian.prototype.addYears = function (date, interval) {
        date.setFullYear(date.getFullYear() + interval);
    };
    Gregorian.prototype.isSameMonth = function (date1, date2) {
        return (date1.getMonth() === date2.getMonth());
    };
    Gregorian.prototype.checkMonth = function (date, months) {
        return (months.indexOf(date.getMonth() + 1) === -1);
    };
    Gregorian.prototype.compareMonth = function (date1, date2) {
        return (date1.getMonth() > date2.getMonth());
    };
    Gregorian.prototype.isSameYear = function (date1, date2) {
        return (date1.getFullYear() === date2.getFullYear());
    };
    Gregorian.prototype.isLastMonth = function (date) {
        return (date.getMonth() === 11);
    };
    Gregorian.prototype.isLeapYear = function (year, interval) {
        return ((year + interval) % 4 === 0);
    };
    return Gregorian;
}());

/** @hidden */
var Islamic = /** @__PURE__ @class */ (function () {
    function Islamic() {
    }
    Islamic.prototype.firstDateOfMonth = function (date) {
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, hDate.month, 1);
        return gDate;
    };
    Islamic.prototype.lastDateOfMonth = function (date) {
        var hDate = this.getHijriDate(date);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, hDate.month, this.getDaysInMonth(hDate.month, hDate.year));
        var finalGDate = new Date(gDate.getTime());
        new Date(finalGDate.setDate(finalGDate.getDate() + 1));
        var finalHDate = this.getHijriDate(finalGDate);
        if (hDate.month === finalHDate.month) {
            return finalGDate;
        }
        finalHDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(gDate);
        if (hDate.month === finalHDate.month) {
            return gDate;
        }
        return new Date(gDate.setDate(gDate.getDate() - 1));
    };
    Islamic.prototype.isMonthStart = function (date) {
        var hijriDate = this.getHijriDate(date);
        return (hijriDate.date === 1);
    };
    Islamic.prototype.getLeapYearDaysCount = function () {
        return 355;
    };
    Islamic.prototype.getYearDaysCount = function (date, interval) {
        var hDate = this.getHijriDate(date);
        return this.isLeapYear(hDate.year, interval) ? 355 : 354;
    };
    Islamic.prototype.getDate = function (date) {
        var hijriDate = this.getHijriDate(date);
        return hijriDate.date;
    };
    Islamic.prototype.getMonth = function (date) {
        var hDate = this.getHijriDate(date);
        return hDate.month;
    };
    Islamic.prototype.getFullYear = function (date) {
        var hDate = this.getHijriDate(date);
        return hDate.year;
    };
    Islamic.prototype.getYearLastDate = function (date, interval) {
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year + interval, 1, 0);
        return gDate;
    };
    Islamic.prototype.getMonthDaysCount = function (date) {
        var maxDate = this.lastDateOfMonth(date);
        var hijriDate = this.getHijriDate(maxDate);
        return hijriDate.date;
    };
    Islamic.prototype.getMonthStartDate = function (date) {
        var firstDate = this.firstDateOfMonth(date);
        return new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate(), date.getHours(), date.getMinutes());
    };
    Islamic.prototype.getMonthEndDate = function (date) {
        var lastDate = this.lastDateOfMonth(date);
        lastDate.setDate(lastDate.getDate() + 1);
        return new Date(lastDate.setMonth(lastDate.getMonth()));
    };
    Islamic.prototype.getExpectedDays = function (date, days) {
        var hDate = this.getHijriDate(date);
        var day = [];
        for (var i = 0; i < days.length; i++) {
            var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, hDate.month, days[i]);
            day.push(gDate.getDate());
        }
        return day;
    };
    Islamic.prototype.setDate = function (dateObj, date) {
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(dateObj);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, hDate.month, date);
        this.updateDateObj(dateObj, gDate);
    };
    Islamic.prototype.setValidDate = function (date, interval, startDate, monthValue, beginDate) {
        var firstDate = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(beginDate)) ? this.firstDateOfMonth(beginDate) : date;
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(firstDate);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, hDate.month + interval, startDate);
        this.updateDateObj(date, gDate);
    };
    Islamic.prototype.setMonth = function (date, interval, startDate) {
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year, interval, startDate);
        this.updateDateObj(date, gDate);
    };
    Islamic.prototype.addYears = function (date, interval, monthValue) {
        var hDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date);
        var gDate = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].toGregorian(hDate.year + interval, monthValue, 1);
        this.updateDateObj(date, gDate);
    };
    Islamic.prototype.isSameMonth = function (date1, date2) {
        var currentHijri = this.getHijriDate(date1);
        var tempHijri = this.getHijriDate(date2);
        return (currentHijri.month === tempHijri.month);
    };
    Islamic.prototype.checkMonth = function (date, months) {
        var hDate = this.getHijriDate(date);
        return (months.indexOf(hDate.month) === -1);
    };
    Islamic.prototype.compareMonth = function (date1, date2) {
        var hDate = this.getHijriDate(date1);
        var hDate1 = this.getHijriDate(date2);
        return (hDate.month > hDate1.month);
    };
    Islamic.prototype.isSameYear = function (date1, date2) {
        var hDate = this.getHijriDate(date1);
        var hDate1 = this.getHijriDate(date2);
        return (hDate.year === hDate1.year);
    };
    Islamic.prototype.isLastMonth = function (date) {
        var hDate = this.getHijriDate(date);
        return (hDate.month === 12);
    };
    Islamic.prototype.updateDateObj = function (date, gDate) {
        date.setFullYear(gDate.getFullYear(), gDate.getMonth(), gDate.getDate());
    };
    Islamic.prototype.isLeapYear = function (year, interval) {
        return (14 + 11 * (year + interval)) % 30 < 11;
    };
    Islamic.prototype.getDaysInMonth = function (month, year) {
        var length = 0;
        length = 29 + ((month + 1) % 2);
        if (month === 11 && this.isLeapYear(year, 0)) {
            length++;
        }
        return length;
    };
    Islamic.prototype.getHijriDate = function (date) {
        return _ej2_base__WEBPACK_IMPORTED_MODULE_0__["HijriParser"].getHijriDate(date);
    };
    return Islamic;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/index.js":
/*!********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/common/index.js ***!
  \********************************************************************/
/*! exports provided: Gregorian, Islamic */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _calendar_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar-util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/calendar-util.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Gregorian", function() { return _calendar_util__WEBPACK_IMPORTED_MODULE_0__["Gregorian"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return _calendar_util__WEBPACK_IMPORTED_MODULE_0__["Islamic"]; });

/**
 * Calendar util exported items
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/index.js":
/*!*************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/index.js ***!
  \*************************************************************/
/*! exports provided: Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, addLocalOffset, addLocalOffsetToEvent, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewHelper, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic, ICalendarExport, ICalendarImport, ExcelExport, Print */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _schedule_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule/index */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Schedule", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Schedule"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["cellClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellDoubleClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["cellDoubleClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "moreEventsClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["moreEventsClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "select", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["select"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hover", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["hover"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionBegin", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["actionBegin"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionComplete", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["actionComplete"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionFailure", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["actionFailure"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "navigating", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["navigating"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "renderCell", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["renderCell"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["eventClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventRendered", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["eventRendered"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataBinding", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["dataBinding"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataBound", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["dataBound"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "popupOpen", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["popupOpen"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "popupClose", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["popupClose"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragStart", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["dragStart"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["drag"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragStop", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["dragStop"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizeStart", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["resizeStart"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizing", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["resizing"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizeStop", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["resizeStop"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["inlineClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialLoad", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["initialLoad"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialEnd", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["initialEnd"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataReady", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["dataReady"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventsLoaded", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["eventsLoaded"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contentReady", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["contentReady"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scroll", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["scroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "virtualScroll", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["virtualScroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scrollUiUpdate", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["scrollUiUpdate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uiUpdate", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["uiUpdate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "documentClick", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["documentClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellMouseDown", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["cellMouseDown"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WEEK_LENGTH", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["WEEK_LENGTH"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MS_PER_DAY", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["MS_PER_DAY"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MS_PER_MINUTE", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["MS_PER_MINUTE"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getElementHeightFromClass", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getElementHeightFromClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTranslateY", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getTranslateY"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekFirstDate", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getWeekFirstDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekLastDate", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getWeekLastDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "firstDateOfMonth", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["firstDateOfMonth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDateOfMonth", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["lastDateOfMonth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekNumber", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getWeekNumber"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekMiddleDate", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getWeekMiddleDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTime", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["setTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resetTime", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["resetTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateInMs", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getDateInMs"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateCount", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getDateCount"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addDays", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["addDays"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMonths", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["addMonths"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addYears", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["addYears"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStartEndHours", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getStartEndHours"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaxDays", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getMaxDays"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDaysCount", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getDaysCount"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateFromString", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getDateFromString"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getScrollBarWidth", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getScrollBarWidth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndexInData", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["findIndexInData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOuterHeight", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["getOuterHeight"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeChildren", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["removeChildren"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDaylightSavingTime", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["isDaylightSavingTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addLocalOffset", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["addLocalOffset"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addLocalOffsetToEvent", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["addLocalOffsetToEvent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalizeFirstWord", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["capitalizeFirstWord"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Resize"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragAndDrop", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["DragAndDrop"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRenderer", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["HeaderRenderer"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewHelper", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["ViewHelper"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewBase", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["ViewBase"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Day", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Day"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Week", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Week"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WorkWeek", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["WorkWeek"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Month", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Month"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Year", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Year"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Agenda", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Agenda"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MonthAgenda", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["MonthAgenda"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineViews", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["TimelineViews"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineMonth", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["TimelineMonth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineYear", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["TimelineYear"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timezone", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Timezone"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timezoneData", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["timezoneData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarExport", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["ICalendarExport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarImport", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["ICalendarImport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExcelExport", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["ExcelExport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Print", function() { return _schedule_index__WEBPACK_IMPORTED_MODULE_0__["Print"]; });

/* harmony import */ var _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./recurrence-editor/index */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RecurrenceEditor", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["RecurrenceEditor"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSummary", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["generateSummary"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["generate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateFromRecurrenceDateString", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["getDateFromRecurrenceDateString"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractObjectFromRule", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["extractObjectFromRule"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCalendarUtil", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["getCalendarUtil"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRecurrenceStringFromDate", function() { return _recurrence_editor_index__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"]; });

/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Gregorian", function() { return _common_index__WEBPACK_IMPORTED_MODULE_2__["Gregorian"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Islamic", function() { return _common_index__WEBPACK_IMPORTED_MODULE_2__["Islamic"]; });

/**
 * Export Schedule components
 */





/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js ***!
  \****************************************************************************************/
/*! exports provided: generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateSummary", function() { return generateSummary; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFromRecurrenceDateString", function() { return getDateFromRecurrenceDateString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractObjectFromRule", function() { return extractObjectFromRule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCalendarUtil", function() { return getCalendarUtil; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRecurrenceStringFromDate", function() { return getRecurrenceStringFromDate; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _schedule_base_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../schedule/base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _common_calendar_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/calendar-util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/calendar-util.js");
/* harmony import */ var _schedule_timezone_timezone__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../schedule/timezone/timezone */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js");




/**
 * Date Generator from Recurrence Rule
 */
function generateSummary(rule, localeObject, locale, calendarType) {
    if (calendarType === void 0) { calendarType = 'Gregorian'; }
    var ruleObject = extractObjectFromRule(rule);
    var summary = localeObject.getConstant(EVERY) + ' ';
    var cldrObj;
    var cldrObj1;
    var calendarMode = calendarType.toLowerCase();
    if (locale === 'en' || locale === 'en-US') {
        var nameSpace1 = 'months.stand-alone.abbreviated';
        var nameSpace = 'days.stand-alone.abbreviated';
        cldrObj1 = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace1, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(calendarMode)));
        cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(calendarMode)));
    }
    else {
        var nameSpace1 = 'main.' + locale + '.dates.calendars.' + calendarMode + '.months.stand-alone.abbreviated';
        var nameSpace = 'main.' + locale + '.dates.calendars.' + calendarMode + '.days.stand-alone.abbreviated';
        cldrObj1 =
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace1, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        cldrObj =
            (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
    }
    if (ruleObject.interval > 1) {
        summary += ruleObject.interval + ' ';
    }
    switch (ruleObject.freq) {
        case 'DAILY':
            summary += localeObject.getConstant(DAYS);
            break;
        case 'WEEKLY':
            summary += localeObject.getConstant(WEEKS) + ' ' + localeObject.getConstant(ON) + ' ';
            ruleObject.day.forEach(function (day, index) {
                summary += Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["capitalizeFirstWord"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(DAYINDEXOBJECT[day], cldrObj), 'single');
                summary += (((ruleObject.day.length - 1) === index) ? '' : ', ');
            });
            break;
        case 'MONTHLY':
            summary += localeObject.getConstant(MONTHS) + ' ' + localeObject.getConstant(ON) + ' ';
            summary += getMonthSummary(ruleObject, cldrObj, localeObject);
            break;
        case 'YEARLY':
            summary += localeObject.getConstant(YEARS) + ' ' + localeObject.getConstant(ON) + ' ';
            summary += Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["capitalizeFirstWord"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((ruleObject.month[0]).toString(), cldrObj1), 'single') + ' ';
            summary += getMonthSummary(ruleObject, cldrObj, localeObject);
            break;
    }
    if (ruleObject.count) {
        summary += ', ' + (ruleObject.count) + ' ' + localeObject.getConstant(TIMES);
    }
    else if (ruleObject.until) {
        var tempDate = ruleObject.until;
        summary += ', ' + localeObject.getConstant(UNTIL)
            + ' ' + tempDate.getDate()
            + ' ' + Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["capitalizeFirstWord"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])((tempDate.getMonth() + 1).toString(), cldrObj1), 'single')
            + ' ' + tempDate.getFullYear();
    }
    return summary;
}
function getMonthSummary(ruleObject, cldrObj, localeObj) {
    var summary = '';
    if (ruleObject.monthDay.length) {
        summary += ruleObject.monthDay[0];
    }
    else if (ruleObject.day) {
        var pos = ruleObject.setPosition - 1;
        summary += localeObj.getConstant(WEEKPOS[pos > -1 ? pos : (WEEKPOS.length - 1)])
            + ' ' + Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["capitalizeFirstWord"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(DAYINDEXOBJECT[ruleObject.day[0]], cldrObj), 'single');
    }
    return summary;
}
function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount, viewDate, calendarMode, oldTimezone, newTimezone) {
    if (maximumCount === void 0) { maximumCount = MAXOCCURRENCE; }
    if (viewDate === void 0) { viewDate = null; }
    if (calendarMode === void 0) { calendarMode = 'Gregorian'; }
    if (oldTimezone === void 0) { oldTimezone = null; }
    if (newTimezone === void 0) { newTimezone = null; }
    var ruleObject = extractObjectFromRule(rule);
    var cacheDate;
    calendarUtil = getCalendarUtil(calendarMode);
    var data = [];
    var modifiedDate = new Date(startDate.getTime());
    tempExcludeDate = [];
    var tempDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(excludeDate) ? [] : excludeDate.split(',');
    var tz = new _schedule_timezone_timezone__WEBPACK_IMPORTED_MODULE_3__["Timezone"]();
    tempDate.forEach(function (content) {
        var parsedDate = getDateFromRecurrenceDateString(content);
        if (oldTimezone && newTimezone) {
            parsedDate = tz.convert(new Date(parsedDate.getTime()), oldTimezone, newTimezone);
        }
        tempExcludeDate.push(new Date(parsedDate.getTime()).setHours(0, 0, 0, 0));
    });
    ruleObject.recExceptionCount = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.count) ? tempExcludeDate.length : 0;
    if (viewDate && viewDate > startDate && !ruleObject.count) {
        tempViewDate = new Date(new Date(viewDate.getTime()).setHours(0, 0, 0));
    }
    else {
        tempViewDate = null;
    }
    if (!ruleObject.until && tempViewDate) {
        cacheDate = new Date(tempViewDate.getTime());
        cacheDate.setDate(tempViewDate.getDate() + maximumCount * (ruleObject.interval));
        ruleObject.until = cacheDate;
    }
    if (ruleObject.until && startDate > ruleObject.until) {
        return data;
    }
    maxOccurrence = maximumCount;
    setFirstDayOfWeek(DAYINDEX[startDayOfWeek]);
    switch (ruleObject.freq) {
        case 'DAILY':
            dailyType(modifiedDate, ruleObject.until, data, ruleObject);
            break;
        case 'WEEKLY':
            weeklyType(modifiedDate, ruleObject.until, data, ruleObject);
            break;
        case 'MONTHLY':
            monthlyType(modifiedDate, ruleObject.until, data, ruleObject);
            break;
        case 'YEARLY':
            yearlyType(modifiedDate, ruleObject.until, data, ruleObject);
    }
    return data;
}
function getDateFromRecurrenceDateString(recDateString) {
    return new Date(recDateString.substr(0, 4) +
        '-' + recDateString.substr(4, 2) +
        '-' + recDateString.substr(6, 5) +
        ':' + recDateString.substr(11, 2) +
        ':' + recDateString.substr(13));
}
function excludeDateHandler(data, date) {
    var zeroIndex = new Date(date).setHours(0, 0, 0, 0);
    if (tempExcludeDate.indexOf(zeroIndex) === -1 && (!tempViewDate || zeroIndex >= tempViewDate.getTime())) {
        data.push(date);
    }
}
function getDateCount(startDate, ruleObject) {
    var count = maxOccurrence;
    if (ruleObject.count) {
        count = ruleObject.count;
    }
    else if (ruleObject.until) {
        if (ruleObject.freq === 'DAILY' || ruleObject.freq === 'WEEKLY') {
            count = Math.floor((ruleObject.until.getTime() - startDate.getTime()) / _schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["MS_PER_DAY"]) + 1;
        }
        else if (ruleObject.freq === 'MONTHLY' || ruleObject.freq === 'YEARLY') {
            count = Math.floor(((ruleObject.until.getMonth() + 12 * ruleObject.until.getFullYear()) -
                (startDate.getMonth() + 12 * startDate.getFullYear())) / ruleObject.interval) +
                (ruleObject.day.length > 1 ? (Math.floor((ruleObject.until.getTime() - startDate.getTime()) / _schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["MS_PER_DAY"]) + 1) : 1);
            if (ruleObject.freq === 'YEARLY') {
                count = ruleObject.month.length > 1 ? (count * ruleObject.month.length) : count;
            }
        }
    }
    return count;
}
function dailyType(startDate, endDate, data, ruleObject) {
    var tempDate = new Date(startDate.getTime());
    var interval = ruleObject.interval;
    var expectedCount = getDateCount(startDate, ruleObject);
    var state;
    var expectedDays = ruleObject.day;
    while (compareDates(tempDate, endDate)) {
        state = true;
        state = validateRules(tempDate, ruleObject);
        if (state && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1 || expectedDays.length === 0)) {
            excludeDateHandler(data, tempDate.getTime());
            if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                break;
            }
        }
        tempDate.setDate(tempDate.getDate() + interval);
    }
}
function weeklyType(startDate, endDate, data, ruleObject) {
    var tempDate = new Date(startDate.getTime());
    if (!ruleObject.day.length) {
        ruleObject.day.push(DAYINDEX[startDate.getDay()]);
    }
    var interval = ruleObject.interval;
    var expectedDays = ruleObject.day;
    var expectedCount = getDateCount(startDate, ruleObject);
    var weekState = true;
    var wkstIndex;
    var weekCollection = [];
    if (expectedDays.length > 1) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.wkst) || ruleObject.wkst === '') {
            ruleObject.wkst = dayIndex[0];
        }
        wkstIndex = DAYINDEX.indexOf(ruleObject.wkst);
        while (compareDates(tempDate, endDate)) {
            var startDateDiff = DAYINDEX.indexOf(DAYINDEX[tempDate.getDay()]) - wkstIndex;
            startDateDiff = startDateDiff === -1 ? 6 : startDateDiff;
            var weekstartDate = Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["addDays"])(tempDate, -startDateDiff);
            var weekendDate = Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["addDays"])(weekstartDate, 6);
            var compareTempDate = new Date(tempDate.getTime());
            Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["resetTime"])(weekendDate);
            Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["resetTime"])(compareTempDate);
            while (weekendDate >= compareTempDate) {
                if (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1) {
                    weekCollection.push([tempDate.getTime()]);
                }
                if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                    break;
                }
                tempDate.setDate(tempDate.getDate() + 1);
                compareTempDate = new Date(tempDate.getTime());
                Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["resetTime"])(compareTempDate);
            }
            tempDate.setDate(tempDate.getDate() - 1);
            if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                break;
            }
            tempDate.setDate((tempDate.getDate()) + 1 + ((interval - 1) * 7));
            insertDataCollection(weekCollection, weekState, startDate, endDate, data, ruleObject);
            weekCollection = [];
        }
    }
    else {
        tempDate = getStartDateForWeek(startDate, ruleObject.day);
        while (compareDates(tempDate, endDate)) {
            weekState = validateRules(tempDate, ruleObject);
            if (weekState && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1)) {
                excludeDateHandler(data, tempDate.getTime());
            }
            if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                break;
            }
            tempDate.setDate(tempDate.getDate() + (interval * 7));
        }
        insertDataCollection(weekCollection, weekState, startDate, endDate, data, ruleObject);
        weekCollection = [];
    }
}
function monthlyType(startDate, endDate, data, ruleObject) {
    // Set monthday value if BYDAY, BYMONTH and Month day property is not set based on start date
    if (!ruleObject.month.length && !ruleObject.day.length && !ruleObject.monthDay.length) {
        ruleObject.monthDay.push(startDate.getDate());
        if (ruleObject.freq === 'YEARLY') {
            ruleObject.month.push(startDate.getMonth() + 1);
        }
    }
    else if (ruleObject.month.length > 0 && !ruleObject.day.length && !ruleObject.monthDay.length) {
        ruleObject.monthDay.push(startDate.getDate());
    }
    var ruleType = validateMonthlyRuleType(ruleObject);
    switch (ruleType) {
        case 'day':
            switch (ruleObject.freq) {
                case 'MONTHLY':
                    monthlyDayTypeProcessforMonthFreq(startDate, endDate, data, ruleObject);
                    break;
                case 'YEARLY':
                    monthlyDayTypeProcess(startDate, endDate, data, ruleObject);
                    break;
            }
            break;
        case 'both':
        case 'date':
            switch (ruleObject.freq) {
                case 'MONTHLY':
                    monthlyDateTypeProcessforMonthFreq(startDate, endDate, data, ruleObject);
                    break;
                case 'YEARLY':
                    monthlyDateTypeProcess(startDate, endDate, data, ruleObject);
                    break;
            }
    }
}
function yearlyType(startDate, endDate, data, ruleObject) {
    var typeValue = checkYearlyType(ruleObject);
    switch (typeValue) {
        case 'MONTH':
            monthlyType(startDate, endDate, data, ruleObject);
            break;
        case 'WEEKNO':
            processWeekNo(startDate, endDate, data, ruleObject);
            break;
        case 'YEARDAY':
            processYearDay(startDate, endDate, data, ruleObject);
            break;
    }
}
function processWeekNo(startDate, endDate, data, ruleObject) {
    var stDate = calendarUtil.getYearLastDate(startDate, 0);
    var tempDate;
    var expectedCount = getDateCount(startDate, ruleObject);
    var state;
    var startDay;
    var firstWeekSpan;
    var weekNos = ruleObject.weekNo;
    var weekNo;
    var maxDate;
    var minDate;
    var weekCollection = [];
    var expectedDays = ruleObject.day;
    while (compareDates(stDate, endDate)) {
        startDay = dayIndex.indexOf(DAYINDEX[stDate.getDay()]);
        firstWeekSpan = (6 - startDay) + 1;
        for (var index = 0; index < weekNos.length; index++) {
            weekNo = weekNos[index];
            weekNo = (weekNo > 0) ? weekNo : 53 + weekNo + 1;
            maxDate = (weekNo === 1) ? firstWeekSpan : firstWeekSpan + ((weekNo - 1) * 7);
            minDate = (weekNo === 1) ? firstWeekSpan - 7 : firstWeekSpan + ((weekNo - 2) * 7);
            while (minDate < maxDate) {
                tempDate = new Date(stDate.getTime() + (_schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["MS_PER_DAY"] * minDate));
                if (expectedDays.length === 0 || expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1) {
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
                        insertDateCollection(state, startDate, endDate, data, ruleObject, tempDate.getTime());
                    }
                    else {
                        weekCollection.push([tempDate.getTime()]);
                    }
                }
                minDate++;
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
            insertDatasIntoExistingCollection(weekCollection, state, startDate, endDate, data, ruleObject);
        }
        if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
            return;
        }
        stDate = calendarUtil.getYearLastDate(tempDate, ruleObject.interval);
        weekCollection = [];
    }
}
function processYearDay(startDate, endDate, data, ruleObject) {
    var stDate = calendarUtil.getYearLastDate(startDate, 0);
    var tempDate;
    var expectedCount = getDateCount(startDate, ruleObject);
    var state;
    var dateCollection = [];
    var date;
    var expectedDays = ruleObject.day;
    while (compareDates(stDate, endDate)) {
        for (var index = 0; index < ruleObject.yearDay.length; index++) {
            date = ruleObject.yearDay[index];
            tempDate = new Date(stDate.getTime());
            if ((date === calendarUtil.getLeapYearDaysCount() || date === -calendarUtil.getLeapYearDaysCount()) &&
                (!calendarUtil.isLeapYear(calendarUtil.getFullYear(tempDate), 1))) {
                tempDate.setDate(tempDate.getDate() + 1);
                continue;
            }
            tempDate.setDate(tempDate.getDate() + ((date < 0) ?
                calendarUtil.getYearDaysCount(tempDate, 1) + 1 + date : date));
            if (expectedDays.length === 0 || expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1) {
                if (ruleObject.setPosition == null) {
                    insertDateCollection(state, startDate, endDate, data, ruleObject, tempDate.getTime());
                }
                else {
                    dateCollection.push([tempDate.getTime()]);
                }
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
            insertDatasIntoExistingCollection(dateCollection, state, startDate, endDate, data, ruleObject);
        }
        if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
            return;
        }
        stDate = calendarUtil.getYearLastDate(tempDate, ruleObject.interval);
        dateCollection = [];
    }
}
function checkYearlyType(ruleObject) {
    if (ruleObject.yearDay.length) {
        return 'YEARDAY';
    }
    else if (ruleObject.weekNo.length) {
        return 'WEEKNO';
    }
    return 'MONTH';
}
function initializeRecRuleVariables(startDate, ruleObject) {
    var ruleData = {
        monthCollection: [],
        index: 0,
        tempDate: new Date(startDate.getTime()),
        mainDate: new Date(startDate.getTime()),
        expectedCount: getDateCount(startDate, ruleObject),
        monthInit: 0,
        dateCollection: [],
    };
    if (ruleObject.month.length) {
        calendarUtil.setMonth(ruleData.tempDate, ruleObject.month[0], ruleData.tempDate.getDate());
    }
    return ruleData;
}
function monthlyDateTypeProcess(startDate, endDate, data, ruleObject) {
    if (ruleObject.month.length) {
        monthlyDateTypeProcessforMonthFreq(startDate, endDate, data, ruleObject);
        return;
    }
    var ruleData = initializeRecRuleVariables(startDate, ruleObject);
    var currentMonthDate;
    ruleData.tempDate = ruleData.mainDate = calendarUtil.getMonthStartDate(ruleData.tempDate);
    while (compareDates(ruleData.tempDate, endDate)) {
        currentMonthDate = new Date(ruleData.tempDate.getTime());
        while (calendarUtil.isSameYear(currentMonthDate, ruleData.tempDate) &&
            (ruleData.expectedCount && (data.length + ruleObject.recExceptionCount) <= ruleData.expectedCount)) {
            if (ruleObject.month.length === 0 || (ruleObject.month.length > 0
                && !calendarUtil.checkMonth(ruleData.tempDate, ruleObject.month))) {
                processDateCollectionForByMonthDay(ruleObject, ruleData, endDate, false);
                ruleData.beginDate = new Date(ruleData.tempDate.getTime());
                ruleData.monthInit = setNextValidDate(ruleData.tempDate, ruleObject, ruleData.monthInit, ruleData.beginDate);
            }
            else {
                calendarUtil.setValidDate(ruleData.tempDate, 1, 1);
                ruleData.tempDate = getStartDateForWeek(ruleData.tempDate, ruleObject.day);
                break;
            }
        }
        ruleData.tempDate.setFullYear(currentMonthDate.getFullYear(), currentMonthDate.getMonth(), currentMonthDate.getDate());
        insertDataCollection(ruleData.dateCollection, ruleData.state, startDate, endDate, data, ruleObject);
        if (calendarUtil.isLastMonth(ruleData.tempDate)) {
            calendarUtil.setValidDate(ruleData.tempDate, 1, 1);
            ruleData.tempDate = getStartDateForWeek(ruleData.tempDate, ruleObject.day);
        }
        if (ruleData.expectedCount && (data.length + ruleObject.recExceptionCount) >= ruleData.expectedCount) {
            return;
        }
        ruleData.tempDate.setFullYear(ruleData.tempDate.getFullYear() + ruleObject.interval - 1);
        ruleData.tempDate = getStartDateForWeek(ruleData.tempDate, ruleObject.day);
        ruleData.monthInit = setNextValidDate(ruleData.tempDate, ruleObject, ruleData.monthInit, ruleData.beginDate);
        ruleData.dateCollection = [];
    }
}
function monthlyDateTypeProcessforMonthFreq(startDate, endDate, data, ruleObject) {
    var ruleData = initializeRecRuleVariables(startDate, ruleObject);
    ruleData.tempDate = ruleData.mainDate = calendarUtil.getMonthStartDate(ruleData.tempDate);
    if (((ruleObject.freq === 'MONTHLY' && ruleObject.interval === 12) || (ruleObject.freq === 'YEARLY')) &&
        calendarUtil.getMonthDaysCount(startDate) < ruleObject.monthDay[0]) {
        return;
    }
    while (compareDates(ruleData.tempDate, endDate)) {
        ruleData.beginDate = new Date(ruleData.tempDate.getTime());
        processDateCollectionForByMonthDay(ruleObject, ruleData, endDate, true, startDate, data);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
            insertDatasIntoExistingCollection(ruleData.dateCollection, ruleData.state, startDate, endDate, data, ruleObject);
        }
        if (ruleData.expectedCount && (data.length + ruleObject.recExceptionCount) >= ruleData.expectedCount) {
            return;
        }
        ruleData.monthInit = setNextValidDate(ruleData.tempDate, ruleObject, ruleData.monthInit, ruleData.beginDate);
        ruleData.dateCollection = [];
    }
}
// To process date collection for Monthly & Yearly based on BYMONTH Day property
function processDateCollectionForByMonthDay(ruleObject, recRuleVariables, endDate, isByMonth, startDate, data) {
    for (var index = 0; index < ruleObject.monthDay.length; index++) {
        recRuleVariables.date = ruleObject.monthDay[index];
        recRuleVariables.tempDate = calendarUtil.getMonthStartDate(recRuleVariables.tempDate);
        var maxDate = calendarUtil.getMonthDaysCount(recRuleVariables.tempDate);
        recRuleVariables.date = recRuleVariables.date > 0 ? recRuleVariables.date : (maxDate + recRuleVariables.date + 1);
        if (validateProperDate(recRuleVariables.tempDate, recRuleVariables.date, recRuleVariables.mainDate)
            && (recRuleVariables.date > 0)) {
            calendarUtil.setDate(recRuleVariables.tempDate, recRuleVariables.date);
            if (endDate && recRuleVariables.tempDate > endDate) {
                return;
            }
            if (ruleObject.day.length === 0 || ruleObject.day.indexOf(DAYINDEX[recRuleVariables.tempDate.getDay()]) > -1) {
                if (isByMonth && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition) && (recRuleVariables.expectedCount
                    && (data.length + ruleObject.recExceptionCount) < recRuleVariables.expectedCount)) {
                    insertDateCollection(recRuleVariables.state, startDate, endDate, data, ruleObject, recRuleVariables.tempDate.getTime());
                }
                else {
                    recRuleVariables.dateCollection.push([recRuleVariables.tempDate.getTime()]);
                }
            }
        }
    }
}
function setNextValidDate(tempDate, ruleObject, monthInit, beginDate, interval) {
    if (beginDate === void 0) { beginDate = null; }
    var monthData = beginDate ? beginDate.getMonth() : 0;
    var startDate = calendarUtil.getMonthStartDate(tempDate);
    interval = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(interval) ? ruleObject.interval : interval;
    tempDate.setFullYear(startDate.getFullYear());
    tempDate.setMonth(startDate.getMonth());
    tempDate.setDate(startDate.getDate());
    if (ruleObject.month.length) {
        monthInit++;
        monthInit = monthInit % ruleObject.month.length;
        calendarUtil.setMonth(tempDate, ruleObject.month[monthInit], 1);
        if (monthInit === 0) {
            calendarUtil.addYears(tempDate, interval, ruleObject.month[0]);
        }
    }
    else {
        if (beginDate && (beginDate.getFullYear() < tempDate.getFullYear())) {
            monthData = tempDate.getMonth() - 1;
        }
        calendarUtil.setValidDate(tempDate, interval, 1, monthData, beginDate);
    }
    return monthInit;
}
// To get month collection when BYDAY property having more than one value in list.
function getMonthCollection(startDate, endDate, data, ruleObject) {
    var expectedDays = ruleObject.day;
    var tempDate = new Date(startDate.getTime());
    tempDate = calendarUtil.getMonthStartDate(tempDate);
    var monthCollection = [];
    var dateCollection = [];
    var dates = [];
    var index;
    var state;
    var expectedCount = getDateCount(startDate, ruleObject);
    var monthInit = 0;
    var beginDate;
    if (ruleObject.month.length) {
        calendarUtil.setMonth(tempDate, ruleObject.month[0], 1);
    }
    tempDate = getStartDateForWeek(tempDate, ruleObject.day);
    while (compareDates(tempDate, endDate)
        && (expectedCount && (data.length + ruleObject.recExceptionCount) < expectedCount)) {
        var currentMonthDate = new Date(tempDate.getTime());
        var isHavingNumber = expectedDays.map(function (item) { return HASNUMBER.test(item); });
        if (isHavingNumber.indexOf(true) > -1) {
            for (var j = 0; j <= expectedDays.length - 1; j++) {
                var expectedDaysArray = expectedDays[j].match(SPLITNUMBERANDSTRING);
                var position = parseInt(expectedDaysArray[0], 10);
                tempDate = new Date(tempDate.getTime());
                tempDate = calendarUtil.getMonthStartDate(tempDate);
                tempDate = getStartDateForWeek(tempDate, expectedDays);
                currentMonthDate.setFullYear(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());
                while (calendarUtil.isSameYear(currentMonthDate, tempDate) && calendarUtil.isSameMonth(currentMonthDate, tempDate)) {
                    if (expectedDaysArray[expectedDaysArray.length - 1] === DAYINDEX[currentMonthDate.getDay()]) {
                        monthCollection.push([currentMonthDate.getTime()]);
                    }
                    currentMonthDate.setDate(currentMonthDate.getDate() + (1));
                }
                currentMonthDate.setDate(currentMonthDate.getDate() - (1));
                if (expectedDaysArray[0].indexOf('-') > -1) {
                    index = monthCollection.length - (-1 * position);
                }
                else {
                    index = position - 1;
                }
                index = isNaN(index) ? 0 : index;
                if (monthCollection.length > 0) {
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) ?
                        insertDatasIntoExistingCollection(monthCollection, state, startDate, endDate, data, ruleObject, index) :
                        dateCollection = [(filterDateCollectionByIndex(monthCollection, index, dates))];
                }
                if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                    return;
                }
                monthCollection = [];
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
                insertDateCollectionBasedonBySetPos(dateCollection, state, startDate, endDate, data, ruleObject);
                dates = [];
            }
            monthInit = setNextValidDate(tempDate, ruleObject, monthInit, beginDate);
            tempDate = getStartDateForWeek(tempDate, ruleObject.day);
            monthCollection = [];
        }
        else {
            var weekCollection = [];
            var dayCycleData = processWeekDays(expectedDays);
            currentMonthDate.setFullYear(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());
            var initialDate = new Date(tempDate.getTime());
            beginDate = new Date(tempDate.getTime());
            while (calendarUtil.isSameMonth(initialDate, tempDate)) {
                weekCollection.push(tempDate.getTime());
                if (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1) {
                    monthCollection.push(weekCollection);
                    weekCollection = [];
                }
                tempDate.setDate(tempDate.getDate()
                    + dayCycleData[DAYINDEX[tempDate.getDay()]]);
            }
            index = ((ruleObject.setPosition < 1) ? (monthCollection.length + ruleObject.setPosition) : ruleObject.setPosition - 1);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
                index = 0;
                var datas = [];
                for (var week = 0; week < monthCollection.length; week++) {
                    for (var row = 0; row < monthCollection[week].length; row++) {
                        datas.push(monthCollection[week][row]);
                    }
                }
                monthCollection = [datas];
            }
            if (monthCollection.length > 0) {
                insertDatasIntoExistingCollection(monthCollection, state, startDate, endDate, data, ruleObject, index);
            }
            if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                return;
            }
            monthInit = setNextValidDate(tempDate, ruleObject, monthInit, beginDate);
            tempDate = getStartDateForWeek(tempDate, ruleObject.day);
            monthCollection = [];
        }
    }
}
// To process monday day type for FREQ=MONTHLY
function monthlyDayTypeProcessforMonthFreq(startDate, endDate, data, ruleObject) {
    var expectedDays = ruleObject.day;
    // When BYDAY property having more than 1 value.
    if (expectedDays.length > 1) {
        getMonthCollection(startDate, endDate, data, ruleObject);
        return;
    }
    var tempDate = new Date(startDate.getTime());
    var expectedCount = getDateCount(startDate, ruleObject);
    var monthCollection = [];
    var beginDate;
    var monthInit = 0;
    tempDate = calendarUtil.getMonthStartDate(tempDate);
    if (ruleObject.month.length) {
        calendarUtil.setMonth(tempDate, ruleObject.month[0], 1);
    }
    tempDate = getStartDateForWeek(tempDate, ruleObject.day);
    while (compareDates(tempDate, endDate) && (expectedCount && (data.length + ruleObject.recExceptionCount) < expectedCount)) {
        beginDate = new Date(tempDate.getTime());
        var currentMonthDate = new Date(tempDate.getTime());
        while (calendarUtil.isSameMonth(tempDate, currentMonthDate)) {
            monthCollection.push([currentMonthDate.getTime()]);
            currentMonthDate.setDate(currentMonthDate.getDate() + (7));
        }
        // To filter date collection based on BYDAY Index, then BYSETPOS and to insert datas into existing collection
        insertDateCollectionBasedonIndex(monthCollection, startDate, endDate, data, ruleObject);
        monthInit = setNextValidDate(tempDate, ruleObject, monthInit, beginDate);
        tempDate = getStartDateForWeek(tempDate, ruleObject.day);
        monthCollection = [];
    }
}
// To process monday day type for FREQ=YEARLY
function monthlyDayTypeProcess(startDate, endDate, data, ruleObject) {
    var expectedDays = ruleObject.day;
    var isHavingNumber = expectedDays.map(function (item) { return HASNUMBER.test(item); });
    // If BYDAY property having more than 1 value in list
    if (expectedDays.length > 1 && isHavingNumber.indexOf(true) > -1) {
        processDateCollectionforByDayWithInteger(startDate, endDate, data, ruleObject);
        return;
    }
    else if (ruleObject.month.length && expectedDays.length === 1 && isHavingNumber.indexOf(true) > -1) {
        monthlyDayTypeProcessforMonthFreq(startDate, endDate, data, ruleObject);
        return;
    }
    var tempDate = new Date(startDate.getTime());
    var currentMonthDate;
    var expectedCount = getDateCount(startDate, ruleObject);
    var interval = ruleObject.interval;
    var monthCollection = [];
    if (ruleObject.month.length) {
        calendarUtil.setMonth(tempDate, ruleObject.month[0], tempDate.getDate());
    }
    // Set the date as start date of the yeear if yearly freq having ByDay property alone
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition) && ruleObject.month.length === 0 && ruleObject.weekNo.length === 0) {
        tempDate.setFullYear(startDate.getFullYear(), 0, 1);
    }
    tempDate = calendarUtil.getMonthStartDate(tempDate);
    tempDate = getStartDateForWeek(tempDate, ruleObject.day);
    while (compareDates(tempDate, endDate)) {
        currentMonthDate = new Date(tempDate.getTime());
        while (calendarUtil.isSameYear(currentMonthDate, tempDate) &&
            (expectedCount && (data.length + ruleObject.recExceptionCount) <= expectedCount)) {
            currentMonthDate = new Date(tempDate.getTime());
            while (calendarUtil.isSameYear(currentMonthDate, tempDate)) {
                if (ruleObject.month.length === 0 || (ruleObject.month.length > 0
                    && !calendarUtil.checkMonth(tempDate, ruleObject.month))) {
                    if (expectedDays.length > 1) {
                        if (calendarUtil.compareMonth(currentMonthDate, tempDate)) {
                            calendarUtil.setValidDate(tempDate, 1, 1);
                            tempDate = getStartDateForWeek(tempDate, ruleObject.day);
                            break;
                        }
                        if (expectedDays.indexOf(DAYINDEX[currentMonthDate.getDay()]) > -1) {
                            monthCollection.push([currentMonthDate.getTime()]);
                        }
                        currentMonthDate.setDate(currentMonthDate.getDate() + (1));
                    }
                    else {
                        // If BYDAY property having 1 value in list
                        if (currentMonthDate.getFullYear() > tempDate.getFullYear()) {
                            calendarUtil.setValidDate(tempDate, 1, 1);
                            tempDate = getStartDateForWeek(tempDate, ruleObject.day);
                            break;
                        }
                        var newstr = getDayString(expectedDays[0]);
                        if (DAYINDEX[currentMonthDate.getDay()] === newstr
                            && new Date(currentMonthDate.getFullYear(), currentMonthDate.getMonth(), 0)
                                > new Date(startDate.getFullYear())) {
                            monthCollection.push([currentMonthDate.getTime()]);
                        }
                        currentMonthDate.setDate(currentMonthDate.getDate() + (7));
                    }
                }
                else {
                    calendarUtil.setValidDate(tempDate, 1, 1);
                    tempDate = getStartDateForWeek(tempDate, ruleObject.day);
                    break;
                }
            }
        }
        tempDate.setFullYear(currentMonthDate.getFullYear(), currentMonthDate.getMonth(), currentMonthDate.getDate());
        // To filter date collection based on BYDAY Index, then BYSETPOS and to insert datas into existing collection
        insertDateCollectionBasedonIndex(monthCollection, startDate, endDate, data, ruleObject);
        if (calendarUtil.isLastMonth(tempDate)) {
            calendarUtil.setValidDate(tempDate, 1, 1);
            tempDate = getStartDateForWeek(tempDate, ruleObject.day);
        }
        tempDate.setFullYear(tempDate.getFullYear() + interval - 1);
        if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
            return;
        }
        tempDate = getStartDateForWeek(tempDate, ruleObject.day);
        monthCollection = [];
    }
}
// To process the recurrence rule when BYDAY property having values with integer
function processDateCollectionforByDayWithInteger(startDate, endDate, data, ruleObject) {
    var expectedDays = ruleObject.day;
    var expectedCount = getDateCount(startDate, ruleObject);
    var tempDate = new Date(startDate.getTime());
    var interval = ruleObject.interval;
    var monthCollection = [];
    var dateCollection = [];
    var index;
    var state;
    var monthInit = 0;
    var currentMonthDate;
    var currentDate;
    var beginDate;
    tempDate = calendarUtil.getMonthStartDate(tempDate);
    var datas = [];
    if (ruleObject.month.length) {
        calendarUtil.setMonth(tempDate, ruleObject.month[0], 1);
    }
    tempDate = getStartDateForWeek(tempDate, ruleObject.day);
    while (compareDates(tempDate, endDate)) {
        currentMonthDate = new Date(tempDate.getTime());
        for (var i = 0; i <= ruleObject.month.length; i++) {
            for (var j = 0; j <= expectedDays.length - 1; j++) {
                tempDate = calendarUtil.getMonthStartDate(tempDate);
                tempDate = getStartDateForWeek(tempDate, ruleObject.day);
                monthCollection = [];
                while (calendarUtil.isSameYear(currentMonthDate, tempDate) &&
                    (expectedCount && (data.length + ruleObject.recExceptionCount) <= expectedCount)) {
                    while (calendarUtil.isSameYear(currentMonthDate, tempDate)) {
                        currentMonthDate = new Date(tempDate.getTime());
                        if (ruleObject.month.length === 0 ||
                            (ruleObject.month.length > 0 && ruleObject.month[i] === calendarUtil.getMonth(currentMonthDate))) {
                            var expectedDaysArray = expectedDays[j].match(SPLITNUMBERANDSTRING);
                            var position = parseInt(expectedDaysArray[0], 10);
                            currentDate = new Date(tempDate.getTime());
                            while (calendarUtil.isSameYear(currentDate, tempDate)
                                && calendarUtil.isSameMonth(currentDate, tempDate)) {
                                if (expectedDaysArray[expectedDaysArray.length - 1] === DAYINDEX[currentDate.getDay()]) {
                                    monthCollection.push([currentDate.getTime()]);
                                }
                                currentDate.setDate(currentDate.getDate() + (1));
                            }
                            currentDate.setDate(currentDate.getDate() - (1));
                            if (expectedDaysArray[0].indexOf('-') > -1) {
                                index = monthCollection.length - (-1 * position);
                            }
                            else {
                                index = position - 1;
                            }
                            index = isNaN(index) ? 0 : index;
                        }
                        monthInit = setNextValidDate(tempDate, ruleObject, monthInit, beginDate, 1);
                        tempDate = getStartDateForWeek(tempDate, ruleObject.day);
                    }
                }
                tempDate = j === 0 && currentDate ? new Date(currentDate.getTime()) : new Date(currentMonthDate.getTime());
                if (monthCollection.length > 0) {
                    (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) ?
                        insertDatasIntoExistingCollection(monthCollection, state, startDate, endDate, data, ruleObject, index) :
                        dateCollection = [(filterDateCollectionByIndex(monthCollection, index, datas))];
                }
                if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
                    return;
                }
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
            insertDateCollectionBasedonBySetPos(dateCollection, state, startDate, endDate, data, ruleObject);
            datas = [];
        }
        if (calendarUtil.isLastMonth(tempDate)) {
            calendarUtil.setValidDate(tempDate, 1, 1);
            tempDate.setFullYear(tempDate.getFullYear() + interval - 1);
        }
        else {
            tempDate.setFullYear(tempDate.getFullYear() + interval);
        }
        tempDate = getStartDateForWeek(tempDate, ruleObject.day);
        if (ruleObject.month.length) {
            calendarUtil.setMonth(tempDate, ruleObject.month[0], tempDate.getDate());
        }
    }
}
// To get recurrence collection if BYSETPOS is null
function getRecurrenceCollection(monthCollection, expectedDays) {
    var index;
    var recurrenceCollectionObject = {
        monthCollection: [],
        index: 0,
    };
    if (expectedDays.length === 1) {
        // To split numeric value from BYDAY property value
        var expectedDaysArrays = expectedDays[0].match(SPLITNUMBERANDSTRING);
        var arrPosition = void 0;
        if (expectedDaysArrays.length > 1) {
            arrPosition = parseInt(expectedDaysArrays[0], 10);
            index = ((arrPosition < 1) ? (monthCollection.length + arrPosition) : arrPosition - 1);
        }
        else {
            index = 0;
            monthCollection = getDateCollectionforBySetPosNull(monthCollection);
        }
    }
    else {
        index = 0;
        monthCollection = getDateCollectionforBySetPosNull(monthCollection);
    }
    recurrenceCollectionObject.monthCollection = monthCollection;
    recurrenceCollectionObject.index = index;
    return recurrenceCollectionObject;
}
function insertDataCollection(dateCollection, state, startDate, endDate, data, ruleObject) {
    var index = ((ruleObject.setPosition < 1) ?
        (dateCollection.length + ruleObject.setPosition) : ruleObject.setPosition - 1);
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(ruleObject.setPosition)) {
        index = 0;
        dateCollection = getDateCollectionforBySetPosNull(dateCollection);
    }
    if (dateCollection.length > 0) {
        insertDatasIntoExistingCollection(dateCollection, state, startDate, endDate, data, ruleObject, index);
    }
}
// To process month collection if BYSETPOS is null
function getDateCollectionforBySetPosNull(monthCollection) {
    var datas = [];
    for (var week = 0; week < monthCollection.length; week++) {
        for (var row = 0; row < monthCollection[week].length; row++) {
            datas.push(new Date(monthCollection[week][row]).getTime());
        }
    }
    monthCollection = datas.length > 0 ? [datas] : [];
    return monthCollection;
}
// To filter date collection based on BYDAY Index, then BYSETPOS and to insert datas into existing collection
function insertDateCollectionBasedonIndex(monthCollection, startDate, endDate, data, ruleObject) {
    var expectedDays = ruleObject.day;
    var index;
    var state;
    var datas = [];
    var dateCollection = [];
    var recurrenceCollections;
    recurrenceCollections = getRecurrenceCollection(monthCollection, expectedDays);
    monthCollection = recurrenceCollections.monthCollection;
    index = recurrenceCollections.index;
    if (ruleObject.setPosition != null) {
        dateCollection = [(filterDateCollectionByIndex(monthCollection, index, datas))];
        insertDateCollectionBasedonBySetPos(dateCollection, state, startDate, endDate, data, ruleObject);
    }
    else {
        if (monthCollection.length > 0) {
            insertDatasIntoExistingCollection(monthCollection, state, startDate, endDate, data, ruleObject, index);
        }
    }
    datas = [];
}
// To filter date collection when BYDAY property having values with number
function filterDateCollectionByIndex(monthCollection, index, datas) {
    for (var week = 0; week < monthCollection[index].length; week++) {
        datas.push(monthCollection[index][week]);
    }
    return datas;
}
// To insert processed date collection in final array element
function insertDateCollection(state, startDate, endDate, data, ruleObject, dayData) {
    var expectedCount = getDateCount(startDate, ruleObject);
    var chDate = new Date(dayData);
    state = validateRules(chDate, ruleObject);
    if ((chDate >= startDate) && compareDates(chDate, endDate) && state
        && expectedCount && (data.length + ruleObject.recExceptionCount) < expectedCount) {
        excludeDateHandler(data, dayData);
    }
}
// To process datte collection based on Byset position after process the collection based on BYDAY property value index: EX:BYDAY=1SUm-1SU
function insertDateCollectionBasedonBySetPos(monthCollection, state, startDate, endDate, data, ruleObject) {
    if (monthCollection.length > 0) {
        for (var week = 0; week < monthCollection.length; week++) {
            monthCollection[week].sort();
            var index = ((ruleObject.setPosition < 1)
                ? (monthCollection[week].length + ruleObject.setPosition) : ruleObject.setPosition - 1);
            var dayData = monthCollection[week][index];
            insertDateCollection(state, startDate, endDate, data, ruleObject, dayData);
        }
    }
}
// To insert datas into existing collection which is processed from previous loop.
function insertDatasIntoExistingCollection(monthCollection, state, startDate, endDate, data, ruleObject, index) {
    if (monthCollection.length > 0) {
        index = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) ? index :
            ((ruleObject.setPosition < 1)
                ? (monthCollection.length + ruleObject.setPosition) : ruleObject.setPosition - 1);
        monthCollection[index].sort();
        for (var week = 0; week < monthCollection[index].length; week++) {
            var dayData = monthCollection[index][week];
            insertDateCollection(state, startDate, endDate, data, ruleObject, dayData);
        }
    }
}
function compareDates(startDate, endDate) {
    return endDate ? (startDate <= endDate) : true;
}
function getDayString(expectedDays) {
    // To get BYDAY value without numeric value
    var newstr = expectedDays.replace(REMOVENUMBERINSTRING, '');
    return newstr;
}
function checkDayIndex(day, expectedDays) {
    var sortedExpectedDays = [];
    expectedDays.forEach(function (element) {
        var expectedDaysNumberSplit = element.match(SPLITNUMBERANDSTRING);
        if (expectedDaysNumberSplit.length === 2) {
            sortedExpectedDays.push(expectedDaysNumberSplit[1]);
        }
        else {
            sortedExpectedDays.push(expectedDaysNumberSplit[0]);
        }
    });
    return (sortedExpectedDays.indexOf(DAYINDEX[day]) === -1);
}
function getStartDateForWeek(startDate, expectedDays) {
    var tempDate = new Date(startDate.getTime());
    var newstr;
    if (expectedDays.length > 0) {
        var expectedDaysArr = [];
        for (var i = 0; i <= expectedDays.length - 1; i++) {
            newstr = getDayString(expectedDays[i]);
            expectedDaysArr.push(newstr);
        }
        if (expectedDaysArr.indexOf(DAYINDEX[tempDate.getDay()]) === -1) {
            do {
                tempDate.setDate(tempDate.getDate() + 1);
            } while (expectedDaysArr.indexOf(DAYINDEX[tempDate.getDay()]) === -1);
        }
    }
    return tempDate;
}
function extractObjectFromRule(rules) {
    var ruleObject = {
        freq: null,
        interval: 1,
        count: null,
        until: null,
        day: [],
        wkst: null,
        month: [],
        weekNo: [],
        monthDay: [],
        yearDay: [],
        setPosition: null,
        validRules: []
    };
    var rulesList = rules.split(';');
    var splitData = [];
    var temp;
    rulesList.forEach(function (data) {
        splitData = data.split('=');
        switch (splitData[0]) {
            case 'UNTIL':
                temp = splitData[1];
                ruleObject.until = getDateFromRecurrenceDateString(temp);
                break;
            case 'BYDAY':
                ruleObject.day = splitData[1].split(',');
                ruleObject.validRules.push(splitData[0]);
                break;
            case 'BYMONTHDAY':
                ruleObject.monthDay = splitData[1].split(',').map(Number);
                ruleObject.validRules.push(splitData[0]);
                break;
            case 'BYMONTH':
                ruleObject.month = splitData[1].split(',').map(Number);
                ruleObject.validRules.push(splitData[0]);
                break;
            case 'BYYEARDAY':
                ruleObject.yearDay = splitData[1].split(',').map(Number);
                ruleObject.validRules.push(splitData[0]);
                break;
            case 'BYWEEKNO':
                ruleObject.weekNo = splitData[1].split(',').map(Number);
                ruleObject.validRules.push(splitData[0]);
                break;
            case 'INTERVAL':
                ruleObject.interval = parseInt(splitData[1], 10);
                break;
            case 'COUNT':
                ruleObject.count = parseInt(splitData[1], 10);
                break;
            case 'BYSETPOS':
                ruleObject.setPosition = parseInt(splitData[1], 10) > 4 ? -1 : parseInt(splitData[1], 10);
                break;
            case 'FREQ':
                ruleObject.freq = splitData[1];
                break;
            case 'WKST':
                ruleObject.wkst = splitData[1];
                break;
        }
    });
    if ((ruleObject.freq === 'MONTHLY') && (ruleObject.monthDay.length === 0)) {
        var index = ruleObject.validRules.indexOf('BYDAY');
        ruleObject.validRules.splice(index, 1);
    }
    return ruleObject;
}
function validateProperDate(tempDate, data, startDate) {
    var maxDate = calendarUtil.getMonthDaysCount(tempDate);
    return (data <= maxDate) && (tempDate >= startDate);
}
function processWeekDays(expectedDays) {
    var dayCycle = {};
    expectedDays.forEach(function (element, index) {
        if (index === expectedDays.length - 1) {
            var startIndex = dayIndex.indexOf(element);
            var temp = startIndex;
            while (temp % 7 !== dayIndex.indexOf(expectedDays[0])) {
                temp++;
            }
            dayCycle[element] = temp - startIndex;
        }
        else {
            dayCycle[element] = dayIndex.indexOf(expectedDays[(index + 1)]) - dayIndex.indexOf(element);
        }
    });
    return dayCycle;
}
function checkDate(tempDate, expectedDate) {
    var temp = expectedDate.slice(0);
    var data;
    var maxDate = calendarUtil.getMonthDaysCount(tempDate);
    data = temp.shift();
    while (data) {
        if (data < 0) {
            data = data + maxDate + 1;
        }
        if (data === tempDate.getDate()) {
            return false;
        }
        data = temp.shift();
    }
    return true;
}
function checkYear(tempDate, expectedyearDay) {
    var temp = expectedyearDay.slice(0);
    var data;
    var yearDay = getYearDay(tempDate);
    data = temp.shift();
    while (data) {
        if (data < 0) {
            data = data + calendarUtil.getYearDaysCount(tempDate, 0) + 1;
        }
        if (data === yearDay) {
            return false;
        }
        data = temp.shift();
    }
    return true;
}
function getYearDay(currentDate) {
    if (!startDateCollection[calendarUtil.getFullYear(currentDate)]) {
        startDateCollection[calendarUtil.getFullYear(currentDate)] = calendarUtil.getYearLastDate(currentDate, 0);
    }
    var tempDate = startDateCollection[calendarUtil.getFullYear(currentDate)];
    var diff = currentDate.getTime() - tempDate.getTime();
    return Math.ceil(diff / _schedule_base_util__WEBPACK_IMPORTED_MODULE_1__["MS_PER_DAY"]);
}
function validateMonthlyRuleType(ruleObject) {
    if (ruleObject.monthDay.length && !ruleObject.day.length) {
        return 'date';
    }
    else if (!ruleObject.monthDay.length && ruleObject.day.length) {
        return 'day';
    }
    return 'both';
}
function rotate(days) {
    var data = days.shift();
    days.push(data);
}
function setFirstDayOfWeek(day) {
    while (dayIndex[0] !== day) {
        rotate(dayIndex);
    }
}
function validateRules(tempDate, ruleObject) {
    var state = true;
    var expectedDays = ruleObject.day;
    var expectedMonth = ruleObject.month;
    var expectedDate = calendarUtil.getExpectedDays(tempDate, ruleObject.monthDay);
    var expectedyearDay = ruleObject.yearDay;
    ruleObject.validRules.forEach(function (rule) {
        switch (rule) {
            case 'BYDAY':
                if (checkDayIndex(tempDate.getDay(), expectedDays)) {
                    state = false;
                }
                break;
            case 'BYMONTH':
                if (calendarUtil.checkMonth(tempDate, expectedMonth)) {
                    state = false;
                }
                break;
            case 'BYMONTHDAY':
                if (checkDate(tempDate, expectedDate)) {
                    state = false;
                }
                break;
            case 'BYYEARDAY':
                if (checkYear(tempDate, expectedyearDay)) {
                    state = false;
                }
                break;
        }
    });
    return state;
}
function getCalendarUtil(calendarMode) {
    if (calendarMode === 'Islamic') {
        return new _common_calendar_util__WEBPACK_IMPORTED_MODULE_2__["Islamic"]();
    }
    return new _common_calendar_util__WEBPACK_IMPORTED_MODULE_2__["Gregorian"]();
}
var startDateCollection = {};
var tempExcludeDate;
var dayIndex = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
var maxOccurrence;
var tempViewDate;
var calendarUtil;
var DAYINDEX = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
var MAXOCCURRENCE = 43;
var WEEKPOS = ['first', 'second', 'third', 'fourth', 'last'];
var TIMES = 'summaryTimes';
var ON = 'summaryOn';
var EVERY = 'every';
var UNTIL = 'summaryUntil';
var DAYS = 'summaryDay';
var WEEKS = 'summaryWeek';
var MONTHS = 'summaryMonth';
var YEARS = 'summaryYear';
var DAYINDEXOBJECT = {
    SU: 'sun',
    MO: 'mon',
    TU: 'tue',
    WE: 'wed',
    TH: 'thu',
    FR: 'fri',
    SA: 'sat'
};
// To check string has number
var HASNUMBER = /\d/;
// To find the numbers in string
var REMOVENUMBERINSTRING = /[^A-Z]+/;
// To split number and string
var SPLITNUMBERANDSTRING = /[a-z]+|[^a-z]+/gi;
function getRecurrenceStringFromDate(date) {
    return [date.getUTCFullYear(),
        roundDateValues(date.getUTCMonth() + 1),
        roundDateValues(date.getUTCDate()),
        'T',
        roundDateValues(date.getUTCHours()),
        roundDateValues(date.getUTCMinutes()),
        roundDateValues(date.getUTCSeconds()),
        'Z'].join('');
}
function roundDateValues(date) {
    return ('0' + date).slice(-2);
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/index.js":
/*!*******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/index.js ***!
  \*******************************************************************************/
/*! exports provided: RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _recurrence_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./recurrence-editor */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/recurrence-editor.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RecurrenceEditor", function() { return _recurrence_editor__WEBPACK_IMPORTED_MODULE_0__["RecurrenceEditor"]; });

/* harmony import */ var _date_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSummary", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["generateSummary"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["generate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateFromRecurrenceDateString", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["getDateFromRecurrenceDateString"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extractObjectFromRule", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["extractObjectFromRule"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getCalendarUtil", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["getCalendarUtil"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getRecurrenceStringFromDate", function() { return _date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"]; });

/**
 * Recurrence-Editor component exported items
 */




/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/recurrence-editor.js":
/*!*******************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/recurrence-editor.js ***!
  \*******************************************************************************************/
/*! exports provided: RecurrenceEditor */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RecurrenceEditor", function() { return RecurrenceEditor; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-dropdowns */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_calendars__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ej2-calendars */ "./ej2-resources/18.4.46/scripts/ej2-calendars/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _date_generator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");
/* harmony import */ var _schedule_base_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../schedule/base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};









var HEADER = 'e-editor';
var INPUTWARAPPER = 'e-input-wrapper';
var INPUTWARAPPERSIDE = 'e-input-wrapper-side';
var REPEATELEMENT = 'e-repeat-element';
var REPEATINTERVAL = 'e-repeat-interval';
var INTERVALCLASS = 'e-interval';
var DAYWRAPPER = 'e-days';
var WEEKWRAPPER = 'e-non-week';
var WEEKPOSITION = 'e-week-position';
var YEAREXPANDERWRAPPER = 'e-year-expander';
var YEAREXPANDERELEMENT = 'e-year-expander-element';
var MONETHEXPANDERWRAPPER = 'e-month-expander';
var MONETHEXPANDWRAPPER = 'e-month-expand-wrapper';
var MONTHEXPANDERELEMENT = 'e-month-expander-element';
var MONTHEXPANDERCHECKBOXWRAPPER = 'e-month-expander-checkbox-wrapper';
var FORMLEFT = 'e-form-left';
var FORMRIGHT = 'e-form-right';
var MONTHDAYWRAPPER = 'e-month-day';
var MONTHEXPANNDERELEM = 'e-month-expander-wrapper';
var MONTHPOS = 'e-month-pos';
var MONTHWEEK = 'e-month-week';
var ENDON = 'e-end-on';
var MONTHEXPANDERLABEL = 'e-month-expander-label';
var WEEKEXPANDERLABEL = 'e-week-expander-label';
var ENDONLABEL = 'e-end-on-label';
var ENDONLEFT = 'e-end-on-left';
var MONTHDAYELEMENT = 'e-monthday-element';
var ENDONELEMENT = 'e-end-on-element';
var ENDONDATE = 'e-end-on-date';
var UNTILDATE = 'e-until-date';
var ENDONCOUNTWRAPPER = 'e-end-on-count';
var ENDONCOUNT = 'e-recurrence-count';
var HIDEWRAPPER = 'e-hide-recurrence-element';
var RTLCLASS = 'e-rtl';
var PRIMARY = 'e-primary';
var ACTIVE = 'e-active';
var RECURRENCETABLE = 'e-recurrence-table';
var REPEATCONTENT = 'e-repeat-content';
var REPEATCONTENTWRAPPER = 'e-repeat-content-wrapper';
var NONE = 'none';
var DAILY = 'daily';
var WEEKLY = 'weekly';
var MONTHLY = 'monthly';
var YEARLY = 'yearly';
var NEVER = 'never';
var UNTIL = 'until';
var COUNT = 'count';
var TEXTFIELD = 'text';
var VALUEFIELD = 'value';
var LAST = 'last';
var REPEAT = 'repeat';
var REPEATEVERY = 'repeatEvery';
var ON = 'on';
var END = 'end';
var RADIOLABEL = 'onDay';
var RULEUNTIL = 'UNTIL';
var RULEBYDAY = 'BYDAY';
var RULEBYMONTHDAY = 'BYMONTHDAY';
var RULEBYMONTH = 'BYMONTH';
var RULEINTERVAL = 'INTERVAL';
var RULECOUNT = 'COUNT';
var RULESETPOS = 'BYSETPOS';
var RULEFREQ = 'FREQ';
var RULEDAILY = 'DAILY';
var RULEWEEKLY = 'WEEKLY';
var RULEMONTHLY = 'MONTHLY';
var RULEYEARLY = 'YEARLY';
var RULESUNDAY = 'SU';
var RULEMONDAY = 'MO';
var RULETUESDAY = 'TU';
var RULEWEDNESDAY = 'WE';
var RULETHURSDAY = 'TH';
var RULEFRIDAY = 'FR';
var RULESATURDAY = 'SA';
var KEYSUNDAY = 'sun';
var KEYMONDAY = 'mon';
var KEYTUESDAY = 'tue';
var KEYWEDNESDAY = 'wed';
var KEYTHURSDAY = 'thu';
var KEYFRIDAY = 'fri';
var KEYSATURDAY = 'sat';
var EQUAL = '=';
var SEMICOLON = ';';
var COMMA = ',';
var FIRST = 'first';
var SECOND = 'second';
var THIRD = 'third';
var FOURTH = 'fourth';
var contentType = {
    none: '',
    daily: 'days',
    weekly: 'weeks',
    monthly: 'months',
    yearly: 'years'
};
var valueData = {
    'sun': RULESUNDAY,
    'mon': RULEMONDAY,
    'tue': RULETUESDAY,
    'wed': RULEWEDNESDAY,
    'thu': RULETHURSDAY,
    'fri': RULEFRIDAY,
    'sat': RULESATURDAY
};
var neverClassList = [DAYWRAPPER, WEEKWRAPPER, ENDON, INTERVALCLASS, YEAREXPANDERWRAPPER, MONETHEXPANDERWRAPPER];
var weekClassList = [WEEKWRAPPER];
var monthClassList = [DAYWRAPPER, YEAREXPANDERWRAPPER];
var yearClassList = [DAYWRAPPER];
var dailyClassList = [DAYWRAPPER, WEEKWRAPPER, YEAREXPANDERWRAPPER, MONETHEXPANDERWRAPPER];
var noEndClassList = [ENDONDATE, ENDONCOUNTWRAPPER];
var endOnCountClassList = [ENDONDATE];
var endOnDateClassList = [ENDONCOUNTWRAPPER];
/**
 * Represents the RecurrenceEditor component.
 * ```html
 * <div id="recurrence"></div>
 * ```
 * ```typescript
 * <script>
 *   var recObj = new RecurrenceEditor();
 *   recObj.appendTo("#recurrence");
 * </script>
 * ```
 */
var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
    __extends(RecurrenceEditor, _super);
    /**
     * Constructor for creating the widget
     * @param  {object} options?
     */
    function RecurrenceEditor(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.defaultLocale = {
            none: 'None',
            daily: 'Daily',
            weekly: 'Weekly',
            monthly: 'Monthly',
            month: 'Month',
            yearly: 'Yearly',
            never: 'Never',
            until: 'Until',
            count: 'Count',
            first: 'First',
            second: 'Second',
            third: 'Third',
            fourth: 'Fourth',
            last: 'Last',
            repeat: 'Repeat',
            repeatEvery: 'Repeat every',
            on: 'Repeat On',
            end: 'End',
            onDay: 'Day',
            days: 'Day(s)',
            weeks: 'Week(s)',
            months: 'Month(s)',
            years: 'Year(s)',
            every: 'every',
            summaryTimes: 'time(s)',
            summaryOn: 'on',
            summaryUntil: 'until',
            summaryRepeat: 'Repeats',
            summaryDay: 'day(s)',
            summaryWeek: 'week(s)',
            summaryMonth: 'month(s)',
            summaryYear: 'year(s)',
            monthWeek: 'Month Week',
            monthPosition: 'Month Position',
            monthExpander: 'Month Expander',
            yearExpander: 'Year Expander',
            repeatInterval: 'Repeat Interval'
        };
        _this.renderStatus = false;
        _this.dayButtons = [];
        _this.monthButtons = [];
        _this.calendarUtil = Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["getCalendarUtil"])(_this.calendarMode);
        return _this;
    }
    RecurrenceEditor.prototype.startState = function (freq, endOn, startDate) {
        this.showFormElement();
        this.updateForm(freq);
        this.freshOnEndForm();
        this.updateEndOnForm(endOn);
        this.selectMonthDay(startDate);
        this.updateUntilDate(startDate);
        this.onMonthDay.setProperties({ checked: true });
    };
    RecurrenceEditor.prototype.preRender = function () {
        this.localeObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getModuleName(), this.defaultLocale, this.locale);
        // pre render code snippets
    };
    RecurrenceEditor.prototype.applyCustomClass = function (cssClass) {
        if (cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], cssClass.split(' '));
        }
    };
    RecurrenceEditor.prototype.initialize = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], 'e-' + this.getModuleName());
        this.renderComponent();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.value) && this.value !== '') {
            this.setRecurrenceRule(this.value);
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.repeatType.value)) {
                this.startState(this.repeatType.value.toString().toUpperCase(), NEVER, this.startDate);
                this.updateForm(this.repeatType.value.toString());
            }
            if (this.selectedType > 0) {
                this.setProperties({ value: this.getRecurrenceRule() }, false);
            }
        }
        this.applyCustomClass(this.cssClass);
    };
    RecurrenceEditor.prototype.triggerChangeEvent = function () {
        var _this = this;
        if (this.renderStatus) {
            var value = this.getRecurrenceRule();
            this.trigger('change', { value: value }, function (args) { return _this.setProperties({ value: args.value }, false); });
        }
    };
    RecurrenceEditor.prototype.resetDayButton = function () {
        var elements = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button'));
        elements.forEach(function (element) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], [ACTIVE, PRIMARY]); });
    };
    RecurrenceEditor.prototype.daySelection = function (dayIndex) {
        this.resetDayButton();
        var days = [0, 1, 2, 3, 4, 5, 6];
        this.rotateArray(days, this.firstDayOfWeek);
        var element = this.element.querySelector('.' + DAYWRAPPER + ' button[data-index="' + days.indexOf(dayIndex) + '"]');
        if (element) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], [ACTIVE, PRIMARY]);
        }
    };
    RecurrenceEditor.prototype.rtlClass = function (status) {
        if (status) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], RTLCLASS);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], RTLCLASS);
        }
    };
    RecurrenceEditor.prototype.updateUntilDate = function (date) {
        var tempDate = new Date(date.getTime());
        tempDate.setDate(tempDate.getDate() + 60);
        this.untilDateObj.setProperties({ value: tempDate });
    };
    RecurrenceEditor.prototype.selectMonthDay = function (date) {
        var weekday = [KEYSUNDAY, KEYMONDAY, KEYTUESDAY, KEYWEDNESDAY, KEYTHURSDAY, KEYFRIDAY, KEYSATURDAY];
        this.monthDate.setProperties({ value: this.calendarUtil.getDate(date) });
        this.monthWeekDays.setProperties({ value: valueData[weekday[date.getDay()]] });
        this.monthValue.setProperties({ value: '' + this.calendarUtil.getMonth(date) });
        this.monthWeekPos.setProperties({ value: this.getDayPosition(date) });
        this.daySelection(date.getDay());
    };
    RecurrenceEditor.prototype.updateForm = function (state) {
        var _this = this;
        this.repeatType.setProperties({ value: state });
        var end = this.element.querySelector('.' + ENDON);
        if (state === DAILY) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(end, [FORMLEFT], [FORMRIGHT]);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(end, [FORMRIGHT], [FORMLEFT]);
        }
        switch (state) {
            case NONE:
                neverClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case WEEKLY:
                weekClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case MONTHLY:
                monthClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case YEARLY:
                yearClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case DAILY:
                dailyClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
        }
    };
    RecurrenceEditor.prototype.updateEndOnForm = function (state) {
        var _this = this;
        this.endType.setProperties({ value: state });
        switch (state) {
            case NEVER:
                noEndClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case UNTIL:
                endOnDateClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
            case COUNT:
                endOnCountClassList.forEach(function (className) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element.querySelector('.' + className)], HIDEWRAPPER); });
                break;
        }
    };
    RecurrenceEditor.prototype.freshOnEndForm = function () {
        var _this = this;
        noEndClassList.forEach(function (className) {
            var element = _this.element.querySelector('.' + className);
            if (element) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], HIDEWRAPPER);
            }
        });
    };
    RecurrenceEditor.prototype.showFormElement = function () {
        var _this = this;
        neverClassList.forEach(function (className) {
            var hideElement = _this.element.querySelector('.' + className);
            if (hideElement) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([hideElement], HIDEWRAPPER);
            }
        });
    };
    RecurrenceEditor.prototype.renderDropdowns = function () {
        var _this = this;
        var self = this;
        this.repeatType = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_1__["DropDownList"]({
            //set the data to dataSource property
            dataSource: this.getRepeatData(),
            floatLabelType: 'Always',
            enableRtl: this.enableRtl,
            index: this.selectedType,
            fields: {
                text: TEXTFIELD,
                value: VALUEFIELD
            },
            placeholder: this.localeObj.getConstant(REPEAT),
            htmlAttributes: { 'title': this.localeObj.getConstant(REPEAT) },
            change: function (args) {
                self.setProperties({ selectedType: _this.frequencies.indexOf(args.value) }, false);
                self.element.querySelector('.' + REPEATCONTENT).innerHTML =
                    self.localeObj.getConstant(contentType[args.value]);
                self.showFormElement();
                self.updateForm(args.value);
                self.resetFormValues();
                self.triggerChangeEvent();
            }
        });
        // set placeholder to DropDownList input element
        this.repeatType.appendTo(this.element.querySelector('.' + REPEATELEMENT));
        this.endType = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_1__["DropDownList"]({
            dataSource: this.getEndData(),
            popupWidth: this.getPopupWidth(),
            enableRtl: this.enableRtl,
            index: 1,
            fields: {
                text: TEXTFIELD,
                value: VALUEFIELD
            },
            change: function (args) {
                self.freshOnEndForm();
                self.updateEndOnForm(args.value);
                self.resetFormValues();
                self.triggerChangeEvent();
            }
        });
        this.endType.appendTo(this.element.querySelector('.' + ENDONELEMENT));
        var renderDropDownList = function (dropDownData) {
            return new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_1__["DropDownList"]({
                dataSource: dropDownData,
                popupWidth: _this.getPopupWidth(),
                enableRtl: _this.enableRtl,
                fields: {
                    text: TEXTFIELD,
                    value: VALUEFIELD
                },
                index: 1,
                change: function (args) {
                    self.onWeekDay.setProperties({ checked: true });
                    self.resetFormValues();
                    self.triggerChangeEvent();
                }
            });
        };
        this.monthWeekPos = renderDropDownList(this.getMonthPosData());
        this.monthWeekPos.appendTo(this.element.querySelector('.' + MONTHPOS));
        this.monthWeekDays = renderDropDownList(this.getDayData('wide'));
        this.monthWeekDays.appendTo(this.element.querySelector('.' + MONTHWEEK));
        this.monthValue = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_1__["DropDownList"]({
            dataSource: this.getMonthData(),
            fields: {
                text: TEXTFIELD,
                value: VALUEFIELD
            },
            floatLabelType: 'Always',
            enableRtl: this.enableRtl,
            index: 7,
            change: function (args) {
                self.resetFormValues();
                self.triggerChangeEvent();
            }
        });
        this.monthValue.appendTo(this.element.querySelector('.' + YEAREXPANDERELEMENT));
    };
    RecurrenceEditor.prototype.setDefaultValue = function () {
        var formelement = [].slice.call(this.element.querySelectorAll('.e-control .e-numerictextbox'));
        for (var _i = 0, formelement_1 = formelement; _i < formelement_1.length; _i++) {
            var element = formelement_1[_i];
            var instance = element.ej2_instances[0];
            if (instance.element.classList.contains(REPEATINTERVAL)) {
                instance.value = 1;
                instance.dataBind();
            }
            else if (instance.element.classList.contains(ENDONCOUNT)) {
                instance.value = 10;
                instance.dataBind();
            }
        }
    };
    RecurrenceEditor.prototype.resetFormValues = function () {
        var recurreneElement = [].slice.call(this.element.querySelectorAll('.e-control [type="text"]'));
        for (var _i = 0, recurreneElement_1 = recurreneElement; _i < recurreneElement_1.length; _i++) {
            var element = recurreneElement_1[_i];
            var instance = void 0;
            if (element.classList.contains('e-datepicker')) {
                instance = element.ej2_instances[0];
                if (instance.value) {
                    instance.value = instance.value;
                    instance.dataBind();
                }
                else {
                    this.updateUntilDate(this.startDate);
                }
            }
            else if (element.classList.contains('e-dropdownlist')) {
                instance = element.ej2_instances[0];
                instance.index = instance.index || 0;
                instance.dataBind();
            }
            else if (element.classList.contains('e-numerictextbox')) {
                instance = element.ej2_instances[0];
                var value = void 0;
                if (instance.element.classList.contains(REPEATINTERVAL)) {
                    value = 1;
                }
                else if (instance.element.classList.contains(ENDONCOUNT)) {
                    value = 10;
                }
                else {
                    value = this.startDate.getDate();
                }
                instance.value = instance.value || value;
                instance.dataBind();
            }
        }
    };
    RecurrenceEditor.prototype.getPopupWidth = function () {
        return _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? '100%' : 'auto';
    };
    RecurrenceEditor.prototype.renderDatePickers = function () {
        var self = this;
        this.untilDateObj = new _ej2_calendars__WEBPACK_IMPORTED_MODULE_3__["DatePicker"]({
            firstDayOfWeek: this.firstDayOfWeek,
            enableRtl: this.enableRtl,
            locale: this.locale,
            min: this.minDate,
            max: this.maxDate,
            format: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.dateFormat) ?
                this.getFormat('dateFormats') : this.dateFormat),
            change: function (args) {
                if (args.value) {
                    self.triggerChangeEvent();
                }
            }
        });
        this.untilDateObj.appendTo(this.element.querySelector('.' + UNTILDATE));
    };
    RecurrenceEditor.prototype.getFormat = function (formatType) {
        var format;
        if (this.locale === 'en' || this.locale === 'en-US') {
            format = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(formatType + '.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.getCalendarMode()));
        }
        else {
            format = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(
            // tslint:disable-next-line:max-line-length
            'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.' + formatType + '.short', _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]);
        }
        return format;
    };
    RecurrenceEditor.prototype.dayButtonRender = function () {
        var _this = this;
        var btns = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button'));
        var self = this;
        for (var _i = 0, btns_1 = btns; _i < btns_1.length; _i++) {
            var btn = btns_1[_i];
            var button = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__["Button"]({ isToggle: true, enableRtl: this.enableRtl }, btn);
            this.dayButtons.push(button);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(btn, 'click', function (args) {
                var btns = [].slice.call(_this.element.querySelectorAll('.' + DAYWRAPPER + ' button.' + PRIMARY));
                var element = args.target;
                if (!element.classList.contains(PRIMARY)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], PRIMARY);
                    self.triggerChangeEvent();
                }
                else if (btns.length > 1) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], PRIMARY);
                    self.triggerChangeEvent();
                }
            });
        }
    };
    RecurrenceEditor.prototype.radioButtonRender = function () {
        var self = this;
        this.onMonthDay = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__["RadioButton"]({
            label: this.localeObj.getConstant(RADIOLABEL),
            enableRtl: this.enableRtl,
            name: 'monthType',
            value: 'day',
            change: function (args) {
                self.resetFormValues();
                self.triggerChangeEvent();
            }
        });
        this.onMonthDay.appendTo(this.element.querySelector('.' + MONTHEXPANDERELEMENT));
        this.monthButtons.push(this.onMonthDay);
        this.onWeekDay = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_4__["RadioButton"]({
            label: '',
            name: 'monthType',
            enableRtl: this.enableRtl,
            value: 'daypos',
            change: function (args) {
                self.resetFormValues();
                self.triggerChangeEvent();
            }
        });
        this.onWeekDay.appendTo(this.element.querySelector('.' + MONTHEXPANNDERELEM));
        this.monthButtons.push(this.onWeekDay);
    };
    RecurrenceEditor.prototype.numericTextboxRender = function () {
        var self = this;
        this.recurrenceCount = new _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["NumericTextBox"]({
            value: 10,
            format: '#',
            enableRtl: this.enableRtl,
            floatLabelType: 'Always',
            min: 1,
            max: 999,
            change: function (args) {
                self.triggerChangeEvent();
            }
        });
        this.recurrenceCount.appendTo(this.element.querySelector('.' + ENDONCOUNT));
        this.monthDate = new _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["NumericTextBox"]({
            value: 1,
            format: '#',
            enableRtl: this.enableRtl,
            min: 1,
            max: 31,
            change: function (args) {
                self.onMonthDay.setProperties({ checked: true });
                self.triggerChangeEvent();
            }
        });
        this.monthDate.appendTo(this.element.querySelector('.' + MONTHDAYWRAPPER));
        this.repeatInterval = new _ej2_inputs__WEBPACK_IMPORTED_MODULE_2__["NumericTextBox"]({
            value: 1,
            format: '#',
            min: 1,
            max: 999,
            enableRtl: this.enableRtl,
            floatLabelType: 'Always',
            placeholder: this.localeObj.getConstant(REPEATEVERY),
            change: function (args) {
                self.triggerChangeEvent();
            }
        });
        this.repeatInterval.appendTo(this.element.querySelector('.' + REPEATINTERVAL));
    };
    RecurrenceEditor.prototype.renderComponent = function () {
        this.setTemplate();
        this.renderDropdowns();
        this.renderDatePickers();
        this.dayButtonRender();
        this.radioButtonRender();
        this.numericTextboxRender();
    };
    RecurrenceEditor.prototype.rotateArray = function (data, count) {
        var temp;
        for (var index = 0; index < count; index++) {
            temp = data.shift();
            data.push(temp);
        }
    };
    RecurrenceEditor.prototype.getEndData = function () {
        var endData = [NEVER, UNTIL, COUNT];
        var self = this;
        var dataSource = [];
        endData.forEach(function (data) {
            dataSource.push({ text: self.localeObj.getConstant(data), value: data });
        });
        return dataSource;
    };
    RecurrenceEditor.prototype.getDayPosition = function (date) {
        var temp = new Date(date.getTime());
        var endDate = new Date(date.getTime());
        var day = date.getDay();
        var positionCollection = [];
        temp = this.calendarUtil.getMonthStartDate(temp);
        endDate = this.calendarUtil.getMonthEndDate(endDate);
        while (temp < endDate) {
            if (temp.getDay() === day) {
                positionCollection.push(temp.getTime());
            }
            temp.setDate(temp.getDate() + 1);
        }
        if (positionCollection.indexOf(date.getTime()) === positionCollection.length - 1) {
            return -1;
        }
        return (positionCollection.indexOf(date.getTime()) + 1);
    };
    RecurrenceEditor.prototype.getRepeatData = function () {
        var data = [];
        var self = this;
        this.frequencies.forEach(function (element) {
            var textValue = (element === NONE) ? NEVER : element;
            data.push({ text: self.localeObj.getConstant(textValue), value: element });
        });
        return data;
    };
    RecurrenceEditor.prototype.getMonthPosData = function () {
        var monthpos = [FIRST, SECOND, THIRD, FOURTH, LAST];
        var monthposValue = {
            first: 1,
            second: 2,
            third: 3,
            fourth: 4,
            last: -1
        };
        var self = this;
        var dataSource = [];
        monthpos.forEach(function (data) {
            dataSource.push({ text: self.localeObj.getConstant(data), value: monthposValue[data] });
        });
        return dataSource;
    };
    RecurrenceEditor.prototype.getDayData = function (format) {
        var weekday = [KEYSUNDAY, KEYMONDAY, KEYTUESDAY, KEYWEDNESDAY, KEYTHURSDAY, KEYFRIDAY, KEYSATURDAY];
        var dayData = [];
        var cldrObj;
        this.rotateArray(weekday, this.firstDayOfWeek);
        if (this.locale === 'en' || this.locale === 'en-US') {
            var nameSpaceString = 'days.stand-alone.';
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpaceString + format, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.getCalendarMode())));
        }
        else {
            var nameSpaceString = 'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.days.stand-alone.' + format;
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpaceString, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        }
        for (var _i = 0, weekday_1 = weekday; _i < weekday_1.length; _i++) {
            var obj = weekday_1[_i];
            var day = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(obj, cldrObj);
            dayData.push({ text: format === 'narrow' ? day : Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_6__["capitalizeFirstWord"])(day, 'single'), value: valueData[obj] });
        }
        return dayData;
    };
    RecurrenceEditor.prototype.getMonthData = function () {
        var monthData = [];
        var cldrObj;
        if (this.locale === 'en' || this.locale === 'en-US') {
            var nameSpaceString = 'months.stand-alone.wide';
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpaceString, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.getCalendarMode())));
        }
        else {
            var nameSpaceString = 'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.months.stand-alone.wide';
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpaceString, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        }
        for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {
            var obj = _a[_i];
            monthData.push({
                text: Object(_schedule_base_util__WEBPACK_IMPORTED_MODULE_6__["capitalizeFirstWord"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(obj, cldrObj), 'single'),
                value: obj
            });
        }
        return monthData;
    };
    RecurrenceEditor.prototype.setTemplate = function () {
        var dayData = this.getDayData('narrow');
        var fullDay = this.getDayData('wide');
        this.element.innerHTML = '<div class="' + HEADER + '">' +
            '<div class="' + INPUTWARAPPER + ' ' + FORMLEFT + '">' +
            '<input type="text" tabindex="0" class="' + REPEATELEMENT +
            '"label="' + REPEATELEMENT.substr(2) + '" />' +
            '</div><div class="' + INPUTWARAPPER + ' ' +
            INTERVALCLASS + ' ' + FORMRIGHT + '"><table  class="' + RECURRENCETABLE + ' ' + REPEATCONTENTWRAPPER + '"><tr>' +
            '<td><input type="text" tabindex="0" class="' + REPEATINTERVAL +
            '"title="' + this.localeObj.getConstant('repeatEvery') + '" /></td>' +
            '<td><span class="' + REPEATCONTENT + '"></span></td>' +
            '</tr></table></div><div class="' + INPUTWARAPPERSIDE + ' ' + DAYWRAPPER + ' ' + FORMLEFT + '">' +
            '<div class=' + WEEKEXPANDERLABEL + '>' + this.localeObj.getConstant(ON) + '</div>' +
            '<button type="button" class="e-round" data-index="0" title="' + fullDay[0].text + '">' + dayData[0].text + '</button>' +
            '<button type="button" class="e-round" data-index="1" title="' + fullDay[1].text + '">' + dayData[1].text + '</button>' +
            '<button type="button" class="e-round" data-index="2" title="' + fullDay[2].text + '">' + dayData[2].text + '</button>' +
            '<button type="button" class="e-round" data-index="3" title="' + fullDay[3].text + '">' + dayData[3].text + '</button>' +
            '<button type="button" class="e-round" data-index="4" title="' + fullDay[4].text + '">' + dayData[4].text + '</button>' +
            '<button type="button" class="e-round" data-index="5" title="' + fullDay[5].text + '">' + dayData[5].text + '</button>' +
            '<button type="button" class="e-round" data-index="6" title="' + fullDay[6].text + '">' + dayData[6].text + '</button></div>' +
            '<div class="' + INPUTWARAPPERSIDE + ' ' + WEEKWRAPPER + ' ' + FORMLEFT + '">' +
            '<div class=' + MONTHEXPANDERLABEL + '>' + this.localeObj.getConstant(ON) + '</div>' +
            '<div class="' + YEAREXPANDERWRAPPER + '">' +
            '<input class="' + YEAREXPANDERELEMENT + '" type="text" tabindex="0" title="' +
            this.localeObj.getConstant('yearExpander') + '"/>' +
            '</div>' +
            '<div class="' + MONETHEXPANDERWRAPPER + '">' +
            '<table class="' + RECURRENCETABLE + ' ' + MONETHEXPANDWRAPPER + '"><tr><td>' +
            '<div class="' + INPUTWARAPPER + ' ' + MONTHEXPANDERCHECKBOXWRAPPER + '">' +
            '<input class="' + MONTHEXPANDERELEMENT + '"title="' + this.localeObj.getConstant('monthExpander') + '" type="radio">' +
            '</div></td>' +
            '<td colspan="2"><div class="' + INPUTWARAPPER + ' ' + MONTHDAYELEMENT + '">' +
            '<input type="text" tabindex="0" class="' + MONTHDAYWRAPPER + '"title="' +
            this.localeObj.getConstant('on') + '" />' +
            '</div></td></tr>' +
            '<tr><td>' +
            '<div class="' + INPUTWARAPPER + ' ' + MONTHEXPANDERCHECKBOXWRAPPER + '" style="min-width: 30px;margin-bottom:18px;">' +
            '<input class="' + MONTHEXPANNDERELEM + '"title="' + this.localeObj.getConstant('monthExpander') + '" type="radio">' +
            '</div></td>' +
            '<td><div class="' + INPUTWARAPPER + ' ' + WEEKPOSITION + '" >' +
            '<input type="text" tabindex="0" class="' + MONTHPOS + '"title="' + this.localeObj.getConstant('monthPosition') + '" />' +
            '</div></td>' +
            '<td><div class="' + INPUTWARAPPER + '" style="min-width: 120px;">' +
            '<input type="text" tabindex="0" class="' + MONTHWEEK + '"title="' + this.localeObj.getConstant('monthWeek') + '" />' +
            '</div></td></tr></table>' +
            '</div></div>' +
            '<div class="' + INPUTWARAPPERSIDE + ' ' + ENDON + ' ' + FORMRIGHT + '">' +
            '<div class=' + ENDONLABEL + '>' + this.localeObj.getConstant(END) + '</div>' +
            '<div class="' + INPUTWARAPPER + ' ' + ENDONLEFT + '">' +
            '<input type="text" tabindex="0" class="' + ENDONELEMENT + '"title="' + this.localeObj.getConstant(END) + '" />' +
            '</div>' +
            '<div class="' + INPUTWARAPPER + ' ' + ENDONDATE + '" >' +
            '<input type="text" tabindex="0" class="' + UNTILDATE + '"title="' + this.localeObj.getConstant(UNTIL) + '" />' +
            '</div>' +
            '<div class="' + INPUTWARAPPER + ' ' + ENDONCOUNTWRAPPER + '">' +
            '<input type="text" tabindex="0" class="' + ENDONCOUNT + '"title="' + this.localeObj.getConstant(COUNT) + '" />' +
            '</div></div>' +
            '</div></div>';
    };
    RecurrenceEditor.prototype.getSelectedDaysData = function () {
        var ruleData = RULEBYDAY + EQUAL;
        var elements = [].slice.call(this.element.querySelectorAll('.' + DAYWRAPPER + ' button.' + PRIMARY));
        var weekday = [RULESUNDAY, RULEMONDAY, RULETUESDAY, RULEWEDNESDAY, RULETHURSDAY, RULEFRIDAY, RULESATURDAY];
        this.rotateArray(weekday, this.firstDayOfWeek);
        for (var index = 0; index < elements.length; index++) {
            ruleData += weekday[parseInt(elements[index].getAttribute('data-index'), 10)] + (index === (elements.length - 1) ? '' : COMMA);
        }
        return ruleData + SEMICOLON;
    };
    RecurrenceEditor.prototype.getSelectedMonthData = function () {
        var ruleData;
        if (this.onWeekDay.checked) {
            ruleData = RULEBYDAY + EQUAL + this.monthWeekDays.value + SEMICOLON
                + RULESETPOS + EQUAL + this.monthWeekPos.value + SEMICOLON;
        }
        else {
            ruleData = RULEBYMONTHDAY + EQUAL + this.monthDate.value + SEMICOLON;
        }
        return ruleData;
    };
    RecurrenceEditor.prototype.getIntervalData = function () {
        return RULEINTERVAL + EQUAL + this.repeatInterval.value + SEMICOLON;
    };
    RecurrenceEditor.prototype.getEndOnCount = function () {
        return RULECOUNT + EQUAL + this.recurrenceCount.value + SEMICOLON;
    };
    RecurrenceEditor.prototype.getYearMonthRuleData = function () {
        return RULEBYMONTH + EQUAL + this.monthValue.value + SEMICOLON;
    };
    RecurrenceEditor.prototype.updateWeekButton = function (keys) {
        var weekday = [RULESUNDAY, RULEMONDAY, RULETUESDAY, RULEWEDNESDAY, RULETHURSDAY, RULEFRIDAY, RULESATURDAY];
        this.rotateArray(weekday, this.firstDayOfWeek);
        for (var _i = 0, _a = this.dayButtons; _i < _a.length; _i++) {
            var obj = _a[_i];
            var index = parseInt(obj.element.getAttribute('data-index'), 10);
            if (keys.indexOf(weekday[index]) !== -1) {
                obj.setProperties({ isPrimary: true });
            }
            else {
                obj.setProperties({ isPrimary: false });
            }
        }
    };
    RecurrenceEditor.prototype.updateMonthUI = function () {
        if (this.ruleObject.monthDay.length) {
            this.monthDate.setProperties({ value: this.ruleObject.monthDay[0] });
            this.onMonthDay.setProperties({ checked: true });
        }
        else {
            this.onWeekDay.setProperties({ checked: true });
            this.monthWeekPos.setProperties({ value: this.ruleObject.setPosition });
            for (var _i = 0, _a = Object.keys(valueData); _i < _a.length; _i++) {
                var key = _a[_i];
                if (valueData[key] === this.ruleObject.day[0]) {
                    this.monthWeekDays.setProperties({ value: this.ruleObject.day[0] });
                    break;
                }
            }
        }
    };
    RecurrenceEditor.prototype.updateUI = function (repeat, state) {
        this.repeatInterval.setProperties({ value: this.ruleObject.interval });
        switch (state) {
            case UNTIL:
                this.untilDateObj.setProperties({ value: this.ruleObject.until });
                break;
            case COUNT:
                this.recurrenceCount.setProperties({ value: this.ruleObject.count });
                break;
        }
        switch (repeat) {
            case WEEKLY:
                this.updateWeekButton(this.ruleObject.day);
                break;
            case YEARLY:
                this.monthValue.setProperties({ index: (this.ruleObject.month[0] - 1) });
                this.updateMonthUI();
                break;
            case MONTHLY:
                this.updateMonthUI();
                break;
        }
    };
    RecurrenceEditor.prototype.getUntilData = function () {
        if (!this.untilDateObj.value) {
            return '';
        }
        var tempStr = Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["getRecurrenceStringFromDate"])(this.untilDateObj.value);
        return RULEUNTIL + EQUAL + tempStr + SEMICOLON;
    };
    RecurrenceEditor.prototype.destroyComponents = function () {
        if (!this.recurrenceCount.isDestroyed) {
            this.recurrenceCount.destroy();
        }
        if (!this.monthDate.isDestroyed) {
            this.monthDate.destroy();
        }
        if (!this.repeatInterval.isDestroyed) {
            this.repeatInterval.destroy();
        }
        if (!this.untilDateObj.isDestroyed) {
            this.untilDateObj.destroy();
        }
        if (!this.repeatType.isDestroyed) {
            this.repeatType.destroy();
        }
        if (!this.endType.isDestroyed) {
            this.endType.destroy();
        }
        if (!this.monthWeekPos.isDestroyed) {
            this.monthWeekPos.destroy();
        }
        if (!this.monthWeekDays.isDestroyed) {
            this.monthWeekDays.destroy();
        }
        if (!this.monthValue.isDestroyed) {
            this.monthValue.destroy();
        }
        this.dayButtons.forEach(function (element) {
            if (!element.isDestroyed) {
                element.destroy();
            }
        });
        this.dayButtons = [];
        this.monthButtons.forEach(function (element) {
            if (!element.isDestroyed) {
                element.destroy();
            }
        });
        this.monthButtons = [];
    };
    /** @hidden */
    RecurrenceEditor.prototype.resetFields = function () {
        this.startState(NONE, NEVER, this.startDate);
        this.setDefaultValue();
    };
    RecurrenceEditor.prototype.updateRuleUntilDate = function (startDate) {
        if (this.untilDateObj.value && startDate) {
            var untilDate = this.untilDateObj.value;
            var newUntilDate = new Date(untilDate.getFullYear(), untilDate.getMonth(), untilDate.getDate(), startDate.getHours(), startDate.getMinutes(), startDate.getMilliseconds());
            this.untilDateObj.setProperties({ value: newUntilDate });
        }
    };
    RecurrenceEditor.prototype.getCalendarMode = function () {
        return this.calendarMode.toLowerCase();
    };
    RecurrenceEditor.prototype.getRuleSummary = function (rule) {
        if (rule === void 0) { rule = this.getRecurrenceRule(); }
        return Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["generateSummary"])(rule, this.localeObj, this.locale, this.calendarMode);
    };
    RecurrenceEditor.prototype.getRecurrenceDates = function (startDate, rule, excludeDate, maximumCount, viewDate) {
        viewDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(viewDate) ? this.startDate : viewDate;
        return Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["generate"])(startDate, rule, excludeDate, this.firstDayOfWeek, maximumCount, viewDate, this.calendarMode);
    };
    RecurrenceEditor.prototype.getRecurrenceRule = function () {
        var ruleData = RULEFREQ + EQUAL;
        switch (this.repeatType.value) {
            case DAILY:
                ruleData += RULEDAILY + SEMICOLON;
                break;
            case WEEKLY:
                ruleData += RULEWEEKLY + SEMICOLON + this.getSelectedDaysData();
                break;
            case MONTHLY:
                ruleData += RULEMONTHLY + SEMICOLON + this.getSelectedMonthData();
                break;
            case YEARLY:
                ruleData += RULEYEARLY + SEMICOLON + this.getSelectedMonthData() + this.getYearMonthRuleData();
                break;
            case NONE:
                return '';
        }
        ruleData += this.getIntervalData();
        switch (this.endType.value) {
            case UNTIL:
                ruleData += this.getUntilData();
                break;
            case COUNT:
                ruleData += this.getEndOnCount();
                break;
        }
        return ruleData;
    };
    RecurrenceEditor.prototype.setRecurrenceRule = function (rule, startDate) {
        if (startDate === void 0) { startDate = this.startDate; }
        if (!rule) {
            this.repeatType.setProperties({ value: NONE });
            return;
        }
        this.renderStatus = false;
        this.ruleObject = Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["extractObjectFromRule"])(rule);
        var endon = this.ruleObject.count ? COUNT : (this.ruleObject.until ? UNTIL : NEVER);
        switch (this.ruleObject.freq) {
            case RULEDAILY:
                this.startState(DAILY, endon, startDate);
                this.updateUI(DAILY, endon);
                break;
            case RULEWEEKLY:
                this.startState(WEEKLY, endon, startDate);
                this.updateUI(WEEKLY, endon);
                break;
            case RULEMONTHLY:
                this.startState(MONTHLY, endon, startDate);
                this.updateUI(MONTHLY, endon);
                break;
            case RULEYEARLY:
                this.startState(YEARLY, endon, startDate);
                this.updateUI(YEARLY, endon);
                break;
        }
        this.renderStatus = true;
        this.triggerChangeEvent();
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    RecurrenceEditor.prototype.destroy = function () {
        this.destroyComponents();
        _super.prototype.destroy.call(this);
        var removeClasses = ['e-' + this.getModuleName()];
        if (this.cssClass) {
            removeClasses = removeClasses.concat(this.cssClass.split(' '));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], removeClasses);
        while (this.element.firstElementChild) {
            this.element.removeChild(this.element.firstElementChild);
        }
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    RecurrenceEditor.prototype.getModuleName = function () {
        return 'recurrenceeditor';
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     */
    RecurrenceEditor.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * Initialize the control rendering
     * @returns void
     * @private
     */
    RecurrenceEditor.prototype.render = function () {
        this.initialize();
        this.rtlClass(this.enableRtl);
        this.renderStatus = true;
        this.renderComplete();
    };
    /**
     * Called internally, if any of the property value changed.
     * @private
     */
    RecurrenceEditor.prototype.onPropertyChanged = function (newProp, oldProp) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'startDate':
                    this.selectMonthDay(newProp.startDate);
                    this.updateUntilDate(newProp.startDate);
                    this.endType.setProperties({ index: 0 });
                    break;
                case 'enableRtl':
                    this.rtlClass(newProp.enableRtl);
                    break;
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newProp.cssClass.split(' '));
                    }
                    break;
                case 'selectedType':
                    this.repeatType.setProperties({ index: this.selectedType });
                    break;
                case 'minDate':
                    this.untilDateObj.setProperties({ minDate: this.minDate });
                    break;
                case 'maxDate':
                    this.untilDateObj.setProperties({ maxDate: this.maxDate });
                    break;
                case 'value':
                    if (this.getRecurrenceRule() !== this.value) {
                        this.setRecurrenceRule(this.value);
                    }
                    break;
                case 'calendarMode':
                    this.calendarMode = newProp.calendarMode;
                    this.calendarUtil = Object(_date_generator__WEBPACK_IMPORTED_MODULE_5__["getCalendarUtil"])(newProp.calendarMode);
                    break;
                case 'locale':
                case 'frequencies':
                case 'firstDayOfWeek':
                    this.refresh();
                    break;
                case 'dateFormat':
                    this.untilDateObj.setProperties({ format: newProp.dateFormat });
                    break;
            }
        }
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(['none', 'daily', 'weekly', 'monthly', 'yearly'])
    ], RecurrenceEditor.prototype, "frequencies", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], RecurrenceEditor.prototype, "firstDayOfWeek", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date())
    ], RecurrenceEditor.prototype, "startDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], RecurrenceEditor.prototype, "dateFormat", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Gregorian')
    ], RecurrenceEditor.prototype, "calendarMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], RecurrenceEditor.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], RecurrenceEditor.prototype, "value", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(1900, 0, 1))
    ], RecurrenceEditor.prototype, "minDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(2099, 11, 31))
    ], RecurrenceEditor.prototype, "maxDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], RecurrenceEditor.prototype, "selectedType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], RecurrenceEditor.prototype, "change", void 0);
    RecurrenceEditor = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], RecurrenceEditor);
    return RecurrenceEditor;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/action-base.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/action-base.js ***!
  \************************************************************************************/
/*! exports provided: ActionBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionBase", function() { return ActionBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");




/**
 * Base class for the common drag and resize related actions
 */
var ActionBase = /** @__PURE__ @class */ (function () {
    function ActionBase(parent) {
        this.daysVariation = 0;
        this.parent = parent;
        this.actionObj = {
            X: 0, Y: 0, groupIndex: 0, cellWidth: 0, cellHeight: 0, slotInterval: 0, interval: 0, actionIndex: 0,
            cloneElement: [], originalElement: [], action: null, isAllDay: null, excludeSelectors: null,
            index: 0, navigationInterval: null, scrollInterval: null
        };
        this.scrollArgs = { element: null, width: 0, height: 0 };
        this.resizeEdges = { left: false, right: false, top: false, bottom: false };
        this.scrollEdges = { left: false, right: false, top: false, bottom: false };
    }
    ActionBase.prototype.getChangedData = function () {
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        eventObj[this.parent.eventFields.startTime] = this.actionObj.start;
        eventObj[this.parent.eventFields.endTime] = this.actionObj.end;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.isAllDay)) {
            eventObj[this.parent.eventFields.isAllDay] = this.actionObj.isAllDay;
        }
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var originalElement = this.getOriginalElement(this.actionObj.element);
            var indexCol = originalElement.map(function (element) { return parseInt(element.getAttribute('data-group-index'), 10); });
            if (indexCol.indexOf(this.actionObj.groupIndex) === -1) {
                var cloneIndex_1 = parseInt(this.actionObj.clone.getAttribute('data-group-index'), 10);
                indexCol = indexCol.filter(function (index) { return index !== cloneIndex_1; });
                indexCol.push(this.actionObj.groupIndex);
                this.parent.resourceBase.getResourceData(eventObj, this.actionObj.groupIndex, indexCol);
            }
        }
        return eventObj;
    };
    ActionBase.prototype.saveChangedData = function (eventArgs) {
        this.parent.activeEventData.event = this.actionObj.event;
        this.parent.currentAction = 'Save';
        var eventObj = eventArgs.data;
        var isSameResource = (this.parent.activeViewOptions.group.resources.length > 0) ?
            parseInt(this.actionObj.element.getAttribute('data-group-index'), 10) === this.actionObj.groupIndex : true;
        if (+eventObj[this.parent.eventFields.startTime] === +this.actionObj.event[this.parent.eventFields.startTime] &&
            +eventObj[this.parent.eventFields.endTime] === +this.actionObj.event[this.parent.eventFields.endTime] && isSameResource) {
            return;
        }
        var currentAction;
        if (eventObj[this.parent.eventFields.recurrenceRule]) {
            var eveId = eventObj[this.parent.eventFields.recurrenceID] || eventObj[this.parent.eventFields.id];
            if (eventObj[this.parent.eventFields.id] === eventObj[this.parent.eventFields.recurrenceID]) {
                eventObj[this.parent.eventFields.id] = this.parent.eventBase.getEventMaxID();
                currentAction = 'EditOccurrence';
            }
            if (this.parent.enableRecurrenceValidation
                && this.parent.eventWindow.editOccurrenceValidation(eveId, eventObj, this.actionObj.event)) {
                this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
                return;
            }
        }
        if (eventObj[this.parent.eventFields.startTimezone] || eventObj[this.parent.eventFields.endTimezone]) {
            this.parent.eventBase.timezoneConvert(eventObj);
        }
        this.parent.crudModule.saveEvent(eventObj, currentAction);
    };
    ActionBase.prototype.calculateIntervalTime = function (date) {
        var intervalTime = new Date(+date);
        intervalTime.setMinutes(Math.floor(intervalTime.getMinutes() / this.actionObj.interval) * this.actionObj.interval);
        return intervalTime;
    };
    ActionBase.prototype.getContentAreaDimension = function () {
        var viewElement = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_WRAP_CLASS"]);
        var trElement = [].slice.call(viewElement.querySelector('tr').children);
        if (!this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0 &&
            !this.parent.isAdaptive) {
            trElement = this.getResourceElements(trElement);
        }
        var leftOffset = trElement[0].getBoundingClientRect();
        var rightOffset = trElement.slice(-1)[0].getBoundingClientRect();
        var viewDimension = {
            bottom: viewElement.scrollHeight - 5,
            left: this.parent.enableRtl ? rightOffset.left : leftOffset.left,
            right: this.parent.enableRtl ? leftOffset.right : rightOffset.right,
            top: 0
        };
        return viewDimension;
    };
    ActionBase.prototype.getPageCoordinates = function (e) {
        var eventArgs = e.event;
        return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
            eventArgs || e;
    };
    ActionBase.prototype.getIndex = function (index) {
        var contentElements = [].slice.call(this.parent.getContentTable().querySelector('tr').children);
        var indexes = { minIndex: 0, maxIndex: contentElements.length - 1 };
        if (this.actionObj.action === 'resize' && this.parent.activeViewOptions.group.resources.length > 0 &&
            !this.parent.uiStateValues.isGroupAdaptive && !this.parent.activeView.isTimelineView()) {
            var groupElements = this.getResourceElements(contentElements);
            indexes.minIndex = groupElements[0].cellIndex;
            indexes.maxIndex = groupElements.slice(-1)[0].cellIndex;
        }
        if (index < indexes.minIndex) {
            index = indexes.minIndex;
        }
        if (index > indexes.maxIndex) {
            index = indexes.maxIndex;
        }
        return index;
    };
    ActionBase.prototype.updateTimePosition = function (date) {
        for (var _i = 0, _a = this.actionObj.cloneElement; _i < _a.length; _i++) {
            var cloneElement = _a[_i];
            var timeElement = cloneElement.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_TIME"]);
            if (timeElement) {
                timeElement.innerHTML = this.parent.getTimeString(this.actionObj.start) + ' - ' +
                    this.parent.getTimeString(this.actionObj.end);
            }
        }
        if (!this.parent.activeViewOptions.timeScale.enable || !this.parent.isAdaptive || this.parent.currentView === 'Month' ||
            this.parent.currentView === 'TimelineMonth') {
            return;
        }
        var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_TIME_INDICATOR_CLASS"]);
        if (!timeIndicator) {
            timeIndicator = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_TIME_INDICATOR_CLASS"] });
            var wrapperClass = this.parent.activeView.isTimelineView() ? _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["DATE_HEADER_WRAP_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["TIME_CELLS_WRAP_CLASS"];
            this.parent.element.querySelector('.' + wrapperClass).appendChild(timeIndicator);
        }
        timeIndicator.innerHTML = this.parent.getTimeString(date);
        var offsetValue = 0;
        if (this.parent.activeView.isTimelineView()) {
            if (this.parent.enableRtl) {
                var rightValue = parseInt(this.actionObj.clone.style.right, 10);
                offsetValue = this.actionObj.action === 'drag' || this.resizeEdges.left ?
                    rightValue + this.actionObj.clone.offsetWidth : rightValue;
                timeIndicator.style.right = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(offsetValue);
            }
            else {
                var leftValue = parseInt(this.actionObj.clone.style.left, 10);
                offsetValue = this.actionObj.action === 'drag' || this.resizeEdges.left ?
                    leftValue : leftValue + this.actionObj.clone.offsetWidth;
                timeIndicator.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(offsetValue);
            }
        }
        else {
            offsetValue = this.actionObj.action === 'drag' || this.resizeEdges.top ? this.actionObj.clone.offsetTop :
                this.actionObj.clone.offsetTop + this.actionObj.clone.offsetHeight;
            timeIndicator.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(offsetValue);
        }
    };
    ActionBase.prototype.getResourceElements = function (table) {
        var _this = this;
        return table.filter(function (element) {
            return parseInt(element.getAttribute('data-group-index'), 10) === _this.actionObj.groupIndex;
        });
    };
    ActionBase.prototype.getOriginalElement = function (element) {
        var originalElement;
        var guid = element.getAttribute('data-guid');
        var isMorePopup = element.offsetParent && element.offsetParent.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_1__["MORE_EVENT_POPUP_CLASS"]);
        if (isMorePopup || this.parent.activeView.isTimelineView()) {
            originalElement = [].slice.call(this.parent.element.querySelectorAll('[data-guid="' + guid + '"]'));
        }
        else {
            var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, 'tr');
            originalElement = [].slice.call(tr.querySelectorAll('[data-guid="' + guid + '"]'));
        }
        return originalElement;
    };
    ActionBase.prototype.createCloneElement = function (element) {
        var cloneWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { innerHTML: element.outerHTML });
        var cloneElement = cloneWrapper.children[0];
        var cloneClassLists = [_base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_ELEMENT_CLASS"]];
        cloneClassLists.push((this.actionObj.action === 'drag') ? _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["DRAG_CLONE_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESIZE_CLONE_CLASS"]);
        if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineMonth') {
            cloneClassLists.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_1__["MONTH_CLONE_ELEMENT_CLASS"]);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cloneElement], cloneClassLists);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element.parentElement)) {
            element.parentElement.appendChild(cloneElement);
        }
        cloneElement.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(cloneElement.offsetWidth - 2);
        if (this.parent.eventDragArea && this.actionObj.action === 'drag') {
            document.querySelector(this.parent.eventDragArea).appendChild(cloneElement);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cloneElement, { border: '0px' });
        return cloneElement;
    };
    ActionBase.prototype.removeCloneElementClasses = function () {
        var elements = this.actionObj.originalElement;
        if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
            elements = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(elements, _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
    };
    ActionBase.prototype.removeCloneElement = function () {
        this.actionObj.originalElement = [];
        for (var _i = 0, _a = this.actionObj.cloneElement; _i < _a.length; _i++) {
            var cloneElement = _a[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cloneElement.parentNode)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(cloneElement);
            }
        }
        this.actionObj.cloneElement = [];
        var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_TIME_INDICATOR_CLASS"]);
        if (timeIndicator) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(timeIndicator);
        }
    };
    ActionBase.prototype.getCursorElement = function (e) {
        var pages = this.getPageCoordinates(e);
        return document.elementFromPoint(pages.clientX, pages.clientY);
    };
    ActionBase.prototype.autoScroll = function () {
        var parent = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_WRAP_CLASS"]);
        var yIsScrollable = parent.offsetHeight <= parent.scrollHeight;
        var xIsScrollable = parent.offsetWidth <= parent.scrollWidth;
        var yInBounds = yIsScrollable && parent.scrollTop >= 0 && parent.scrollTop + parent.offsetHeight <= parent.scrollHeight;
        var xInBounds = xIsScrollable && parent.scrollLeft >= 0 && parent.scrollLeft + parent.offsetWidth <= parent.scrollWidth;
        if (yInBounds && (this.scrollEdges.top || this.scrollEdges.bottom)) {
            parent.scrollTop += this.scrollEdges.top ? -this.actionObj.scroll.scrollBy : this.actionObj.scroll.scrollBy;
            if (this.actionObj.action === 'resize') {
                if (parent.scrollHeight !== parent.offsetHeight + parent.scrollTop && parent.scrollTop > 0) {
                    this.actionObj.Y += this.scrollEdges.top ? this.actionObj.scroll.scrollBy : -this.actionObj.scroll.scrollBy;
                }
            }
        }
        if (xInBounds && (this.scrollEdges.left || this.scrollEdges.right)) {
            parent.scrollLeft += this.scrollEdges.left ? -this.actionObj.scroll.scrollBy : this.actionObj.scroll.scrollBy;
            if (this.actionObj.action === 'resize') {
                if (parent.scrollWidth !== parent.offsetWidth + parent.scrollLeft && parent.scrollLeft > 0) {
                    this.actionObj.X += this.scrollEdges.left ? this.actionObj.scroll.scrollBy : -this.actionObj.scroll.scrollBy;
                }
            }
        }
    };
    ActionBase.prototype.autoScrollValidation = function (e) {
        if (!this.actionObj.scroll.enable) {
            return false;
        }
        var res = this.parent.boundaryValidation(this.actionObj.pageY, this.actionObj.pageX);
        this.scrollEdges = res;
        return res.bottom || res.top || res.left || res.right;
    };
    ActionBase.prototype.actionClass = function (type) {
        if (type === 'addClass') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.parent.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.parent.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
        }
    };
    ActionBase.prototype.updateScrollPosition = function (e) {
        var _this = this;
        if (this.actionObj.scroll.enable && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.scrollInterval)) {
            this.actionObj.scrollInterval = window.setInterval(function () {
                if (_this.autoScrollValidation(e) && !_this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_1__["ALLDAY_APPOINTMENT_CLASS"])) {
                    if (_this.parent.activeView.isTimelineView() && _this.parent.activeViewOptions.group.resources.length > 0
                        && _this.actionObj.groupIndex < 0) {
                        return;
                    }
                    _this.autoScroll();
                    if (_this.actionObj.action === 'drag') {
                        _this.parent.dragAndDropModule.updateDraggingDateTime(e);
                    }
                    else {
                        _this.parent.resizeModule.updateResizingDirection(e);
                    }
                }
            }, this.actionObj.scroll.timeDelay);
        }
    };
    ActionBase.prototype.updateOriginalElement = function (cloneElement) {
        var query = '[data-id="' + cloneElement.getAttribute('data-id') + '"]';
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            query = query.concat('[data-group-index = "' + cloneElement.getAttribute('data-group-index') + '"]');
        }
        var elements = [].slice.call(this.parent.element.querySelectorAll(query));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(elements, _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
        var eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_ELEMENT_CLASS"]));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(eventWrappers, _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_ACTION_CLASS"]);
    };
    ActionBase.prototype.getUpdatedEvent = function (startTime, endTime, eventObj) {
        var event = JSON.parse(JSON.stringify(eventObj));
        event[this.parent.eventFields.startTime] = startTime;
        event[this.parent.eventFields.endTime] = endTime;
        return event;
    };
    ActionBase.prototype.dynamicYearlyEventsRendering = function (event, isResize) {
        if (isResize === void 0) { isResize = false; }
        var appWidth = this.actionObj.cellWidth - 7;
        if (isResize && (this.resizeEdges.left || this.resizeEdges.right)) {
            appWidth = this.actionObj.cellWidth * event.count;
        }
        if (!isResize && (this.parent.activeViewOptions.orientation === 'Horizontal' && this.parent.activeViewOptions.group.resources.length === 0)) {
            var month = event[this.parent.eventFields.startTime].getMonth();
            var eventObj = this.yearEvent.isSpannedEvent(event, month);
            if (eventObj[this.parent.eventFields.startTime].getTime() ===
                eventObj[this.parent.eventFields.endTime].getTime()) {
                eventObj.isSpanned.count = 1;
            }
            appWidth = eventObj.isSpanned.count * this.actionObj.cellWidth;
        }
        var appointmentElement = this.createAppointmentElement(this.actionObj.groupIndex);
        appointmentElement.setAttribute('drag', 'true');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_ELEMENT_CLASS"]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, {
            'width': appWidth + 'px', 'border': '0px', 'pointer-events': 'none',
            'position': 'absolute', 'overflow': 'hidden', 'padding': '3px'
        });
        if (this.actionObj.clone.style.backgroundColor !== '') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'backgroundColor': this.actionObj.clone.style.backgroundColor });
        }
        var date = _base_util__WEBPACK_IMPORTED_MODULE_2__["addLocalOffset"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](event[this.parent.eventFields.startTime])).getTime();
        var query = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"] + '[data-date="' + date + '"]';
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            query = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"] + '[data-date="' + date + '"][data-group-index="' + this.actionObj.groupIndex + '"]';
        }
        var cellTd = this.parent.element.querySelector(query);
        if (isResize) {
            var dateHeader = cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["DATE_HEADER_CLASS"]);
            var appHeight = this.actionObj.cellHeight * event.count -
                (dateHeader ? dateHeader.offsetHeight : 0) - 7;
            if (this.resizeEdges.right || this.resizeEdges.left) {
                appHeight = parseInt(this.actionObj.clone.style.height, 10);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'height': appHeight + 'px' });
        }
        this.renderDynamicElement(cellTd, appointmentElement, true);
        this.actionObj.cloneElement.push(appointmentElement);
    };
    ActionBase.prototype.renderDynamicElement = function (cellTd, element, isAppointment) {
        if (isAppointment === void 0) { isAppointment = false; }
        if (cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_WRAPPER_CLASS"])) {
            cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_WRAPPER_CLASS"]).appendChild(element);
        }
        else {
            var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_WRAPPER_CLASS"] });
            wrapper.appendChild(element);
            cellTd.appendChild(wrapper);
        }
    };
    ActionBase.prototype.createAppointmentElement = function (resIndex) {
        var appDetails = this.actionObj.clone.querySelector('.e-appointment-details') ?
            this.actionObj.clone.querySelector('.e-appointment-details') : this.actionObj.clone.querySelector('.e-subject');
        var appointmentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_CLASS"],
            innerHTML: appDetails.innerText
        });
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            appointmentWrapper.setAttribute('data-group-index', resIndex.toString());
        }
        return appointmentWrapper;
    };
    ActionBase.prototype.dynamicEventsRendering = function (event) {
        var _this = this;
        var dateRender = this.parent.activeView.renderDates;
        var workCells = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"]));
        var workDays = this.parent.activeViewOptions.workDays;
        var groupOrder;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var resources = this.parent.resourceBase.lastResourceLevel.
                filter(function (res) { return res.groupIndex === _this.actionObj.groupIndex; });
            dateRender = resources[0].renderDates;
            var elementSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"] + "[data-group-index=\"" + this.actionObj.groupIndex + "\"]";
            workCells = [].slice.call(this.parent.element.querySelectorAll(elementSelector));
            workDays = resources[0].workDays;
            groupOrder = resources[0].groupOrder;
        }
        this.monthEvent.dateRender = dateRender;
        this.monthEvent.getSlotDates(workDays);
        var eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_ELEMENT_CLASS"]));
        for (var _i = 0, eventWrappers_1 = eventWrappers; _i < eventWrappers_1.length; _i++) {
            var wrapper = eventWrappers_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrapper);
        }
        var splittedEvents = this.monthEvent.splitEvent(event, dateRender);
        for (var _a = 0, splittedEvents_1 = splittedEvents; _a < splittedEvents_1.length; _a++) {
            var event_1 = splittedEvents_1[_a];
            var day = this.parent.getIndexOfDate(dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](event_1[this.monthEvent.fields.startTime]));
            var diffInDays = event_1.data.count;
            var appWidth = (diffInDays * this.actionObj.cellWidth) - 7;
            var appointmentElement = this.monthEvent.createAppointmentElement(event_1, this.actionObj.groupIndex, true);
            appointmentElement.setAttribute('drag', 'true');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CLONE_ELEMENT_CLASS"]);
            this.monthEvent.applyResourceColor(appointmentElement, event_1, 'backgroundColor', groupOrder);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'width': appWidth + 'px', 'border': '0px', 'pointer-events': 'none' });
            var cellTd = workCells[day];
            this.monthEvent.renderElement(cellTd, appointmentElement, true);
            this.actionObj.cloneElement.push(appointmentElement);
        }
    };
    /**
     * To destroy the action base module.
     * @return {void}
     * @private
     */
    ActionBase.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.actionObj = {};
        this.scrollArgs = {};
        this.resizeEdges = { left: false, right: false, top: false, bottom: false };
        this.scrollEdges = { left: false, right: false, top: false, bottom: false };
    };
    return ActionBase;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/crud.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/crud.js ***!
  \*****************************************************************************/
/*! exports provided: Crud */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Crud", function() { return Crud; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../recurrence-editor/date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");




/**
 * Schedule CRUD operations
 */
var Crud = /** @__PURE__ @class */ (function () {
    function Crud(parent) {
        this.parent = parent;
        this.crudObj = { sourceEvent: null, targetEvent: null, isCrudAction: false };
    }
    Crud.prototype.getQuery = function () {
        var start = this.parent.activeView.startDate();
        var end = this.parent.activeView.endDate();
        return this.parent.dataModule.generateQuery(start, end);
    };
    Crud.prototype.getTable = function () {
        if (this.parent.eventSettings.query) {
            var query = this.parent.eventSettings.query.clone();
            return query.fromTable;
        }
        return null;
    };
    Crud.prototype.refreshData = function (args) {
        var _this = this;
        var actionArgs = {
            requestType: args.requestType, cancel: false, data: args.data,
            addedRecords: args.editParms.addedRecords, changedRecords: args.editParms.changedRecords,
            deletedRecords: args.editParms.deletedRecords
        };
        if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj && this.parent.dragAndDropModule.actionObj.element) {
            this.parent.dragAndDropModule.actionObj.element.style.display = 'none';
        }
        if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element) {
            this.parent.resizeModule.actionObj.element.style.display = 'none';
        }
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.activeViewOptions.group.allowGroupEdit
            && !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {
            if (args.requestType === 'eventCreated' || args.requestType === 'eventRemoved') {
                this.crudObj.isCrudAction = true;
                this.crudObj.sourceEvent = [];
                var crudData = (args.data instanceof Array ? args.data : ((typeof args.data === 'string' || typeof args.data === 'number') &&
                    args.requestType === 'eventRemoved') ? args.editParms.deletedRecords : [args.data]);
                var _loop_1 = function (data) {
                    this_1.crudObj.isCrudAction = !(args.requestType === 'eventRemoved' && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.parent));
                    var groupIndex = this_1.parent.eventBase.getGroupIndexFromEvent(data);
                    if (this_1.parent.crudModule.crudObj.sourceEvent.filter(function (tdData) { return tdData.groupIndex === groupIndex; }).length === 0
                        && this_1.crudObj.isCrudAction) {
                        this_1.crudObj.sourceEvent.push(this_1.parent.resourceBase.lastResourceLevel[groupIndex]);
                    }
                };
                var this_1 = this;
                for (var _i = 0, crudData_1 = crudData; _i < crudData_1.length; _i++) {
                    var data = crudData_1[_i];
                    _loop_1(data);
                }
                this.crudObj.targetEvent = this.crudObj.sourceEvent;
            }
        }
        if (this.parent.dataModule.dataManager.dataSource.offline) {
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionComplete"], actionArgs, function (offlineArgs) {
                if (!offlineArgs.cancel) {
                    _this.parent.renderModule.refreshDataManager();
                }
            });
        }
        else {
            args.promise.then(function (e) {
                if (_this.parent.isDestroyed) {
                    return;
                }
                _this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionComplete"], actionArgs, function (onlineArgs) {
                    if (!onlineArgs.cancel) {
                        _this.parent.renderModule.refreshDataManager();
                    }
                });
            }).catch(function (e) {
                if (_this.parent.isDestroyed) {
                    return;
                }
                // tslint:disable:no-any
                _this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionFailure"], { error: e });
                // tslint:disable:no-any
            });
        }
    };
    Crud.prototype.addEvent = function (eventData) {
        var _this = this;
        if (this.parent.eventSettings.allowAdding) {
            if (!this.isBlockEvent(eventData) &&
                this.parent.eventBase.isBlockRange(eventData)) {
                this.parent.quickPopup.openValidationError('blockAlert', (eventData instanceof Array) ? [eventData] : eventData);
                return;
            }
            var addEvents = (eventData instanceof Array) ? eventData : [eventData];
            var args = {
                requestType: 'eventCreate', cancel: false,
                addedRecords: addEvents, changedRecords: [], deletedRecords: []
            };
            args.data = addEvents;
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (addArgs) {
                if (!addArgs.cancel) {
                    var fields = _this.parent.eventFields;
                    var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                    var promise = void 0;
                    if (addArgs.addedRecords instanceof Array) {
                        for (var _i = 0, _a = addArgs.addedRecords; _i < _a.length; _i++) {
                            var event_1 = _a[_i];
                            editParms.addedRecords.push(_this.parent.eventBase.processTimezone(event_1, true));
                        }
                        // tslint:disable-next-line:max-line-length
                        promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields.id, _this.getTable(), _this.getQuery());
                    }
                    else {
                        var event_2 = _this.parent.eventBase.processTimezone(addArgs.addedRecords, true);
                        editParms.addedRecords.push(event_2);
                        promise = _this.parent.dataModule.dataManager.insert(event_2, _this.getTable(), _this.getQuery());
                    }
                    var crudArgs = {
                        requestType: 'eventCreated', cancel: false, data: addArgs.addedRecords, promise: promise, editParms: editParms
                    };
                    _this.refreshData(crudArgs);
                }
            });
        }
    };
    Crud.prototype.saveEvent = function (eventData, action) {
        var _this = this;
        if (this.parent.eventSettings.allowEditing) {
            if (this.parent.currentAction !== 'EditFollowingEvents' && !this.isBlockEvent(eventData)
                && this.parent.eventBase.isBlockRange(eventData)) {
                this.parent.quickPopup.openValidationError('blockAlert', (eventData instanceof Array) ? [eventData] : eventData);
                return;
            }
            this.parent.currentAction = action;
            if (action) {
                switch (action) {
                    case 'EditOccurrence':
                        this.processOccurrences(eventData, action);
                        break;
                    case 'EditFollowingEvents':
                        this.processFollowSeries(eventData, action);
                        break;
                    case 'EditSeries':
                        this.processEntireSeries(eventData, action);
                        break;
                }
            }
            else {
                var updateEvents = (eventData instanceof Array) ? eventData : [eventData];
                var args = {
                    requestType: 'eventChange', cancel: false,
                    addedRecords: [], changedRecords: updateEvents, deletedRecords: []
                };
                args.data = eventData;
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (saveArgs) {
                    if (!saveArgs.cancel) {
                        var promise = void 0;
                        var fields = _this.parent.eventFields;
                        var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                        if (saveArgs.changedRecords instanceof Array) {
                            for (var _i = 0, _a = saveArgs.changedRecords; _i < _a.length; _i++) {
                                var event_3 = _a[_i];
                                editParms.changedRecords.push(_this.parent.eventBase.processTimezone(event_3, true));
                            }
                            // tslint:disable-next-line:max-line-length
                            promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields.id, _this.getTable(), _this.getQuery());
                        }
                        else {
                            var event_4 = _this.parent.eventBase.processTimezone(saveArgs.changedRecords, true);
                            editParms.changedRecords.push(event_4);
                            // tslint:disable-next-line:max-line-length
                            promise = _this.parent.dataModule.dataManager.update(fields.id, event_4, _this.getTable(), _this.getQuery());
                        }
                        var crudArgs = {
                            requestType: 'eventChanged', cancel: false,
                            data: saveArgs.changedRecords, promise: promise, editParms: editParms
                        };
                        _this.refreshData(crudArgs);
                    }
                });
            }
        }
    };
    Crud.prototype.deleteEvent = function (eventData, action) {
        var _this = this;
        if (this.parent.eventSettings.allowDeleting) {
            this.parent.currentAction = action;
            var deleteEvents = [];
            if (typeof eventData === 'string' || typeof eventData === 'number') {
                deleteEvents = this.parent.eventsData.filter(function (eventObj) {
                    return eventObj[_this.parent.eventFields.id] === eventData;
                });
            }
            else {
                deleteEvents = (eventData instanceof Array ? eventData : [eventData]);
            }
            if (action) {
                switch (action) {
                    case 'Delete':
                        this.processEventDelete(deleteEvents);
                        break;
                    case 'DeleteOccurrence':
                        this.processOccurrences(deleteEvents, action);
                        break;
                    case 'DeleteFollowingEvents':
                        this.processFollowSeries(deleteEvents, action);
                        break;
                    case 'DeleteSeries':
                        this.processEntireSeries(deleteEvents, action);
                        break;
                }
            }
            else {
                var args = {
                    requestType: 'eventRemove', cancel: false,
                    addedRecords: [], changedRecords: [], deletedRecords: deleteEvents
                };
                args.data = eventData;
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (deleteArgs) {
                    if (!deleteArgs.cancel) {
                        var promise = void 0;
                        var fields = _this.parent.eventFields;
                        var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                        if (deleteArgs.deletedRecords.length > 1) {
                            editParms.deletedRecords = editParms.deletedRecords.concat(deleteArgs.deletedRecords);
                            // tslint:disable-next-line:max-line-length
                            promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields.id, _this.getTable(), _this.getQuery());
                        }
                        else {
                            editParms.deletedRecords.push(deleteArgs.deletedRecords[0]);
                            // tslint:disable-next-line:max-line-length
                            promise = _this.parent.dataModule.dataManager.remove(fields.id, deleteArgs.deletedRecords[0], _this.getTable(), _this.getQuery());
                        }
                        _this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);
                        var crudArgs = {
                            requestType: 'eventRemoved', cancel: false,
                            data: deleteArgs.deletedRecords, promise: promise, editParms: editParms
                        };
                        _this.refreshData(crudArgs);
                    }
                });
            }
        }
    };
    Crud.prototype.processOccurrences = function (eventData, action) {
        var _this = this;
        var occurenceData = [];
        var isDeletedRecords = false;
        if (eventData instanceof Array) {
            for (var _i = 0, eventData_1 = eventData; _i < eventData_1.length; _i++) {
                var event_5 = eventData_1[_i];
                occurenceData.push({ occurrence: event_5, parent: this.getParentEvent(event_5) });
            }
        }
        else {
            occurenceData = { occurrence: eventData, parent: this.getParentEvent(eventData) };
        }
        var updateEvents = (eventData instanceof Array) ? eventData : [eventData];
        var args = {
            requestType: action === 'EditOccurrence' ? 'eventChange' : 'eventRemove', cancel: false,
            addedRecords: [], changedRecords: updateEvents, deletedRecords: []
        };
        args.data = occurenceData;
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (occurenceArgs) {
            if (!occurenceArgs.cancel) {
                var fields = _this.parent.eventFields;
                var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                var occurrenceEvents = (occurenceData instanceof Array ? occurenceData : [occurenceData]);
                var _loop_2 = function (a, count) {
                    var childEvent = occurenceArgs.changedRecords[a];
                    var parentEvent = occurrenceEvents[a].parent;
                    var parentException = parentEvent[fields.recurrenceException];
                    switch (action) {
                        case 'EditOccurrence':
                            var editedData = _this.parent.eventsProcessed.filter(function (event) { return event.Guid === childEvent.Guid; })[0];
                            var exceptionDate = _this.excludeDateCheck(editedData[fields.startTime], parentException);
                            if (exceptionDate !== parentEvent[fields.recurrenceException]) {
                                parentEvent[fields.recurrenceException] = exceptionDate;
                                childEvent[fields.recurrenceException] = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(editedData[fields.startTime]);
                                childEvent[fields.recurrenceID] = parentEvent[fields.id];
                                childEvent[fields.followingID] = null;
                                editParms.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));
                                editParms.addedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));
                            }
                            else {
                                editParms.changedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));
                            }
                            break;
                        case 'DeleteOccurrence':
                            if (!childEvent[fields.recurrenceException]) {
                                parentEvent[fields.recurrenceException] =
                                    _this.excludeDateCheck(childEvent[fields.startTime], parentException);
                                editParms.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));
                            }
                            if (childEvent[fields.id] !== parentEvent[fields.id]) {
                                editParms.deletedRecords.push(childEvent);
                                isDeletedRecords = true;
                            }
                            break;
                    }
                };
                for (var a = 0, count = occurenceArgs.changedRecords.length; a < count; a++) {
                    _loop_2(a, count);
                }
                // tslint:disable-next-line:max-line-length
                var promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields.id, _this.getTable(), _this.getQuery());
                _this.parent.eventBase.selectWorkCellByTime(occurenceArgs.changedRecords);
                var crudArgs = {
                    requestType: action === 'EditOccurrence' ? 'eventChanged' : 'eventRemoved',
                    cancel: false, data: isDeletedRecords ? occurenceArgs.deletedRecords : occurenceArgs.changedRecords,
                    promise: promise, editParms: editParms
                };
                _this.refreshData(crudArgs);
            }
        });
    };
    Crud.prototype.processFollowSeries = function (eventData, action) {
        var _this = this;
        var followData = [];
        if (eventData instanceof Array) {
            for (var _i = 0, eventData_2 = eventData; _i < eventData_2.length; _i++) {
                var event_6 = eventData_2[_i];
                followData.push({ occurrence: event_6, parent: this.getParentEvent(event_6) });
            }
        }
        else {
            followData = { occurrence: eventData, parent: this.getParentEvent(eventData) };
        }
        var updateFollowEvents = (eventData instanceof Array) ? eventData : [eventData];
        var args = {
            requestType: action === 'EditFollowingEvents' ? 'eventChange' : 'eventRemove', cancel: false,
            addedRecords: [], changedRecords: updateFollowEvents, deletedRecords: []
        };
        args.data = followData;
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (followArgs) {
            if (!followArgs.cancel) {
                var fields_1 = _this.parent.eventFields;
                var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                var followEvents = (followData instanceof Array ? followData : [followData]);
                var _loop_3 = function (a, count) {
                    var childEvent = followArgs.changedRecords[a];
                    var parentEvent = followEvents[a].parent;
                    var followData_1 = _this.parent.eventBase.getEventCollections(parentEvent, childEvent);
                    switch (action) {
                        case 'EditFollowingEvents':
                            _this.processRecurrenceRule(parentEvent, childEvent);
                            var isSplitted = !_this.parent.eventBase.isFollowingEvent(parentEvent, childEvent);
                            childEvent[fields_1.followingID] = isSplitted ? null : parentEvent[fields_1.id];
                            childEvent[fields_1.recurrenceID] = null;
                            editParms.addedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));
                            editParms.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));
                            if (!_this.parent.uiStateValues.isIgnoreOccurrence) {
                                childEvent[fields_1.recurrenceException] = null;
                                if (followData_1.occurrence.length > 0) {
                                    var rule = followData_1.occurrence.slice(-1)[0][fields_1.recurrenceRule];
                                    if (rule.indexOf('COUNT') === -1) {
                                        childEvent[fields_1.recurrenceRule] = rule;
                                    }
                                }
                                if (followData_1.follow.length > 0) {
                                    childEvent[fields_1.recurrenceRule] =
                                        followData_1.follow.slice(-1)[0][fields_1.recurrenceRule];
                                    editParms.deletedRecords = editParms.deletedRecords.concat(followData_1.follow);
                                }
                                if (isSplitted) {
                                    followData_1.occurrence = followData_1.occurrence.filter(function (eventObj) {
                                        return eventObj[fields_1.recurrenceID] === childEvent[fields_1.id];
                                    });
                                }
                                editParms.deletedRecords = editParms.deletedRecords.concat(followData_1.occurrence);
                            }
                            break;
                        case 'DeleteFollowingEvents':
                            _this.processRecurrenceRule(parentEvent, childEvent[fields_1.startTime]);
                            editParms.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));
                            editParms.deletedRecords = editParms.deletedRecords.concat(followData_1.occurrence).concat(followData_1.follow);
                            break;
                    }
                };
                for (var a = 0, count = followArgs.changedRecords.length; a < count; a++) {
                    _loop_3(a, count);
                }
                // tslint:disable-next-line:max-line-length
                var promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields_1.id, _this.getTable(), _this.getQuery());
                _this.parent.eventBase.selectWorkCellByTime(followArgs.changedRecords);
                var crudArgs = {
                    requestType: action === 'EditFollowingEvents' ? 'eventChanged' : 'eventRemoved',
                    cancel: false, data: followArgs.changedRecords, promise: promise, editParms: editParms
                };
                _this.refreshData(crudArgs);
            }
        });
    };
    Crud.prototype.processEntireSeries = function (eventData, action) {
        var _this = this;
        var seriesData = [];
        var isDeletedRecords = false;
        if (eventData instanceof Array) {
            for (var _i = 0, eventData_3 = eventData; _i < eventData_3.length; _i++) {
                var event_7 = eventData_3[_i];
                seriesData.push(this.getParentEvent(event_7, true));
            }
        }
        else {
            seriesData = this.getParentEvent(eventData, true);
        }
        var updateSeriesEvents = (eventData instanceof Array) ? eventData : [eventData];
        var args = {
            requestType: action === 'EditSeries' ? 'eventChange' : 'eventRemove', cancel: false,
            addedRecords: [], changedRecords: updateSeriesEvents, deletedRecords: []
        };
        args.data = seriesData;
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (seriesArgs) {
            if (!seriesArgs.cancel) {
                var fields_2 = _this.parent.eventFields;
                var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                var seriesEvents = (seriesData instanceof Array ? seriesData : [seriesData]);
                var _loop_4 = function (a, count) {
                    var childEvent = seriesArgs.changedRecords[a];
                    var parentEvent = seriesEvents[a];
                    var eventCollections = _this.parent.eventBase.getEventCollections(parentEvent);
                    var deletedEvents = eventCollections.follow.concat(eventCollections.occurrence);
                    switch (action) {
                        case 'EditSeries':
                            if ((childEvent[fields_2.startTime] > parentEvent[fields_2.startTime]) && childEvent[fields_2.recurrenceRule]) {
                                _this.processRecurrenceRule(parentEvent, childEvent);
                            }
                            childEvent[fields_2.id] = parentEvent[fields_2.id];
                            childEvent[fields_2.recurrenceID] = null;
                            childEvent[fields_2.followingID] = null;
                            if (_this.parent.uiStateValues.isIgnoreOccurrence && childEvent[fields_2.recurrenceException]) {
                                var originalParent = _this.parent.eventsData.filter(function (eventObj) {
                                    return eventObj[fields_2.id] === childEvent[fields_2.id];
                                });
                                if (originalParent.length > 0) {
                                    childEvent[fields_2.recurrenceRule] = originalParent[0][fields_2.recurrenceRule];
                                }
                            }
                            else {
                                childEvent[fields_2.recurrenceException] = null;
                                editParms.deletedRecords = editParms.deletedRecords.concat(deletedEvents);
                            }
                            editParms.changedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));
                            _this.parent.uiStateValues.isIgnoreOccurrence = false;
                            break;
                        case 'DeleteSeries':
                            editParms.deletedRecords = editParms.deletedRecords.concat(deletedEvents.concat(parentEvent));
                            isDeletedRecords = true;
                            break;
                    }
                };
                for (var a = 0, count = seriesArgs.changedRecords.length; a < count; a++) {
                    _loop_4(a, count);
                }
                // tslint:disable-next-line:max-line-length
                var promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields_2.id, _this.getTable(), _this.getQuery());
                _this.parent.eventBase.selectWorkCellByTime(seriesArgs.changedRecords);
                var crudArgs = {
                    requestType: action === 'EditSeries' ? 'eventChanged' : 'eventRemoved',
                    cancel: false, data: isDeletedRecords ? seriesArgs.deletedRecords : seriesArgs.changedRecords,
                    promise: promise, editParms: editParms
                };
                _this.refreshData(crudArgs);
            }
        });
    };
    Crud.prototype.processEventDelete = function (eventData) {
        var _this = this;
        var deleteData = [];
        for (var _i = 0, eventData_4 = eventData; _i < eventData_4.length; _i++) {
            var eventObj = eventData_4[_i];
            if (eventObj[this.parent.eventFields.recurrenceRule]) {
                deleteData.push({ occurrence: eventObj, parent: this.getParentEvent(eventObj) });
            }
            else {
                deleteData.push(eventObj);
            }
        }
        var args = {
            requestType: 'eventRemove', cancel: false,
            addedRecords: [], changedRecords: [], deletedRecords: eventData
        };
        args.data = deleteData;
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["actionBegin"], args, function (deleteArgs) {
            if (!deleteArgs.cancel) {
                var fields_3 = _this.parent.eventFields;
                var editParms = { addedRecords: [], changedRecords: [], deletedRecords: [] };
                var _loop_5 = function (a, count) {
                    var isDelete = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(deleteArgs.deletedRecords[a][_this.parent.eventFields.recurrenceRule]);
                    if (!isDelete) {
                        var parentEvent_1 = deleteData[a].parent;
                        var isEdited = editParms.changedRecords.filter(function (obj) {
                            return obj[fields_3.id] === parentEvent_1[fields_3.id];
                        });
                        var editedDate = deleteArgs.deletedRecords[a][fields_3.startTime];
                        if (isEdited.length > 0) {
                            var editedData = isEdited[0];
                            editedData[fields_3.recurrenceException] =
                                _this.excludeDateCheck(editedDate, editedData[fields_3.recurrenceException]);
                        }
                        else {
                            parentEvent_1[fields_3.recurrenceException] =
                                _this.excludeDateCheck(editedDate, parentEvent_1[fields_3.recurrenceException]);
                        }
                        if (isEdited.length === 0) {
                            editParms.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent_1, true));
                        }
                        isDelete = (deleteArgs.deletedRecords[a][fields_3.id] !== parentEvent_1[fields_3.id]);
                    }
                    if (isDelete) {
                        editParms.deletedRecords.push(deleteArgs.deletedRecords[a]);
                    }
                };
                for (var a = 0, count = deleteArgs.deletedRecords.length; a < count; a++) {
                    _loop_5(a, count);
                }
                // tslint:disable-next-line:max-line-length
                var promise = _this.parent.dataModule.dataManager.saveChanges(editParms, fields_3.id, _this.getTable(), _this.getQuery());
                var crudArgs = {
                    requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParms: editParms
                };
                _this.refreshData(crudArgs);
            }
        });
    };
    Crud.prototype.getParentEvent = function (event, isParent) {
        if (isParent === void 0) { isParent = false; }
        var parentEvent = this.parent.eventBase.getParentEvent(event, isParent) || event;
        if (parentEvent[this.parent.eventFields.startTimezone] || parentEvent[this.parent.eventFields.endTimezone]) {
            this.parent.eventBase.timezoneConvert(parentEvent);
        }
        return parentEvent;
    };
    Crud.prototype.excludeDateCheck = function (eventStartTime, exceptionDateList) {
        var exDate = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(eventStartTime);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(exceptionDateList)) {
            if (exceptionDateList.indexOf(exDate) === -1) {
                exceptionDateList = !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(exceptionDateList)) ? exceptionDateList + ',' + exDate : exDate;
            }
        }
        else {
            exceptionDateList = exDate;
        }
        return exceptionDateList;
    };
    Crud.prototype.processRecurrenceRule = function (parentEvent, followEvent) {
        var fields = this.parent.eventFields;
        var recurrenceRule = parentEvent[fields.recurrenceRule];
        var endDate;
        if (followEvent instanceof Date) {
            endDate = new Date(+followEvent);
        }
        else {
            endDate = new Date(+followEvent[fields.startTime]);
            var newRecurrenceRule = followEvent[fields.recurrenceRule];
            var startDate = parentEvent[fields.startTime];
            var ruleException = (this.parent.currentAction === 'DeleteFollowingEvents') ? followEvent[fields.recurrenceException] : null;
            var dateCollection = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(startDate, newRecurrenceRule, ruleException, this.parent.activeViewOptions.firstDayOfWeek);
            var untilDate = new Date(dateCollection.slice(-1)[0]);
            untilDate.setHours(endDate.getHours(), endDate.getMinutes(), endDate.getSeconds());
            endDate.setHours(startDate.getHours(), startDate.getMinutes(), startDate.getSeconds());
            followEvent[fields.recurrenceRule] = this.getUpdatedRecurrenceRule(newRecurrenceRule, new Date(+untilDate), false);
        }
        parentEvent[fields.recurrenceRule] =
            this.getUpdatedRecurrenceRule(recurrenceRule, _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(endDate.getTime()), -1), true);
    };
    Crud.prototype.getUpdatedRecurrenceRule = function (recurrenceRule, untilDate, isParent) {
        var splitRule = recurrenceRule.split(';');
        var updatedRule = '';
        for (var _i = 0, splitRule_1 = splitRule; _i < splitRule_1.length; _i++) {
            var rule = splitRule_1[_i];
            if (rule !== '') {
                var ruleKey = rule.split('=')[0];
                var ruleValue = rule.split('=')[1];
                if (ruleKey === 'COUNT' || ruleKey === 'UNTIL') {
                    ruleValue = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(untilDate);
                    rule = rule.replace(rule, 'UNTIL=' + ruleValue);
                }
                updatedRule += rule + ';';
            }
        }
        if (isParent && updatedRule.indexOf('UNTIL') === -1) {
            updatedRule += 'UNTIL=' + Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(untilDate);
        }
        return updatedRule;
    };
    Crud.prototype.isBlockEvent = function (eventData) {
        var eventCollection = (eventData instanceof Array) ? eventData : [eventData];
        var value = false;
        for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {
            var event_8 = eventCollection_1[_i];
            value = event_8[this.parent.eventFields.isBlock] || false;
        }
        return value;
    };
    return Crud;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/data.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/data.js ***!
  \*****************************************************************************/
/*! exports provided: Data */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Data", function() { return Data; });
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");

/**
 * data module is used to generate query and data source.
 * @hidden
 */
var Data = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for data module
     * @private
     */
    function Data(dataSource, query) {
        this.initDataManager(dataSource, query);
    }
    /**
     * The function used to initialize dataManager and query
     * @return {void}
     * @private
     */
    Data.prototype.initDataManager = function (dataSource, query) {
        this.dataManager = dataSource instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_0__["DataManager"] ? dataSource : new _ej2_data__WEBPACK_IMPORTED_MODULE_0__["DataManager"](dataSource);
        this.query = query instanceof _ej2_data__WEBPACK_IMPORTED_MODULE_0__["Query"] ? query : new _ej2_data__WEBPACK_IMPORTED_MODULE_0__["Query"]();
    };
    /**
     * The function used to generate updated Query from schedule model
     * @return {void}
     * @private
     */
    Data.prototype.generateQuery = function (startDate, endDate) {
        var query = this.query.clone();
        if (startDate) {
            query.addParams('StartDate', startDate.toISOString());
        }
        if (endDate) {
            query.addParams('EndDate', endDate.toISOString());
        }
        return query;
    };
    /**
     * The function used to get dataSource by executing given Query
     * @param  {Query} query - A Query that specifies to generate dataSource
     * @return {void}
     * @private
     */
    Data.prototype.getData = function (query) {
        return this.dataManager.executeQuery(query);
    };
    return Data;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/drag.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/drag.js ***!
  \*****************************************************************************/
/*! exports provided: DragAndDrop */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDrop", function() { return DragAndDrop; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _actions_action_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../actions/action-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/action-base.js");
/* harmony import */ var _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
/* harmony import */ var _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../event-renderer/timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js");
/* harmony import */ var _event_renderer_year__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../event-renderer/year */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/year.js");
/* harmony import */ var _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../event-renderer/vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/vertical-view.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();










var MINUTES_PER_DAY = 1440;
/**
 * Schedule events drag actions
 */
var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
    __extends(DragAndDrop, _super);
    function DragAndDrop() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.widthUptoCursorPoint = 0;
        _this.heightUptoCursorPoint = 0;
        _this.cursorPointIndex = 0;
        _this.isHeaderRows = false;
        _this.isTimelineDayProcess = false;
        _this.widthPerMinute = 0;
        _this.heightPerMinute = 0;
        _this.minDiff = 0;
        _this.isStepDragging = false;
        _this.isMorePopupOpened = false;
        _this.isAllDayDrag = false;
        return _this;
    }
    DragAndDrop.prototype.wireDragEvent = function (element) {
        var dragObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Draggable"](element, {
            abort: '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_RESIZE_CLASS"],
            clone: true,
            isDragScroll: true,
            enableTapHold: this.parent.isAdaptive,
            enableTailMode: (this.parent.eventDragArea) ? true : false,
            cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
            dragArea: (this.parent.eventDragArea) ?
                document.querySelector(this.parent.eventDragArea) :
                this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_TABLE_CLASS"]),
            dragStart: this.dragStart.bind(this),
            drag: this.drag.bind(this),
            dragStop: this.dragStop.bind(this),
            enableAutoScroll: false,
            helper: this.dragHelper.bind(this),
            queryPositionInfo: this.dragPosition.bind(this)
        });
        if (!(dragObj.enableTapHold && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice && _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isTouch)) {
            // tslint:disable-next-line:no-any
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(element, 'touchstart', dragObj.initialize);
        }
    };
    DragAndDrop.prototype.dragHelper = function (e) {
        this.setDragActionDefaultValues();
        this.actionObj.element = e.element;
        this.actionObj.action = 'drag';
        this.actionObj.clone = this.createCloneElement(this.actionObj.element);
        if (!this.parent.eventDragArea && this.parent.currentView !== 'Month' &&
            this.parent.timeScale.enable && !this.parent.activeView.isTimelineView() &&
            !this.actionObj.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"])) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.actionObj.clone, { cursor: 'move', left: '0%', right: '0%', width: '100%' });
        }
        this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.element.offsetTop);
        this.actionObj.cloneElement = [this.actionObj.clone];
        this.actionObj.originalElement = [this.actionObj.element];
        return this.actionObj.clone;
    };
    DragAndDrop.prototype.dragPosition = function (e) {
        if (this.parent.eventDragArea) {
            return { left: e.left, top: e.top };
        }
        var cellHeight = (this.actionObj.cellHeight / this.actionObj.slotInterval) * this.actionObj.interval;
        var leftValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0);
        if (this.parent.currentView === 'Month') {
            leftValue = e.left;
        }
        if (this.parent.activeView.isTimelineView()) {
            leftValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.clone.offsetLeft);
        }
        var topValue;
        if ((this.parent.activeView.isTimelineView() || !this.parent.timeScale.enable ||
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.clone.offsetParent) &&
                this.actionObj.clone.offsetParent.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"])))) {
            topValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.clone.offsetTop);
        }
        else if (this.parent.currentView === 'Month') {
            topValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0);
        }
        else if (this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"])) {
            topValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_ROW_CLASS"]).offsetTop);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.actionObj.clone, {
                width: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(Math.ceil(this.actionObj.clone.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth),
                right: this.parent.enableRtl && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0)
            });
        }
        else {
            if (this.actionObj.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]) &&
                !this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.actionObj.clone, {
                    height: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.cellHeight),
                    width: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.cellWidth - 1),
                    pointerEvents: 'none'
                });
            }
            var top_1 = parseInt(e.top, 10);
            top_1 = top_1 < 0 ? 0 : top_1;
            topValue = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(Math.ceil(top_1 / cellHeight) * cellHeight);
            var scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
            var cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
            if (cloneBottom > scrollHeight) {
                topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
            }
        }
        return { left: leftValue, top: topValue };
    };
    DragAndDrop.prototype.setDragActionDefaultValues = function () {
        this.actionObj.action = 'drag';
        this.actionObj.isAllDay = null;
        this.actionObj.slotInterval = this.parent.activeViewOptions.timeScale.interval / this.parent.activeViewOptions.timeScale.slotCount;
        this.actionObj.interval = this.actionObj.slotInterval;
        var workCell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]);
        this.actionObj.cellWidth = workCell.offsetWidth;
        this.actionObj.cellHeight = workCell.offsetHeight;
    };
    DragAndDrop.prototype.dragStart = function (e) {
        var _this = this;
        var eventGuid = this.actionObj.element.getAttribute('data-guid');
        this.actionObj.event = this.parent.eventBase.getEventByGuid(eventGuid);
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var dragArgs = {
            cancel: false,
            data: eventObj,
            event: e,
            excludeSelectors: null,
            element: this.actionObj.element,
            interval: this.actionObj.interval,
            navigation: { enable: false, timeDelay: 2000 },
            scroll: { enable: true, scrollBy: 30, timeDelay: 100 }
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_7__["dragStart"], dragArgs, function (dragEventArgs) {
            if (dragEventArgs.cancel || (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.actionObj.element) &&
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.actionObj.element.parentElement))) {
                var dragObj = _this.actionObj.element.ej2_instances[0];
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dragObj)) {
                    dragObj.intDestroy(e.event);
                }
                _this.actionObj.action = '';
                _this.removeCloneElementClasses();
                _this.removeCloneElement();
                return;
            }
            _this.actionClass('addClass');
            _this.parent.uiStateValues.action = true;
            _this.actionObj.start = eventObj[_this.parent.eventFields.startTime];
            _this.actionObj.end = eventObj[_this.parent.eventFields.endTime];
            _this.actionObj.groupIndex = parseInt(_this.actionObj.element.getAttribute('data-group-index') || '0', 10);
            _this.actionObj.interval = dragEventArgs.interval;
            _this.actionObj.navigation = dragEventArgs.navigation;
            _this.actionObj.scroll = dragEventArgs.scroll;
            _this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
            var viewElement = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
            _this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
            _this.widthPerMinute = (_this.actionObj.cellWidth / _this.actionObj.slotInterval) * _this.actionObj.interval;
            _this.heightPerMinute = (_this.actionObj.cellHeight / _this.actionObj.slotInterval) * _this.actionObj.interval;
            _this.widthUptoCursorPoint = 0;
            _this.heightUptoCursorPoint = 0;
            _this.cursorPointIndex = -1;
            _this.isHeaderRows = false;
            _this.isTimelineDayProcess = false;
            _this.minDiff = 0;
            _this.isMorePopupOpened = false;
            _this.daysVariation = -1;
            if ((_this.parent.activeView.isTimelineView() || !_this.parent.timeScale.enable) && _this.parent.currentView !== 'TimelineYear') {
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.actionObj.clone.offsetParent) &&
                    _this.actionObj.clone.offsetParent.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"])) {
                    _this.isMorePopupOpened = true;
                }
                var rows = _this.parent.activeViewOptions.headerRows;
                _this.isHeaderRows = rows.length > 0 && rows[rows.length - 1].option !== 'Hour' &&
                    rows[rows.length - 1].option !== 'Date';
                _this.isTimelineDayProcess = !_this.parent.activeViewOptions.timeScale.enable || _this.isHeaderRows ||
                    _this.parent.currentView === 'TimelineMonth' || (rows.length > 0 && rows[rows.length - 1].option === 'Date');
                _this.isStepDragging = !_this.isTimelineDayProcess && (_this.actionObj.slotInterval !== _this.actionObj.interval);
                if (_this.isTimelineDayProcess) {
                    _this.timelineEventModule = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_3__["TimelineEvent"](_this.parent, 'day');
                }
                else {
                    _this.timelineEventModule = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_3__["TimelineEvent"](_this.parent, 'hour');
                }
            }
            if (_this.parent.currentView === 'TimelineYear') {
                _this.yearEvent = new _event_renderer_year__WEBPACK_IMPORTED_MODULE_4__["YearEvent"](_this.parent);
            }
            if (_this.parent.currentView === 'Month') {
                _this.updateOriginalElement(_this.actionObj.clone);
                _this.monthEvent = new _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__["MonthEvent"](_this.parent);
            }
            if (_this.parent.currentView === 'Day' || _this.parent.currentView === 'Week' || _this.parent.currentView === 'WorkWeek') {
                _this.verticalEvent = new _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_5__["VerticalEvent"](_this.parent);
            }
        });
    };
    DragAndDrop.prototype.drag = function (e) {
        this.parent.quickPopup.quickPopupHide(true);
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.target)) && e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_DATES"])) {
            return;
        }
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var eventArgs = this.getPageCoordinates(e);
        this.actionObj.Y = this.actionObj.pageY = eventArgs.pageY;
        this.actionObj.X = this.actionObj.pageX = eventArgs.pageX;
        this.actionObj.target = e.target;
        this.widthUptoCursorPoint = (this.widthUptoCursorPoint === 0) ?
            Math.ceil((Math.abs(this.actionObj.clone.getBoundingClientRect().left - this.actionObj.X) / this.widthPerMinute)) *
                this.widthPerMinute : this.widthUptoCursorPoint;
        this.widthUptoCursorPoint = this.isMorePopupOpened ? this.actionObj.cellWidth : this.widthUptoCursorPoint;
        this.heightUptoCursorPoint = (this.heightUptoCursorPoint === 0) ?
            Math.ceil((Math.abs(this.actionObj.clone.getBoundingClientRect().top - this.actionObj.Y) / this.heightPerMinute)) *
                this.heightPerMinute : this.heightUptoCursorPoint;
        this.isAllDayDrag = (this.parent.activeViewOptions.timeScale.enable) ?
            this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]) :
            this.actionObj.event[this.parent.eventFields.isAllDay];
        if (this.isStepDragging && this.minDiff === 0) {
            this.calculateMinutesDiff(eventObj);
        }
        if ((this.parent.currentView === 'Month' || this.isAllDayDrag) && this.daysVariation < 0) {
            var date = this.parent.getDateFromElement(this.actionObj.target);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date)) {
                var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](date);
                var startDate = _base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](new Date(eventObj[this.parent.eventFields.startTime].getTime()));
                this.daysVariation = (currentDate.getTime() - startDate.getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_8__["MS_PER_DAY"];
            }
            else {
                this.daysVariation = 0;
            }
        }
        else {
            this.daysVariation = 0;
        }
        if (this.parent.eventDragArea) {
            var targetElement = eventArgs.target;
            this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(targetElement.offsetTop);
            this.actionObj.clone.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(targetElement.offsetLeft);
            var currentTarget = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(targetElement, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ROOT"]);
            if (!currentTarget) {
                this.actionObj.clone.style.height = '';
                this.actionObj.clone.style.width = '';
            }
            else {
                if (!(this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek'
                    || this.parent.currentView === 'Day')) {
                    this.actionObj.clone.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.element.offsetWidth);
                }
            }
        }
        this.updateScrollPosition(e);
        this.updateNavigatingPosition(e);
        this.updateDraggingDateTime(e);
        var dragArgs = {
            data: eventObj, event: e, element: this.actionObj.element, startTime: this.actionObj.start,
            endTime: this.actionObj.end
        };
        if (this.parent.group.resources.length > 0) {
            dragArgs.groupIndex = this.actionObj.groupIndex;
        }
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_7__["drag"], dragArgs);
    };
    DragAndDrop.prototype.calculateMinutesDiff = function (eventObj) {
        if (this.parent.enableRtl) {
            this.minDiff =
                ((this.actionObj.clone.offsetWidth - this.widthUptoCursorPoint) / this.widthPerMinute) * this.actionObj.interval;
        }
        else {
            this.minDiff = (this.widthUptoCursorPoint / this.widthPerMinute) * this.actionObj.interval;
        }
        var startDate = eventObj[this.parent.eventFields.startTime];
        var startTime = this.parent.activeView.renderDates[0];
        var startEndHours = _base_util__WEBPACK_IMPORTED_MODULE_8__["getStartEndHours"](startTime, this.parent.activeView.getStartHour(), this.parent.activeView.getEndHour());
        if (startEndHours.startHour.getTime() > startDate.getTime()) {
            this.minDiff = this.minDiff + ((startEndHours.startHour.getTime() - startDate.getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_8__["MS_PER_MINUTE"]);
        }
    };
    DragAndDrop.prototype.dragStop = function (e) {
        var _this = this;
        this.removeCloneElementClasses();
        this.removeCloneElement();
        clearInterval(this.actionObj.navigationInterval);
        this.actionObj.navigationInterval = null;
        clearInterval(this.actionObj.scrollInterval);
        this.actionObj.scrollInterval = null;
        this.actionClass('removeClass');
        this.parent.uiStateValues.action = false;
        this.actionObj.action = null;
        if (this.isAllowDrop(e)) {
            return;
        }
        var target = ((!e.target.classList.contains('e-work-cells') && this.parent.cellTemplate) ?
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-work-cells') : e.target);
        var dragArgs = {
            cancel: false, data: this.getChangedData(),
            event: e, element: this.actionObj.element, target: target
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_7__["dragStop"], dragArgs, function (dragEventArgs) {
            if (dragEventArgs.cancel) {
                return;
            }
            if (_this.parent.activeViewOptions.group.resources.length > 0 && !_this.parent.activeViewOptions.group.allowGroupEdit
                && !_this.parent.rowAutoHeight && !_this.parent.virtualScrollModule && _this.parent.activeViewOptions.group.byGroupID) {
                _this.parent.crudModule.crudObj.isCrudAction = true;
                _this.parent.crudModule.crudObj.sourceEvent =
                    [_this.parent.resourceBase.lastResourceLevel[parseInt(dragArgs.element.getAttribute('data-group-index'), 10)]];
                var currentGroupIndex = parseInt(dragArgs.target.getAttribute('data-group-index'), 10) || _this.actionObj.groupIndex;
                _this.parent.crudModule.crudObj.targetEvent = [_this.parent.resourceBase.lastResourceLevel[currentGroupIndex]];
            }
            _this.saveChangedData(dragEventArgs);
        });
    };
    DragAndDrop.prototype.updateNavigatingPosition = function (e) {
        var _this = this;
        if (this.actionObj.navigation.enable) {
            var currentDate_1 = this.parent.getCurrentTime();
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.navigationInterval)) {
                this.actionObj.navigationInterval = window.setInterval(function () {
                    if (currentDate_1) {
                        var crtDate = _this.parent.getCurrentTime();
                        var end = crtDate.getSeconds();
                        var start = currentDate_1.getSeconds() + (_this.actionObj.navigation.timeDelay / 1000);
                        start = (start >= 60) ? start - 60 : start;
                        if (start === end) {
                            currentDate_1 = _this.parent.getCurrentTime();
                            _this.viewNavigation(e);
                            _this.updateDraggingDateTime(e);
                        }
                    }
                }, this.actionObj.navigation.timeDelay);
            }
        }
    };
    DragAndDrop.prototype.updateDraggingDateTime = function (e) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.clone.offsetParent) &&
            this.actionObj.clone.offsetParent.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"])) {
            this.morePopupEventDragging(e);
        }
        else if (this.parent.activeView.isTimelineView() && this.parent.currentView !== 'TimelineYear') {
            this.timelineEventModule.dateRender = this.parent.activeView.renderDates;
            this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
            this.timelineEventModule.getSlotDates();
            this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth : this.actionObj.cellWidth;
            this.calculateTimelineTime(e);
        }
        else {
            if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
                this.calculateVerticalDate(e);
            }
            else {
                this.calculateVerticalTime(e);
            }
        }
    };
    DragAndDrop.prototype.navigationWrapper = function () {
        if (!this.parent.activeView.isTimelineView()) {
            if (this.parent.currentView === 'Month' || !this.parent.timeScale.enable) {
                var outerWrapperCls = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]));
                this.actionObj.index = (this.parent.activeView.renderDates.length < this.actionObj.index) ?
                    this.parent.activeView.renderDates.length - 1 : this.actionObj.index;
                var targetWrapper = outerWrapperCls[this.actionObj.index].querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]);
                if (!targetWrapper) {
                    targetWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] });
                    outerWrapperCls[this.actionObj.index].appendChild(targetWrapper);
                }
                targetWrapper.appendChild(this.actionObj.clone);
            }
            else {
                var wrapperClass = this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]) ?
                    '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"] : '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"];
                this.parent.element.querySelectorAll(wrapperClass)
                    .item(this.actionObj.index).appendChild(this.actionObj.clone);
                if (wrapperClass === '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"]) {
                    var elementHeight = this.getAllDayEventHeight();
                    var event_2 = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"] + ':first-child'));
                    if (event_2[0].offsetHeight < elementHeight) {
                        for (var _i = 0, event_1 = event_2; _i < event_1.length; _i++) {
                            var e = event_1[_i];
                            e.style.height = ((elementHeight + 2) / 12) + 'em';
                        }
                    }
                    this.actionObj.clone.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(elementHeight);
                }
                this.actionObj.height = parseInt(this.actionObj.clone.style.height, 0);
            }
        }
        else {
            var outWrapper = void 0;
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                outWrapper = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(this.actionObj.index);
            }
            else {
                outWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CONTAINER_CLASS"]);
            }
            var tarWrapper = outWrapper.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]);
            if (!tarWrapper) {
                tarWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] });
                outWrapper.appendChild(tarWrapper);
            }
            tarWrapper.appendChild(this.actionObj.clone);
        }
    };
    DragAndDrop.prototype.viewNavigation = function (e) {
        var navigationType;
        var dragArea = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
        if (dragArea && ((!this.scrollEdges.top && !this.scrollEdges.bottom) ||
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"]))) {
            if ((dragArea.scrollLeft === 0) &&
                (Math.round(this.actionObj.X) <=
                    Math.round(dragArea.getBoundingClientRect().left + this.actionObj.cellWidth + window.pageXOffset))) {
                navigationType = this.parent.enableRtl ? 'next' : 'previous';
            }
            else if ((Math.round(dragArea.scrollLeft) + dragArea.clientWidth === dragArea.scrollWidth) &&
                (Math.round(this.actionObj.X) >=
                    Math.round(dragArea.getBoundingClientRect().right - this.actionObj.cellWidth + window.pageXOffset))) {
                navigationType = this.parent.enableRtl ? 'previous' : 'next';
            }
            if (navigationType) {
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate(navigationType));
            }
        }
    };
    DragAndDrop.prototype.morePopupEventDragging = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.target) || (e.target && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, 'td')))) {
            return;
        }
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var eventDuration = eventObj[this.parent.eventFields.endTime].getTime() -
            eventObj[this.parent.eventFields.startTime].getTime();
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, 'td');
        if (this.parent.currentView === 'TimelineYear' && !td.classList.contains('e-work-cells')) {
            return;
        }
        var dragStart = this.parent.getDateFromElement(td);
        var dragEnd = new Date(dragStart.getTime());
        dragEnd.setMilliseconds(eventDuration);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
        }
        this.actionObj.start = new Date(dragStart.getTime());
        this.actionObj.end = new Date(dragEnd.getTime());
        this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(td.offsetParent.offsetTop);
        this.actionObj.clone.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(td.offsetLeft);
        this.actionObj.clone.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(td.offsetWidth);
        var eventContainer = td;
        var eventWrapper;
        if (this.parent.activeView.isTimelineView()) {
            var rowIndex = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(td, 'tr').rowIndex;
            eventContainer = this.parent.element.querySelectorAll('.e-appointment-container').item(rowIndex);
        }
        eventWrapper = eventContainer.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]);
        if (!eventWrapper) {
            eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] });
            eventContainer.appendChild(eventWrapper);
        }
        this.appendCloneElement(eventWrapper);
    };
    DragAndDrop.prototype.calculateVerticalTime = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.actionObj.target) ||
            (this.actionObj.target && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'tr'))) ||
            (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"])) &&
                !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"])))) {
            return;
        }
        if (this.parent.activeViewOptions.timeScale.enable) {
            this.swapDragging(e);
        }
        var dragArea = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var eventStart = eventObj[this.parent.eventFields.startTime];
        var eventEnd = eventObj[this.parent.eventFields.endTime];
        var eventDuration = eventEnd.getTime() - eventStart.getTime();
        var offsetTop = Math.floor(parseInt(this.actionObj.clone.style.top, 10) / this.actionObj.cellHeight)
            * this.actionObj.cellHeight;
        offsetTop = offsetTop < 0 ? 0 : offsetTop;
        if (this.scrollEdges.top || this.scrollEdges.bottom) {
            offsetTop = this.scrollEdges.top ? dragArea.scrollTop - this.heightUptoCursorPoint +
                this.actionObj.cellHeight + window.pageYOffset :
                (dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
                    (this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
            offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
            this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(offsetTop);
        }
        var rowIndex = (this.parent.activeViewOptions.timeScale.enable) ? (offsetTop / this.actionObj.cellHeight) : 0;
        var heightPerMinute = this.actionObj.cellHeight / this.actionObj.slotInterval;
        var diffInMinutes = parseInt(this.actionObj.clone.style.top, 10) - offsetTop;
        var tr;
        if (this.isAllDayDrag) {
            tr = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_ROW_CLASS"]);
        }
        else {
            var trCollections = [].slice.call(this.parent.getContentTable().querySelectorAll('tr'));
            tr = trCollections[rowIndex];
        }
        var index;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]) ||
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"])) {
            index = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').cellIndex;
        }
        var colIndex = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, 'td').cellIndex : index;
        this.actionObj.index = colIndex;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tr)) {
            return;
        }
        var td = tr.children[colIndex];
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
        }
        var dragStart;
        var dragEnd;
        if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
            this.appendCloneElement(this.getEventWrapper(colIndex));
            dragStart = this.parent.getDateFromElement(td);
            dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
            dragEnd = new Date(dragStart.getTime());
            if (this.actionObj.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"])) {
                dragEnd.setMinutes(dragEnd.getMinutes() + this.actionObj.slotInterval);
            }
            else {
                dragEnd.setMilliseconds(eventDuration);
            }
        }
        else {
            dragStart = this.parent.getDateFromElement(td);
            dragStart.setDate(dragStart.getDate() - this.daysVariation);
            dragStart.setHours(eventStart.getHours(), eventStart.getMinutes(), eventStart.getSeconds());
            dragEnd = new Date(dragStart.getTime());
            dragEnd.setMilliseconds(eventDuration);
            if (!this.actionObj.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]) &&
                this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"])) {
                dragEnd = _base_util__WEBPACK_IMPORTED_MODULE_8__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](dragEnd), 1);
            }
            this.updateAllDayEvents(dragStart, dragEnd, this.parent.activeViewOptions.group.byDate ? colIndex : undefined);
        }
        this.actionObj.start = new Date(+dragStart);
        this.actionObj.end = new Date(+dragEnd);
        var event = this.getUpdatedEvent(this.actionObj.start, this.actionObj.end, this.actionObj.event);
        this.updateEventHeight(event);
        this.updateTimePosition(this.actionObj.start);
    };
    DragAndDrop.prototype.updateEventHeight = function (event) {
        this.verticalEvent.initializeValues();
        var datesCount = 0;
        for (var i = 0; i < this.actionObj.groupIndex; i++) {
            datesCount = datesCount + this.verticalEvent.dateRender[i].length;
        }
        var target = (this.parent.activeViewOptions.group.byDate &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.getDateFromElement(this.actionObj.target))) ? true : false;
        if (target || !this.parent.activeViewOptions.group.byDate) {
            var dayIndex = !this.parent.activeViewOptions.group.byDate ? this.actionObj.index - datesCount
                : this.parent.getIndexOfDate(this.verticalEvent.dateRender[this.actionObj.groupIndex], _base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](this.parent.getDateFromElement(this.actionObj.target)));
            var record = this.verticalEvent.isSpannedEvent(event, dayIndex, this.actionObj.groupIndex);
            var eStart = record[this.verticalEvent.fields.startTime];
            var eEnd = record[this.verticalEvent.fields.endTime];
            var appHeight = this.parent.activeViewOptions.timeScale.enable ? this.verticalEvent.getHeight(eStart, eEnd) :
                this.actionObj.element.offsetHeight;
            var topValue = this.parent.activeViewOptions.timeScale.enable ?
                this.verticalEvent.getTopValue(eStart, dayIndex, this.actionObj.groupIndex) : this.actionObj.element.offsetTop;
            this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(topValue);
            this.actionObj.clone.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(appHeight);
        }
    };
    DragAndDrop.prototype.updateAllDayEvents = function (startDate, endDate, colIndex) {
        var _this = this;
        this.parent.eventBase.slots = [];
        var event = this.getUpdatedEvent(startDate, endDate, this.actionObj.event);
        var renderDates = this.parent.activeView.renderDates;
        this.parent.eventBase.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.parent.eventBase.slots = [];
            var resources = this.parent.resourceBase.lastResourceLevel.
                filter(function (res) { return res.groupIndex === _this.actionObj.groupIndex; });
            renderDates = resources[0].renderDates;
            this.parent.eventBase.slots.push(renderDates.map(function (date) { return +date; }));
        }
        var events = this.parent.eventBase.splitEvent(event, renderDates);
        var query = '.e-all-day-cells[data-date="' +
            this.parent.getMsFromDate(events[0][this.parent.eventFields.startTime]) + '"]';
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            query = query.concat('[data-group-index = "' + this.actionObj.groupIndex + '"]');
        }
        var cell = [].slice.call(this.parent.element.querySelectorAll(query));
        if (cell.length > 0 || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(colIndex)) {
            var cellIndex = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(colIndex) ? colIndex : cell[0].cellIndex;
            this.appendCloneElement(this.getEventWrapper(cellIndex));
            this.actionObj.clone.style.width =
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(events[0].data.count * this.actionObj.cellWidth);
        }
    };
    DragAndDrop.prototype.swapDragging = function (e) {
        var colIndex = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td').cellIndex;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_WRAP_CLASS"]) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"])) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.actionObj.clone], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]);
            this.appendCloneElement(this.getEventWrapper(colIndex));
            this.actionObj.isAllDay = true;
            var eventHeight = this.getAllDayEventHeight();
            var allDayElement = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"] + ':first-child'));
            if (allDayElement[0].offsetHeight < eventHeight) {
                for (var _i = 0, allDayElement_1 = allDayElement; _i < allDayElement_1.length; _i++) {
                    var element = allDayElement_1[_i];
                    element.style.height = ((eventHeight + 2) / 12) + 'em';
                }
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.actionObj.clone, {
                width: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.cellWidth),
                height: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(eventHeight),
                top: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_ROW_CLASS"]).offsetTop)
            });
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DAY_WRAPPER_CLASS"])) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.actionObj.clone], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]);
            this.appendCloneElement(this.getEventWrapper(colIndex));
            this.actionObj.isAllDay = false;
            var height = (this.actionObj.element.offsetHeight === 0) ? this.actionObj.height : this.actionObj.element.offsetHeight;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(this.actionObj.clone, {
                left: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0),
                height: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height),
                width: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.cellWidth)
            });
        }
    };
    DragAndDrop.prototype.calculateVerticalDate = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.target) || (e.target && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, 'tr'))) ||
            (e.target && e.target.tagName === 'DIV')) {
            return;
        }
        this.removeCloneElement();
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var eventDuration = eventObj[this.parent.eventFields.endTime].getTime() -
            eventObj[this.parent.eventFields.startTime].getTime();
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(td)) {
            var tr = td.parentElement;
            this.actionObj.index = (tr.rowIndex * tr.children.length) + td.cellIndex;
            var workCells = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]));
            td = workCells[this.actionObj.index];
            var currentDate = this.parent.getDateFromElement(td);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currentDate)) {
                if (this.parent.activeViewOptions.group.resources.length > 0) {
                    this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
                }
                var timeString = new Date(currentDate.setDate(currentDate.getDate() - this.daysVariation));
                var dragStart = new Date(timeString.getTime());
                var dragEnd = new Date(dragStart.getTime());
                var startTimeDiff = eventObj[this.parent.eventFields.startTime].getTime() -
                    (_base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](new Date(+eventObj[this.parent.eventFields.startTime]))).getTime();
                dragStart = new Date(dragStart.getTime() + startTimeDiff);
                dragEnd = new Date(dragStart.getTime() + eventDuration);
                this.actionObj.start = new Date(dragStart.getTime());
                this.actionObj.end = new Date(dragEnd.getTime());
            }
        }
        var event = this.getUpdatedEvent(this.actionObj.start, this.actionObj.end, this.actionObj.event);
        if (this.parent.currentView === 'TimelineYear') {
            this.dynamicYearlyEventsRendering(event);
        }
        else {
            this.dynamicEventsRendering(event);
        }
    };
    DragAndDrop.prototype.calculateTimelineTime = function (e) {
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var eventDuration = eventObj[this.parent.eventFields.endTime].getTime() -
            eventObj[this.parent.eventFields.startTime].getTime();
        var offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
            parseInt(this.actionObj.clone.style.left, 10);
        offsetLeft = Math.floor(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
        var rightOffset;
        if (this.parent.enableRtl) {
            rightOffset = Math.abs(parseInt(this.actionObj.clone.style.right, 10));
            this.actionObj.clone.style.right = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(rightOffset);
        }
        offsetLeft = this.getOffsetValue(offsetLeft, rightOffset);
        var colIndex = this.getColumnIndex(offsetLeft);
        var dragArea = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
        var leftVal = (this.parent.eventDragArea) ? dragArea.scrollLeft - dragArea.offsetLeft : 0;
        var cloneIndex = Math.floor((this.actionObj.pageX - this.actionObj.clone.getBoundingClientRect().left + leftVal) / this.actionObj.cellWidth);
        if (this.parent.enableRtl) {
            cloneIndex = Math.abs(Math.floor((this.actionObj.pageX - this.actionObj.clone.getBoundingClientRect().right) /
                this.actionObj.cellWidth)) - 1;
        }
        if (this.cursorPointIndex < 0) {
            this.cursorIndex(e, eventObj, offsetLeft, cloneIndex);
        }
        var tr = this.parent.getContentTable().querySelector('tr');
        var index = this.getCursorCurrentIndex(colIndex, cloneIndex, tr);
        index = index < 0 ? 0 : index;
        var eventStart = this.isHeaderRows ? new Date(this.timelineEventModule.dateRender[index].getTime()) :
            this.parent.getDateFromElement(tr.children[index]);
        if (this.isStepDragging) {
            var widthDiff = this.getWidthDiff(tr, index);
            if (widthDiff !== 0) {
                var timeDiff = Math.round(widthDiff / this.widthPerMinute);
                eventStart.setMinutes(eventStart.getMinutes() + (timeDiff * this.actionObj.interval));
                eventStart.setMinutes(eventStart.getMinutes() - this.minDiff);
            }
            else {
                eventStart = this.actionObj.start;
            }
        }
        else {
            eventStart.setMinutes(eventStart.getMinutes() -
                (this.cursorPointIndex * (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval)));
        }
        eventStart = this.calculateIntervalTime(eventStart);
        if (this.isTimelineDayProcess) {
            var eventSrt = eventObj[this.parent.eventFields.startTime];
            eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds());
        }
        var eventEnd = new Date(eventStart.getTime());
        eventEnd.setMilliseconds(eventDuration);
        var event = this.getUpdatedEvent(eventStart, eventEnd, this.actionObj.event);
        var events = this.timelineEventModule.splitEvent(event, this.timelineEventModule.dateRender);
        var eventData = events[0].data;
        var startTime = this.timelineEventModule.getStartTime(events[0], eventData);
        var endTime = this.timelineEventModule.getEndTime(events[0], eventData);
        var width = this.timelineEventModule.
            getEventWidth(startTime, endTime, eventObj[this.parent.eventFields.isAllDay], eventData.count);
        var day = this.parent.getIndexOfDate(this.timelineEventModule.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_8__["resetTime"](new Date(startTime.getTime())));
        day = day < 0 ? 0 : day;
        var left = this.timelineEventModule.getPosition(startTime, endTime, eventObj[this.parent.eventFields.isAllDay], day);
        if (this.parent.enableRtl) {
            this.actionObj.clone.style.right = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(left);
        }
        else {
            this.actionObj.clone.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(left);
        }
        if (!this.isMorePopupOpened) {
            this.actionObj.clone.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        }
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.calculateResourceGroupingPosition(e);
        }
        this.actionObj.start = new Date(eventStart.getTime());
        this.actionObj.end = new Date(eventEnd.getTime());
        this.updateTimePosition(this.actionObj.start);
    };
    DragAndDrop.prototype.getOffsetValue = function (offsetLeft, rightOffset) {
        if (this.scrollEdges.left || this.scrollEdges.right) {
            var viewEle = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
            if (this.parent.enableRtl) {
                rightOffset = viewEle.offsetWidth - viewEle.scrollLeft;
                if (this.scrollEdges.right) {
                    rightOffset = (rightOffset - viewEle.offsetWidth + this.actionObj.clone.offsetWidth) -
                        (this.actionObj.clone.offsetWidth - this.widthUptoCursorPoint);
                }
                else {
                    rightOffset = rightOffset + this.widthUptoCursorPoint;
                    if (rightOffset - this.widthUptoCursorPoint >= viewEle.scrollWidth) {
                        this.actionObj.clone.style.width =
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.actionObj.clone.offsetWidth - this.widthUptoCursorPoint + this.actionObj.cellWidth);
                        rightOffset = (viewEle.scrollLeft - viewEle.scrollWidth);
                    }
                }
                this.actionObj.clone.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(rightOffset);
            }
            else {
                if (this.scrollEdges.left) {
                    offsetLeft = viewEle.scrollLeft - this.widthUptoCursorPoint + this.actionObj.cellWidth;
                    if (viewEle.scrollLeft + viewEle.offsetWidth >= viewEle.offsetWidth) {
                        viewEle.scrollLeft = viewEle.scrollLeft - 1;
                    }
                    else if (this.actionObj.clone.offsetLeft === 0) {
                        offsetLeft = viewEle.scrollLeft;
                    }
                }
                else {
                    offsetLeft = (viewEle.scrollLeft + viewEle.offsetWidth -
                        this.actionObj.clone.offsetWidth) + (this.actionObj.clone.offsetWidth - this.widthUptoCursorPoint);
                }
                offsetLeft = offsetLeft < 0 ? 0 : offsetLeft;
                this.actionObj.clone.style.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(offsetLeft);
            }
        }
        return offsetLeft;
    };
    DragAndDrop.prototype.getWidthDiff = function (tr, index) {
        var pages = this.scrollArgs.element.getBoundingClientRect();
        if (pages.left <= this.actionObj.pageX && pages.right >= this.actionObj.pageX) {
            var targetLeft = tr.children[index].offsetLeft;
            var pageX = this.actionObj.pageX - pages.left;
            if (this.parent.enableRtl) {
                return (targetLeft + this.actionObj.cellWidth) - (this.scrollArgs.element.scrollLeft + pageX);
            }
            else {
                return (this.scrollArgs.element.scrollLeft + pageX) - targetLeft;
            }
        }
        return 0;
    };
    DragAndDrop.prototype.getColumnIndex = function (offsetLeft) {
        var index = Math.floor(offsetLeft / this.actionObj.cellWidth);
        if (this.isHeaderRows) {
            return index;
        }
        return this.getIndex(index);
    };
    DragAndDrop.prototype.getCursorCurrentIndex = function (colIndex, cloneIndex, tr) {
        var index = colIndex + cloneIndex;
        if (this.isHeaderRows) {
            var dateLength = Math.floor(tr.offsetWidth / this.actionObj.cellWidth);
            return (index > dateLength - 1) ? dateLength - 1 : index;
        }
        return (index > tr.children.length - 1) ? tr.children.length - 1 : index;
    };
    DragAndDrop.prototype.cursorIndex = function (e, event, left, index) {
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.e-work-cells');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(td) && !this.isMorePopupOpened) {
            var targetDate = this.parent.getDateFromElement(td);
            if (this.isHeaderRows) {
                var currentIndex = Math.floor(left / this.actionObj.cellWidth);
                targetDate = new Date(this.timelineEventModule.dateRender[currentIndex + index].getTime());
            }
            var timeDiff = targetDate.getTime() - event[this.parent.eventFields.startTime].getTime();
            if (this.isTimelineDayProcess) {
                this.cursorPointIndex = Math.abs(Math.ceil(timeDiff / (_base_util__WEBPACK_IMPORTED_MODULE_8__["MS_PER_DAY"])));
            }
            else {
                var widthDiff = Math.floor((timeDiff / _base_util__WEBPACK_IMPORTED_MODULE_8__["MS_PER_MINUTE"]) / (this.actionObj.slotInterval / this.actionObj.cellWidth));
                this.cursorPointIndex = Math.floor(widthDiff / this.actionObj.cellWidth);
                this.cursorPointIndex = this.cursorPointIndex < 0 ? 0 : this.cursorPointIndex;
            }
        }
        else {
            this.cursorPointIndex = 0;
        }
    };
    DragAndDrop.prototype.calculateResourceGroupingPosition = function (e) {
        var dragArea = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
        var trCollection = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap .e-content-table tr:not(.e-hidden)'));
        var translateY = _base_util__WEBPACK_IMPORTED_MODULE_8__["getTranslateY"](dragArea.querySelector('table'));
        translateY = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(translateY)) ? 0 : translateY;
        var rowHeight = (this.parent.rowAutoHeight) ?
            ~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
        var rowIndex = Math.floor(Math.floor((this.actionObj.Y + (dragArea.scrollTop - translateY - window.scrollY)) -
            dragArea.getBoundingClientRect().top) / rowHeight);
        rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
        this.actionObj.index = rowIndex;
        var eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
        var eventWrapper = eventContainer.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]);
        if (!eventWrapper) {
            eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] });
            eventContainer.appendChild(eventWrapper);
        }
        this.appendCloneElement(eventWrapper);
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.target, 'td');
        this.actionObj.groupIndex = (td && !isNaN(parseInt(td.getAttribute('data-group-index'), 10)))
            ? parseInt(td.getAttribute('data-group-index'), 10) : this.actionObj.groupIndex;
        var top = trCollection[rowIndex].offsetTop;
        if (this.parent.rowAutoHeight) {
            var cursorElement = this.getCursorElement(e);
            if (cursorElement) {
                top = cursorElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]) ? cursorElement.offsetTop :
                    cursorElement.offsetParent.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"]) ?
                        cursorElement.offsetParent.offsetTop : top;
            }
        }
        this.actionObj.clone.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(top);
    };
    DragAndDrop.prototype.appendCloneElement = function (element) {
        if (this.parent.eventDragArea) {
            document.querySelector(this.parent.eventDragArea).appendChild(this.actionObj.clone);
        }
        else {
            element.appendChild(this.actionObj.clone);
        }
    };
    DragAndDrop.prototype.getEventWrapper = function (index) {
        var eventWrapper;
        var isAllDayDrag = this.actionObj.clone.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_CLASS"]);
        if (this.parent.activeViewOptions.timeScale.enable) {
            var wrapperClass = isAllDayDrag ? '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"] : '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"];
            eventWrapper = this.parent.element.querySelectorAll(wrapperClass).item(index);
        }
        else {
            var targetWrapper = this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]).item(index);
            eventWrapper = targetWrapper.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]);
            if (!eventWrapper) {
                eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] });
                targetWrapper.appendChild(eventWrapper);
            }
        }
        return eventWrapper;
    };
    DragAndDrop.prototype.getAllDayEventHeight = function () {
        var eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"] });
        this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"]).appendChild(eventWrapper);
        var eventHeight = eventWrapper.offsetHeight;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(eventWrapper);
        return eventHeight;
    };
    DragAndDrop.prototype.isAllowDrop = function (e) {
        if (!this.actionObj.excludeSelectors) {
            return false;
        }
        var dropSelectors = this.actionObj.excludeSelectors.split(',');
        var isAllowDrop = false;
        for (var _i = 0, dropSelectors_1 = dropSelectors; _i < dropSelectors_1.length; _i++) {
            var selector = dropSelectors_1[_i];
            if (e.target.classList.contains(selector)) {
                isAllowDrop = true;
                break;
            }
        }
        return isAllowDrop;
    };
    /**
     * Get module name.
     */
    DragAndDrop.prototype.getModuleName = function () {
        return 'dragAndDrop';
    };
    return DragAndDrop;
}(_actions_action_base__WEBPACK_IMPORTED_MODULE_1__["ActionBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/keyboard.js":
/*!*********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/keyboard.js ***!
  \*********************************************************************************/
/*! exports provided: KeyboardInteraction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyboardInteraction", function() { return KeyboardInteraction; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");





/**
 * Keyboard interaction
 */
var KeyboardInteraction = /** @__PURE__ @class */ (function () {
    function KeyboardInteraction(parent) {
        this.selectedCells = [];
        this.keyConfigs = {
            downArrow: 'downarrow',
            upArrow: 'uparrow',
            rightArrow: 'rightarrow',
            leftArrow: 'leftarrow',
            shiftDownArrow: 'shift+downarrow',
            shiftUpArrow: 'shift+uparrow',
            shiftRightArrow: 'shift+rightarrow',
            shiftLeftArrow: 'shift+leftarrow',
            ctrlLeftArrow: 'ctrl+leftarrow',
            ctrlRightArrow: 'ctrl+rightarrow',
            altOne: 'alt+1',
            altTwo: 'alt+2',
            altThree: 'alt+3',
            altFour: 'alt+4',
            altFive: 'alt+5',
            altSix: 'alt+6',
            altSeven: 'alt+7',
            altEight: 'alt+8',
            altNine: 'alt+9',
            enter: 'enter',
            escape: 'escape',
            delete: 'delete',
            home: 'home',
            pageUp: 'pageup',
            pageDown: 'pagedown',
            tab: 'tab',
            shiftTab: 'shift+tab',
            ctrlShiftUpArrow: 'ctrl+shift+uparrow',
            ctrlShiftDownArrow: 'ctrl+shift+downarrow',
            ctrlShiftLeftArrow: 'ctrl+shift+leftarrow',
            ctrlShiftRightArrow: 'ctrl+shift+rightarrow'
        };
        this.parent = parent;
        this.parent.element.tabIndex = this.parent.element.tabIndex === -1 ? 0 : this.parent.element.tabIndex;
        this.keyboardModule = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.parent.element, {
            keyAction: this.keyActionHandler.bind(this),
            keyConfigs: this.keyConfigs,
            eventName: 'keydown'
        });
        this.addEventListener();
    }
    KeyboardInteraction.prototype.keyActionHandler = function (e) {
        switch (e.action) {
            case 'downArrow':
            case 'shiftDownArrow':
                this.processDown(e, e.shiftKey);
                break;
            case 'upArrow':
            case 'shiftUpArrow':
                this.processUp(e, e.shiftKey);
                break;
            case 'leftArrow':
            case 'shiftLeftArrow':
                this.processLeft(e, e.shiftKey);
                break;
            case 'rightArrow':
            case 'shiftRightArrow':
                this.processRight(e, e.shiftKey);
                break;
            case 'ctrlLeftArrow':
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
                if (this.parent.headerModule) {
                    this.parent.headerModule.element.querySelector('.e-prev button').focus();
                }
                break;
            case 'ctrlRightArrow':
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
                if (this.parent.headerModule) {
                    this.parent.headerModule.element.querySelector('.e-next button').focus();
                }
                break;
            case 'altOne':
            case 'altTwo':
            case 'altThree':
            case 'altFour':
            case 'altFive':
            case 'altSix':
            case 'altSeven':
            case 'altEight':
            case 'altNine':
                this.processViewNavigation(e);
                break;
            case 'enter':
                this.processEnter(e);
                break;
            case 'home':
                this.focusFirstCell();
                break;
            case 'tab':
            case 'shiftTab':
                this.processTab(e, e.shiftKey);
                break;
            case 'delete':
                this.processDelete(e);
                break;
            case 'ctrlShiftUpArrow':
            case 'ctrlShiftDownArrow':
            case 'ctrlShiftLeftArrow':
            case 'ctrlShiftRightArrow':
                this.processCtrlShiftNavigationArrows(e);
                break;
            case 'escape':
                this.processEscape();
        }
    };
    KeyboardInteraction.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellMouseDown"], this.onCellMouseDown, this);
    };
    KeyboardInteraction.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellMouseDown"], this.onCellMouseDown);
    };
    KeyboardInteraction.prototype.onCellMouseDown = function (e) {
        if (e.event.shiftKey) {
            return;
        }
        this.initialTarget = this.getClosestCell(e.event);
        if (this.parent.activeViewOptions.readonly || this.parent.currentView === 'MonthAgenda' || !this.initialTarget) {
            return;
        }
        if (e.event.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) && e.event.which !== 3) {
            this.parent.removeSelectedClass();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.parent.getContentTable(), 'mousemove', this.onMouseSelection, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.parent.getContentTable(), 'mouseup', this.onMoveup, this);
        }
        if (e.event.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"]) && e.event.which !== 3) {
            this.parent.removeSelectedClass();
            var allDayRow = this.parent.getAllDayRow();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(allDayRow, 'mousemove', this.onMouseSelection, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(allDayRow, 'mouseup', this.onMoveup, this);
        }
    };
    KeyboardInteraction.prototype.onMouseSelection = function (e) {
        var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"]));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(appointments, 'e-allow-select');
        var selectionEdges = this.parent.boundaryValidation(e.pageY, e.pageX);
        if (selectionEdges.bottom || selectionEdges.top || selectionEdges.left || selectionEdges.right) {
            var parent_1 = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CONTENT_WRAP_CLASS"]);
            var yInBounds = parent_1.offsetHeight <= parent_1.scrollHeight && parent_1.scrollTop >= 0 &&
                parent_1.scrollTop + parent_1.offsetHeight <= parent_1.scrollHeight;
            var xInBounds = parent_1.offsetWidth <= parent_1.scrollWidth && parent_1.scrollLeft >= 0 &&
                parent_1.scrollLeft + parent_1.offsetWidth <= parent_1.scrollWidth;
            if (yInBounds && (selectionEdges.top || selectionEdges.bottom)) {
                parent_1.scrollTop += selectionEdges.top ? -e.target.offsetHeight : e.target.offsetHeight;
            }
            if (xInBounds && (selectionEdges.left || selectionEdges.right)) {
                parent_1.scrollLeft += selectionEdges.left ? -e.target.offsetWidth : e.target.offsetWidth;
            }
        }
        var target = this.getClosestCell(e);
        if (target) {
            this.selectCells(true, target);
        }
    };
    KeyboardInteraction.prototype.getClosestCell = function (e) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"]);
    };
    KeyboardInteraction.prototype.onMoveup = function (e) {
        var _this = this;
        var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"]));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(appointments, 'e-allow-select');
        if (e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"])) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.parent.getContentTable(), 'mousemove', this.onMouseSelection);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.parent.getContentTable(), 'mouseup', this.onMoveup);
        }
        if (e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            var allDayRow = this.parent.getAllDayRow();
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(allDayRow, 'mousemove', this.onMouseSelection);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(allDayRow, 'mouseup', this.onMoveup);
        }
        if (this.isPreventAction(e)) {
            return;
        }
        var queryStr = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["HEADER_CELLS_CLASS"];
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, queryStr);
        this.parent.activeCellsData = this.getSelectedElements(target);
        var cellData = {};
        if (this.parent.eventWindow) {
            this.parent.eventWindow.convertToEventData(this.parent.activeCellsData, cellData);
        }
        var args = {
            data: cellData, element: this.parent.activeCellsData.element, event: e,
            requestType: 'cellSelect', showQuickPopup: false
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["select"], args, function (selectArgs) {
            var isPopupShow = selectArgs.showQuickPopup || _this.parent.quickInfoOnSelectionEnd;
            if (isPopupShow) {
                var cellArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(_this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });
                _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellClick"], cellArgs);
            }
        });
    };
    KeyboardInteraction.prototype.processEnter = function (e) {
        if (this.parent.activeViewOptions.readonly || this.isPreventAction(e)) {
            return;
        }
        var target = e.target;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_WRAPPER_CLASS"])) {
            if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["QUICK_POPUP_EVENT_DETAILS_CLASS"]) ||
                target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EVENT_CREATE_CLASS"]) ||
                target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EDIT_EVENT_CLASS"]) ||
                target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DELETE_EVENT_CLASS"]) ||
                target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CLOSE_CLASS"])) {
                target.click();
                e.preventDefault();
            }
            else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["SUBJECT_CLASS"])) {
                this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EVENT_CREATE_CLASS"]).click();
                e.preventDefault();
            }
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_CELLS_CLASS"]) && target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_PARENT_CLASS"])) {
            var resourceIcon = target.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_TREE_ICON_CLASS"]);
            if (resourceIcon) {
                resourceIcon.click();
            }
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            this.parent.activeCellsData = this.getSelectedElements(target);
            var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeCellsData, { cancel: false, event: e });
            if (this.parent.allowInline) {
                var inlineArgs = {
                    element: args.element,
                    groupIndex: args.groupIndex, type: 'Cell'
                };
                this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["inlineClick"], inlineArgs);
            }
            else {
                this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellClick"], args);
            }
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["INLINE_SUBJECT_CLASS"])) {
            this.parent.inlineModule.inlineCrudActions(target);
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_EVENT_CLOSE_CLASS"]) ||
            target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_APPOINTMENT_SECTION_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_INDICATOR_CLASS"])) {
            target.click();
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_EVENT_HEADER_DATE_CLASS"])) {
            this.parent.setScheduleProperties({ selectedDate: this.parent.getDateFromElement(target) });
            this.parent.changeView(this.parent.getNavigateView(), e);
            this.processEscape();
            return;
        }
    };
    KeyboardInteraction.prototype.getSelectedElements = function (target) {
        var cellDetails;
        if (this.selectedCells.length > 1 && target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["SELECTED_CELL_CLASS"])) {
            var start = this.parent.getCellDetails(this.selectedCells[0]);
            var end = this.parent.getCellDetails(this.selectedCells.slice(-1)[0]);
            start.endTime = end.endTime;
            start.element = target;
            cellDetails = start;
        }
        else {
            cellDetails = this.parent.getCellDetails(target);
        }
        return cellDetails;
    };
    KeyboardInteraction.prototype.getCells = function (isInverseTable, start, end) {
        var tableEle = this.parent.getContentTable();
        var cells = [].slice.call(tableEle.querySelectorAll('td'));
        var maxRow = tableEle.rows.length;
        var maxColumn = tableEle.rows[0].cells.length;
        if (start.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            var allDayRow = this.parent.getAllDayRow();
            cells = [].slice.call(allDayRow.cells);
            maxRow = 1;
            maxColumn = allDayRow.cells.length;
        }
        var startIndex = cells.indexOf(start);
        var endIndex = cells.indexOf(end);
        var inverseCells = [];
        if (isInverseTable) {
            for (var i = 0; i < maxColumn; i++) {
                for (var j = 0; j < maxRow; j++) {
                    inverseCells.push(cells[maxColumn * j + i]);
                }
            }
            startIndex = inverseCells.indexOf(start);
            endIndex = inverseCells.indexOf(end);
        }
        if (startIndex > endIndex) {
            var temp = startIndex;
            startIndex = endIndex;
            endIndex = temp;
        }
        var sCells = isInverseTable ? inverseCells : cells;
        return sCells.slice(startIndex, endIndex + 1);
    };
    KeyboardInteraction.prototype.focusFirstCell = function () {
        if (this.parent.currentView === 'Agenda') {
            var focusCell = this.parent.getContentTable().querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["AGENDA_CELLS_CLASS"]);
            focusCell.setAttribute('tabindex', '0');
            focusCell.focus();
            return;
        }
        this.parent.eventBase.removeSelectedAppointmentClass();
        if (this.parent.activeView.isTimelineView()) {
            var cell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CONTENT_TABLE_CLASS"] +
                ' tr:not(.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["HIDDEN_CLASS"] + ') .' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"] + ':not(.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_GROUP_CELLS_CLASS"] + ')');
            this.selectCells(false, cell);
        }
        else {
            this.selectCells(false, this.parent.getWorkCellElements()[0]);
        }
    };
    KeyboardInteraction.prototype.isInverseTableSelect = function () {
        return this.parent.activeView.isInverseTableSelect;
    };
    /** @hidden */
    KeyboardInteraction.prototype.selectCells = function (isMultiple, targetCell) {
        var _this = this;
        this.parent.removeSelectedClass();
        var target = (targetCell instanceof Array) ? targetCell.slice(-1)[0] : targetCell;
        if (isMultiple) {
            var initialId_1;
            var views_1 = ['Day', 'Week', 'WorkWeek', 'Month', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'];
            var args = { element: targetCell, requestType: 'mousemove', allowMultipleRow: true };
            this.parent.inlineModule.removeInlineAppointmentElement();
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["select"], args, function (selectArgs) {
                var allowMultipleRow = (!selectArgs.allowMultipleRow) || (!_this.parent.allowMultiRowSelection);
                if (allowMultipleRow && (views_1.indexOf(_this.parent.currentView) > -1)) {
                    target = target.parentElement.children[_this.initialTarget.cellIndex];
                }
                var selectedCells = _this.getCells(_this.isInverseTableSelect(), _this.initialTarget, target);
                if (_this.parent.activeViewOptions.group.resources.length > 0) {
                    initialId_1 = _this.initialTarget.getAttribute('data-group-index');
                    var resourceSelectedCells = [];
                    for (var _i = 0, selectedCells_1 = selectedCells; _i < selectedCells_1.length; _i++) {
                        var cell = selectedCells_1[_i];
                        if (cell.getAttribute('data-group-index') === initialId_1) {
                            resourceSelectedCells.push(cell);
                        }
                    }
                    selectedCells = resourceSelectedCells;
                }
                if (!_this.parent.allowMultiCellSelection) {
                    selectedCells = [_this.initialTarget];
                }
                _this.selectedCells = selectedCells;
                if (selectedCells.length > 2 && !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
                    var allDayCells = _this.getAllDayCells(selectedCells);
                    if (_this.parent.activeViewOptions.group.resources.length > 0) {
                        var resourceAllDayCells = [];
                        for (var _a = 0, allDayCells_1 = allDayCells; _a < allDayCells_1.length; _a++) {
                            var cell = allDayCells_1[_a];
                            if (cell.getAttribute('data-group-index') === initialId_1) {
                                resourceAllDayCells.push(cell);
                            }
                        }
                        allDayCells = resourceAllDayCells;
                    }
                    selectedCells = selectedCells.concat(allDayCells);
                }
                if ((target.getAttribute('data-group-index') !== initialId_1) && _this.parent.activeViewOptions.group.resources.length > 0) {
                    target = _this.selectedCells[_this.selectedCells.length - 1];
                }
                _this.parent.addSelectedClass(selectedCells, target);
            });
        }
        else {
            this.initialTarget = target;
            this.selectedCells = [target];
            this.parent.addSelectedClass([target], target);
        }
    };
    KeyboardInteraction.prototype.selectAppointment = function (isReverse, target) {
        var appointments = this.getAppointmentElements();
        if (appointments.length < 0) {
            return;
        }
        this.parent.eventBase.removeSelectedAppointmentClass();
        var nextAppEle;
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            var targetIndex = appointments.indexOf(target);
            nextAppEle = appointments[(isReverse ? targetIndex - 1 : targetIndex + 1)];
        }
        else {
            nextAppEle = isReverse ? appointments[appointments.length - 1] : appointments[0];
        }
        if (nextAppEle) {
            this.parent.eventBase.addSelectedAppointments([nextAppEle]);
            nextAppEle.focus();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([nextAppEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["AGENDA_SELECTED_CELL"]);
        }
    };
    KeyboardInteraction.prototype.selectAppointmentElementFromWorkCell = function (isReverse, target) {
        var _this = this;
        this.parent.eventBase.removeSelectedAppointmentClass();
        this.parent.removeSelectedClass();
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            var appointmentElements_1 = this.getUniqueAppointmentElements();
            var filteredElements_1 = [];
            var selectedDate_1 = this.parent.getDateFromElement(target).getTime();
            var selectedSeriesEvents = this.parent.eventsProcessed.filter(function (eventObject) {
                return (!isReverse ? (eventObject[_this.parent.eventFields.startTime].getTime() >= selectedDate_1) :
                    (eventObject[_this.parent.eventFields.startTime].getTime() <= selectedDate_1));
            });
            selectedSeriesEvents.filter(function (event) {
                appointmentElements_1.filter(function (element) {
                    if (JSON.stringify(event.Guid) === JSON.stringify(element.getAttribute('data-guid'))) {
                        filteredElements_1.push(element);
                    }
                });
            });
            if (filteredElements_1.length > 0) {
                var selectedElement = isReverse ? filteredElements_1[filteredElements_1.length - 1] : filteredElements_1[0];
                var focusElements = this.getAppointmentElementsByGuid(selectedElement.getAttribute('data-guid'));
                this.parent.eventBase.addSelectedAppointments(focusElements);
                (focusElements[focusElements.length - 1]).focus();
            }
        }
    };
    KeyboardInteraction.prototype.getAllDayCells = function (cells) {
        var allDayRow = this.parent.getAllDayRow();
        if (!allDayRow) {
            return [];
        }
        var startCell = cells[0];
        var endCell = cells[cells.length - 1];
        var start = this.parent.getCellDetails(startCell);
        var end = this.parent.getCellDetails(endCell);
        if (end.endTime.getTime() - start.startTime.getTime() >= _base_util__WEBPACK_IMPORTED_MODULE_2__["MS_PER_DAY"]) {
            var allDayCells = [].slice.call(allDayRow.cells);
            return allDayCells.slice(startCell.cellIndex, endCell.cellIndex + 1);
        }
        return [];
    };
    KeyboardInteraction.prototype.getAppointmentElements = function () {
        return [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"]));
    };
    KeyboardInteraction.prototype.getAppointmentElementsByGuid = function (guid) {
        return [].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]'));
    };
    KeyboardInteraction.prototype.getUniqueAppointmentElements = function () {
        var appointments = this.getAppointmentElements();
        var appointmentElements = [];
        appointments.map(function (value) { return value.getAttribute('data-guid'); }).filter(function (value, index, self) {
            if (self.indexOf(value) === index) {
                appointmentElements.push(appointments[index]);
            }
        });
        return appointmentElements;
    };
    KeyboardInteraction.prototype.getWorkCellFromAppointmentElement = function (target) {
        var selectedObject = this.parent.eventBase.getEventByGuid(target.getAttribute('data-guid'));
        return this.parent.eventBase.selectWorkCellByTime([selectedObject]);
    };
    KeyboardInteraction.prototype.processViewNavigation = function (e) {
        var index = parseInt(e.key, 10) - 1;
        if (index < this.parent.views.length) {
            var view = this.parent.viewCollections[index].option;
            this.parent.changeView(view, e, undefined, index);
            if (this.parent.headerModule) {
                this.parent.headerModule.element.querySelector('.e-active-view button').focus();
            }
        }
    };
    KeyboardInteraction.prototype.processUp = function (e, isMultiple) {
        if ((isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda'))) {
            return;
        }
        var target = (e.target);
        var selectedElements = this.parent.getSelectedElements();
        var selectedEventElements = this.parent.eventBase.getSelectedAppointments();
        var moreEventWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_POPUP_WRAPPER_CLASS"]);
        var quickPopupWrapper = this.getQuickPopupElement();
        if (selectedElements.length > 0 && !e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"])) {
            target = selectedElements[selectedElements.length - 1];
        }
        if (selectedEventElements.length > 0 && !moreEventWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"]) &&
            !quickPopupWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"]) &&
            ['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) {
            target = this.getWorkCellFromAppointmentElement(selectedEventElements[selectedEventElements.length - 1]);
            this.parent.eventBase.removeSelectedAppointmentClass();
        }
        if (!target) {
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) && !this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"])) {
            var tableRows = this.parent.getTableRows();
            var curRowIndex = tableRows.indexOf(target.parentElement);
            if (curRowIndex > 0 && curRowIndex < tableRows.length) {
                this.selectCells(isMultiple, (tableRows[curRowIndex - 1]).cells[target.cellIndex]);
            }
        }
        else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
            this.selectAppointment(true, target);
        }
    };
    KeyboardInteraction.prototype.processDown = function (e, isMultiple) {
        if (isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda')) {
            return;
        }
        var target = (e.target);
        var selectedCells = this.parent.getSelectedElements();
        var selectedElements = this.parent.eventBase.getSelectedAppointments();
        var moreEventWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_POPUP_WRAPPER_CLASS"]);
        var quickPopupWrapper = this.getQuickPopupElement();
        if (selectedCells.length > 0 && !e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"])) {
            target = selectedCells[selectedCells.length - 1];
        }
        if (selectedElements.length > 0 && !moreEventWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"]) &&
            !quickPopupWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"]) &&
            ['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) {
            target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]);
            this.parent.eventBase.removeSelectedAppointmentClass();
        }
        var tableRows = this.parent.getTableRows();
        if (!target) {
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) && !this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"])) {
            var curRowIndex = tableRows.indexOf(target.parentElement);
            if (curRowIndex >= 0 && curRowIndex < tableRows.length - 1) {
                this.selectCells(isMultiple, (tableRows[curRowIndex + 1]).cells[target.cellIndex]);
            }
        }
        else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
            this.selectAppointment(false, target);
        }
    };
    KeyboardInteraction.prototype.processLeftRight = function (target) {
        var tableEle = this.parent.getContentTable();
        var curRowIndex = target.parentNode.sectionRowIndex;
        var key = {
            element: tableEle,
            rowIndex: curRowIndex,
            columnIndex: target.cellIndex,
            maxIndex: tableEle.rows[curRowIndex].cells.length
        };
        return key;
    };
    KeyboardInteraction.prototype.getQuickPopupElement = function () {
        return (this.parent.isAdaptive ? document.body : this.parent.element).querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_WRAPPER_CLASS"]);
    };
    KeyboardInteraction.prototype.isCancelLeftRightAction = function (e, isMultiple) {
        if (this.parent.currentView === 'Agenda' || (isMultiple && this.parent.currentView === 'MonthAgenda')) {
            return true;
        }
        if (this.isPreventAction(e) && isMultiple) {
            return true;
        }
        var moreEventWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_POPUP_WRAPPER_CLASS"]);
        var quickPopupWrapper = this.getQuickPopupElement();
        if (moreEventWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"]) || quickPopupWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"])) {
            return true;
        }
        return false;
    };
    KeyboardInteraction.prototype.processRight = function (e, isMultiple) {
        if (this.isCancelLeftRightAction(e, isMultiple)) {
            return;
        }
        var selectedCells = this.parent.getSelectedElements();
        var targetCell;
        var selectedAppointments = this.parent.eventBase.getSelectedAppointments();
        var target = (e.target);
        if (selectedCells.length > 0 && !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) &&
            !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            target = selectedCells[selectedCells.length - 1];
        }
        if (selectedAppointments.length > 0) {
            target = this.getWorkCellFromAppointmentElement(selectedAppointments[selectedAppointments.length - 1]);
            this.parent.eventBase.removeSelectedAppointmentClass();
            if (!target) {
                return;
            }
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) &&
            (e.target).classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"])) {
            var key = this.processLeftRight(target);
            if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1) {
                targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex + 1], 'right');
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(targetCell)) {
                    this.selectCells(isMultiple, targetCell);
                }
            }
            else if (key.columnIndex === key.maxIndex - 1) {
                if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1) {
                    targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex + 1].cells[0], 'right');
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(targetCell)) {
                        this.selectCells(isMultiple, targetCell);
                    }
                }
                else if (!isMultiple) {
                    var rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
                    this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
                    var tableEle = this.parent.getContentTable();
                    this.selectCells(false, tableEle.rows[rowIndex].cells[0]);
                }
            }
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            var curColIndex = target.cellIndex;
            var allDayRow = this.parent.getAllDayRow();
            var maxColIndex = allDayRow.cells.length;
            if (curColIndex >= 0 && curColIndex < maxColIndex - 1) {
                this.selectCells(isMultiple, allDayRow.cells[curColIndex + 1]);
            }
            else if (curColIndex === maxColIndex - 1 && !isMultiple) {
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
                var allDayRow_1 = this.parent.getAllDayRow();
                this.selectCells(false, allDayRow_1.cells[0]);
            }
        }
    };
    KeyboardInteraction.prototype.processLeft = function (e, isMultiple) {
        if (this.isCancelLeftRightAction(e, isMultiple)) {
            return;
        }
        var target = (e.target);
        var selectedCells = this.parent.getSelectedElements();
        var targetCell;
        if (selectedCells.length > 0 && !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) &&
            !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            target = selectedCells[selectedCells.length - 1];
        }
        var selectedElements = this.parent.eventBase.getSelectedAppointments();
        if (selectedElements.length > 0) {
            target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]);
            this.parent.eventBase.removeSelectedAppointmentClass();
            if (!target) {
                return;
            }
        }
        if ((e.target).classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"]) &&
            target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"])) {
            var key = this.processLeftRight(target);
            if (key.columnIndex > 0 && key.columnIndex < key.maxIndex) {
                targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex - 1], 'left');
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(targetCell)) {
                    this.selectCells(isMultiple, targetCell);
                }
            }
            else if (key.columnIndex === 0) {
                if (!this.isInverseTableSelect() && key.rowIndex > 0) {
                    targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex - 1].cells[key.maxIndex - 1], 'left');
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(targetCell)) {
                        this.selectCells(isMultiple, targetCell);
                    }
                }
                else if (!isMultiple) {
                    this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
                    var tableEle = this.parent.getContentTable();
                    var rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
                    this.selectCells(false, tableEle.rows[rowIndex].cells[key.maxIndex - 1]);
                }
            }
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ALLDAY_CELLS_CLASS"])) {
            var curColIndex = target.cellIndex;
            var allDayRow = this.parent.getAllDayRow();
            var maxColIndex = allDayRow.cells.length;
            if (curColIndex > 0 && curColIndex < maxColIndex) {
                this.selectCells(isMultiple, allDayRow.cells[curColIndex - 1]);
            }
            else if (curColIndex === 0 && !isMultiple) {
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
                var allDayRow_2 = this.parent.getAllDayRow();
                this.selectCells(false, allDayRow_2.cells[maxColIndex - 1]);
            }
        }
    };
    KeyboardInteraction.prototype.calculateNextPrevDate = function (currentCell, target, type) {
        var initialId = this.initialTarget.getAttribute('data-group-index');
        if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.currentView === 'Month') {
            if (currentCell && target && target.getAttribute('data-group-index') !== initialId) {
                var currentDate = this.parent.getDateFromElement(currentCell);
                var nextPrevDate = (type === 'right') ? new Date(currentDate.setDate(currentDate.getDate() + 1))
                    : new Date(currentDate.setDate(currentDate.getDate() - 1));
                target = [].slice.call(this.parent.element.querySelectorAll('td[data-date="'
                    + this.parent.getMsFromDate(nextPrevDate).toString() + '"]' + '[data-group-index="' + initialId + '"]'))[0];
            }
        }
        return target;
    };
    KeyboardInteraction.prototype.getFocusableElements = function (container) {
        var queryString = 'a[href]:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),' +
            'textarea:not([disabled]):not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),' +
            'select:not([disabled]):not([tabindex="-1"]),[tabindex]:not([tabindex="-1"]),[contentEditable=true]:not([tabindex="-1"])';
        return [].slice.call(container.querySelectorAll(queryString));
    };
    KeyboardInteraction.prototype.processTabOnPopup = function (e, popupElement) {
        var _this = this;
        var focusableElements = this.getFocusableElements(popupElement);
        focusableElements = focusableElements.filter(function (element) {
            var footerEle = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_FOOTER_CLASS"]);
            if (footerEle && footerEle.offsetParent) {
                return !(element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EDIT_CLASS"]) || element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DELETE_CLASS"]));
            }
            else {
                return !(element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EDIT_EVENT_CLASS"]) || element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DELETE_EVENT_CLASS"]));
            }
        });
        var firstEle = focusableElements[0];
        var lastEle = focusableElements[focusableElements.length - 1];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(lastEle) && document.activeElement === lastEle && !e.shiftKey) {
            e.preventDefault();
            firstEle.focus();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(firstEle) && document.activeElement === firstEle && e.shiftKey) {
            e.preventDefault();
            lastEle.focus();
        }
    };
    KeyboardInteraction.prototype.processTab = function (e, isReverse) {
        var target = e.target;
        var popupWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_WRAPPER_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_POPUP_WRAPPER_CLASS"]);
        if (popupWrapper && popupWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["POPUP_OPEN"])) {
            if (popupWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MORE_POPUP_WRAPPER_CLASS"])) {
                this.parent.eventBase.removeSelectedAppointmentClass();
            }
            this.processTabOnPopup(e, popupWrapper);
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["ROOT"])) {
            this.parent.eventBase.removeSelectedAppointmentClass();
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_CELLS_CLASS"]) && this.parent.activeView.isTimelineView()
            && this.parent.activeViewOptions.group.resources.length > 0) {
            var index = parseInt(target.getAttribute('data-group-index'), 10);
            var appSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"] + "[data-group-index=\"" + (isReverse ? index - 1 : index) + "\"]";
            var appElements = [].slice.call(this.parent.element.querySelectorAll(appSelector));
            if (appElements.length > 0) {
                this.parent.eventBase.removeSelectedAppointmentClass();
                var focusAppointment = isReverse ? appElements.slice(-1)[0] : appElements[0];
                this.parent.eventBase.addSelectedAppointments([focusAppointment]);
                focusAppointment.focus();
                e.preventDefault();
            }
            else if (index + 1 === this.parent.resourceBase.lastResourceLevel.length) {
                this.parent.element.focus();
                e.preventDefault();
            }
            return;
        }
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"]));
            if (this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0) {
                var index = parseInt(target.getAttribute('data-group-index'), 10);
                appElements = [].slice.call(this.parent.element.querySelectorAll("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"] + "[data-group-index=\"" + index + "\"]"));
                var resCellSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_CELLS_CLASS"] + "[data-group-index=\"" + (isReverse ? index : index + 1) + "\"]";
                var resourceCell = this.parent.element.querySelector(resCellSelector);
                if (resourceCell && (isReverse && target.getAttribute('data-guid') === appElements[0].getAttribute('data-guid') ||
                    !isReverse && target.getAttribute('data-guid') === appElements.slice(-1)[0].getAttribute('data-guid'))) {
                    this.parent.eventBase.removeSelectedAppointmentClass();
                    resourceCell.focus();
                    e.preventDefault();
                    return;
                }
            }
            var selectedAppointments = this.parent.eventBase.getSelectedAppointments();
            if (selectedAppointments.length > 0) {
                target = selectedAppointments[selectedAppointments.length - 1];
            }
            this.parent.eventBase.removeSelectedAppointmentClass();
            if (!isReverse && target.getAttribute('data-guid') === appElements[appElements.length - 1].getAttribute('data-guid') ||
                isReverse && target.getAttribute('data-guid') === appElements[0].getAttribute('data-guid')) {
                return;
            }
            if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
                this.selectAppointment(isReverse, target);
                e.preventDefault();
            }
            return;
        }
        var selectedCells = this.parent.getSelectedElements();
        if (selectedCells.length > 0 && !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            target = selectedCells[selectedCells.length - 1];
            this.selectAppointmentElementFromWorkCell(isReverse, target);
            e.preventDefault();
            return;
        }
    };
    KeyboardInteraction.prototype.processDelete = function (e) {
        var activeEle = document.activeElement;
        if (this.parent.currentView === 'MonthAgenda') {
            var selectedEle = this.parent.eventBase.getSelectedEvents().element;
            activeEle = ((selectedEle && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(selectedEle.length)) ? selectedEle : selectedEle[0]);
        }
        if (activeEle && activeEle.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([activeEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_BORDER"]);
            this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();
            if (this.parent.activeViewOptions.readonly || activeEle.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["READ_ONLY"])) {
                return;
            }
            this.parent.quickPopup.deleteClick();
        }
    };
    KeyboardInteraction.prototype.processCtrlShiftNavigationArrows = function (e) {
        if (this.parent.activeViewOptions.group.resources.length > 0 && document.activeElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            var groupIndex = parseInt(document.activeElement.getAttribute('data-group-index'), 10);
            var index = (e.action === 'ctrlShiftLeftArrow' || e.action === 'ctrlShiftUpArrow') ? groupIndex - 1 : groupIndex + 1;
            index = index < 0 ? 0 : index > this.parent.resourceBase.lastResourceLevel.length ?
                this.parent.resourceBase.lastResourceLevel.length : index;
            var eventEle = [];
            while (eventEle.length === 0 && index >= 0 && index <= this.parent.resourceBase.lastResourceLevel.length) {
                eventEle = [].slice.call(this.parent.element.querySelectorAll("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"] + "[data-group-index=\"" + index + "\"]"));
                index = (e.action === 'ctrlShiftLeftArrow' || e.action === 'ctrlShiftUpArrow') ? index - 1 : index + 1;
            }
            var nextAppEle = eventEle[0];
            if (nextAppEle) {
                this.parent.eventBase.removeSelectedAppointmentClass();
                this.parent.eventBase.addSelectedAppointments([nextAppEle]);
                nextAppEle.focus();
            }
        }
        else if (this.parent.activeViewOptions.group.resources.length > 0 &&
            !document.activeElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"])) {
            var index = this.parent.resourceBase.renderedResources[0].groupIndex;
            var appSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CLASS"] + "[data-group-index=\"" + index + "\"]";
            var appElements = [].slice.call(this.parent.element.querySelectorAll(appSelector));
            if (appElements.length > 0) {
                this.parent.eventBase.removeSelectedAppointmentClass();
                var focusAppointment = appElements[0];
                this.parent.eventBase.addSelectedAppointments([focusAppointment]);
                focusAppointment.focus();
                e.preventDefault();
            }
        }
    };
    KeyboardInteraction.prototype.processEscape = function () {
        this.parent.quickPopup.onClosePopup();
        this.parent.quickPopup.morePopup.hide();
        if (this.parent.headerModule) {
            this.parent.headerModule.hideHeaderPopup();
        }
        if (this.parent.inlineModule) {
            this.parent.inlineModule.removeInlineAppointmentElement();
        }
    };
    KeyboardInteraction.prototype.isPreventAction = function (e) {
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_GROUP_CELLS_CLASS"]);
        if (this.parent.activeView.isTimelineView() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            return true;
        }
        return false;
    };
    /**
     * Get module name.
     */
    KeyboardInteraction.prototype.getModuleName = function () {
        return 'keyboard';
    };
    /**
     * To destroy the keyboard module.
     * @return {void}
     * @private
     */
    KeyboardInteraction.prototype.destroy = function () {
        this.removeEventListener();
        this.keyboardModule.destroy();
    };
    return KeyboardInteraction;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/resize.js":
/*!*******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/resize.js ***!
  \*******************************************************************************/
/*! exports provided: Resize */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return Resize; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _actions_action_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../actions/action-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/action-base.js");
/* harmony import */ var _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






/**
 * Schedule events resize actions
 */
var Resize = /** @__PURE__ @class */ (function (_super) {
    __extends(Resize, _super);
    function Resize() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Resize.prototype.wireResizeEvent = function (element) {
        var resizeElement = [].slice.call(element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["EVENT_RESIZE_CLASS"]));
        for (var _i = 0, resizeElement_1 = resizeElement; _i < resizeElement_1.length; _i++) {
            var element_1 = resizeElement_1[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element_1, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.resizeStart, this);
        }
    };
    Resize.prototype.resizeHelper = function () {
        if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.activeViewOptions.group.allowGroupEdit) {
            for (var i = 0, len = this.actionObj.originalElement.length; i < len; i++) {
                var cloneElement = this.createCloneElement(this.actionObj.originalElement[i]);
                this.actionObj.cloneElement[i] = cloneElement;
                if (this.actionObj.element === this.actionObj.originalElement[i]) {
                    this.actionObj.clone = cloneElement;
                }
            }
        }
        else {
            this.actionObj.clone = this.createCloneElement(this.actionObj.element);
            this.actionObj.cloneElement = [this.actionObj.clone];
            this.actionObj.originalElement = [this.actionObj.element];
        }
    };
    Resize.prototype.resizeStart = function (e) {
        var _this = this;
        this.actionObj.action = 'resize';
        this.actionObj.slotInterval = this.parent.activeViewOptions.timeScale.interval / this.parent.activeViewOptions.timeScale.slotCount;
        this.actionObj.interval = this.actionObj.slotInterval;
        var resizeTarget = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["EVENT_RESIZE_CLASS"]);
        this.actionObj.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(resizeTarget, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_CLASS"]);
        this.actionObj.event = this.parent.eventBase.getEventByGuid(this.actionObj.element.getAttribute('data-guid'));
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var resizeArgs = {
            cancel: false,
            data: eventObj,
            element: this.actionObj.element,
            event: e,
            interval: this.actionObj.interval,
            scroll: { enable: true, scrollBy: 30, timeDelay: 100 }
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["resizeStart"], resizeArgs, function (resizeEventArgs) {
            if (resizeEventArgs.cancel) {
                return;
            }
            _this.actionClass('addClass');
            _this.parent.uiStateValues.action = true;
            _this.resizeEdges = {
                left: resizeTarget.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["LEFT_RESIZE_HANDLER"]),
                right: resizeTarget.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RIGHT_RESIZE_HANDLER"]),
                top: resizeTarget.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TOP_RESIZE_HANDLER"]),
                bottom: resizeTarget.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["BOTTOM_RESIZE_HANDLER"])
            };
            _this.actionObj.groupIndex = _this.parent.uiStateValues.isGroupAdaptive ? _this.parent.uiStateValues.groupIndex : 0;
            var workCell = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"]);
            _this.actionObj.cellWidth = workCell.offsetWidth;
            _this.actionObj.cellHeight = workCell.offsetHeight;
            var headerRows = _this.parent.activeViewOptions.headerRows.map(function (row) {
                return row.option;
            });
            if (_this.parent.activeView.isTimelineView() && headerRows.length > 0 &&
                ['Date', 'Hour'].indexOf(headerRows.slice(-1)[0]) < 0) {
                var tr = _this.parent.getContentTable().querySelector('tr');
                var noOfDays = 0;
                var tdCollections = [].slice.call(tr.children);
                for (var _i = 0, tdCollections_1 = tdCollections; _i < tdCollections_1.length; _i++) {
                    var td = tdCollections_1[_i];
                    noOfDays += parseInt(td.getAttribute('colspan'), 10);
                }
                _this.actionObj.cellWidth = tr.offsetWidth / noOfDays;
                _this.actionObj.cellHeight = tr.offsetHeight;
            }
            var pages = _this.getPageCoordinates(e);
            _this.actionObj.X = pages.pageX;
            _this.actionObj.Y = pages.pageY;
            _this.actionObj.groupIndex = parseInt(_this.actionObj.element.getAttribute('data-group-index') || '0', 10);
            _this.actionObj.interval = resizeEventArgs.interval;
            _this.actionObj.scroll = resizeEventArgs.scroll;
            _this.actionObj.start = new Date(eventObj[_this.parent.eventFields.startTime].getTime());
            _this.actionObj.end = new Date(eventObj[_this.parent.eventFields.endTime].getTime());
            _this.actionObj.originalElement = _this.getOriginalElement(_this.actionObj.element);
            if (_this.parent.currentView === 'Month') {
                _this.daysVariation = -1;
                _this.monthEvent = new _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__["MonthEvent"](_this.parent);
            }
            var viewElement = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
            _this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, _this.resizing, _this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, _this.resizeStop, _this);
        });
    };
    Resize.prototype.resizing = function (e) {
        this.parent.quickPopup.quickPopupHide();
        if (this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESIZE_CLONE_CLASS"]).length === 0) {
            this.resizeHelper();
        }
        if ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(e.target)) && e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DISABLE_DATES"])) {
            return;
        }
        var pages = this.getPageCoordinates(e);
        this.actionObj.pageX = pages.pageX;
        this.actionObj.pageY = pages.pageY;
        this.updateScrollPosition(e);
        this.updateResizingDirection(e);
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.actionObj.event, null, true);
        var resizeArgs = {
            cancel: false,
            data: eventObj,
            element: this.actionObj.element,
            event: e,
            startTime: this.actionObj.start,
            endTime: this.actionObj.end
        };
        if (this.parent.group.resources.length > 0) {
            resizeArgs.groupIndex = this.actionObj.groupIndex;
        }
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["resizing"], resizeArgs);
    };
    Resize.prototype.updateResizingDirection = function (e) {
        if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
            this.monthResizing();
            return;
        }
        var resizeValidation = this.resizeValidation(e);
        if (this.resizeEdges.left) {
            if (resizeValidation) {
                var leftStyles = this.getLeftRightStyles(e, true);
                if (parseInt(leftStyles.width, 10) < 1) {
                    return;
                }
                for (var _i = 0, _a = this.actionObj.cloneElement; _i < _a.length; _i++) {
                    var cloneElement = _a[_i];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cloneElement, leftStyles);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cloneElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["LEFT_RESIZE_HANDLER"]);
                }
            }
            this.horizontalResizing(!this.parent.enableRtl);
        }
        if (this.resizeEdges.right) {
            if (resizeValidation) {
                var rightStyles = this.getLeftRightStyles(e, false);
                if (parseInt(rightStyles.width, 10) < 1) {
                    return;
                }
                for (var _b = 0, _c = this.actionObj.cloneElement; _b < _c.length; _b++) {
                    var cloneElement = _c[_b];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cloneElement, rightStyles);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cloneElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RIGHT_RESIZE_HANDLER"]);
                }
            }
            this.horizontalResizing(this.parent.enableRtl);
        }
        if (this.resizeEdges.top) {
            if (resizeValidation) {
                var topStyles = this.getTopBottomStyles(e, true);
                if (parseInt(topStyles.height, 10) < 1) {
                    return;
                }
                for (var _d = 0, _e = this.actionObj.cloneElement; _d < _e.length; _d++) {
                    var cloneElement = _e[_d];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cloneElement, topStyles);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cloneElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TOP_RESIZE_HANDLER"]);
                }
            }
            this.verticalResizing(true);
        }
        if (this.resizeEdges.bottom) {
            if (resizeValidation) {
                var bottomStyles = this.getTopBottomStyles(e, false);
                if (parseInt(bottomStyles.height, 10) < 1) {
                    return;
                }
                for (var _f = 0, _g = this.actionObj.cloneElement; _f < _g.length; _f++) {
                    var cloneElement = _g[_f];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cloneElement, bottomStyles);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cloneElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["BOTTOM_RESIZE_HANDLER"]);
                }
            }
            this.verticalResizing(false);
        }
    };
    Resize.prototype.monthResizing = function () {
        this.removeCloneElement();
        var td = document.elementFromPoint(this.actionObj.pageX, this.actionObj.pageY);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(td)) {
            return;
        }
        var resizeTime = this.parent.getDateFromElement(td);
        var isSameCell = this.parent.activeViewOptions.group.resources.length > 0 ?
            parseInt(td.getAttribute('data-group-index'), 10) === this.actionObj.groupIndex : true;
        var startTime = new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime());
        var endTime = new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());
        if ((!this.parent.enableRtl && this.resizeEdges.left) || (this.parent.enableRtl && this.resizeEdges.right)
            || this.resizeEdges.top) {
            startTime = resizeTime;
        }
        else if ((!this.parent.enableRtl && this.resizeEdges.right) || (this.parent.enableRtl && this.resizeEdges.left)
            || this.resizeEdges.bottom) {
            endTime = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](resizeTime, 1);
        }
        if (isSameCell && startTime < endTime) {
            this.actionObj.start = startTime;
            this.actionObj.end = endTime;
            var event_1 = this.getUpdatedEvent(this.actionObj.start, this.actionObj.end, this.actionObj.event);
            if (this.parent.currentView === 'TimelineYear') {
                this.yearEventsRendering(event_1);
            }
            else {
                this.dynamicEventsRendering(event_1);
            }
            this.updateOriginalElement(this.actionObj.clone);
        }
    };
    Resize.prototype.yearEventsRendering = function (event) {
        var eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CLONE_ELEMENT_CLASS"]));
        for (var _i = 0, eventWrappers_1 = eventWrappers; _i < eventWrappers_1.length; _i++) {
            var wrapper = eventWrappers_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrapper);
        }
        var endDate = new Date(event[this.parent.eventFields.endTime]);
        var monthDiff = 0;
        if (this.parent.activeViewOptions.group.resources.length === 0) {
            monthDiff = this.getMonthDiff(event[this.parent.eventFields.startTime], _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](endDate, -1));
        }
        for (var i = 0; i <= monthDiff; i++) {
            var eventObj = void 0;
            if (this.parent.activeViewOptions.group.resources.length === 0) {
                eventObj = this.getEventCount(event, this.actionObj.start.getMonth() + i);
            }
            else {
                eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true);
                endDate = this.resizeEdges.left || this.resizeEdges.right ? _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](endDate, -1) : endDate;
                eventObj.count = this.getMonthDiff(event[this.parent.eventFields.startTime], endDate) + 1;
            }
            this.dynamicYearlyEventsRendering(eventObj, true);
        }
    };
    Resize.prototype.getMonthDiff = function (startDate, endDate) {
        var months;
        months = (endDate.getFullYear() - startDate.getFullYear()) * 12;
        months -= startDate.getMonth();
        months += endDate.getMonth();
        return months <= 0 ? 0 : months;
    };
    Resize.prototype.getEventCount = function (eventObj, month) {
        var eventData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
        var eventStart = eventData[this.parent.eventFields.startTime];
        var eventEnd = eventData[this.parent.eventFields.endTime];
        var monthStart = new Date(this.parent.selectedDate.getFullYear(), month, 1);
        var monthEnd = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(this.parent.selectedDate.getFullYear(), month + 1, 0), 1);
        var count = 1;
        if (eventStart.getTime() < monthStart.getTime()) {
            eventData[this.parent.eventFields.startTime] = monthStart;
        }
        if (eventEnd.getTime() > monthEnd.getTime()) {
            eventData[this.parent.eventFields.endTime] = monthEnd;
        }
        if (this.parent.activeViewOptions.group.resources.length === 0) {
            count = Math.ceil((eventData[this.parent.eventFields.endTime].getTime() -
                eventData[this.parent.eventFields.startTime].getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]);
        }
        eventData.count = count;
        return eventData;
    };
    Resize.prototype.resizeStop = function (e) {
        var _this = this;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.resizing);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchEndEvent, this.resizeStop);
        clearInterval(this.actionObj.scrollInterval);
        this.actionObj.scrollInterval = null;
        this.removeCloneElementClasses();
        this.removeCloneElement();
        this.actionClass('removeClass');
        this.parent.uiStateValues.action = false;
        var resizeArgs = { cancel: false, data: this.getChangedData(), element: this.actionObj.element, event: e };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["resizeStop"], resizeArgs, function (resizeEventArgs) {
            if (resizeEventArgs.cancel) {
                return;
            }
            if (_this.parent.activeViewOptions.group.resources.length > 0 && !_this.parent.rowAutoHeight
                && !_this.parent.activeViewOptions.group.allowGroupEdit && !_this.parent.virtualScrollModule
                && _this.parent.activeViewOptions.group.byGroupID) {
                _this.parent.crudModule.crudObj.sourceEvent =
                    [_this.parent.resourceBase.lastResourceLevel[parseInt(resizeEventArgs.element.getAttribute('data-group-index'), 10)]];
                _this.parent.crudModule.crudObj.targetEvent = _this.parent.crudModule.crudObj.sourceEvent;
                _this.parent.crudModule.crudObj.isCrudAction = true;
            }
            _this.saveChangedData(resizeEventArgs);
        });
    };
    Resize.prototype.verticalResizing = function (isTop) {
        var offsetValue = this.actionObj.clone.offsetTop;
        if (!isTop) {
            offsetValue += this.actionObj.clone.offsetHeight;
        }
        var minutes = (offsetValue / this.actionObj.cellHeight) * this.actionObj.slotInterval;
        var element = this.actionObj.clone.offsetParent;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            return;
        }
        var resizeTime = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](this.parent.getDateFromElement(element));
        resizeTime.setHours(this.parent.activeView.getStartHour().getHours());
        resizeTime.setMinutes(minutes + this.parent.activeView.getStartHour().getMinutes());
        if (isTop) {
            this.actionObj.start = this.calculateIntervalTime(resizeTime);
        }
        else {
            this.actionObj.end = this.calculateIntervalTime(resizeTime);
        }
        this.updateTimePosition(resizeTime);
    };
    Resize.prototype.horizontalResizing = function (isLeft) {
        var eventStart = new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime());
        var eventEnd = new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());
        var resizeTime;
        if (this.parent.activeView.isTimelineView()) {
            var tr = this.parent.getContentTable().querySelector('tr');
            var headerName = this.parent.currentView;
            if (this.parent.activeViewOptions.headerRows.length > 0) {
                var rows = this.parent.activeViewOptions.headerRows.map(function (row) { return row.option; });
                headerName = rows.slice(-1)[0];
                if (this.parent.currentView === 'TimelineMonth' && headerName === 'Hour') {
                    headerName = rows.slice(-2)[0] || 'Month';
                }
            }
            resizeTime = isLeft ? eventStart : eventEnd;
            var cellIndex = 0;
            var tdCollections = [].slice.call(tr.children);
            var isLastCell = false;
            if (['Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1) {
                var noOfDays = 0;
                for (var _i = 0, tdCollections_2 = tdCollections; _i < tdCollections_2.length; _i++) {
                    var td = tdCollections_2[_i];
                    noOfDays += parseInt(td.getAttribute('colspan'), 10);
                }
                var offsetValue = this.parent.enableRtl ? parseInt(this.actionObj.clone.style.right, 10) :
                    parseInt(this.actionObj.clone.style.left, 10);
                if (!isLeft) {
                    offsetValue += (this.actionObj.clone.offsetWidth - this.actionObj.cellWidth);
                }
                cellIndex = Math.floor(offsetValue / Math.floor(tr.offsetWidth / noOfDays));
                cellIndex = isLeft ? cellIndex : this.parent.currentView === 'TimelineMonth' ? cellIndex + 1 : cellIndex;
                isLastCell = cellIndex === tdCollections.length;
                cellIndex = (cellIndex < 0) ? 0 : (cellIndex >= noOfDays) ? noOfDays - 1 : cellIndex;
            }
            else {
                var cellWidth = this.actionObj.cellWidth;
                cellIndex = isLeft ? Math.floor(this.actionObj.clone.offsetLeft / this.actionObj.cellWidth) :
                    Math.ceil((this.actionObj.clone.offsetLeft + (this.actionObj.clone.offsetWidth - cellWidth)) /
                        this.actionObj.cellWidth);
                if (this.parent.enableRtl) {
                    var cellOffsetWidth = 0;
                    if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
                        this.parent.currentView !== 'TimelineMonth')) {
                        cellOffsetWidth = this.actionObj.cellWidth;
                    }
                    var offsetWidth = (Math.floor(parseInt(this.actionObj.clone.style.right, 10) / this.actionObj.cellWidth) *
                        this.actionObj.cellWidth) + (isLeft ? 0 : this.actionObj.clone.offsetWidth - cellOffsetWidth);
                    cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
                }
                isLastCell = cellIndex === tdCollections.length;
                cellIndex = this.getIndex(cellIndex);
            }
            var resizeDate = void 0;
            if (['Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1) {
                resizeDate = new Date(this.parent.activeView.renderDates[cellIndex].getTime());
            }
            else {
                resizeDate = this.parent.getDateFromElement(tr.children[cellIndex]);
            }
            if (['TimelineMonth', 'Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1 ||
                !this.parent.activeViewOptions.timeScale.enable) {
                resizeTime = new Date(resizeDate.setHours(resizeTime.getHours(), resizeTime.getMinutes(), resizeTime.getSeconds()));
            }
            else {
                var offsetValue = this.parent.enableRtl ? parseFloat(this.actionObj.clone.style.right) :
                    parseFloat(this.actionObj.clone.style.left);
                if (!isLeft) {
                    offsetValue += this.actionObj.clone.offsetWidth;
                }
                var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
                    (offsetValue - Math.floor(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth));
                spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
                resizeTime = new Date(resizeDate.getTime());
                resizeTime.setMinutes(resizeTime.getMinutes() + spanMinutes);
                this.updateTimePosition(resizeTime);
            }
        }
        else {
            var cloneIndex = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, 'td').cellIndex;
            var originalWidth = Math.ceil((isLeft ? this.actionObj.element.offsetWidth : 0) / this.actionObj.cellWidth) *
                this.actionObj.cellWidth;
            var noOfDays = Math.ceil((this.actionObj.clone.offsetWidth - originalWidth) / this.actionObj.cellWidth);
            var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(this.actionObj.clone, 'tr');
            var dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
            dayIndex = this.getIndex(dayIndex);
            resizeTime = this.parent.getDateFromElement(tr.children[dayIndex]);
            if (isLeft) {
                resizeTime.setHours(eventStart.getHours(), eventStart.getMinutes(), eventStart.getSeconds());
            }
            else {
                resizeTime.setHours(eventEnd.getHours(), eventEnd.getMinutes(), eventEnd.getSeconds());
            }
        }
        if (isLeft) {
            if ((this.actionObj.event[this.parent.eventFields.endTime].getTime() - resizeTime.getTime()) <= 0) {
                resizeTime = new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime());
            }
            this.actionObj.start = this.parent.activeViewOptions.timeScale.enable ? this.calculateIntervalTime(resizeTime) : resizeTime;
        }
        else {
            var isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1 &&
                this.parent.activeViewOptions.timeScale.enable;
            var resizeEnd = (!isTimeViews && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ?
                _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](resizeTime, 1) : resizeTime;
            this.actionObj.end = this.parent.activeViewOptions.timeScale.enable && this.parent.currentView !== 'Month' ?
                this.calculateIntervalTime(resizeEnd) : resizeEnd;
        }
    };
    Resize.prototype.getTopBottomStyles = function (e, isTop) {
        var viewElement = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        var slotInterval = (this.actionObj.cellHeight / this.actionObj.slotInterval) * this.actionObj.interval;
        var clnHeight = isTop ? this.actionObj.element.offsetHeight + (this.actionObj.Y - this.actionObj.pageY) :
            this.actionObj.element.offsetHeight + (this.actionObj.pageY - this.actionObj.Y);
        var clnTop = isTop ? this.actionObj.element.offsetTop -
            (this.actionObj.Y - this.actionObj.pageY) : this.actionObj.clone.offsetTop;
        clnHeight = (clnTop < 0) ? this.actionObj.clone.offsetHeight :
            (this.actionObj.clone.offsetTop + this.actionObj.clone.offsetHeight) > this.scrollArgs.height ?
                this.actionObj.clone.offsetHeight : clnHeight;
        clnTop = (clnTop < 0) ? 0 : clnTop;
        clnTop = isTop ? Math.floor(clnTop / slotInterval) * slotInterval : clnTop;
        clnHeight = clnTop + clnHeight >= viewElement.scrollHeight ? viewElement.scrollHeight - clnTop :
            Math.ceil(clnHeight / slotInterval) * slotInterval;
        var styles = {
            height: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(clnHeight < this.actionObj.cellHeight ? Math.floor(clnHeight / slotInterval) * slotInterval : clnHeight),
            top: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])((clnHeight < this.actionObj.cellHeight && isTop) ? Math.ceil(clnTop / slotInterval) * slotInterval : clnTop),
            left: '0px', right: '0px', width: '100%'
        };
        return styles;
    };
    Resize.prototype.getLeftRightStyles = function (e, isLeft) {
        var styles = {};
        var isTimelineView = this.parent.activeView.isTimelineView();
        var isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1 &&
            this.parent.activeViewOptions.timeScale.enable;
        var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
        var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
        var targetWidth = isTimelineView ?
            (this.actionObj.element.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth :
            this.parent.currentView === 'Month' ? this.actionObj.element.offsetWidth :
                Math.ceil(this.actionObj.element.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth;
        var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
        var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
        if (isTimeViews) {
            offsetWidth = targetWidth + (isLeft ? (Math.ceil(pageWidth / slotInterval) * slotInterval) :
                (Math.floor(pageWidth / slotInterval) * slotInterval));
            this.actionObj.event[this.parent.eventFields.isAllDay] = false;
        }
        var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
            this.actionObj.clone.offsetWidth : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
        if (this.parent.enableRtl) {
            var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
                -(offsetWidth - this.actionObj.cellWidth);
            rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
            if (isTimelineView && !isLeft) {
                rightValue = Math.ceil((this.actionObj.element.offsetLeft + (this.actionObj.element.offsetWidth +
                    (this.actionObj.pageX - this.actionObj.X))) / slotInterval) * slotInterval;
                rightValue = rightValue < 0 ? Math.abs(rightValue) : -rightValue;
            }
            rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
            styles.right = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(rightValue);
            width = width + rightValue > this.scrollArgs.width ? this.actionObj.clone.offsetWidth : width;
        }
        else {
            var offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
                this.parent.enableRtl ? this.actionObj.element.offsetLeft : 0;
            if (isTimelineView) {
                offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
                if (this.parent.enableRtl) {
                    offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.actionObj.clone.offsetWidth) ?
                        parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
                }
                else {
                    offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.actionObj.clone.offsetWidth &&
                        this.actionObj.clone.offsetWidth === this.actionObj.cellWidth) ?
                        parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
                }
            }
            var leftValue = offsetLeft;
            offsetLeft = isTimelineView ? isTimeViews ? isLeft ? Math.floor(offsetLeft / slotInterval) * slotInterval : offsetLeft :
                Math.floor(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth :
                Math.ceil(Math.abs(offsetLeft) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
            if (offsetLeft < 0) {
                offsetLeft = 0;
                width = this.actionObj.clone.offsetWidth;
            }
            var cloneWidth = Math.ceil(this.actionObj.clone.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth;
            if (isLeft) {
                styles.left = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
                    (Math.ceil((targetWidth - cloneWidth) / this.actionObj.cellWidth) * this.actionObj.cellWidth) : offsetLeft);
            }
        }
        styles.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(width);
        return styles;
    };
    Resize.prototype.resizeValidation = function (e) {
        var pages = this.getPageCoordinates(e);
        var viewDimension = this.getContentAreaDimension();
        var resizeValidation = false;
        if (this.resizeEdges.left) {
            resizeValidation = (pages.pageX - this.actionObj.cellWidth) >= viewDimension.left;
        }
        if (this.resizeEdges.right) {
            resizeValidation = (pages.pageX + this.actionObj.cellWidth) <= viewDimension.right;
        }
        if (this.resizeEdges.top) {
            resizeValidation = this.actionObj.clone.offsetTop >= viewDimension.top;
        }
        if (this.resizeEdges.bottom) {
            resizeValidation = (this.actionObj.clone.offsetTop + this.actionObj.clone.offsetHeight) <= this.scrollArgs.height;
        }
        return resizeValidation;
    };
    /**
     * Get module name.
     */
    Resize.prototype.getModuleName = function () {
        return 'resize';
    };
    return Resize;
}(_actions_action_base__WEBPACK_IMPORTED_MODULE_1__["ActionBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/scroll.js":
/*!*******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/scroll.js ***!
  \*******************************************************************************/
/*! exports provided: Scroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scroll", function() { return Scroll; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");


/**
 * `Scroll` module
 */
var Scroll = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for the scrolling.
     * @hidden
     */
    function Scroll(parent) {
        this.parent = parent;
        this.addEventListener();
    }
    /**
     * For internal use only - Get the module name.
     * @private
     */
    Scroll.prototype.getModuleName = function () {
        return 'scroll';
    };
    /**
     * @hidden
     */
    Scroll.prototype.setWidth = function () {
        this.parent.element.style.width = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.parent.width);
    };
    /**
     * @hidden
     */
    Scroll.prototype.setHeight = function () {
        this.parent.element.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.parent.height);
    };
    /**
     * @hidden
     */
    Scroll.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_1__["contentReady"], this.setDimensions, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_1__["uiUpdate"], this.onPropertyChanged, this);
    };
    /**
     * @hidden
     */
    Scroll.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_1__["contentReady"], this.setDimensions);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_1__["uiUpdate"], this.onPropertyChanged);
    };
    /**
     * @hidden
     */
    Scroll.prototype.setDimensions = function () {
        this.setWidth();
        this.setHeight();
        var data = { cssProperties: this.parent.getCssProperties(), module: this.getModuleName() };
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["scrollUiUpdate"], data);
    };
    /**
     * @hidden
     */
    Scroll.prototype.onPropertyChanged = function (e) {
        this.setDimensions();
    };
    /**
     * @hidden
     */
    Scroll.prototype.destroy = function () {
        this.removeEventListener();
    };
    return Scroll;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/touch.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/touch.js ***!
  \******************************************************************************/
/*! exports provided: ScheduleTouch */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScheduleTouch", function() { return ScheduleTouch; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");





/**
 * `touch` module is used to handle touch interactions.
 */
var ScheduleTouch = /** @__PURE__ @class */ (function () {
    function ScheduleTouch(parent) {
        this.parent = parent;
        this.element = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TABLE_CONTAINER_CLASS"]);
        this.touchObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Touch"](this.element, {
            scroll: this.scrollHandler.bind(this),
            swipe: this.swipeHandler.bind(this),
            tapHold: this.tapHoldHandler.bind(this),
            swipeSettings: { swipeThresholdDistance: 1 }
        });
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'transitionend', this.onTransitionEnd, this);
        this.touchLeftDirection = this.parent.enableRtl ? 'Right' : 'Left';
        this.touchRightDirection = this.parent.enableRtl ? 'Left' : 'Right';
    }
    ScheduleTouch.prototype.scrollHandler = function (e) {
        if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action ||
            (e.originalEvent && (e.originalEvent.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"]) ||
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.originalEvent.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"])))) {
            return;
        }
        if (!this.timeStampStart) {
            this.timeStampStart = Date.now();
        }
        if (this.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TRANSLATE_CLASS"])) {
            this.onTransitionEnd();
        }
        if (e.scrollDirection === 'Left' || e.scrollDirection === 'Right') {
            var args = { requestType: 'dateNavigate', cancel: false, event: e.originalEvent };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["actionBegin"], args);
            if (args.cancel) {
                return;
            }
            var scrollDiv = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_WRAP_CLASS"]);
            if (scrollDiv && scrollDiv.scrollWidth > scrollDiv.clientWidth) {
                return;
            }
            else {
                this.isScrollTriggered = true;
                e.originalEvent.preventDefault();
                e.originalEvent.stopPropagation();
            }
        }
        if (e.scrollDirection === this.touchLeftDirection) {
            if (!this.nextPanel) {
                this.renderPanel(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["NEXT_PANEL_CLASS"], 'next');
                this.nextPanel = {
                    element: this.parent.activeView.getPanel(),
                    selectedDate: new Date(this.parent.selectedDate.getTime())
                };
                this.setDimensions(this.nextPanel.element);
            }
            var x = this.parent.enableRtl ? e.distanceX : -e.distanceX;
            this.element.style.transform = 'translatex(' + (this.getTranslateX(this.element) + x) + 'px)';
        }
        else if (e.scrollDirection === this.touchRightDirection) {
            var prevWidth = 0;
            if (!this.previousPanel) {
                this.renderPanel(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["PREVIOUS_PANEL_CLASS"], 'previous');
                this.previousPanel = {
                    element: this.parent.activeView.getPanel(),
                    selectedDate: new Date(this.parent.selectedDate.getTime())
                };
                this.setDimensions(this.previousPanel.element);
                prevWidth = this.previousPanel.element.offsetWidth;
            }
            var x = this.parent.enableRtl ? prevWidth - e.distanceX : -prevWidth + e.distanceX;
            this.element.style.transform = 'translatex(' + (this.getTranslateX(this.element) + x) + 'px)';
        }
    };
    ScheduleTouch.prototype.swipeHandler = function (e) {
        if (!this.isScrollTriggered || this.parent.uiStateValues.action) {
            return;
        }
        this.isScrollTriggered = false;
        var swipeDate = e.swipeDirection === 'Left' ?
            this.parent.activeView.renderDates[0] : this.parent.activeView.renderDates.slice(-1)[0];
        if ((e.swipeDirection === 'Left' && swipeDate < this.parent.maxDate) ||
            (e.swipeDirection === 'Right' && swipeDate >= this.parent.minDate)) {
            var time = Date.now() - this.timeStampStart;
            var offsetDist = (e.distanceX * (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice ? 6 : 1.66));
            if (offsetDist > time || (e.distanceX > (this.parent.element.offsetWidth / 2))) {
                this.swapPanels(e.swipeDirection);
                if (offsetDist > time && (e.distanceX > (this.parent.element.offsetWidth / 2))) {
                    this.element.style.transitionDuration = ((offsetDist / time) / 10) + 's';
                }
                this.confirmSwipe(e.swipeDirection);
            }
            else {
                this.cancelSwipe();
            }
            var args = { requestType: 'dateNavigate', cancel: false, event: e.originalEvent };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["actionComplete"], args);
        }
        else {
            this.cancelSwipe();
        }
        this.timeStampStart = null;
    };
    ScheduleTouch.prototype.tapHoldHandler = function (e) {
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.originalEvent.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) && this.parent.isAdaptive) {
            this.parent.quickPopup.tapHoldEventPopup(e.originalEvent);
            return;
        }
    };
    ScheduleTouch.prototype.renderPanel = function (clsName, nextPrevType) {
        if (!this.currentPanel) {
            this.currentPanel = {
                element: this.parent.activeView.getPanel(),
                selectedDate: new Date(this.parent.selectedDate.getTime())
            };
            this.setDimensions(this.currentPanel.element);
        }
        else {
            this.parent.setProperties({ selectedDate: this.currentPanel.selectedDate }, true);
        }
        this.parent.setProperties({ selectedDate: this.parent.activeView.getNextPreviousDate(nextPrevType) }, true);
        if (this.parent.headerModule) {
            this.parent.headerModule.setCalendarDate(this.parent.selectedDate);
        }
        this.parent.activeView.getRenderDates();
        this.parent.activeView.renderLayout(clsName);
    };
    ScheduleTouch.prototype.swapPanels = function (direction) {
        if (direction === this.touchLeftDirection) {
            var temp = this.nextPanel;
            this.nextPanel = this.currentPanel;
            this.currentPanel = temp;
        }
        else {
            var temp = this.previousPanel;
            this.previousPanel = this.currentPanel;
            this.currentPanel = temp;
        }
    };
    ScheduleTouch.prototype.confirmSwipe = function (swipeDirection) {
        var _this = this;
        var previousDate = swipeDirection === this.touchLeftDirection ? this.nextPanel.selectedDate : this.previousPanel.selectedDate;
        var args = {
            action: 'date', cancel: false, previousDate: previousDate, currentDate: this.currentPanel.selectedDate
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["navigating"], args, function (navArgs) {
            if (navArgs.cancel) {
                _this.swapPanels(swipeDirection);
                _this.cancelSwipe();
            }
            else {
                _this.parent.activeView.setPanel(_this.currentPanel.element);
                _this.parent.setProperties({ selectedDate: _this.currentPanel.selectedDate }, true);
                var translateX = void 0;
                if (_this.parent.enableRtl) {
                    translateX = swipeDirection === _this.touchLeftDirection ?
                        (_this.previousPanel ? _this.previousPanel.element.offsetLeft : _this.currentPanel.element.offsetWidth) : 0;
                }
                else {
                    translateX = swipeDirection === _this.touchLeftDirection ? -_this.currentPanel.element.offsetLeft : 0;
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TRANSLATE_CLASS"]);
                _this.element.style.transform = 'translatex(' + translateX + 'px)';
                if (_this.parent.headerModule) {
                    _this.parent.headerModule.updateDateRange(_this.parent.activeView.getDateRangeText());
                }
                _this.parent.renderTemplates();
                _this.parent.renderModule.refreshDataManager();
            }
        });
    };
    ScheduleTouch.prototype.cancelSwipe = function () {
        this.parent.activeView.setPanel(this.currentPanel.element);
        this.parent.setProperties({ selectedDate: this.currentPanel.selectedDate }, true);
        this.parent.activeView.getRenderDates();
        this.parent.activeView.generateColumnLevels();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TRANSLATE_CLASS"]);
        var prevWidth = this.previousPanel ? this.previousPanel.element.offsetWidth : 0;
        this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';
    };
    ScheduleTouch.prototype.onTransitionEnd = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TRANSLATE_CLASS"]);
        this.element.style.transitionDuration = '';
        this.element.style.transform = '';
        if (this.previousPanel) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.previousPanel.element);
            this.previousPanel = null;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.currentPanel.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["PREVIOUS_PANEL_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.currentPanel.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CURRENT_PANEL_CLASS"]);
        }
        if (this.nextPanel) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.nextPanel.element);
            this.nextPanel = null;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.currentPanel.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["NEXT_PANEL_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.currentPanel.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CURRENT_PANEL_CLASS"]);
        }
        this.currentPanel = null;
        this.parent.activeView.getPanel().style.width = '';
    };
    ScheduleTouch.prototype.getTranslateX = function (element) {
        var style = window.getComputedStyle(element);
        return new WebKitCSSMatrix(style.webkitTransform).m41;
    };
    ScheduleTouch.prototype.setDimensions = function (element) {
        element.style.width = (this.parent.element.clientWidth) + 'px';
    };
    ScheduleTouch.prototype.resetValues = function () {
        this.currentPanel = null;
        this.previousPanel = null;
        this.nextPanel = null;
        this.timeStampStart = null;
        this.element.style.transform = '';
        _base_util__WEBPACK_IMPORTED_MODULE_3__["removeChildren"](this.element);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TRANSLATE_CLASS"]);
    };
    /**
     * @hidden
     */
    ScheduleTouch.prototype.destroy = function () {
        this.touchObj.destroy();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'transitionend', this.onTransitionEnd);
        this.resetValues();
    };
    return ScheduleTouch;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/virtual-scroll.js":
/*!***************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/virtual-scroll.js ***!
  \***************************************************************************************/
/*! exports provided: VirtualScroll */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualScroll", function() { return VirtualScroll; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");




/**
 * Virtual Scroll
 */
var VirtualScroll = /** @__PURE__ @class */ (function () {
    function VirtualScroll(parent) {
        this.translateY = 0;
        this.itemSize = 60;
        this.bufferCount = 3;
        this.renderedLength = 0;
        this.averageRowHeight = 0;
        this.startIndex = 0;
        this.isScrollHeightNull = true;
        this.previousTop = 0;
        this.parent = parent;
        this.addEventListener();
    }
    VirtualScroll.prototype.addEventListener = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_1__["virtualScroll"], this.virtualScrolling, this);
    };
    VirtualScroll.prototype.removeEventListener = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_1__["virtualScroll"], this.virtualScrolling);
    };
    VirtualScroll.prototype.getRenderedCount = function () {
        this.setItemSize();
        return Math.ceil(this.parent.element.clientHeight / this.itemSize) + this.bufferCount;
    };
    VirtualScroll.prototype.triggerScrolling = function () {
        this.parent.showSpinner();
        // tslint:disable-next-line:no-any
        var scheduleObj = this.parent;
        var adaptor = 'interopAdaptor';
        var invokeMethodAsync = 'invokeMethodAsync';
        scheduleObj[adaptor][invokeMethodAsync]('OnContentUpdate', this.startIndex);
    };
    VirtualScroll.prototype.setTranslateValue = function () {
        var resWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_COLUMN_WRAP_CLASS"]);
        var conWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_WRAP_CLASS"]);
        var eventWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_TABLE_CLASS"]);
        var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CURRENT_TIMELINE_CLASS"]);
        this.renderVirtualTrackHeight(conWrap, resWrap);
        this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
    };
    VirtualScroll.prototype.renderVirtualTrackHeight = function (contentWrap, resourceWrap) {
        this.parent.resourceBase.setExpandedResources();
        if (this.isScrollHeightNull) {
            var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["VIRTUAL_TRACK_CLASS"] });
            var resWrap = [].slice.call((resourceWrap).querySelectorAll('table td'));
            var startIndex_1 = parseInt(resWrap[0].getAttribute('data-group-index'), 10);
            var endIndex_1 = parseInt(resWrap[resWrap.length - 1].getAttribute('data-group-index'), 10);
            this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources.filter(function (resource) {
                return (resource.groupIndex >= startIndex_1 && resource.groupIndex <= endIndex_1);
            });
            this.setItemSize();
            wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
            this.isScrollHeightNull = false;
            var virtual = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["VIRTUAL_TRACK_CLASS"]);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(virtual)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(virtual);
            }
            contentWrap.appendChild(wrap);
        }
    };
    VirtualScroll.prototype.renderVirtualTrack = function (contentWrap) {
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["VIRTUAL_TRACK_CLASS"] });
        wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
        contentWrap.appendChild(wrap);
    };
    VirtualScroll.prototype.updateVirtualScrollHeight = function () {
        var virtual = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["VIRTUAL_TRACK_CLASS"]);
        var lastResourceIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;
        var lastRenderIndex = this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length - 1].groupIndex;
        if (lastRenderIndex !== lastResourceIndex) {
            var conTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_TABLE_CLASS"]);
            this.renderedLength = conTable.querySelector('tbody').children.length;
            virtual.style.height = (conTable.offsetHeight + (this.parent.resourceBase.expandedResources.length - (this.renderedLength)) *
                conTable.offsetHeight / this.renderedLength) + 'px';
        }
        else {
            virtual.style.height = '';
        }
        this.averageRowHeight = virtual.offsetHeight / this.parent.resourceBase.expandedResources.length;
    };
    VirtualScroll.prototype.updateVirtualTrackHeight = function (wrap) {
        var resourceCount = this.parent.resourceBase.renderedResources.length;
        if (resourceCount !== this.getRenderedCount()) {
            wrap.style.height = this.parent.element.querySelector('.e-content-wrap').clientHeight + 'px';
            var resWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_COLUMN_WRAP_CLASS"]);
            var conWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_WRAP_CLASS"]);
            var eventWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_TABLE_CLASS"]);
            this.translateY = 0;
            this.setTranslate(resWrap, conWrap, eventWrap);
        }
        else {
            var lastRenderIndex = this.parent.resourceBase.renderedResources[resourceCount - 1].groupIndex;
            var lastCollIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;
            var renderedResConut = resourceCount + (lastCollIndex - lastRenderIndex);
            renderedResConut = (renderedResConut > this.parent.resourceBase.expandedResources.length) ?
                this.parent.resourceBase.expandedResources.length : renderedResConut;
            wrap.style.height = (renderedResConut * this.itemSize) + 'px';
        }
    };
    VirtualScroll.prototype.setItemSize = function () {
        this.itemSize = _base_util__WEBPACK_IMPORTED_MODULE_3__["getElementHeightFromClass"](this.parent.activeView.element, _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"]) || this.itemSize;
    };
    VirtualScroll.prototype.beforeInvoke = function (resWrap, conWrap, eventWrap, timeIndicator) {
        //code
    };
    VirtualScroll.prototype.renderEvents = function () {
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["dataReady"], {});
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["contentReady"], {});
        this.parent.hideSpinner();
    };
    VirtualScroll.prototype.virtualScrolling = function () {
        var _this = this;
        this.parent.quickPopup.quickPopupHide();
        this.parent.quickPopup.morePopup.hide();
        var resWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_COLUMN_WRAP_CLASS"]);
        var conWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_WRAP_CLASS"]);
        var eventWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_TABLE_CLASS"]);
        var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CURRENT_TIMELINE_CLASS"]);
        var conTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_TABLE_CLASS"]);
        this.renderedLength = resWrap.querySelector('tbody').children.length;
        var firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);
        var scrollHeight = this.parent.rowAutoHeight ?
            (conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([conWrap], 'e-transition');
        var resCollection = [];
        if ((conWrap.scrollTop) - this.translateY < 0) {
            resCollection = this.upScroll(conWrap, firstTDIndex);
            this.beforeInvoke(resWrap, conWrap, eventWrap, timeIndicator);
        }
        else if (conWrap.scrollTop - this.translateY > scrollHeight) {
            resCollection = this.downScroll(conWrap, firstTDIndex);
            if (!(this.previousTop === conWrap.scrollTop)) {
                this.beforeInvoke(resWrap, conWrap, eventWrap, timeIndicator);
            }
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resCollection) && resCollection.length > 0) {
            this.parent.showSpinner();
            this.updateContent(resWrap, conWrap, eventWrap, resCollection);
            this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
            if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
                this.parent.dragAndDropModule.navigationWrapper();
            }
            window.clearTimeout(this.timeValue);
            this.timeValue = window.setTimeout(function () { _this.renderEvents(); }, 250);
        }
    };
    VirtualScroll.prototype.upScroll = function (conWrap, firstTDIndex) {
        var index = 0;
        index = (~~(conWrap.scrollTop / this.itemSize) + Math.ceil(conWrap.clientHeight / this.itemSize)) - this.renderedLength;
        if (this.parent.rowAutoHeight) {
            index = (index > firstTDIndex) ? firstTDIndex - this.bufferCount : index;
        }
        index = (index > 0) ? index : 0;
        var prevSetCollection = this.getBufferCollection(index, index + this.renderedLength);
        this.parent.resourceBase.renderedResources = prevSetCollection;
        if (firstTDIndex === 0) {
            this.translateY = conWrap.scrollTop;
        }
        else {
            var height = (this.parent.rowAutoHeight) ? this.averageRowHeight : this.itemSize;
            this.translateY = (conWrap.scrollTop - (this.bufferCount * height) > 0) ?
                conWrap.scrollTop - (this.bufferCount * height) : 0;
        }
        return prevSetCollection;
    };
    VirtualScroll.prototype.downScroll = function (conWrap, firstTDIndex) {
        var lastResource = this.parent.resourceBase.
            renderedResources[this.parent.resourceBase.renderedResources.length - 1].groupIndex;
        var lastResourceIndex = this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex;
        if (lastResource === lastResourceIndex) {
            return null;
        }
        var nextSetResIndex = 0;
        var height = (this.parent.rowAutoHeight) ? this.averageRowHeight : this.itemSize;
        nextSetResIndex = ~~(conWrap.scrollTop / this.itemSize);
        if (this.parent.rowAutoHeight) {
            nextSetResIndex = ~~((conWrap.scrollTop - this.translateY) / this.averageRowHeight) + firstTDIndex;
            nextSetResIndex = (nextSetResIndex > firstTDIndex + this.bufferCount) ? nextSetResIndex : firstTDIndex + this.bufferCount;
        }
        var lastIndex = nextSetResIndex + this.renderedLength;
        lastIndex = (lastIndex > this.parent.resourceBase.expandedResources.length) ?
            nextSetResIndex + (this.parent.resourceBase.expandedResources.length - nextSetResIndex) : lastIndex;
        var nextSetCollection = this.getBufferCollection(lastIndex - this.renderedLength, lastIndex);
        this.translateY = conWrap.scrollTop;
        return nextSetCollection;
    };
    VirtualScroll.prototype.updateContent = function (resWrap, conWrap, eventWrap, resCollection) {
        var renderedLenth = resWrap.querySelector('tbody').children.length;
        for (var i = 0; i < renderedLenth; i++) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(resWrap.querySelector('tbody tr'));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(conWrap.querySelector('tbody tr'));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(eventWrap.querySelector('div'));
        }
        this.parent.resourceBase.renderedResources = resCollection;
        var resourceRows = this.parent.resourceBase.getContentRows(resCollection);
        var contentRows = this.parent.activeView.getContentRows();
        var eventRows = this.parent.activeView.getEventRows(resCollection.length);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(resourceRows, resWrap.querySelector('tbody'));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(contentRows, conWrap.querySelector('tbody'));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(eventRows, eventWrap);
    };
    VirtualScroll.prototype.getBufferCollection = function (startIndex, endIndex) {
        return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
    };
    VirtualScroll.prototype.setTranslate = function (resWrap, conWrap, eventWrap, timeIndicator) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(resWrap.querySelector('table'), {
            transform: "translateY(" + this.translateY + "px)"
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(conWrap.querySelector('table'), {
            transform: "translateY(" + this.translateY + "px)"
        });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(eventWrap, {
            transform: "translateY(" + this.translateY + "px)"
        });
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timeIndicator)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(timeIndicator, {
                transform: "translateY(" + this.translateY + "px)"
            });
        }
    };
    VirtualScroll.prototype.destroy = function () {
        this.removeEventListener();
    };
    return VirtualScroll;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/work-cells.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/work-cells.js ***!
  \***********************************************************************************/
/*! exports provided: WorkCellInteraction */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkCellInteraction", function() { return WorkCellInteraction; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");



/**
 * Work cell interactions
 */
var WorkCellInteraction = /** @__PURE__ @class */ (function () {
    function WorkCellInteraction(parent) {
        this.parent = parent;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.parent.element, 'mouseover', this.onHover, this);
    }
    WorkCellInteraction.prototype.cellMouseDown = function (e) {
        if (this.isPreventAction(e)) {
            return;
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellMouseDown"], { event: e });
    };
    WorkCellInteraction.prototype.cellClick = function (e) {
        var _this = this;
        if (this.isPreventAction(e)) {
            return;
        }
        var queryStr = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ALLDAY_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["HEADER_CELLS_CLASS"];
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, queryStr);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["NEW_EVENT_CLASS"]))) {
            this.parent.eventWindow.openEditor(this.parent.activeCellsData, 'Add');
            return;
        }
        var navigateEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["NAVIGATE_CLASS"]);
        var navigateView = this.parent.getNavigateView();
        var sameView = this.parent.currentView === navigateView;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(navigateEle) || sameView ||
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.viewOptions[navigateView.charAt(0).toLowerCase() + navigateView.slice(1)])) {
            if (this.parent.activeViewOptions.readonly && this.parent.currentView !== 'MonthAgenda') {
                this.parent.quickPopup.quickPopupHide();
                return;
            }
            if (this.parent.isAdaptive && (e.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"]) ||
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"]))) {
                return;
            }
            var isWorkCell_1 = target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"]) ||
                target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ALLDAY_CELLS_CLASS"]);
            if (isWorkCell_1 && e.shiftKey && e.which === 1 && this.parent.keyboardInteractionModule) {
                this.parent.keyboardInteractionModule.onMouseSelection(e);
                return;
            }
            this.parent.activeCellsData = this.parent.getCellDetails(target);
            var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellClick"], args, function (clickArgs) {
                clickArgs = _this.serializingData(clickArgs, e);
                if (!clickArgs.cancel) {
                    if (isWorkCell_1) {
                        _this.parent.selectCell(target);
                    }
                    if (_this.parent.allowInline) {
                        var inlineArgs = {
                            element: clickArgs.element,
                            groupIndex: clickArgs.groupIndex, type: 'Cell'
                        };
                        _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["inlineClick"], inlineArgs);
                    }
                    else {
                        _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellClick"], clickArgs);
                    }
                }
                else {
                    if (_this.parent.quickPopup) {
                        _this.parent.quickPopup.quickPopupHide();
                    }
                }
            });
        }
        else {
            var date = this.parent.getDateFromElement(target);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date) && !this.parent.isAdaptive && this.parent.isMinMaxDate(date)) {
                this.parent.setScheduleProperties({ selectedDate: date });
                this.parent.changeView(this.parent.getNavigateView(), e);
            }
        }
    };
    WorkCellInteraction.prototype.cellDblClick = function (e) {
        var _this = this;
        if (this.parent.activeViewOptions.readonly || this.isPreventAction(e)) {
            return;
        }
        var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellDoubleClick' });
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["cellDoubleClick"], args, function (clickArgs) {
            clickArgs = _this.serializingData(clickArgs, e);
            var date = new Date(clickArgs.startTime.getTime());
            if (!_this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {
                return;
            }
            if (!clickArgs.cancel) {
                _this.parent.eventWindow.openEditor(_this.parent.activeCellsData, 'Add');
            }
        });
    };
    WorkCellInteraction.prototype.serializingData = function (clickArgs, e) {
        return clickArgs;
    };
    WorkCellInteraction.prototype.onHover = function (e) {
        var targetSelector = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["TIME_SLOT_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ALLDAY_CELLS_CLASS"] + ',.' +
            _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["HEADER_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WEEK_NUMBER_CLASS"] +
            ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MONTH_HEADER_CLASS"];
        var hoverTarget = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, targetSelector);
        if (hoverTarget) {
            var hoverArgs = { element: hoverTarget, event: e };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_1__["hover"], hoverArgs);
        }
    };
    WorkCellInteraction.prototype.isPreventAction = function (e) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["NAVIGATE_CLASS"])) {
            return false;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"]) &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"])) {
            return true;
        }
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_GROUP_CELLS_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            return true;
        }
        target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["HEADER_CELLS_CLASS"]);
        if (this.parent.activeView.isTimelineView() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target)) {
            return true;
        }
        return false;
    };
    WorkCellInteraction.prototype.destroy = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.parent.element, 'mouseover', this.onHover);
    };
    return WorkCellInteraction;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js ***!
  \******************************************************************************/
/*! exports provided: cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellClick", function() { return cellClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellDoubleClick", function() { return cellDoubleClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moreEventsClick", function() { return moreEventsClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return select; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hover", function() { return hover; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actionBegin", function() { return actionBegin; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actionComplete", function() { return actionComplete; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actionFailure", function() { return actionFailure; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "navigating", function() { return navigating; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCell", function() { return renderCell; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventClick", function() { return eventClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventRendered", function() { return eventRendered; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataBinding", function() { return dataBinding; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataBound", function() { return dataBound; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "popupOpen", function() { return popupOpen; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "popupClose", function() { return popupClose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dragStart", function() { return dragStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return drag; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dragStop", function() { return dragStop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resizeStart", function() { return resizeStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resizing", function() { return resizing; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resizeStop", function() { return resizeStop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inlineClick", function() { return inlineClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialLoad", function() { return initialLoad; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialEnd", function() { return initialEnd; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataReady", function() { return dataReady; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eventsLoaded", function() { return eventsLoaded; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contentReady", function() { return contentReady; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scroll", function() { return scroll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "virtualScroll", function() { return virtualScroll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollUiUpdate", function() { return scrollUiUpdate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uiUpdate", function() { return uiUpdate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "documentClick", function() { return documentClick; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellMouseDown", function() { return cellMouseDown; });
/**
 * Constants
 */
/** @hidden */
var cellClick = 'cellClick';
/** @hidden */
var cellDoubleClick = 'cellDoubleClick';
/** @hidden */
var moreEventsClick = 'moreEventsClick';
/** @hidden */
var select = 'select';
/** @hidden */
var hover = 'hover';
/** @hidden */
var actionBegin = 'actionBegin';
/** @hidden */
var actionComplete = 'actionComplete';
/** @hidden */
var actionFailure = 'actionFailure';
/** @hidden */
var navigating = 'navigating';
/** @hidden */
var renderCell = 'renderCell';
/** @hidden */
var eventClick = 'eventClick';
/** @hidden */
var eventRendered = 'eventRendered';
/** @hidden */
var dataBinding = 'dataBinding';
/** @hidden */
var dataBound = 'dataBound';
/** @hidden */
var popupOpen = 'popupOpen';
/** @hidden */
var popupClose = 'popupClose';
/** @hidden */
var dragStart = 'dragStart';
/** @hidden */
var drag = 'drag';
/** @hidden */
var dragStop = 'dragStop';
/** @hidden */
var resizeStart = 'resizeStart';
/** @hidden */
var resizing = 'resizing';
/** @hidden */
var resizeStop = 'resizeStop';
/** @hidden */
var inlineClick = 'inlineClick';
/**
 * Specifies schedule internal events
 */
/** @hidden */
var initialLoad = 'initial-load';
/** @hidden */
var initialEnd = 'initial-end';
/** @hidden */
var dataReady = 'data-ready';
/** @hidden */
var eventsLoaded = 'events-loaded';
/** @hidden */
var contentReady = 'content-ready';
/** @hidden */
var scroll = 'scroll';
/** @hidden */
var virtualScroll = 'virtual-scroll';
/** @hidden */
var scrollUiUpdate = 'scroll-ui-update';
/** @hidden */
var uiUpdate = 'ui-update';
/** @hidden */
var documentClick = 'document-click';
/** @hidden */
var cellMouseDown = 'cell-mouse-down';


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js ***!
  \**********************************************************************************/
/*! exports provided: ROOT, RTL, DEVICE_CLASS, ICON, ENABLE_CLASS, DISABLE_CLASS, TABLE_CONTAINER_CLASS, SCHEDULE_TABLE_CLASS, ALLDAY_CELLS_CLASS, HEADER_POPUP_CLASS, HEADER_CALENDAR_CLASS, ALLDAY_ROW_CLASS, CONTENT_TABLE_CLASS, WORK_CELLS_CLASS, WORK_HOURS_CLASS, POPUP_OPEN, POPUP_CLOSE, DATE_HEADER_WRAP_CLASS, DATE_HEADER_CONTAINER_CLASS, HEADER_CELLS_CLASS, WORKDAY_CLASS, OTHERMONTH_CLASS, CURRENT_DAY_CLASS, CURRENTDATE_CLASS, CURRENT_PANEL_CLASS, PREVIOUS_PANEL_CLASS, NEXT_PANEL_CLASS, PREVIOUS_DATE_CLASS, NEXT_DATE_CLASS, TRANSLATE_CLASS, LEFT_INDENT_CLASS, LEFT_INDENT_WRAP_CLASS, EVENT_TABLE_CLASS, RESOURCE_LEFT_TD_CLASS, RESOURCE_GROUP_CELLS_CLASS, RESOURCE_TEXT_CLASS, RESOURCE_COLUMN_WRAP_CLASS, RESOURCE_COLUMN_TABLE_CLASS, RESOURCE_CHILD_CLASS, RESOURCE_PARENT_CLASS, RESOURCE_EXPAND_CLASS, RESOURCE_COLLAPSE_CLASS, RESOURCE_TREE_ICON_CLASS, RESOURCE_CELLS_CLASS, TIME_CELLS_WRAP_CLASS, TIME_CELLS_CLASS, TIME_SLOT_CLASS, ALTERNATE_CELLS_CLASS, CURRENT_TIME_CLASS, CURRENT_TIMELINE_CLASS, PREVIOUS_TIMELINE_CLASS, HIDE_CHILDS_CLASS, SCROLL_CONTAINER_CLASS, WRAPPER_CLASS, TIMELINE_WRAPPER_CLASS, APPOINTMENT_WRAPPER_CLASS, DAY_WRAPPER_CLASS, TOOLBAR_CONTAINER, RESOURCE_TOOLBAR_CONTAINER, HEADER_TOOLBAR, RESOURCE_HEADER_TOOLBAR, SELECTED_CELL_CLASS, WEEK_NUMBER_WRAPPER_CLASS, WEEK_NUMBER_CLASS, APPOINTMENT_WRAP_CLASS, WRAPPER_CONTAINER_CLASS, APPOINTMENT_CONTAINER_CLASS, APPOINTMENT_CLASS, BLOCK_APPOINTMENT_CLASS, BLOCK_INDICATOR_CLASS, APPOINTMENT_BORDER, APPOINTMENT_DETAILS, SUBJECT_WRAP, RESOURCE_NAME, APPOINTMENT_TIME, TABLE_WRAP_CLASS, OUTER_TABLE_CLASS, CONTENT_WRAP_CLASS, VIRTUAL_TRACK_CLASS, AGENDA_CELLS_CLASS, AGENDA_CURRENT_DAY_CLASS, AGENDA_SELECTED_CELL, MONTH_HEADER_CLASS, AGENDA_HEADER_CLASS, AGENDA_RESOURCE_CLASS, AGENDA_DATE_CLASS, NAVIGATE_CLASS, DATE_HEADER_CLASS, AGENDA_DAY_BORDER_CLASS, DATE_BORDER_CLASS, AGENDA_DAY_PADDING_CLASS, DATE_TIME_CLASS, DATE_TIME_WRAPPER_CLASS, AGENDA_EMPTY_EVENT_CLASS, AGENDA_NO_EVENT_CLASS, APPOINTMENT_INDICATOR_CLASS, EVENT_INDICATOR_CLASS, EVENT_ICON_UP_CLASS, EVENT_ICON_DOWN_CLASS, EVENT_ICON_LEFT_CLASS, EVENT_ICON_RIGHT_CLASS, EVENT_ACTION_CLASS, NEW_EVENT_CLASS, CLONE_ELEMENT_CLASS, MONTH_CLONE_ELEMENT_CLASS, CLONE_TIME_INDICATOR_CLASS, DRAG_CLONE_CLASS, EVENT_RESIZE_CLASS, RESIZE_CLONE_CLASS, LEFT_RESIZE_HANDLER, RIGHT_RESIZE_HANDLER, TOP_RESIZE_HANDLER, BOTTOM_RESIZE_HANDLER, EVENT_RECURRENCE_ICON_CLASS, EVENT_RECURRENCE_EDIT_ICON_CLASS, HEADER_ROW_CLASS, ALLDAY_APPOINTMENT_WRAPPER_CLASS, ALLDAY_APPOINTMENT_CLASS, EVENT_COUNT_CLASS, ROW_COUNT_WRAPPER_CLASS, ALLDAY_APPOINTMENT_SECTION_CLASS, APPOINTMENT_ROW_EXPAND_CLASS, APPOINTMENT_ROW_COLLAPSE_CLASS, MORE_INDICATOR_CLASS, CELL_POPUP_CLASS, EVENT_POPUP_CLASS, MULTIPLE_EVENT_POPUP_CLASS, POPUP_HEADER_CLASS, POPUP_HEADER_ICON_WRAPPER, POPUP_CONTENT_CLASS, POPUP_FOOTER_CLASS, DATE_TIME_DETAILS_CLASS, RECURRENCE_SUMMARY_CLASS, QUICK_POPUP_EVENT_DETAILS_CLASS, EVENT_CREATE_CLASS, EDIT_EVENT_CLASS, DELETE_EVENT_CLASS, TEXT_ELLIPSIS, MORE_POPUP_WRAPPER_CLASS, MORE_EVENT_POPUP_CLASS, MORE_EVENT_HEADER_CLASS, MORE_EVENT_DATE_HEADER_CLASS, MORE_EVENT_HEADER_DAY_CLASS, MORE_EVENT_HEADER_DATE_CLASS, MORE_EVENT_CLOSE_CLASS, MORE_EVENT_CONTENT_CLASS, MORE_EVENT_WRAPPER_CLASS, QUICK_DIALOG_CLASS, QUICK_DIALOG_OCCURRENCE_CLASS, QUICK_DIALOG_SERIES_CLASS, QUICK_DIALOG_FOLLOWING_EVENTS_CLASS, FOLLOWING_EVENTS_DIALOG, QUICK_DIALOG_DELETE_CLASS, QUICK_DIALOG_CANCEL_CLASS, QUICK_DIALOG_ALERT_OK, QUICK_DIALOG_ALERT_CANCEL, QUICK_DIALOG_ALERT_FOLLOWING, QUICK_DIALOG_ALERT_BTN_CLASS, EVENT_WINDOW_DIALOG_CLASS, FORM_CONTAINER_CLASS, FORM_CLASS, EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS, EVENT_WINDOW_ALL_DAY_CLASS, TIME_ZONE_CLASS, TIME_ZONE_ICON_CLASS, TIME_ZONE_DETAILS_CLASS, EVENT_WINDOW_REPEAT_DIV_CLASS, EVENT_WINDOW_REPEAT_CLASS, EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS, SUBJECT_CLASS, LOCATION_CLASS, LOCATION_ICON_CLASS, LOCATION_DETAILS_CLASS, EVENT_WINDOW_START_END_DIV_CLASS, EVENT_WINDOW_START_CLASS, EVENT_WINDOW_END_CLASS, EVENT_WINDOW_RESOURCES_DIV_CLASS, DESCRIPTION_CLASS, DESCRIPTION_ICON_CLASS, DESCRIPTION_DETAILS_CLASS, EVENT_WINDOW_TIME_ZONE_DIV_CLASS, EVENT_WINDOW_START_TZ_CLASS, EVENT_WINDOW_END_TZ_CLASS, EVENT_WINDOW_BACK_ICON_CLASS, EVENT_WINDOW_SAVE_ICON_CLASS, EVENT_WINDOW_CANCEL_BUTTON_CLASS, EVENT_WINDOW_SAVE_BUTTON_CLASS, EVENT_WINDOW_DIALOG_PARENT_CLASS, EVENT_WINDOW_TITLE_TEXT_CLASS, EVENT_WINDOW_ICON_DISABLE_CLASS, EDIT_CLASS, EDIT_ICON_CLASS, DELETE_CLASS, DELETE_ICON_CLASS, CLOSE_CLASS, CLOSE_ICON_CLASS, ERROR_VALIDATION_CLASS, EVENT_TOOLTIP_ROOT_CLASS, ALLDAY_ROW_ANIMATE_CLASS, TIMESCALE_DISABLE, DISABLE_DATE, HIDDEN_CLASS, DISABLE_DATES, POPUP_WRAPPER_CLASS, POPUP_TABLE_CLASS, RESOURCE_MENU, RESOURCE_MENU_ICON, RESOURCE_LEVEL_TITLE, RESOURCE_TREE, RESOURCE_TREE_POPUP_OVERLAY, RESOURCE_TREE_POPUP, RESOURCE_CLASS, RESOURCE_ICON_CLASS, RESOURCE_DETAILS_CLASS, DATE_TIME_ICON_CLASS, VIRTUAL_SCROLL_CLASS, ICON_DISABLE_CLASS, AUTO_HEIGHT, IGNORE_WHITESPACE, EVENT_TEMPLATE, READ_ONLY, MONTH_HEADER_WRAPPER, INLINE_SUBJECT_CLASS, INLINE_APPOINTMENT_CLASS */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROOT", function() { return ROOT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RTL", function() { return RTL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEVICE_CLASS", function() { return DEVICE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICON", function() { return ICON; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENABLE_CLASS", function() { return ENABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISABLE_CLASS", function() { return DISABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TABLE_CONTAINER_CLASS", function() { return TABLE_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCHEDULE_TABLE_CLASS", function() { return SCHEDULE_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_CELLS_CLASS", function() { return ALLDAY_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_POPUP_CLASS", function() { return HEADER_POPUP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_CALENDAR_CLASS", function() { return HEADER_CALENDAR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_ROW_CLASS", function() { return ALLDAY_ROW_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTENT_TABLE_CLASS", function() { return CONTENT_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WORK_CELLS_CLASS", function() { return WORK_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WORK_HOURS_CLASS", function() { return WORK_HOURS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_OPEN", function() { return POPUP_OPEN; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_CLOSE", function() { return POPUP_CLOSE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_HEADER_WRAP_CLASS", function() { return DATE_HEADER_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_HEADER_CONTAINER_CLASS", function() { return DATE_HEADER_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_CELLS_CLASS", function() { return HEADER_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WORKDAY_CLASS", function() { return WORKDAY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OTHERMONTH_CLASS", function() { return OTHERMONTH_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CURRENT_DAY_CLASS", function() { return CURRENT_DAY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CURRENTDATE_CLASS", function() { return CURRENTDATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CURRENT_PANEL_CLASS", function() { return CURRENT_PANEL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PREVIOUS_PANEL_CLASS", function() { return PREVIOUS_PANEL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEXT_PANEL_CLASS", function() { return NEXT_PANEL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PREVIOUS_DATE_CLASS", function() { return PREVIOUS_DATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEXT_DATE_CLASS", function() { return NEXT_DATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRANSLATE_CLASS", function() { return TRANSLATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT_INDENT_CLASS", function() { return LEFT_INDENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT_INDENT_WRAP_CLASS", function() { return LEFT_INDENT_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_TABLE_CLASS", function() { return EVENT_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_LEFT_TD_CLASS", function() { return RESOURCE_LEFT_TD_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_GROUP_CELLS_CLASS", function() { return RESOURCE_GROUP_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TEXT_CLASS", function() { return RESOURCE_TEXT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_COLUMN_WRAP_CLASS", function() { return RESOURCE_COLUMN_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_COLUMN_TABLE_CLASS", function() { return RESOURCE_COLUMN_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_CHILD_CLASS", function() { return RESOURCE_CHILD_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_PARENT_CLASS", function() { return RESOURCE_PARENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_EXPAND_CLASS", function() { return RESOURCE_EXPAND_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_COLLAPSE_CLASS", function() { return RESOURCE_COLLAPSE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TREE_ICON_CLASS", function() { return RESOURCE_TREE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_CELLS_CLASS", function() { return RESOURCE_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_CELLS_WRAP_CLASS", function() { return TIME_CELLS_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_CELLS_CLASS", function() { return TIME_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_SLOT_CLASS", function() { return TIME_SLOT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALTERNATE_CELLS_CLASS", function() { return ALTERNATE_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CURRENT_TIME_CLASS", function() { return CURRENT_TIME_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CURRENT_TIMELINE_CLASS", function() { return CURRENT_TIMELINE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PREVIOUS_TIMELINE_CLASS", function() { return PREVIOUS_TIMELINE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HIDE_CHILDS_CLASS", function() { return HIDE_CHILDS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCROLL_CONTAINER_CLASS", function() { return SCROLL_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WRAPPER_CLASS", function() { return WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIMELINE_WRAPPER_CLASS", function() { return TIMELINE_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_WRAPPER_CLASS", function() { return APPOINTMENT_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DAY_WRAPPER_CLASS", function() { return DAY_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOOLBAR_CONTAINER", function() { return TOOLBAR_CONTAINER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TOOLBAR_CONTAINER", function() { return RESOURCE_TOOLBAR_CONTAINER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_TOOLBAR", function() { return HEADER_TOOLBAR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_HEADER_TOOLBAR", function() { return RESOURCE_HEADER_TOOLBAR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SELECTED_CELL_CLASS", function() { return SELECTED_CELL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WEEK_NUMBER_WRAPPER_CLASS", function() { return WEEK_NUMBER_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WEEK_NUMBER_CLASS", function() { return WEEK_NUMBER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_WRAP_CLASS", function() { return APPOINTMENT_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WRAPPER_CONTAINER_CLASS", function() { return WRAPPER_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_CONTAINER_CLASS", function() { return APPOINTMENT_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_CLASS", function() { return APPOINTMENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BLOCK_APPOINTMENT_CLASS", function() { return BLOCK_APPOINTMENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BLOCK_INDICATOR_CLASS", function() { return BLOCK_INDICATOR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_BORDER", function() { return APPOINTMENT_BORDER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_DETAILS", function() { return APPOINTMENT_DETAILS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBJECT_WRAP", function() { return SUBJECT_WRAP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_NAME", function() { return RESOURCE_NAME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_TIME", function() { return APPOINTMENT_TIME; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TABLE_WRAP_CLASS", function() { return TABLE_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OUTER_TABLE_CLASS", function() { return OUTER_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTENT_WRAP_CLASS", function() { return CONTENT_WRAP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VIRTUAL_TRACK_CLASS", function() { return VIRTUAL_TRACK_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_CELLS_CLASS", function() { return AGENDA_CELLS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_CURRENT_DAY_CLASS", function() { return AGENDA_CURRENT_DAY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_SELECTED_CELL", function() { return AGENDA_SELECTED_CELL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_HEADER_CLASS", function() { return MONTH_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_HEADER_CLASS", function() { return AGENDA_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_RESOURCE_CLASS", function() { return AGENDA_RESOURCE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_DATE_CLASS", function() { return AGENDA_DATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NAVIGATE_CLASS", function() { return NAVIGATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_HEADER_CLASS", function() { return DATE_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_DAY_BORDER_CLASS", function() { return AGENDA_DAY_BORDER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_BORDER_CLASS", function() { return DATE_BORDER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_DAY_PADDING_CLASS", function() { return AGENDA_DAY_PADDING_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_TIME_CLASS", function() { return DATE_TIME_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_TIME_WRAPPER_CLASS", function() { return DATE_TIME_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_EMPTY_EVENT_CLASS", function() { return AGENDA_EMPTY_EVENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AGENDA_NO_EVENT_CLASS", function() { return AGENDA_NO_EVENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_INDICATOR_CLASS", function() { return APPOINTMENT_INDICATOR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_INDICATOR_CLASS", function() { return EVENT_INDICATOR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_ICON_UP_CLASS", function() { return EVENT_ICON_UP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_ICON_DOWN_CLASS", function() { return EVENT_ICON_DOWN_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_ICON_LEFT_CLASS", function() { return EVENT_ICON_LEFT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_ICON_RIGHT_CLASS", function() { return EVENT_ICON_RIGHT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_ACTION_CLASS", function() { return EVENT_ACTION_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEW_EVENT_CLASS", function() { return NEW_EVENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLONE_ELEMENT_CLASS", function() { return CLONE_ELEMENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_CLONE_ELEMENT_CLASS", function() { return MONTH_CLONE_ELEMENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLONE_TIME_INDICATOR_CLASS", function() { return CLONE_TIME_INDICATOR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DRAG_CLONE_CLASS", function() { return DRAG_CLONE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_RESIZE_CLASS", function() { return EVENT_RESIZE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESIZE_CLONE_CLASS", function() { return RESIZE_CLONE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEFT_RESIZE_HANDLER", function() { return LEFT_RESIZE_HANDLER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RIGHT_RESIZE_HANDLER", function() { return RIGHT_RESIZE_HANDLER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOP_RESIZE_HANDLER", function() { return TOP_RESIZE_HANDLER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BOTTOM_RESIZE_HANDLER", function() { return BOTTOM_RESIZE_HANDLER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_RECURRENCE_ICON_CLASS", function() { return EVENT_RECURRENCE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_RECURRENCE_EDIT_ICON_CLASS", function() { return EVENT_RECURRENCE_EDIT_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HEADER_ROW_CLASS", function() { return HEADER_ROW_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_APPOINTMENT_WRAPPER_CLASS", function() { return ALLDAY_APPOINTMENT_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_APPOINTMENT_CLASS", function() { return ALLDAY_APPOINTMENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_COUNT_CLASS", function() { return EVENT_COUNT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ROW_COUNT_WRAPPER_CLASS", function() { return ROW_COUNT_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_APPOINTMENT_SECTION_CLASS", function() { return ALLDAY_APPOINTMENT_SECTION_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_ROW_EXPAND_CLASS", function() { return APPOINTMENT_ROW_EXPAND_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APPOINTMENT_ROW_COLLAPSE_CLASS", function() { return APPOINTMENT_ROW_COLLAPSE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_INDICATOR_CLASS", function() { return MORE_INDICATOR_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CELL_POPUP_CLASS", function() { return CELL_POPUP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_POPUP_CLASS", function() { return EVENT_POPUP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MULTIPLE_EVENT_POPUP_CLASS", function() { return MULTIPLE_EVENT_POPUP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_HEADER_CLASS", function() { return POPUP_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_HEADER_ICON_WRAPPER", function() { return POPUP_HEADER_ICON_WRAPPER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_CONTENT_CLASS", function() { return POPUP_CONTENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_FOOTER_CLASS", function() { return POPUP_FOOTER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_TIME_DETAILS_CLASS", function() { return DATE_TIME_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RECURRENCE_SUMMARY_CLASS", function() { return RECURRENCE_SUMMARY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_POPUP_EVENT_DETAILS_CLASS", function() { return QUICK_POPUP_EVENT_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_CREATE_CLASS", function() { return EVENT_CREATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDIT_EVENT_CLASS", function() { return EDIT_EVENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE_EVENT_CLASS", function() { return DELETE_EVENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TEXT_ELLIPSIS", function() { return TEXT_ELLIPSIS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_POPUP_WRAPPER_CLASS", function() { return MORE_POPUP_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_POPUP_CLASS", function() { return MORE_EVENT_POPUP_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_HEADER_CLASS", function() { return MORE_EVENT_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_DATE_HEADER_CLASS", function() { return MORE_EVENT_DATE_HEADER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_HEADER_DAY_CLASS", function() { return MORE_EVENT_HEADER_DAY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_HEADER_DATE_CLASS", function() { return MORE_EVENT_HEADER_DATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_CLOSE_CLASS", function() { return MORE_EVENT_CLOSE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_CONTENT_CLASS", function() { return MORE_EVENT_CONTENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MORE_EVENT_WRAPPER_CLASS", function() { return MORE_EVENT_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_CLASS", function() { return QUICK_DIALOG_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_OCCURRENCE_CLASS", function() { return QUICK_DIALOG_OCCURRENCE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_SERIES_CLASS", function() { return QUICK_DIALOG_SERIES_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_FOLLOWING_EVENTS_CLASS", function() { return QUICK_DIALOG_FOLLOWING_EVENTS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FOLLOWING_EVENTS_DIALOG", function() { return FOLLOWING_EVENTS_DIALOG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_DELETE_CLASS", function() { return QUICK_DIALOG_DELETE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_CANCEL_CLASS", function() { return QUICK_DIALOG_CANCEL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_ALERT_OK", function() { return QUICK_DIALOG_ALERT_OK; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_ALERT_CANCEL", function() { return QUICK_DIALOG_ALERT_CANCEL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_ALERT_FOLLOWING", function() { return QUICK_DIALOG_ALERT_FOLLOWING; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QUICK_DIALOG_ALERT_BTN_CLASS", function() { return QUICK_DIALOG_ALERT_BTN_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_DIALOG_CLASS", function() { return EVENT_WINDOW_DIALOG_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORM_CONTAINER_CLASS", function() { return FORM_CONTAINER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FORM_CLASS", function() { return FORM_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS", function() { return EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_ALL_DAY_CLASS", function() { return EVENT_WINDOW_ALL_DAY_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_ZONE_CLASS", function() { return TIME_ZONE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_ZONE_ICON_CLASS", function() { return TIME_ZONE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIME_ZONE_DETAILS_CLASS", function() { return TIME_ZONE_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_REPEAT_DIV_CLASS", function() { return EVENT_WINDOW_REPEAT_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_REPEAT_CLASS", function() { return EVENT_WINDOW_REPEAT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS", function() { return EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBJECT_CLASS", function() { return SUBJECT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_CLASS", function() { return LOCATION_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_ICON_CLASS", function() { return LOCATION_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOCATION_DETAILS_CLASS", function() { return LOCATION_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_START_END_DIV_CLASS", function() { return EVENT_WINDOW_START_END_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_START_CLASS", function() { return EVENT_WINDOW_START_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_END_CLASS", function() { return EVENT_WINDOW_END_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_RESOURCES_DIV_CLASS", function() { return EVENT_WINDOW_RESOURCES_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DESCRIPTION_CLASS", function() { return DESCRIPTION_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DESCRIPTION_ICON_CLASS", function() { return DESCRIPTION_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DESCRIPTION_DETAILS_CLASS", function() { return DESCRIPTION_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_TIME_ZONE_DIV_CLASS", function() { return EVENT_WINDOW_TIME_ZONE_DIV_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_START_TZ_CLASS", function() { return EVENT_WINDOW_START_TZ_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_END_TZ_CLASS", function() { return EVENT_WINDOW_END_TZ_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_BACK_ICON_CLASS", function() { return EVENT_WINDOW_BACK_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_SAVE_ICON_CLASS", function() { return EVENT_WINDOW_SAVE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_CANCEL_BUTTON_CLASS", function() { return EVENT_WINDOW_CANCEL_BUTTON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_SAVE_BUTTON_CLASS", function() { return EVENT_WINDOW_SAVE_BUTTON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_DIALOG_PARENT_CLASS", function() { return EVENT_WINDOW_DIALOG_PARENT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_TITLE_TEXT_CLASS", function() { return EVENT_WINDOW_TITLE_TEXT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_WINDOW_ICON_DISABLE_CLASS", function() { return EVENT_WINDOW_ICON_DISABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDIT_CLASS", function() { return EDIT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDIT_ICON_CLASS", function() { return EDIT_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE_CLASS", function() { return DELETE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DELETE_ICON_CLASS", function() { return DELETE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLOSE_CLASS", function() { return CLOSE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLOSE_ICON_CLASS", function() { return CLOSE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_VALIDATION_CLASS", function() { return ERROR_VALIDATION_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_TOOLTIP_ROOT_CLASS", function() { return EVENT_TOOLTIP_ROOT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ALLDAY_ROW_ANIMATE_CLASS", function() { return ALLDAY_ROW_ANIMATE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TIMESCALE_DISABLE", function() { return TIMESCALE_DISABLE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISABLE_DATE", function() { return DISABLE_DATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HIDDEN_CLASS", function() { return HIDDEN_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISABLE_DATES", function() { return DISABLE_DATES; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_WRAPPER_CLASS", function() { return POPUP_WRAPPER_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "POPUP_TABLE_CLASS", function() { return POPUP_TABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_MENU", function() { return RESOURCE_MENU; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_MENU_ICON", function() { return RESOURCE_MENU_ICON; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_LEVEL_TITLE", function() { return RESOURCE_LEVEL_TITLE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TREE", function() { return RESOURCE_TREE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TREE_POPUP_OVERLAY", function() { return RESOURCE_TREE_POPUP_OVERLAY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_TREE_POPUP", function() { return RESOURCE_TREE_POPUP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_CLASS", function() { return RESOURCE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_ICON_CLASS", function() { return RESOURCE_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESOURCE_DETAILS_CLASS", function() { return RESOURCE_DETAILS_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATE_TIME_ICON_CLASS", function() { return DATE_TIME_ICON_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VIRTUAL_SCROLL_CLASS", function() { return VIRTUAL_SCROLL_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICON_DISABLE_CLASS", function() { return ICON_DISABLE_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTO_HEIGHT", function() { return AUTO_HEIGHT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IGNORE_WHITESPACE", function() { return IGNORE_WHITESPACE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EVENT_TEMPLATE", function() { return EVENT_TEMPLATE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "READ_ONLY", function() { return READ_ONLY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MONTH_HEADER_WRAPPER", function() { return MONTH_HEADER_WRAPPER; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_SUBJECT_CLASS", function() { return INLINE_SUBJECT_CLASS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_APPOINTMENT_CLASS", function() { return INLINE_APPOINTMENT_CLASS; });
/**
 * CSS Constants
 */
/** @hidden */
var ROOT = 'e-schedule';
/** @hidden */
var RTL = 'e-rtl';
/** @hidden */
var DEVICE_CLASS = 'e-device';
/** @hidden */
var ICON = 'e-icons';
/** @hidden */
var ENABLE_CLASS = 'e-enable';
/** @hidden */
var DISABLE_CLASS = 'e-disable';
/** @hidden */
var TABLE_CONTAINER_CLASS = 'e-table-container';
/** @hidden */
var SCHEDULE_TABLE_CLASS = 'e-schedule-table';
/** @hidden */
var ALLDAY_CELLS_CLASS = 'e-all-day-cells';
/** @hidden */
var HEADER_POPUP_CLASS = 'e-header-popup';
/** @hidden */
var HEADER_CALENDAR_CLASS = 'e-header-calendar';
/** @hidden */
var ALLDAY_ROW_CLASS = 'e-all-day-row';
/** @hidden */
var CONTENT_TABLE_CLASS = 'e-content-table';
/** @hidden */
var WORK_CELLS_CLASS = 'e-work-cells';
/** @hidden */
var WORK_HOURS_CLASS = 'e-work-hours';
/** @hidden */
var POPUP_OPEN = 'e-popup-open';
/** @hidden */
var POPUP_CLOSE = 'e-popup-close';
/** @hidden */
var DATE_HEADER_WRAP_CLASS = 'e-date-header-wrap';
/** @hidden */
var DATE_HEADER_CONTAINER_CLASS = 'e-date-header-container';
/** @hidden */
var HEADER_CELLS_CLASS = 'e-header-cells';
/** @hidden */
var WORKDAY_CLASS = 'e-work-days';
/** @hidden */
var OTHERMONTH_CLASS = 'e-other-month';
/** @hidden */
var CURRENT_DAY_CLASS = 'e-current-day';
/** @hidden */
var CURRENTDATE_CLASS = 'e-current-date';
/** @hidden */
var CURRENT_PANEL_CLASS = 'e-current-panel';
/** @hidden */
var PREVIOUS_PANEL_CLASS = 'e-previous-panel';
/** @hidden */
var NEXT_PANEL_CLASS = 'e-next-panel';
/** @hidden */
var PREVIOUS_DATE_CLASS = 'e-prev';
/** @hidden */
var NEXT_DATE_CLASS = 'e-next';
/** @hidden */
var TRANSLATE_CLASS = 'e-translate';
/** @hidden */
var LEFT_INDENT_CLASS = 'e-left-indent';
/** @hidden */
var LEFT_INDENT_WRAP_CLASS = 'e-left-indent-wrap';
/** @hidden */
var EVENT_TABLE_CLASS = 'e-event-table';
/** @hidden */
var RESOURCE_LEFT_TD_CLASS = 'e-resource-left-td';
/** @hidden */
var RESOURCE_GROUP_CELLS_CLASS = 'e-resource-group-cells';
/** @hidden */
var RESOURCE_TEXT_CLASS = 'e-resource-text';
/** @hidden */
var RESOURCE_COLUMN_WRAP_CLASS = 'e-resource-column-wrap';
/** @hidden */
var RESOURCE_COLUMN_TABLE_CLASS = 'e-resource-column-table';
/** @hidden */
var RESOURCE_CHILD_CLASS = 'e-child-node';
/** @hidden */
var RESOURCE_PARENT_CLASS = 'e-parent-node';
/** @hidden */
var RESOURCE_EXPAND_CLASS = 'e-resource-expand';
/** @hidden */
var RESOURCE_COLLAPSE_CLASS = 'e-resource-collapse';
/** @hidden */
var RESOURCE_TREE_ICON_CLASS = 'e-resource-tree-icon';
/** @hidden */
var RESOURCE_CELLS_CLASS = 'e-resource-cells';
/** @hidden */
var TIME_CELLS_WRAP_CLASS = 'e-time-cells-wrap';
/** @hidden */
var TIME_CELLS_CLASS = 'e-time-cells';
/** @hidden */
var TIME_SLOT_CLASS = 'e-time-slots';
/** @hidden */
var ALTERNATE_CELLS_CLASS = 'e-alternate-cells';
/** @hidden */
var CURRENT_TIME_CLASS = 'e-current-time';
/** @hidden */
var CURRENT_TIMELINE_CLASS = 'e-current-timeline';
/** @hidden */
var PREVIOUS_TIMELINE_CLASS = 'e-previous-timeline';
/** @hidden */
var HIDE_CHILDS_CLASS = 'e-hide-childs';
/** @hidden */
var SCROLL_CONTAINER_CLASS = 'e-scroll-container';
/** @hidden */
var WRAPPER_CLASS = 'e-wrapper';
/** @hidden */
var TIMELINE_WRAPPER_CLASS = 'e-timeline-wrapper';
/** @hidden */
var APPOINTMENT_WRAPPER_CLASS = 'e-appointment-wrapper';
/** @hidden */
var DAY_WRAPPER_CLASS = 'e-day-wrapper';
/** @hidden */
var TOOLBAR_CONTAINER = 'e-schedule-toolbar-container';
/** @hidden */
var RESOURCE_TOOLBAR_CONTAINER = 'e-schedule-resource-toolbar-container';
/** @hidden */
var HEADER_TOOLBAR = 'e-schedule-toolbar';
/** @hidden */
var RESOURCE_HEADER_TOOLBAR = 'e-schedule-resource-toolbar';
/** @hidden */
var SELECTED_CELL_CLASS = 'e-selected-cell';
/** @hidden */
var WEEK_NUMBER_WRAPPER_CLASS = 'e-week-number-wrapper';
/** @hidden */
var WEEK_NUMBER_CLASS = 'e-week-number';
/** @hidden */
var APPOINTMENT_WRAP_CLASS = 'e-appointment-wrap';
/** @hidden */
var WRAPPER_CONTAINER_CLASS = 'e-wrapper-container';
/** @hidden */
var APPOINTMENT_CONTAINER_CLASS = 'e-appointment-container';
/** @hidden */
var APPOINTMENT_CLASS = 'e-appointment';
/** @hidden */
var BLOCK_APPOINTMENT_CLASS = 'e-block-appointment';
/** @hidden */
var BLOCK_INDICATOR_CLASS = 'e-block-indicator';
/** @hidden */
var APPOINTMENT_BORDER = 'e-appointment-border';
/** @hidden */
var APPOINTMENT_DETAILS = 'e-appointment-details';
/** @hidden */
var SUBJECT_WRAP = 'e-subject-wrap';
/** @hidden */
var RESOURCE_NAME = 'e-resource-name';
/** @hidden */
var APPOINTMENT_TIME = 'e-time';
/** @hidden */
var TABLE_WRAP_CLASS = 'e-table-wrap';
/** @hidden */
var OUTER_TABLE_CLASS = 'e-outer-table';
/** @hidden */
var CONTENT_WRAP_CLASS = 'e-content-wrap';
/** @hidden */
var VIRTUAL_TRACK_CLASS = 'e-virtual-track';
/** @hidden */
var AGENDA_CELLS_CLASS = 'e-agenda-cells';
/** @hidden */
var AGENDA_CURRENT_DAY_CLASS = 'e-current-day';
/** @hidden */
var AGENDA_SELECTED_CELL = 'e-active-appointment-agenda';
/** @hidden */
var MONTH_HEADER_CLASS = 'e-month-header';
/** @hidden */
var AGENDA_HEADER_CLASS = 'e-day-date-header';
/** @hidden */
var AGENDA_RESOURCE_CLASS = 'e-resource-column';
/** @hidden */
var AGENDA_DATE_CLASS = 'e-date-column';
/** @hidden */
var NAVIGATE_CLASS = 'e-navigate';
/** @hidden */
var DATE_HEADER_CLASS = 'e-date-header';
/** @hidden */
var AGENDA_DAY_BORDER_CLASS = 'e-day-border';
/** @hidden */
var DATE_BORDER_CLASS = 'e-date-border';
/** @hidden */
var AGENDA_DAY_PADDING_CLASS = 'e-day-padding';
/** @hidden */
var DATE_TIME_CLASS = 'e-date-time';
/** @hidden */
var DATE_TIME_WRAPPER_CLASS = 'e-date-time-wrapper';
/** @hidden */
var AGENDA_EMPTY_EVENT_CLASS = 'e-empty-event';
/** @hidden */
var AGENDA_NO_EVENT_CLASS = 'e-no-event';
/** @hidden */
var APPOINTMENT_INDICATOR_CLASS = 'e-appointment-indicator';
/** @hidden */
var EVENT_INDICATOR_CLASS = 'e-indicator';
/** @hidden */
var EVENT_ICON_UP_CLASS = 'e-up-icon';
/** @hidden */
var EVENT_ICON_DOWN_CLASS = 'e-down-icon';
/** @hidden */
var EVENT_ICON_LEFT_CLASS = 'e-left-icon';
/** @hidden */
var EVENT_ICON_RIGHT_CLASS = 'e-right-icon';
/** @hidden */
var EVENT_ACTION_CLASS = 'e-event-action';
/** @hidden */
var NEW_EVENT_CLASS = 'e-new-event';
/** @hidden */
var CLONE_ELEMENT_CLASS = 'e-schedule-event-clone';
/** @hidden */
var MONTH_CLONE_ELEMENT_CLASS = 'e-month-event';
/** @hidden */
var CLONE_TIME_INDICATOR_CLASS = 'e-clone-time-indicator';
/** @hidden */
var DRAG_CLONE_CLASS = 'e-drag-clone';
/** @hidden */
var EVENT_RESIZE_CLASS = 'e-event-resize';
/** @hidden */
var RESIZE_CLONE_CLASS = 'e-resize-clone';
/** @hidden */
var LEFT_RESIZE_HANDLER = 'e-left-handler';
/** @hidden */
var RIGHT_RESIZE_HANDLER = 'e-right-handler';
/** @hidden */
var TOP_RESIZE_HANDLER = 'e-top-handler';
/** @hidden */
var BOTTOM_RESIZE_HANDLER = 'e-bottom-handler';
/** @hidden */
var EVENT_RECURRENCE_ICON_CLASS = 'e-recurrence-icon';
/** @hidden */
var EVENT_RECURRENCE_EDIT_ICON_CLASS = 'e-recurrence-edit-icon';
/** @hidden */
var HEADER_ROW_CLASS = 'e-header-row';
/** @hidden */
var ALLDAY_APPOINTMENT_WRAPPER_CLASS = 'e-all-day-appointment-wrapper';
/** @hidden */
var ALLDAY_APPOINTMENT_CLASS = 'e-all-day-appointment';
/** @hidden */
var EVENT_COUNT_CLASS = 'e-appointment-hide';
/** @hidden */
var ROW_COUNT_WRAPPER_CLASS = 'e-row-count-wrapper';
/** @hidden */
var ALLDAY_APPOINTMENT_SECTION_CLASS = 'e-all-day-appointment-section';
/** @hidden */
var APPOINTMENT_ROW_EXPAND_CLASS = 'e-appointment-expand';
/** @hidden */
var APPOINTMENT_ROW_COLLAPSE_CLASS = 'e-appointment-collapse';
/** @hidden */
var MORE_INDICATOR_CLASS = 'e-more-indicator';
/** @hidden */
var CELL_POPUP_CLASS = 'e-cell-popup';
/** @hidden */
var EVENT_POPUP_CLASS = 'e-event-popup';
/** @hidden */
var MULTIPLE_EVENT_POPUP_CLASS = 'e-multiple-event-popup';
/** @hidden */
var POPUP_HEADER_CLASS = 'e-popup-header';
/** @hidden */
var POPUP_HEADER_ICON_WRAPPER = 'e-header-icon-wrapper';
/** @hidden */
var POPUP_CONTENT_CLASS = 'e-popup-content';
/** @hidden */
var POPUP_FOOTER_CLASS = 'e-popup-footer';
/** @hidden */
var DATE_TIME_DETAILS_CLASS = 'e-date-time-details';
/** @hidden */
var RECURRENCE_SUMMARY_CLASS = 'e-recurrence-summary';
/** @hidden */
var QUICK_POPUP_EVENT_DETAILS_CLASS = 'e-event-details';
/** @hidden */
var EVENT_CREATE_CLASS = 'e-event-create';
/** @hidden */
var EDIT_EVENT_CLASS = 'e-event-edit';
/** @hidden */
var DELETE_EVENT_CLASS = 'e-event-delete';
/** @hidden */
var TEXT_ELLIPSIS = 'e-text-ellipsis';
/** @hidden */
var MORE_POPUP_WRAPPER_CLASS = 'e-more-popup-wrapper';
/** @hidden */
var MORE_EVENT_POPUP_CLASS = 'e-more-event-popup';
/** @hidden */
var MORE_EVENT_HEADER_CLASS = 'e-more-event-header';
/** @hidden */
var MORE_EVENT_DATE_HEADER_CLASS = 'e-more-event-date-header';
/** @hidden */
var MORE_EVENT_HEADER_DAY_CLASS = 'e-header-day';
/** @hidden */
var MORE_EVENT_HEADER_DATE_CLASS = 'e-header-date';
/** @hidden */
var MORE_EVENT_CLOSE_CLASS = 'e-more-event-close';
/** @hidden */
var MORE_EVENT_CONTENT_CLASS = 'e-more-event-content';
/** @hidden */
var MORE_EVENT_WRAPPER_CLASS = 'e-more-appointment-wrapper';
/** @hidden */
var QUICK_DIALOG_CLASS = 'e-quick-dialog';
/** @hidden */
var QUICK_DIALOG_OCCURRENCE_CLASS = 'e-quick-dialog-occurrence-event';
/** @hidden */
var QUICK_DIALOG_SERIES_CLASS = 'e-quick-dialog-series-event';
/** @hidden */
var QUICK_DIALOG_FOLLOWING_EVENTS_CLASS = 'e-quick-dialog-following-events';
/** @hidden */
var FOLLOWING_EVENTS_DIALOG = 'e-following-events-dialog';
/** @hidden */
var QUICK_DIALOG_DELETE_CLASS = 'e-quick-dialog-delete';
/** @hidden */
var QUICK_DIALOG_CANCEL_CLASS = 'e-quick-dialog-cancel';
/** @hidden */
var QUICK_DIALOG_ALERT_OK = 'e-quick-alertok';
/** @hidden */
var QUICK_DIALOG_ALERT_CANCEL = 'e-quick-alertcancel';
/** @hidden */
var QUICK_DIALOG_ALERT_FOLLOWING = 'e-quick-alertfollowing';
/** @hidden */
var QUICK_DIALOG_ALERT_BTN_CLASS = 'e-quick-dialog-alert-btn';
/** @hidden */
var EVENT_WINDOW_DIALOG_CLASS = 'e-schedule-dialog';
/** @hidden */
var FORM_CONTAINER_CLASS = 'e-form-container';
/** @hidden */
var FORM_CLASS = 'e-schedule-form';
/** @hidden */
var EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS = 'e-all-day-time-zone-row';
/** @hidden */
var EVENT_WINDOW_ALL_DAY_CLASS = 'e-all-day';
/** @hidden */
var TIME_ZONE_CLASS = 'e-time-zone';
/** @hidden */
var TIME_ZONE_ICON_CLASS = 'e-time-zone-icon';
/** @hidden */
var TIME_ZONE_DETAILS_CLASS = 'e-time-zone-details';
/** @hidden */
var EVENT_WINDOW_REPEAT_DIV_CLASS = 'e-repeat-parent-row';
/** @hidden */
var EVENT_WINDOW_REPEAT_CLASS = 'e-repeat';
/** @hidden */
var EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS = 'e-title-location-row';
/** @hidden */
var SUBJECT_CLASS = 'e-subject';
/** @hidden */
var LOCATION_CLASS = 'e-location';
/** @hidden */
var LOCATION_ICON_CLASS = 'e-location-icon';
/** @hidden */
var LOCATION_DETAILS_CLASS = 'e-location-details';
/** @hidden */
var EVENT_WINDOW_START_END_DIV_CLASS = 'e-start-end-row';
/** @hidden */
var EVENT_WINDOW_START_CLASS = 'e-start';
/** @hidden */
var EVENT_WINDOW_END_CLASS = 'e-end';
/** @hidden */
var EVENT_WINDOW_RESOURCES_DIV_CLASS = 'e-resources-row';
/** @hidden */
var DESCRIPTION_CLASS = 'e-description';
/** @hidden */
var DESCRIPTION_ICON_CLASS = 'e-description-icon';
/** @hidden */
var DESCRIPTION_DETAILS_CLASS = 'e-description-details';
/** @hidden */
var EVENT_WINDOW_TIME_ZONE_DIV_CLASS = 'e-time-zone-row';
/** @hidden */
var EVENT_WINDOW_START_TZ_CLASS = 'e-start-time-zone';
/** @hidden */
var EVENT_WINDOW_END_TZ_CLASS = 'e-end-time-zone';
/** @hidden */
var EVENT_WINDOW_BACK_ICON_CLASS = 'e-back-icon';
/** @hidden */
var EVENT_WINDOW_SAVE_ICON_CLASS = 'e-save-icon';
/** @hidden */
var EVENT_WINDOW_CANCEL_BUTTON_CLASS = 'e-event-cancel';
/** @hidden */
var EVENT_WINDOW_SAVE_BUTTON_CLASS = 'e-event-save';
/** @hidden */
var EVENT_WINDOW_DIALOG_PARENT_CLASS = 'e-dialog-parent';
/** @hidden */
var EVENT_WINDOW_TITLE_TEXT_CLASS = 'e-title-text';
/** @hidden */
var EVENT_WINDOW_ICON_DISABLE_CLASS = 'e-icon-disable';
/** @hidden */
var EDIT_CLASS = 'e-edit';
/** @hidden */
var EDIT_ICON_CLASS = 'e-edit-icon';
/** @hidden */
var DELETE_CLASS = 'e-delete';
/** @hidden */
var DELETE_ICON_CLASS = 'e-delete-icon';
/** @hidden */
var CLOSE_CLASS = 'e-close';
/** @hidden */
var CLOSE_ICON_CLASS = 'e-close-icon';
/** @hidden */
var ERROR_VALIDATION_CLASS = 'e-schedule-error';
/** @hidden */
var EVENT_TOOLTIP_ROOT_CLASS = 'e-schedule-event-tooltip';
/** @hidden */
var ALLDAY_ROW_ANIMATE_CLASS = 'e-animate';
/** @hidden */
var TIMESCALE_DISABLE = 'e-timescale-disable';
/** @hidden */
var DISABLE_DATE = 'e-disable-date';
/** @hidden */
var HIDDEN_CLASS = 'e-hidden';
/** @hidden */
var DISABLE_DATES = 'e-disable-dates';
/** @hidden */
var POPUP_WRAPPER_CLASS = 'e-quick-popup-wrapper';
/** @hidden */
var POPUP_TABLE_CLASS = 'e-popup-table';
/** @hidden */
var RESOURCE_MENU = 'e-resource-menu';
/** @hidden */
var RESOURCE_MENU_ICON = 'e-icon-menu';
/** @hidden */
var RESOURCE_LEVEL_TITLE = 'e-resource-level-title';
/** @hidden */
var RESOURCE_TREE = 'e-resource-tree';
/** @hidden */
var RESOURCE_TREE_POPUP_OVERLAY = 'e-resource-tree-popup-overlay';
/** @hidden */
var RESOURCE_TREE_POPUP = 'e-resource-tree-popup';
/** @hidden */
var RESOURCE_CLASS = 'e-resource';
/** @hidden */
var RESOURCE_ICON_CLASS = 'e-resource-icon';
/** @hidden */
var RESOURCE_DETAILS_CLASS = 'e-resource-details';
/** @hidden */
var DATE_TIME_ICON_CLASS = 'e-date-time-icon';
/** @hidden */
var VIRTUAL_SCROLL_CLASS = 'e-virtual-scroll';
/** @hidden */
var ICON_DISABLE_CLASS = 'e-icon-disable';
/** @hidden */
var AUTO_HEIGHT = 'e-auto-height';
/** @hidden */
var IGNORE_WHITESPACE = 'e-ignore-whitespace';
/** @hidden */
var EVENT_TEMPLATE = 'e-template';
/** @hidden */
var READ_ONLY = 'e-read-only';
/** @hidden */
var MONTH_HEADER_WRAPPER = 'e-month-header-wrapper';
/** @hidden */
var INLINE_SUBJECT_CLASS = 'e-inline-subject';
/** @hidden */
var INLINE_APPOINTMENT_CLASS = 'e-inline-appointment';


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/resource.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/resource.js ***!
  \******************************************************************************/
/*! exports provided: ResourceBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceBase", function() { return ResourceBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_navigations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ej2-navigations */ "./ej2-resources/18.4.46/scripts/ej2-navigations/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _actions_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../actions/data */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/data.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");








var ResourceBase = /** @__PURE__ @class */ (function () {
    function ResourceBase(parent) {
        this.resourceCollection = [];
        this.leftPixel = 25;
        this.parent = parent;
    }
    ResourceBase.prototype.renderResourceHeaderIndent = function (tr) {
        var resColTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_LEFT_TD_CLASS"] });
        var resColDiv = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TEXT_CLASS"] });
        resColTd.appendChild(resColDiv);
        var args = { elementType: 'emptyCells', element: resColTd };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_6__["renderCell"], args);
        tr.appendChild(resColTd);
    };
    ResourceBase.prototype.hideResourceRows = function (tBody) {
        if (this.resourceCollection.length <= 1 || this.parent.virtualScrollModule) {
            return;
        }
        var trCount = this.lastResourceLevel.length;
        for (var i = 0; i < trCount; i++) {
            var resData = this.lastResourceLevel[i].resourceData;
            var res = this.lastResourceLevel[i].resource;
            if (resData.ClassName === _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"] && !resData[res.expandedField] &&
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resData[res.expandedField])) {
                var trCollection = [].slice.call(tBody.children);
                var slicedCollection = trCollection.slice(i + 1, i + (parseInt(resData.Count, 0) + 1));
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(slicedCollection, _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"]);
            }
        }
    };
    ResourceBase.prototype.createResourceColumn = function () {
        var resColl = this.resourceCollection;
        var resDiv = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"] });
        var tbl = this.parent.activeView.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_TABLE_CLASS"]);
        if (!this.parent.uiStateValues.isGroupAdaptive && this.parent.rowAutoHeight && this.parent.activeView.isTimelineView()
            && this.parent.activeViewOptions.group.resources.length > 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tbl], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AUTO_HEIGHT"]);
        }
        var tBody = tbl.querySelector('tbody');
        var resData = this.generateTreeData(true);
        this.countCalculation(resColl.slice(0, -2), resColl.slice(0, -1));
        this.renderedResources = this.lastResourceLevel;
        if (this.parent.virtualScrollModule) {
            var resourceCount = this.parent.virtualScrollModule.getRenderedCount();
            this.setExpandedResources();
            resData = this.expandedResources.slice(0, resourceCount);
            this.renderedResources = resData;
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getContentRows(resData), tBody);
        this.hideResourceRows(tBody);
        tbl.appendChild(tBody);
        resDiv.appendChild(tbl);
        return resDiv;
    };
    ResourceBase.prototype.setRenderedResources = function () {
        var resColl = this.resourceCollection;
        this.generateTreeData(true);
        this.countCalculation(resColl.slice(0, -2), resColl.slice(0, -1));
        this.renderedResources = this.lastResourceLevel;
    };
    ResourceBase.prototype.setExpandedResources = function () {
        var resources = [];
        for (var i = 0; i < this.lastResourceLevel.length; i++) {
            var resource = this.lastResourceLevel[i].resourceData;
            var count = resource.Count;
            resources.push(this.lastResourceLevel[i]);
            var isExpanded = resource[this.lastResourceLevel[i].resource.expandedField];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(isExpanded) && !isExpanded && count > 0) {
                i = i + count;
            }
        }
        this.expandedResources = resources;
    };
    ResourceBase.prototype.getContentRows = function (resData) {
        var resRows = [];
        var left;
        var rIndex;
        var resColl = this.resourceCollection;
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { attrs: { tabindex: '0' } });
        for (var i = 0; i < resData.length; i++) {
            var ntd = td.cloneNode();
            rIndex = _base_util__WEBPACK_IMPORTED_MODULE_7__["findIndexInData"](resColl, 'name', resData[i].resource.name);
            if (rIndex === resColl.length - 1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(resData[i].resourceData, { ClassName: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_CHILD_CLASS"] });
                this.renderedResources[i].className = [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_CHILD_CLASS"]];
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(resData[i].resourceData, { ClassName: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"] });
                this.renderedResources[i].className = [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"]];
            }
            left = (rIndex * this.leftPixel) + 'px';
            if (resData[i].resourceData.ClassName === _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"]
                && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resData[i].resourceData.Count) && (resData[i].resourceData.Count > 0)) {
                var iconClass = void 0;
                if (resData[i].resourceData[resColl[rIndex].expandedField] ||
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resData[i].resourceData[resColl[rIndex].expandedField])) {
                    iconClass = _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"];
                }
                else {
                    iconClass = _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"];
                }
                var iconDiv = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([iconDiv], [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_ICON_CLASS"], iconClass]);
                this.setMargin(iconDiv, left);
                ntd.appendChild(iconDiv);
                if (this.resourceCollection.length > 1) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(iconDiv, 'click', this.onTreeIconClick, this);
                }
            }
            this.parent.activeView.setResourceHeaderContent(ntd, resData[i], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TEXT_CLASS"]);
            ntd.setAttribute('data-group-index', resData[i].groupIndex.toString());
            ntd.setAttribute('aria-label', resData[i].resourceData[resData[i].resource.textField] + ' resource');
            if (!this.parent.activeViewOptions.resourceHeaderTemplate) {
                this.setMargin(ntd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TEXT_CLASS"]), left);
            }
            var classCollection = [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_CELLS_CLASS"], resData[i].resourceData.ClassName];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], classCollection);
            var args = { elementType: 'resourceHeader', element: ntd, groupIndex: resData[i].groupIndex };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_6__["renderCell"], args);
            var ntr = tr.cloneNode();
            ntr.appendChild(ntd);
            resRows.push(ntr);
        }
        return resRows;
    };
    ResourceBase.prototype.setMargin = function (element, value) {
        if (!this.parent.enableRtl) {
            element.style.marginLeft = value;
        }
        else {
            element.style.marginRight = value;
        }
    };
    ResourceBase.prototype.countCalculation = function (parentCollection, wholeCollection) {
        var collection;
        for (var y = 0; y < parentCollection.length; y++) {
            var data = parentCollection[parentCollection.length - (y + 1)]
                .dataSource;
            for (var x = 0; x < data.length; x++) {
                var totalCount = 0;
                if (this.parent.activeViewOptions.group.byGroupID) {
                    collection = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](wholeCollection[wholeCollection.length - 1].dataSource)
                        .executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(wholeCollection[wholeCollection.length - 1].groupIDField, 'equal', data[x][parentCollection[parentCollection.length - (y + 1)].idField]));
                }
                else {
                    collection = wholeCollection[wholeCollection.length - 1].dataSource;
                }
                for (var z = 0; z < collection.length; z++) {
                    totalCount = totalCount + parseInt(collection[z].Count, 0);
                }
                totalCount = totalCount + parseInt(data[x].Count, 0);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(data[x], { Count: totalCount });
            }
            wholeCollection = wholeCollection.slice(0, -1);
        }
    };
    ResourceBase.prototype.onTreeIconClick = function (e) {
        var _this = this;
        if (this.parent.eventTooltip) {
            this.parent.eventTooltip.close();
        }
        var target = e.target;
        var hide;
        var trElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"])
            .parentElement;
        var index = parseInt(trElement.children[0].getAttribute('data-group-index'), 10);
        var args = {
            cancel: false, event: e, groupIndex: index,
            requestType: !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]) ? 'resourceExpand' : 'resourceCollapse',
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_6__["actionBegin"], args, function (actionArgs) {
            if (!actionArgs.cancel) {
                if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"])) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(target, [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"]], [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]]);
                    hide = true;
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(target, [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]], [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"]]);
                    hide = false;
                }
                var eventElements = [].slice.call(_this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_CLASS"]));
                for (var _i = 0, eventElements_1 = eventElements; _i < eventElements_1.length; _i++) {
                    var element = eventElements_1[_i];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(element);
                }
                if (_this.parent.virtualScrollModule) {
                    _this.updateVirtualContent(index, hide, e, target);
                }
                else {
                    _this.updateContent(index, hide);
                }
                var data = { cssProperties: _this.parent.getCssProperties(), module: 'scroll' };
                _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_6__["scrollUiUpdate"], data);
                args = {
                    cancel: false, event: e, groupIndex: index,
                    requestType: target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]) ? 'resourceExpanded' : 'resourceCollapsed',
                };
                _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_6__["dataReady"], {});
                _this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_6__["actionComplete"], args);
            }
        });
    };
    ResourceBase.prototype.updateContent = function (index, hide) {
        var rowCollection = [];
        var workCellCollection = [];
        var headerRowCollection = [];
        var pNode;
        var clickedRes = this.lastResourceLevel[index].resourceData;
        var resRows = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"] + ' ' + 'tr'));
        var contentRows = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] + ' ' + 'tbody tr'));
        var eventRows = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] + ' .' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_CONTAINER_CLASS"]));
        for (var j = 0; j < clickedRes.Count; j++) {
            rowCollection.push(resRows[index + j + 1]);
            workCellCollection.push(contentRows[index + j + 1]);
            headerRowCollection.push(eventRows[index + j + 1]);
        }
        var clonedCollection = this.lastResourceLevel;
        for (var i = 0; i < rowCollection.length; i++) {
            var expanded = true;
            pNode = rowCollection[i].children[0].classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"]);
            clonedCollection[index].resourceData[clonedCollection[index].resource.expandedField] = !hide;
            if (hide) {
                if (pNode) {
                    var trElem = rowCollection[i].querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_ICON_CLASS"]);
                    if (trElem) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(trElem, [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"]], [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]]);
                    }
                }
                if (!rowCollection[i].classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"])) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([rowCollection[i], workCellCollection[i], headerRowCollection[i]], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"]);
                }
            }
            else {
                if (pNode) {
                    var rowIndex = rowCollection[i].rowIndex;
                    if (!clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField]
                        && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(clonedCollection[rowIndex].resourceData[clonedCollection[rowIndex].resource.expandedField])) {
                        rowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 0)));
                        workCellCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 0)));
                        headerRowCollection.splice(i + 1, (parseInt(clonedCollection[rowIndex].resourceData.Count, 0)));
                        expanded = false;
                    }
                    if (expanded) {
                        var trElem = rowCollection[i].querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_ICON_CLASS"]);
                        if (trElem) {
                            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(trElem, [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]], [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"]]);
                        }
                    }
                }
                if (rowCollection[i].classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"])) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([rowCollection[i], workCellCollection[i], headerRowCollection[i]], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"]);
                }
            }
        }
    };
    ResourceBase.prototype.updateVirtualContent = function (index, expand, e, target) {
        this.lastResourceLevel[index].resourceData[this.lastResourceLevel[index].resource.expandedField] = !expand;
        this.setExpandedResources();
        var resourceCount = this.parent.virtualScrollModule.getRenderedCount();
        var startIndex = this.expandedResources.indexOf(this.renderedResources[0]);
        this.renderedResources = this.expandedResources.slice(startIndex, startIndex + resourceCount);
        if (this.renderedResources.length < resourceCount) {
            var sIndex = this.expandedResources.length - resourceCount;
            sIndex = (sIndex > 0) ? sIndex : 0;
            this.renderedResources = this.expandedResources.slice(sIndex, this.expandedResources.length);
        }
        var virtualTrack = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["VIRTUAL_TRACK_CLASS"]);
        this.parent.virtualScrollModule.updateVirtualTrackHeight(virtualTrack);
        var resTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"] + ' ' + 'table');
        var contentTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] + ' ' + 'table');
        var eventTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["EVENT_TABLE_CLASS"]);
        this.parent.virtualScrollModule.updateContent(resTable, contentTable, eventTable, this.renderedResources);
        var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_TIMELINE_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(timeIndicator)) {
            timeIndicator.style.height =
                this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]).offsetHeight + 'px';
        }
    };
    ResourceBase.prototype.renderResourceHeader = function () {
        var resourceWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TOOLBAR_CONTAINER"] });
        resourceWrapper.innerHTML = '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_HEADER_TOOLBAR"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_MENU"] + '">' +
            '<div class="e-icons ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_MENU_ICON"] + '"></div></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_LEVEL_TITLE"] + '"></div></div>';
        if (this.parent.currentView === 'MonthAgenda') {
            var target = this.parent.activeView.getPanel().querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
            target.insertBefore(resourceWrapper, target.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WRAPPER_CONTAINER_CLASS"]));
        }
        else {
            this.parent.element.insertBefore(resourceWrapper, this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"]));
        }
        this.renderResourceHeaderText();
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(resourceWrapper.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_MENU_ICON"]), 'click', this.menuClick, this);
    };
    ResourceBase.prototype.renderResourceTree = function () {
        this.popupOverlay = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP_OVERLAY"] });
        var treeWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP"] + ' e-popup-close' });
        if (this.parent.currentView === 'MonthAgenda') {
            var target = this.parent.activeView.getPanel().querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WRAPPER_CONTAINER_CLASS"]);
            target.insertBefore(treeWrapper, target.children[0]);
            target.appendChild(this.popupOverlay);
        }
        else {
            this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"]).appendChild(treeWrapper);
            this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"]).appendChild(this.popupOverlay);
        }
        var resourceTree = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE"] });
        treeWrapper.appendChild(resourceTree);
        this.treeViewObj = new _ej2_navigations__WEBPACK_IMPORTED_MODULE_2__["TreeView"]({
            cssClass: this.parent.cssClass,
            enableRtl: this.parent.enableRtl,
            fields: {
                dataSource: [].slice.call(this.generateTreeData()),
                id: 'resourceId',
                text: 'resourceName',
                child: 'resourceChild'
            },
            nodeTemplate: this.parent.resourceHeaderTemplate,
            nodeClicked: this.resourceClick.bind(this)
        });
        this.treeViewObj.appendTo(resourceTree);
        this.treeViewObj.expandAll();
        this.treePopup = new _ej2_popups__WEBPACK_IMPORTED_MODULE_3__["Popup"](treeWrapper, {
            targetType: 'relative',
            actionOnScroll: 'none',
            content: this.treeViewObj.element,
            enableRtl: this.parent.enableRtl,
            hideAnimation: { name: 'SlideLeftOut', duration: 500 },
            showAnimation: { name: 'SlideLeftIn', duration: 500 },
            viewPortElement: this.parent.element.querySelector('.' + (this.parent.currentView === 'MonthAgenda' ?
                _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WRAPPER_CONTAINER_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"]))
        });
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_6__["documentClick"], this.documentClick, this);
    };
    ResourceBase.prototype.generateTreeData = function (isTimeLine) {
        var _this = this;
        var treeCollection = [];
        var resTreeColl = [];
        var groupIndex = 0;
        var _loop_1 = function (i, len) {
            var treeHandler = function (treeLevel, index, levelId) {
                var resource = _this.resourceCollection[index];
                var treeArgs;
                var resObj;
                if (!isTimeLine) {
                    treeArgs = {
                        resourceId: levelId,
                        resourceName: treeLevel.resourceData[resource.textField],
                        resource: treeLevel.resource,
                        resourceData: treeLevel.resourceData
                    };
                }
                else {
                    resObj = {
                        type: 'resourceHeader', resource: treeLevel.resource,
                        resourceData: treeLevel.resourceData, groupIndex: groupIndex,
                        groupOrder: treeLevel.groupOrder
                    };
                    resTreeColl.push(resObj);
                    groupIndex++;
                }
                if (treeLevel.child.length > 0 && !isTimeLine) {
                    treeArgs.resourceChild = [];
                }
                var count = 1;
                for (var _i = 0, _a = treeLevel.child; _i < _a.length; _i++) {
                    var tree = _a[_i];
                    if (!isTimeLine) {
                        treeArgs.resourceChild.push(treeHandler(tree, index + 1, levelId + '-' + count));
                    }
                    else {
                        treeHandler(tree, index + 1, levelId + '-' + count);
                    }
                    count += 1;
                }
                if (isTimeLine) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(resObj.resourceData, { Count: count - 1 });
                }
                return treeArgs;
            };
            if (!isTimeLine) {
                treeCollection.push(treeHandler(this_1.resourceTreeLevel[i], 0, (i + 1).toString()));
            }
            else {
                treeHandler(this_1.resourceTreeLevel[i], 0, (i + 1).toString());
            }
        };
        var this_1 = this;
        for (var i = 0, len = this.resourceTreeLevel.length; i < len; i++) {
            _loop_1(i, len);
        }
        if (isTimeLine) {
            this.lastResourceLevel = resTreeColl;
            return resTreeColl;
        }
        else {
            return treeCollection;
        }
    };
    ResourceBase.prototype.renderResourceHeaderText = function () {
        var resource = this.lastResourceLevel[this.parent.uiStateValues.groupIndex];
        var headerCollection = [];
        var _loop_2 = function (i, len) {
            var resourceLevel = this_2.resourceCollection[i];
            var resourceText = resourceLevel.dataSource.filter(function (resData) {
                return resData[resourceLevel.idField] === resource.groupOrder[i];
            });
            var resourceName = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_NAME"],
                innerHTML: resourceText[0][resourceLevel.textField]
            });
            headerCollection.push(resourceName);
            var levelIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-icons e-icon-next' });
            headerCollection.push(levelIcon);
        };
        var this_2 = this;
        for (var i = 0, len = resource.groupOrder.length; i < len; i++) {
            _loop_2(i, len);
        }
        headerCollection.pop();
        var target = (this.parent.currentView === 'MonthAgenda') ? this.parent.activeView.getPanel() : this.parent.element;
        var headerWrapper = target.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_LEVEL_TITLE"]);
        _base_util__WEBPACK_IMPORTED_MODULE_7__["removeChildren"](headerWrapper);
        for (var _i = 0, headerCollection_1 = headerCollection; _i < headerCollection_1.length; _i++) {
            var header = headerCollection_1[_i];
            headerWrapper.appendChild(header);
        }
        if (this.lastResourceLevel.length === 1) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_MENU"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DISABLE_CLASS"]);
        }
    };
    ResourceBase.prototype.menuClick = function (event) {
        if (this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP"]).classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["POPUP_OPEN"])) {
            this.treePopup.hide();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.popupOverlay], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["ENABLE_CLASS"]);
        }
        else {
            var treeNodes = [].slice.call(this.treeViewObj.element.querySelectorAll('.e-list-item:not(.e-has-child)'));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(treeNodes, 'e-active');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([treeNodes[this.parent.uiStateValues.groupIndex]], 'e-active');
            this.treePopup.show();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.popupOverlay], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["ENABLE_CLASS"]);
        }
    };
    ResourceBase.prototype.resourceClick = function (event) {
        var _this = this;
        if (!event.node.classList.contains('e-has-child')) {
            this.treePopup.hide();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.popupOverlay], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["ENABLE_CLASS"]);
            var treeNodes = [].slice.call(this.treeViewObj.element.querySelectorAll('.e-list-item:not(.e-has-child)'));
            this.parent.uiStateValues.groupIndex = treeNodes.indexOf(event.node);
            if (this.parent.isServerRenderer()) {
                // tslint:disable-next-line:no-any
                this.parent.interopAdaptor.invokeMethodAsync('OnResourceClick', this.parent.uiStateValues.groupIndex).then(function () {
                    if (_this.parent.isDestroyed) {
                        return;
                    }
                    _this.renderResourceHeaderText();
                    _this.parent.activeView.serverRenderLayout();
                    var processed = _this.parent.eventBase.processData(_this.parent.eventsData);
                    _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_6__["dataReady"], { processedData: processed });
                }).catch(function (e) { return _this.parent.renderModule.dataManagerFailure(e); });
            }
            else {
                this.parent.renderModule.render(this.parent.currentView, false);
                var processed = this.parent.eventBase.processData(this.parent.blockData.concat(this.parent.eventsData));
                this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_6__["dataReady"], { processedData: processed });
            }
        }
        event.event.preventDefault();
    };
    ResourceBase.prototype.documentClick = function (args) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(args.event.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP"])) {
            return;
        }
        var treeWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP"]);
        if (treeWrapper && treeWrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["POPUP_OPEN"])) {
            this.treePopup.hide();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.popupOverlay], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["ENABLE_CLASS"]);
        }
    };
    ResourceBase.prototype.bindResourcesData = function (isSetModel) {
        var _this = this;
        this.parent.showSpinner();
        var promises = [];
        for (var i = 0; i < this.parent.resources.length; i++) {
            var dataModule = new _actions_data__WEBPACK_IMPORTED_MODULE_4__["Data"](this.parent.resources[i].dataSource, this.parent.resources[i].query);
            promises.push(dataModule.getData(dataModule.generateQuery()));
        }
        Promise.all(promises).then(function (e) { return _this.dataManagerSuccess(e, isSetModel); })
            .catch(function (e) { return _this.parent.renderModule.dataManagerFailure(e); });
    };
    ResourceBase.prototype.dataManagerSuccess = function (e, isSetModel) {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.resourceCollection = [];
        for (var i = 0, length_1 = e.length; i < length_1; i++) {
            var resource = this.parent.resources[i];
            var resourceObj = this.getResourceModel(resource, e[i].result);
            this.parent.resourceCollection.push(resourceObj);
        }
        this.refreshLayout(isSetModel);
    };
    ResourceBase.prototype.getResourceModel = function (resource, resourceData) {
        var resourceObj = {
            field: resource.field,
            title: resource.title,
            name: resource.name,
            allowMultiple: resource.allowMultiple,
            dataSource: resourceData || resource.dataSource,
            idField: resource.idField,
            textField: resource.textField,
            groupIDField: resource.groupIDField,
            colorField: resource.colorField,
            startHourField: resource.startHourField,
            endHourField: resource.endHourField,
            workDaysField: resource.workDaysField,
            expandedField: resource.expandedField,
            cssClassField: resource.cssClassField
        };
        return resourceObj;
    };
    ResourceBase.prototype.refreshLayout = function (isSetModel) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.uiStateValues.groupIndex) || !(this.parent.enablePersistence)) {
            this.parent.uiStateValues.groupIndex = 0;
        }
        this.parent.renderElements(isSetModel);
    };
    ResourceBase.prototype.setResourceCollection = function () {
        var requiredResources = [];
        this.resourceCollection = [];
        this.colorIndex = null;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            for (var _i = 0, _a = this.parent.activeViewOptions.group.resources; _i < _a.length; _i++) {
                var resource = _a[_i];
                var index_1 = _base_util__WEBPACK_IMPORTED_MODULE_7__["findIndexInData"](this.parent.resourceCollection, 'name', resource);
                if (index_1 >= 0) {
                    requiredResources.push(this.parent.resourceCollection[index_1]);
                }
            }
        }
        else if (this.parent.resourceCollection.length > 0) {
            requiredResources = this.parent.resourceCollection;
        }
        var index = 0;
        for (var _b = 0, requiredResources_1 = requiredResources; _b < requiredResources_1.length; _b++) {
            var resource = requiredResources_1[_b];
            var resources = this.getResourceModel(resource);
            if (resource.name === this.parent.eventSettings.resourceColorField) {
                this.colorIndex = index;
            }
            index++;
            this.resourceCollection.push(resources);
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.colorIndex)) {
            this.colorIndex = this.resourceCollection.length - 1;
        }
    };
    ResourceBase.prototype.generateResourceLevels = function (innerDates, isTimeLine) {
        var _this = this;
        var resources = this.resourceCollection;
        var resTreeGroup = [];
        var lastColumnDates = [];
        var group = function (resources, index, prevResource, prevResourceData, prevOrder) {
            var resTree = [];
            var resource = resources[0];
            if (resource) {
                var data = void 0;
                if (prevResourceData && _this.parent.activeViewOptions.group.byGroupID) {
                    var id_1 = prevResourceData[prevResource.idField];
                    data = resource.dataSource.filter(function (e) { return e[resource.groupIDField] === id_1; });
                }
                else {
                    data = resource.dataSource;
                }
                for (var i = 0; i < data.length; i++) {
                    var groupOrder = [];
                    if (prevOrder && prevOrder.length > 0) {
                        groupOrder = groupOrder.concat(prevOrder);
                    }
                    groupOrder.push(data[i][resource.idField]);
                    var items = group(resources.slice(1), index + 1, resource, data[i], groupOrder);
                    // Here validate child item empty top level resource only
                    if (index === 0 && items.length === 0 && _this.resourceCollection.length > 1) {
                        continue;
                    }
                    var dateCol = [];
                    var renderDates = _this.parent.activeView.renderDates;
                    var resWorkDays = void 0;
                    if (!_this.parent.activeViewOptions.group.byDate && index + 1 === _this.resourceCollection.length) {
                        var workDays = data[i][resource.workDaysField];
                        var resStartHour = data[i][resource.startHourField];
                        var resEndHour = data[i][resource.endHourField];
                        if (workDays && workDays.length > 0) {
                            renderDates = _this.parent.activeView.getRenderDates(workDays);
                            resWorkDays = workDays;
                            dateCol = _this.parent.activeView.getDateSlots(renderDates, workDays);
                        }
                        else {
                            resWorkDays = _this.parent.activeViewOptions.workDays;
                            dateCol = innerDates;
                        }
                        var dateSlots = _this.generateCustomHours(dateCol, resStartHour, resEndHour, groupOrder);
                        lastColumnDates = lastColumnDates.concat(dateSlots);
                    }
                    var resCssClass = data[i][resource.cssClassField];
                    var slotData = {
                        type: 'resourceHeader', className: ['e-resource-cells'],
                        resourceLevelIndex: index, groupOrder: groupOrder,
                        resource: resource, resourceData: data[i],
                        colSpan: _this.parent.activeViewOptions.group.byDate ? 1 : dateCol.length,
                        renderDates: renderDates, workDays: resWorkDays, cssClass: resCssClass,
                        child: items
                    };
                    resTree.push(slotData);
                }
                if (!resTreeGroup[index]) {
                    resTreeGroup[index] = [];
                }
                if (resTree.length > 0) {
                    resTreeGroup[index].push(resTree);
                }
                return resTree;
            }
            return [];
        };
        this.resourceTreeLevel = group(resources, 0);
        return (isTimeLine) ? [] : this.generateHeaderLevels(resTreeGroup, lastColumnDates, innerDates);
    };
    ResourceBase.prototype.generateCustomHours = function (renderDates, startHour, endHour, groupOrder) {
        var dateSlots = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], renderDates, null, true);
        for (var _i = 0, dateSlots_1 = dateSlots; _i < dateSlots_1.length; _i++) {
            var dateSlot = dateSlots_1[_i];
            if (startHour) {
                dateSlot.startHour = this.parent.getStartEndTime(startHour);
            }
            if (endHour) {
                dateSlot.endHour = this.parent.getStartEndTime(endHour);
            }
            if (groupOrder) {
                dateSlot.groupOrder = groupOrder;
            }
        }
        return dateSlots;
    };
    ResourceBase.prototype.generateHeaderLevels = function (resTreeGroup, lastColumnDates, headerDates) {
        var headerLevels = [];
        for (var i = resTreeGroup.length - 1; i >= 0; i--) {
            var temp = 0;
            for (var _i = 0, _a = resTreeGroup[i]; _i < _a.length; _i++) {
                var currentLevelChilds = _a[_i];
                for (var _b = 0, currentLevelChilds_1 = currentLevelChilds; _b < currentLevelChilds_1.length; _b++) {
                    var currentLevelChild = currentLevelChilds_1[_b];
                    if (resTreeGroup[i + 1]) {
                        var nextLevelChilds = resTreeGroup[i + 1][temp];
                        var colSpan = 0;
                        for (var _c = 0, nextLevelChilds_1 = nextLevelChilds; _c < nextLevelChilds_1.length; _c++) {
                            var nextLevelChild = nextLevelChilds_1[_c];
                            if (!this.parent.activeViewOptions.group.byGroupID || (this.parent.activeViewOptions.group.byGroupID &&
                                nextLevelChild.resourceData[nextLevelChild.resource.groupIDField] ===
                                    currentLevelChild.resourceData[currentLevelChild.resource.idField])) {
                                colSpan += nextLevelChild.colSpan;
                            }
                        }
                        currentLevelChild.colSpan = colSpan;
                    }
                    currentLevelChild.groupIndex = temp;
                    temp++;
                    headerLevels[currentLevelChild.resourceLevelIndex] = headerLevels[currentLevelChild.resourceLevelIndex] || [];
                    headerLevels[currentLevelChild.resourceLevelIndex].push(currentLevelChild);
                }
            }
        }
        this.lastResourceLevel = headerLevels.slice(-1)[0] || [];
        if (!this.parent.activeViewOptions.group.byDate) {
            var index = 0;
            for (var _d = 0, _e = this.lastResourceLevel; _d < _e.length; _d++) {
                var lastLevelResource = _e[_d];
                for (var i = 0; i < lastLevelResource.colSpan; i++) {
                    lastColumnDates[index].groupIndex = lastLevelResource.groupIndex;
                    index++;
                }
            }
            headerLevels.push(lastColumnDates);
            return headerLevels;
        }
        var dateHeaderLevels = [];
        var levels = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], headerLevels, null, true);
        var dateColSpan = 0;
        for (var _f = 0, _g = levels[0]; _f < _g.length; _f++) {
            var firstRowTd = _g[_f];
            dateColSpan += firstRowTd.colSpan;
        }
        var datesColumn = [];
        for (var _h = 0, headerDates_1 = headerDates; _h < headerDates_1.length; _h++) {
            var headerDate = headerDates_1[_h];
            headerDate.colSpan = dateColSpan;
            datesColumn.push(headerDate);
            var resGroup = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], levels, null, true);
            for (var k = 0, length_2 = resGroup.length; k < length_2; k++) {
                if (k === resGroup.length - 1) {
                    for (var _j = 0, _k = resGroup[k]; _j < _k.length; _j++) {
                        var resTd = _k[_j];
                        resTd.date = headerDate.date;
                        resTd.workDays = headerDate.workDays;
                        resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||
                            headerDate.startHour;
                        resTd.endHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.endHourField]) ||
                            headerDate.endHour;
                    }
                }
                if (!dateHeaderLevels[k]) {
                    dateHeaderLevels[k] = [];
                }
                dateHeaderLevels[k] = dateHeaderLevels[k].concat(resGroup[k]);
            }
        }
        dateHeaderLevels.unshift(datesColumn);
        return dateHeaderLevels;
    };
    ResourceBase.prototype.setResourceValues = function (eventObj, groupIndex) {
        var _this = this;
        var setValues = function (index, field, value) {
            if (_this.resourceCollection[index].allowMultiple && _this.parent.activeViewOptions.group.allowGroupEdit) {
                eventObj[field] = [value];
            }
            else {
                eventObj[field] = value;
            }
        };
        if (groupIndex === void 0) {
            groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex :
                this.parent.activeCellsData.groupIndex;
        }
        if (this.parent.activeViewOptions.group.resources.length > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
            var groupOrder = this.lastResourceLevel[groupIndex].groupOrder;
            for (var index = 0; index < this.resourceCollection.length; index++) {
                setValues(index, this.resourceCollection[index].field, groupOrder[index]);
            }
        }
        else if (this.parent.resourceCollection.length > 0) {
            for (var index = 0; index < this.resourceCollection.length; index++) {
                var data = this.resourceCollection[index].dataSource[0];
                if (data) {
                    setValues(index, this.resourceCollection[index].field, data[this.resourceCollection[index].idField]);
                }
            }
        }
    };
    ResourceBase.prototype.getResourceColor = function (eventObj, groupOrder) {
        var colorFieldIndex = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupOrder) &&
            this.colorIndex > groupOrder.length - 1) ? groupOrder.length - 1 : this.colorIndex;
        var resource = this.resourceCollection[colorFieldIndex];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupOrder) && this.parent.activeViewOptions.group.allowGroupEdit && resource.allowMultiple) {
            return undefined;
        }
        var id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupOrder) ? eventObj[resource.field] : groupOrder[colorFieldIndex];
        var data = this.filterData(resource.dataSource, resource.idField, id);
        if (data.length > 0) {
            return data[0][resource.colorField];
        }
        return undefined;
    };
    ResourceBase.prototype.getCssClass = function (eventObj) {
        var resource = this.resourceCollection.slice(-1)[0];
        if (this.parent.activeViewOptions.group.allowGroupEdit && resource.allowMultiple) {
            return undefined;
        }
        var data = this.filterData(resource.dataSource, resource.idField, eventObj[resource.field]);
        if (data.length > 0) {
            return data[0][resource.cssClassField];
        }
        return undefined;
    };
    ResourceBase.prototype.getResourceRenderDates = function () {
        var resourceDates = [].concat.apply([], this.lastResourceLevel.map(function (e) { return e.renderDates; }));
        var removeDuplicateDates = function (dateColl) { return dateColl.filter(function (date, index, dates) {
            return dates.map(function (dateObj) { return dateObj.getTime(); }).indexOf(date.getTime()) === index;
        }); };
        var renderDates = removeDuplicateDates(resourceDates);
        renderDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
        return renderDates;
    };
    ResourceBase.prototype.filterData = function (dataSource, field, value) {
        return dataSource.filter(function (data) { return data[field] === value; });
    };
    ResourceBase.prototype.getResourceData = function (eventObj, index, groupEditIndex) {
        if (this.parent.activeViewOptions.group.allowGroupEdit) {
            var resourceObj = {};
            for (var _i = 0, groupEditIndex_1 = groupEditIndex; _i < groupEditIndex_1.length; _i++) {
                var groupIndex = groupEditIndex_1[_i];
                var resourceLevel = this.lastResourceLevel[groupIndex].groupOrder;
                for (var level = 0, length_3 = resourceLevel.length; level < length_3; level++) {
                    var fieldName = this.resourceCollection[level].field;
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceObj[fieldName])) {
                        resourceObj[fieldName] = [];
                    }
                    resourceObj[fieldName].push(resourceLevel[level]);
                }
            }
            eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(eventObj, resourceObj);
        }
        else {
            for (var level = 0, length_4 = this.resourceCollection.length; level < length_4; level++) {
                eventObj[this.resourceCollection[level].field] = this.lastResourceLevel[index].groupOrder[level];
            }
        }
    };
    ResourceBase.prototype.addResource = function (resources, name, index) {
        var resourceCollection = (resources instanceof Array) ? resources : [resources];
        var _loop_3 = function (resource) {
            if (resource.name === name) {
                resourceCollection.forEach(function (addObj, i) {
                    return new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]({ json: resource.dataSource }).insert(addObj, null, null, index + i);
                });
                return "break";
            }
        };
        for (var _i = 0, _a = this.parent.resourceCollection; _i < _a.length; _i++) {
            var resource = _a[_i];
            var state_1 = _loop_3(resource);
            if (state_1 === "break")
                break;
        }
        this.refreshLayout(true);
    };
    ResourceBase.prototype.removeResource = function (resourceId, name) {
        var resourceCollection = (resourceId instanceof Array) ? resourceId : [resourceId];
        var _loop_4 = function (resource) {
            if (resource.name === name) {
                resourceCollection.forEach(function (removeObj) {
                    return new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]({ json: resource.dataSource }).remove(resource.idField, removeObj);
                });
                return "break";
            }
        };
        for (var _i = 0, _a = this.parent.resourceCollection; _i < _a.length; _i++) {
            var resource = _a[_i];
            var state_2 = _loop_4(resource);
            if (state_2 === "break")
                break;
        }
        this.refreshLayout(true);
    };
    ResourceBase.prototype.getIndexFromResourceId = function (id, name, resourceData, event, parentField) {
        var resource = resourceData.dataSource.filter(function (e) {
            if (event && e[resourceData.idField] === id) {
                if (e[resourceData.groupIDField] === event[parentField]) {
                    return e[resourceData.idField] === id;
                }
                return null;
            }
            else {
                return e[resourceData.idField] === id;
            }
        })[0];
        return (this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resource));
    };
    ResourceBase.prototype.resourceExpand = function (id, name, hide) {
        var resource = this.parent.resourceCollection.filter(function (e) {
            if (e.name === name) {
                return e;
            }
            return null;
        })[0];
        var index = 0;
        var resourceData = resource.dataSource.filter(function (e) {
            return e[resource.idField] === id;
        })[0];
        if (!this.parent.activeViewOptions.group.byGroupID) {
            index = this.getIndexFromResourceId(id, name, resource);
        }
        else {
            index = this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resourceData);
        }
        var target = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"] + ' ' + ("[data-group-index=\"" + index + "\"]") +
            ' ' + '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_ICON_CLASS"]);
        if (target) {
            if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_EXPAND_CLASS"]) && !hide) {
                target.click();
            }
            else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLLAPSE_CLASS"]) && hide) {
                target.click();
            }
        }
    };
    ResourceBase.prototype.resourceScroll = function (id, name) {
        if (this.parent.isAdaptive || ['Agenda', 'MonthAgenda'].indexOf(this.parent.currentView) > -1) {
            return;
        }
        var levelName = name || this.parent.resourceCollection.slice(-1)[0].name;
        var levelIndex = this.parent.resourceCollection.length - 1;
        var resource = this.parent.resourceCollection.filter(function (e, index) {
            if (e.name === levelName) {
                levelIndex = index;
                return e;
            }
            return null;
        })[0];
        var scrollElement = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        var index = 0;
        if (this.parent.activeView.isTimelineView()) {
            if (!this.parent.activeViewOptions.group.byGroupID) {
                index = this.getIndexFromResourceId(id, levelName, resource);
            }
            else {
                var resourceData = resource.dataSource.filter(function (e) {
                    return e[resource.idField] === id;
                })[0];
                index = this.lastResourceLevel.map(function (e) { return e.resourceData; }).indexOf(resourceData);
            }
            if (this.parent.virtualScrollModule) {
                var virtual = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["VIRTUAL_TRACK_CLASS"]);
                var averageRowHeight = Math.round(virtual.offsetHeight / this.expandedResources.length);
                if (this.parent.rowAutoHeight) {
                    scrollElement.scrollTop = 0;
                    this.parent.virtualScrollModule.virtualScrolling();
                }
                scrollElement.scrollTop = (index * averageRowHeight)
                    - (((this.parent.virtualScrollModule.bufferCount - 1) * averageRowHeight));
                this.parent.virtualScrollModule.virtualScrolling();
                if (this.parent.rowAutoHeight) {
                    var td = this.parent.element.querySelector("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"] + "[data-group-index=\"" + index + "\"]");
                    if (td && !td.parentElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"])) {
                        scrollElement.scrollTop =
                            (scrollElement.scrollTop < td.offsetTop) ? td.offsetTop : scrollElement.scrollTop + td.offsetTop;
                    }
                }
                else {
                    scrollElement.scrollTop = (index * averageRowHeight);
                }
            }
            else {
                var td = this.parent.element.querySelector("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"] + "[data-group-index=\"" + index + "\"]");
                if (td && !td.parentElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HIDDEN_CLASS"])) {
                    scrollElement.scrollTop = td.offsetTop;
                }
            }
        }
        else {
            if (!this.parent.activeViewOptions.group.byGroupID) {
                index = this.getIndexFromResourceId(id, levelName, resource);
            }
            else {
                if (levelName === this.parent.resourceCollection.slice(-1)[0].name) {
                    index = this.lastResourceLevel.map(function (e) {
                        return e.resourceData[resource.idField];
                    }).indexOf(id);
                }
                else {
                    index = resource.dataSource.map(function (e) { return e[resource.idField]; }).indexOf(id);
                }
            }
            var offsetTarget = this.parent.element.querySelector("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_ROW_CLASS"] + ":nth-child(" + (levelIndex + 1) + ")");
            var offset = [].slice.call(offsetTarget.children).map(function (node) { return node.offsetLeft; });
            scrollElement.scrollLeft = offset[index];
        }
    };
    ResourceBase.prototype.destroy = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_6__["documentClick"], this.documentClick);
        if (this.treeViewObj) {
            this.treeViewObj.destroy();
            this.treeViewObj = null;
        }
        if (this.treePopup) {
            this.treePopup.destroy();
            this.treePopup = null;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP"]));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TREE_POPUP_OVERLAY"]));
        }
        var resToolBarEle = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TOOLBAR_CONTAINER"]);
        if (resToolBarEle) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(resToolBarEle);
        }
    };
    return ResourceBase;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/schedule.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/schedule.js ***!
  \******************************************************************************/
/*! exports provided: Schedule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Schedule", function() { return Schedule; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../renderer/header-renderer */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/header-renderer.js");
/* harmony import */ var _actions_scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actions/scroll */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/scroll.js");
/* harmony import */ var _actions_touch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../actions/touch */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/touch.js");
/* harmony import */ var _actions_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actions/keyboard */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/keyboard.js");
/* harmony import */ var _actions_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../actions/data */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/data.js");
/* harmony import */ var _event_renderer_event_base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../event-renderer/event-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/event-base.js");
/* harmony import */ var _event_renderer_inline_edit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../event-renderer/inline-edit */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/inline-edit.js");
/* harmony import */ var _popups_quick_popups__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../popups/quick-popups */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/quick-popups.js");
/* harmony import */ var _popups_event_tooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../popups/event-tooltip */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-tooltip.js");
/* harmony import */ var _popups_event_window__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../popups/event-window */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-window.js");
/* harmony import */ var _renderer_renderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../renderer/renderer */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/renderer.js");
/* harmony import */ var _models_work_hours__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../models/work-hours */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/work-hours.js");
/* harmony import */ var _models_time_scale__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../models/time-scale */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/time-scale.js");
/* harmony import */ var _models_quick_info_templates__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../models/quick-info-templates */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/quick-info-templates.js");
/* harmony import */ var _models_header_rows__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../models/header-rows */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/header-rows.js");
/* harmony import */ var _actions_crud__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../actions/crud */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/crud.js");
/* harmony import */ var _actions_work_cells__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../actions/work-cells */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/work-cells.js");
/* harmony import */ var _models_event_settings__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../models/event-settings */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/event-settings.js");
/* harmony import */ var _models_group__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../models/group */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/group.js");
/* harmony import */ var _models_resources__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../models/resources */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/resources.js");
/* harmony import */ var _common_calendar_util__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../common/calendar-util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/common/calendar-util.js");
/* harmony import */ var _base_resource__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../base/resource */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/resource.js");
/* harmony import */ var _timezone_timezone__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../timezone/timezone */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};































/**
 * Represents the Schedule component that displays a list of events scheduled against specific date and timings,
 * thus helping us to plan and manage it properly.
 * ```html
 * <div id="schedule"></div>
 * ```
 * ```typescript
 * <script>
 *   var scheduleObj = new Schedule();
 *   scheduleObj.appendTo("#schedule");
 * </script>
 * ```
 */
var Schedule = /** @__PURE__ @class */ (function (_super) {
    __extends(Schedule, _super);
    /**
     * Constructor for creating the Schedule widget
     * @hidden
     */
    function Schedule(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Core method that initializes the control rendering.
     * @private
     */
    Schedule.prototype.render = function () {
        var addClasses = [];
        var removeClasses = [];
        addClasses.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["ROOT"]);
        if (this.enableRtl) {
            addClasses.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["RTL"]);
        }
        else {
            removeClasses.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["RTL"]);
        }
        if (this.isAdaptive) {
            addClasses.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["DEVICE_CLASS"]);
        }
        else {
            removeClasses.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["DEVICE_CLASS"]);
        }
        if (this.cssClass) {
            var cssClass = this.cssClass.split(' ');
            for (var _i = 0, cssClass_1 = cssClass; _i < cssClass_1.length; _i++) {
                var cls_1 = cssClass_1[_i];
                addClasses.push(cls_1);
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(this.element, addClasses, removeClasses);
        this.validateDate();
        this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
        this.editorTemplateFn = this.templateParser(this.editorTemplate);
        this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
        this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
        this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["createSpinner"])({ target: this.element });
        this.scrollModule = new _actions_scroll__WEBPACK_IMPORTED_MODULE_3__["Scroll"](this);
        this.scrollModule.setWidth();
        this.scrollModule.setHeight();
        this.renderModule = new _renderer_renderer__WEBPACK_IMPORTED_MODULE_12__["Render"](this);
        this.eventBase = new _event_renderer_event_base__WEBPACK_IMPORTED_MODULE_7__["EventBase"](this);
        this.workCellAction = new _actions_work_cells__WEBPACK_IMPORTED_MODULE_18__["WorkCellInteraction"](this);
        if (this.allowKeyboardInteraction) {
            this.keyboardInteractionModule = new _actions_keyboard__WEBPACK_IMPORTED_MODULE_5__["KeyboardInteraction"](this);
        }
        this.inlineModule = new _event_renderer_inline_edit__WEBPACK_IMPORTED_MODULE_8__["InlineEdit"](this);
        this.initializeDataModule();
        this.renderTableContainer();
        this.activeViewOptions = this.getActiveViewOptions();
        this.initializeResources();
        this.wireEvents();
    };
    Schedule.prototype.renderTableContainer = function () {
        if (!this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["TABLE_CONTAINER_CLASS"])) {
            this.element.appendChild(this.createElement('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["TABLE_CONTAINER_CLASS"] }));
        }
    };
    /** @hidden */
    Schedule.prototype.isServerRenderer = function (view) {
        if (view === void 0) { view = this.currentView; }
        // tslint:disable-next-line:max-line-length
        var views = ['Day', 'Week', 'WorkWeek', 'Month', 'MonthAgenda', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'];
        return false;
    };
    /** @hidden */
    Schedule.prototype.renderCompleted = function () {
        this.renderComplete();
    };
    /** @hidden */
    Schedule.prototype.layoutReady = function (resourceCollection, isFirstRender, isSetModel) {
        if (resourceCollection && resourceCollection.length > 0 && (isFirstRender || isSetModel)) {
            this.resourceCollection = resourceCollection;
            if (this.resourceBase) {
                this.resourceBase.refreshLayout(isSetModel);
            }
        }
        if (!this.isServerRenderer()) {
            return;
        }
        if (this.activeView) {
            this.activeView.serverRenderLayout();
            if (this.renderModule) {
                this.renderModule.refreshDataManager();
            }
        }
    };
    /** @hidden */
    Schedule.prototype.refreshLayout = function (args) {
        this.uiStateValues.groupIndex = 0;
        this.resourceCollection = args;
        this.renderElements(true);
        this.layoutReady();
    };
    /**
     * To render the react templates
     *  @hidden
     */
    Schedule.prototype.renderTemplates = function () {
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.renderReactTemplates();
        }
    };
    /**
     * To reset the react templates
     *  @hidden
     */
    Schedule.prototype.resetTemplates = function (templates) {
        // tslint:disable-next-line:no-any
        if (this.isReact) {
            this.clearTemplate(templates);
        }
    };
    Schedule.prototype.initializeResources = function (isSetModel) {
        if (isSetModel === void 0) { isSetModel = false; }
        if (this.resources.length > 0) {
            this.resourceBase = new _base_resource__WEBPACK_IMPORTED_MODULE_23__["ResourceBase"](this);
            this.resourceBase.bindResourcesData(isSetModel);
        }
        else {
            this.resourceBase = null;
            this.resourceCollection = [];
            this.renderElements(isSetModel);
        }
    };
    /** @hidden */
    Schedule.prototype.renderElements = function (isLayoutOnly) {
        if (isLayoutOnly) {
            this.initializeView(this.currentView);
            this.eventWindow.refresh();
            return;
        }
        this.destroyHeaderModule();
        if (this.showHeaderBar) {
            this.headerModule = new _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_2__["HeaderRenderer"](this);
        }
        this.renderTableContainer();
        if (_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice || _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isTouch) {
            this.scheduleTouchModule = new _actions_touch__WEBPACK_IMPORTED_MODULE_4__["ScheduleTouch"](this);
        }
        this.initializeView(this.currentView);
        this.destroyPopups();
        this.initializePopups();
    };
    Schedule.prototype.validateDate = function (selectedDate) {
        if (selectedDate === void 0) { selectedDate = this.selectedDate; }
        // persist the selected date value
        var date = selectedDate instanceof Date ? new Date(selectedDate.getTime()) : new Date(selectedDate);
        var minDate = this.minDate instanceof Date ? new Date(this.minDate.getTime()) : new Date(this.minDate);
        var maxDate = this.maxDate instanceof Date ? new Date(this.maxDate.getTime()) : new Date(this.maxDate);
        if (minDate <= maxDate) {
            if (date < minDate) {
                date = minDate;
            }
            if (date > maxDate) {
                date = maxDate;
            }
            this.setScheduleProperties({ selectedDate: new Date('' + date), minDate: new Date('' + minDate), maxDate: new Date('' + maxDate) });
            if (this.eventWindow) {
                this.eventWindow.updateMinMaxDateToEditor();
            }
        }
        else {
            throw Error('minDate should be equal or less than maxDate');
        }
    };
    Schedule.prototype.getViewIndex = function (viewName) {
        for (var item = 0; item < this.viewCollections.length; item++) {
            var checkIndex = this.viewCollections[item].option;
            if (checkIndex === viewName) {
                return item;
            }
        }
        return -1;
    };
    Schedule.prototype.setViewOptions = function (isModuleLoad) {
        if (isModuleLoad === void 0) { isModuleLoad = false; }
        this.viewOptions = {};
        this.viewCollections = [];
        var viewName;
        var selectedView;
        var prevIndex = this.viewIndex;
        var count = 0;
        this.viewIndex = -1;
        for (var _i = 0, _a = this.views; _i < _a.length; _i++) {
            var view = _a[_i];
            var isOptions = (typeof view === 'string') ? false : true;
            if (typeof view === 'string') {
                viewName = view;
                if (this.currentView === viewName) {
                    selectedView = viewName;
                    this.viewIndex = count;
                }
            }
            else {
                viewName = view.option;
                if (view.isSelected) {
                    selectedView = viewName;
                    this.viewIndex = count;
                }
            }
            var obj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({ option: viewName }, isOptions ? view : {});
            var fieldViewName = viewName.charAt(0).toLowerCase() + viewName.slice(1);
            obj.cellHeaderTemplateName = obj.cellHeaderTemplate ? obj.option : '';
            obj.dateHeaderTemplateName = obj.dateHeaderTemplate ? obj.option : '';
            obj.cellTemplateName = obj.cellTemplate ? obj.option : '';
            obj.resourceHeaderTemplateName = obj.resourceHeaderTemplate ? obj.option : '';
            obj.eventTemplateName = obj.eventTemplate ? obj.option : '';
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj.firstDayOfWeek) && obj.firstDayOfWeek === 0) {
                delete obj.firstDayOfWeek;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj.interval) && obj.interval === 1) {
                delete obj.interval;
            }
            this.viewCollections.push(obj);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.viewOptions[fieldViewName])) {
                this.viewOptions[fieldViewName] = [obj];
            }
            else {
                this.viewOptions[fieldViewName].push(obj);
            }
            count++;
        }
        if (!isModuleLoad && selectedView) {
            this.setScheduleProperties({ currentView: selectedView });
        }
        if (this.viewIndex === -1) {
            var currentIndex = this.getViewIndex(this.currentView);
            this.viewIndex = ((typeof this.views[0] !== 'string') && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prevIndex) && prevIndex !== -1)) ? prevIndex :
                (currentIndex === -1) ? 0 : currentIndex;
        }
    };
    Schedule.prototype.getActiveViewOptions = function () {
        var timeScale = {
            enable: this.timeScale.enable,
            interval: this.timeScale.interval,
            slotCount: this.timeScale.slotCount,
            majorSlotTemplate: this.timeScale.majorSlotTemplate,
            minorSlotTemplate: this.timeScale.minorSlotTemplate
        };
        var group = {
            byDate: this.group.byDate,
            byGroupID: this.group.byGroupID,
            allowGroupEdit: this.group.allowGroupEdit,
            resources: this.group.resources,
            headerTooltipTemplate: this.group.headerTooltipTemplate,
            enableCompactView: this.group.enableCompactView
        };
        var workDays = this.viewCollections[this.viewIndex].workDays ? [] : this.workDays;
        var scheduleOptions = {
            dateFormat: this.dateFormat,
            endHour: this.endHour,
            isSelected: false,
            option: null,
            readonly: this.readonly,
            startHour: this.startHour,
            allowVirtualScrolling: false,
            cellHeaderTemplate: this.cellHeaderTemplate,
            cellTemplate: this.cellTemplate,
            eventTemplate: this.eventSettings.template,
            dateHeaderTemplate: this.dateHeaderTemplate,
            resourceHeaderTemplate: this.resourceHeaderTemplate,
            firstDayOfWeek: this.firstDayOfWeek,
            workDays: workDays,
            showWeekend: this.showWeekend,
            showWeekNumber: this.showWeekNumber,
            displayName: null,
            interval: 1,
            timeScale: timeScale,
            group: group,
            headerRows: this.headerRows,
            orientation: 'Horizontal'
        };
        var viewOptions = this.viewCollections[this.viewIndex];
        var viewsData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(scheduleOptions, viewOptions, undefined, true);
        if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {
            viewsData.firstDayOfWeek = this.firstDayOfWeek;
        }
        return viewsData;
    };
    Schedule.prototype.initializeDataModule = function () {
        this.eventFields = {
            id: this.eventSettings.fields.id,
            isBlock: this.eventSettings.fields.isBlock,
            subject: this.eventSettings.fields.subject.name,
            startTime: this.eventSettings.fields.startTime.name,
            endTime: this.eventSettings.fields.endTime.name,
            startTimezone: this.eventSettings.fields.startTimezone.name,
            endTimezone: this.eventSettings.fields.endTimezone.name,
            location: this.eventSettings.fields.location.name,
            description: this.eventSettings.fields.description.name,
            isAllDay: this.eventSettings.fields.isAllDay.name,
            recurrenceID: this.eventSettings.fields.recurrenceID.name,
            recurrenceRule: this.eventSettings.fields.recurrenceRule.name,
            recurrenceException: this.eventSettings.fields.recurrenceException.name,
            isReadonly: this.eventSettings.fields.isReadonly,
            followingID: this.eventSettings.fields.followingID,
        };
        this.setEditorTitles();
        this.dataModule = new _actions_data__WEBPACK_IMPORTED_MODULE_6__["Data"](this.eventSettings.dataSource, this.eventSettings.query);
        this.crudModule = new _actions_crud__WEBPACK_IMPORTED_MODULE_17__["Crud"](this);
    };
    Schedule.prototype.setEditorTitles = function () {
        this.editorTitles = {
            subject: this.eventSettings.fields.subject.title || this.localeObj.getConstant('title'),
            startTime: this.eventSettings.fields.startTime.title || this.localeObj.getConstant('start'),
            endTime: this.eventSettings.fields.endTime.title || this.localeObj.getConstant('end'),
            isAllDay: this.eventSettings.fields.isAllDay.title || this.localeObj.getConstant('allDay'),
            startTimezone: this.eventSettings.fields.startTimezone.title || this.localeObj.getConstant('startTimezone'),
            endTimezone: this.eventSettings.fields.endTimezone.title || this.localeObj.getConstant('endTimezone'),
            location: this.eventSettings.fields.location.title || this.localeObj.getConstant('location'),
            description: this.eventSettings.fields.description.title || this.localeObj.getConstant('description'),
            recurrenceRule: this.eventSettings.fields.recurrenceRule.title || this.localeObj.getConstant('repeat')
        };
    };
    Schedule.prototype.initializeView = function (viewName) {
        this.showSpinner();
        this.activeViewOptions = this.getActiveViewOptions();
        if (this.resourceBase) {
            this.resourceBase.setResourceCollection();
        }
        this.initializeTemplates();
        this.renderModule.render(viewName);
    };
    Schedule.prototype.initializeTemplates = function () {
        this.cellHeaderTemplateFn = this.templateParser(this.activeViewOptions.cellHeaderTemplate);
        this.cellTemplateFn = this.templateParser(this.activeViewOptions.cellTemplate);
        this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
        this.majorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.majorSlotTemplate);
        this.minorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate);
        this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);
        this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);
        this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);
    };
    Schedule.prototype.initializePopups = function () {
        this.eventWindow = new _popups_event_window__WEBPACK_IMPORTED_MODULE_11__["EventWindow"](this);
        this.quickPopup = new _popups_quick_popups__WEBPACK_IMPORTED_MODULE_9__["QuickPopups"](this);
    };
    /** @hidden */
    Schedule.prototype.getDayNames = function (type) {
        var culShortNames = [];
        var cldrObj;
        var nameSpace = '';
        if (this.locale === 'en' || this.locale === 'en-US') {
            nameSpace = 'days.stand-alone.';
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace + type, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.getCalendarMode())));
        }
        else {
            nameSpace =
                'main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.days.format.' + type;
            cldrObj = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(nameSpace, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        }
        for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {
            var obj = _a[_i];
            culShortNames.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(obj, cldrObj));
        }
        return culShortNames;
    };
    Schedule.prototype.setCldrTimeFormat = function () {
        if (this.locale === 'en' || this.locale === 'en-US') {
            this.timeFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('timeFormats.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.getCalendarMode())));
        }
        else {
            this.timeFormat = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.locale + '.dates.calendars.' + this.getCalendarMode() + '.timeFormats.short', _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]));
        }
    };
    /** @hidden */
    Schedule.prototype.getCalendarMode = function () {
        return this.calendarMode.toLowerCase();
    };
    /** @hidden */
    Schedule.prototype.getTimeString = function (date) {
        var time = this.globalize.formatDate(date, { format: this.timeFormat, type: 'time', calendar: this.getCalendarMode() });
        return time.toLocaleUpperCase();
    };
    /** @hidden */
    Schedule.prototype.getDateTime = function (date) {
        return date instanceof Date ? new Date(date.getTime()) : new Date(date);
    };
    Schedule.prototype.setCalendarMode = function () {
        if (this.calendarMode === 'Islamic') {
            this.calendarUtil = new _common_calendar_util__WEBPACK_IMPORTED_MODULE_22__["Islamic"]();
        }
        else {
            this.calendarUtil = new _common_calendar_util__WEBPACK_IMPORTED_MODULE_22__["Gregorian"]();
        }
    };
    /** @hidden */
    Schedule.prototype.setScheduleProperties = function (properties) {
        this.allowServerDataBinding = false;
        this.setProperties(properties, true);
        this.allowServerDataBinding = true;
    };
    /** @hidden */
    Schedule.prototype.changeView = function (view, event, muteOnChange, index) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            index = this.getViewIndex(view);
        }
        if (!muteOnChange && index === this.viewIndex && this.currentView === view || index < 0) {
            return;
        }
        this.viewIndex = index;
        var args = { requestType: 'viewNavigate', cancel: false, event: event };
        this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["actionBegin"], args, function (actionArgs) {
            if (!actionArgs.cancel) {
                var navArgs = {
                    action: 'view', cancel: false, previousView: _this.currentView, currentView: view, viewIndex: _this.viewIndex
                };
                _this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["navigating"], navArgs, function (navigationArgs) {
                    if (!navigationArgs.cancel) {
                        _this.viewIndex = navigationArgs.viewIndex;
                        _this.setScheduleProperties({ currentView: view });
                        if (_this.headerModule) {
                            _this.headerModule.updateActiveView();
                            _this.headerModule.setCalendarDate(_this.selectedDate);
                            _this.headerModule.setCalendarView();
                        }
                        _this.initializeView(_this.currentView);
                        _this.animateLayout();
                        args = { requestType: 'viewNavigate', cancel: false, event: event };
                        _this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["actionComplete"], args);
                    }
                });
            }
        });
    };
    /** @hidden */
    Schedule.prototype.changeDate = function (selectedDate, event) {
        var _this = this;
        var args = { requestType: 'dateNavigate', cancel: false, event: event };
        this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["actionBegin"], args, function (actionArgs) {
            if (!actionArgs.cancel) {
                var navArgs = {
                    action: 'date', cancel: false,
                    previousDate: _this.selectedDate, currentDate: selectedDate
                };
                _this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["navigating"], navArgs, function (navigationArgs) {
                    if (!navigationArgs.cancel) {
                        _this.uiStateValues.isInitial = _this.activeView.isTimelineView() ? true : _this.uiStateValues.isInitial;
                        _this.validateDate(navigationArgs.currentDate);
                        if (_this.headerModule) {
                            _this.headerModule.setCalendarDate(navigationArgs.currentDate);
                        }
                        _this.initializeView(_this.currentView);
                        _this.animateLayout();
                        args = { requestType: 'dateNavigate', cancel: false, event: event };
                        _this.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_25__["actionComplete"], args);
                    }
                });
            }
        });
    };
    /** @hidden */
    Schedule.prototype.resetScrollTop = function () {
        var resWrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["RESOURCE_COLUMN_WRAP_CLASS"]);
        var conWrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["CONTENT_WRAP_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(conWrap)) {
            conWrap.scrollTop = 0;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resWrap)) {
            resWrap.scrollTop = 0;
        }
    };
    /** @hidden */
    Schedule.prototype.isMinMaxDate = function (date) {
        if (date === void 0) { date = this.selectedDate; }
        return ((date.getTime() >= this.minDate.getTime()) && (date.getTime() <= this.maxDate.getTime()));
    };
    /** @hidden */
    Schedule.prototype.isSelectedDate = function (date) {
        return date.setHours(0, 0, 0, 0) === new Date('' + this.selectedDate).setHours(0, 0, 0, 0);
    };
    /** @hidden */
    Schedule.prototype.getCurrentTime = function (date) {
        if (date === void 0) { date = new Date(); }
        if (this.timezone) {
            return this.tzModule.convert(date, this.tzModule.getLocalTimezoneName(), this.timezone);
        }
        return date;
    };
    /** @hidden */
    Schedule.prototype.getNavigateView = function () {
        if (this.activeView.isTimelineView()) {
            return this.currentView === 'TimelineMonth' || this.currentView === 'TimelineYear' ? 'TimelineDay' : 'Agenda';
        }
        return 'Day';
    };
    Schedule.prototype.animateLayout = function () {
        if (!this.activeView.element) {
            return;
        }
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"]({ duration: 600, name: 'FadeIn', timingFunction: 'easeIn' }).animate(this.activeView.element);
    };
    /**
     * To provide the array of modules needed for control rendering
     * @return {ModuleDeclaration[]}
     * @hidden
     */
    Schedule.prototype.requiredModules = function () {
        var modules = [];
        this.setViewOptions(true);
        for (var _i = 0, _a = Object.keys(this.viewOptions); _i < _a.length; _i++) {
            var view = _a[_i];
            view = (view === 'timelineDay' || view === 'timelineWeek' || view === 'timelineWorkWeek') ? 'timelineViews' : view;
            modules.push({ member: view, args: [this] });
        }
        if (this.allowDragAndDrop) {
            modules.push({ member: 'dragAndDrop', args: [this] });
        }
        if (this.allowResizing) {
            modules.push({ member: 'resize', args: [this] });
        }
        modules.push({ member: 'excelExport', args: [this] });
        modules.push({ member: 'iCalendarExport', args: [this] });
        modules.push({ member: 'iCalendarImport', args: [this] });
        modules.push({ member: 'print', args: [this] });
        return modules;
    };
    /**
     * Initializes the values of private members.
     * @private
     */
    Schedule.prototype.preRender = function () {
        this.isAdaptive = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].isDevice;
        this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
        this.tzModule = new _timezone_timezone__WEBPACK_IMPORTED_MODULE_24__["Timezone"]();
        if (this && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.uiStateValues) || !(this.enablePersistence)) {
            this.uiStateValues = {
                expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
                isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false
            };
        }
        this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
        this.activeEventData = { event: undefined, element: undefined };
        this.getDefaultLocale();
        this.localeObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getModuleName(), this.defaultLocale, this.locale);
        this.setCldrTimeFormat();
        this.setCalendarMode();
        this.eventsData = [];
        this.eventsProcessed = [];
        this.blockData = [];
        this.blockProcessed = [];
        this.resourceCollection = [];
        this.currentAction = null;
        this.selectedElements = [];
        this.setViewOptions();
    };
    Schedule.prototype.getDefaultLocale = function () {
        this.defaultLocale = {
            day: 'Day',
            week: 'Week',
            workWeek: 'Work Week',
            month: 'Month',
            year: 'Year',
            agenda: 'Agenda',
            weekAgenda: 'Week Agenda',
            workWeekAgenda: 'Work Week Agenda',
            monthAgenda: 'Month Agenda',
            today: 'Today',
            noEvents: 'No events',
            emptyContainer: 'There are no events scheduled on this day.',
            allDay: 'All day',
            start: 'Start',
            end: 'End',
            more: 'more',
            close: 'Close',
            cancel: 'Cancel',
            noTitle: '(No Title)',
            delete: 'Delete',
            deleteEvent: 'Delete Event',
            deleteMultipleEvent: 'Delete Multiple Events',
            selectedItems: 'Items selected',
            deleteSeries: 'Entire Series',
            edit: 'Edit',
            editSeries: 'Entire Series',
            editEvent: 'Edit Event',
            createEvent: 'Create',
            subject: 'Subject',
            addTitle: 'Add title',
            moreDetails: 'More Details',
            save: 'Save',
            editContent: 'How would you like to change the appointment in the series?',
            deleteContent: 'Are you sure you want to delete this event?',
            deleteMultipleContent: 'Are you sure you want to delete the selected events?',
            newEvent: 'New Event',
            title: 'Title',
            location: 'Location',
            description: 'Description',
            timezone: 'Timezone',
            startTimezone: 'Start Timezone',
            endTimezone: 'End Timezone',
            repeat: 'Repeat',
            saveButton: 'Save',
            cancelButton: 'Cancel',
            deleteButton: 'Delete',
            recurrence: 'Recurrence',
            wrongPattern: 'The recurrence pattern is not valid.',
            seriesChangeAlert: 'Do you want to cancel the changes made to specific ' +
                'instances of this series and match it to the whole series again?',
            createError: 'The duration of the event must be shorter than how frequently it occurs. ' +
                'Shorten the duration, or change the recurrence pattern in the recurrence event editor.',
            sameDayAlert: 'Two occurrences of the same event cannot occur on the same day.',
            editRecurrence: 'Edit Recurrence',
            repeats: 'Repeats',
            alert: 'Alert',
            startEndError: 'The selected end date occurs before the start date.',
            invalidDateError: 'The entered date value is invalid.',
            blockAlert: 'Events cannot be scheduled within the blocked time range.',
            ok: 'Ok',
            yes: 'Yes',
            no: 'No',
            occurrence: 'Occurrence',
            series: 'Series',
            previous: 'Previous',
            next: 'Next',
            timelineDay: 'Timeline Day',
            timelineWeek: 'Timeline Week',
            timelineWorkWeek: 'Timeline Work Week',
            timelineMonth: 'Timeline Month',
            timelineYear: 'Timeline Year',
            editFollowingEvent: 'Following Events',
            deleteTitle: 'Delete Event',
            editTitle: 'Edit Event',
            beginFrom: 'Begin From',
            endAt: 'Ends At',
            expandAllDaySection: 'Expand-all-day-section',
            collapseAllDaySection: 'Collapse-all-day-section'
        };
    };
    /**
     * Binding events to the Schedule element.
     * @hidden
     */
    Schedule.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(window, 'resize', this.onScheduleResize, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(window, 'orientationchange', this.onScheduleResize, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.onDocumentClick, this);
    };
    /** @hidden */
    Schedule.prototype.removeSelectedClass = function () {
        var selectedCells = this.getSelectedElements();
        for (var _i = 0, selectedCells_1 = selectedCells; _i < selectedCells_1.length; _i++) {
            var cell = selectedCells_1[_i];
            cell.setAttribute('aria-selected', 'false');
            cell.removeAttribute('tabindex');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selectedCells, _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["SELECTED_CELL_CLASS"]);
    };
    /** @hidden */
    Schedule.prototype.addSelectedClass = function (cells, focusCell) {
        for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
            var cell = cells_1[_i];
            cell.setAttribute('aria-selected', 'true');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(cells, _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["SELECTED_CELL_CLASS"]);
        if (focusCell) {
            focusCell.setAttribute('tabindex', '0');
            focusCell.focus();
        }
    };
    /** @hidden */
    Schedule.prototype.selectCell = function (element) {
        this.removeSelectedClass();
        this.addSelectedClass([element], element);
    };
    /** @hidden */
    Schedule.prototype.getAllDayRow = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["ALLDAY_ROW_CLASS"]);
    };
    /** @hidden */
    Schedule.prototype.getContentTable = function () {
        return this.activeView.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["CONTENT_TABLE_CLASS"] + ' tbody');
    };
    /** @hidden */
    Schedule.prototype.getTableRows = function () {
        return [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["CONTENT_TABLE_CLASS"] + ' tbody tr:not(.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["HIDDEN_CLASS"] + ')'));
    };
    /** @hidden */
    Schedule.prototype.getWorkCellElements = function () {
        return [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_CELLS_CLASS"]));
    };
    /** @hidden */
    Schedule.prototype.getIndexOfDate = function (collection, date) {
        return collection.map(Number).indexOf(+date);
    };
    /** @hidden */
    Schedule.prototype.isAllDayCell = function (td) {
        if (['Month', 'TimelineMonth', 'TimelineYear', 'MonthAgenda'].indexOf(this.currentView) > -1 ||
            td.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["ALLDAY_CELLS_CLASS"]) ||
            td.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["HEADER_CELLS_CLASS"]) || !this.activeViewOptions.timeScale.enable) {
            return true;
        }
        if (this.activeView.isTimelineView() && this.activeViewOptions.headerRows.length > 0 &&
            this.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
            return true;
        }
        return false;
    };
    /** @hidden */
    Schedule.prototype.getDateFromElement = function (td) {
        var dateString = td.getAttribute('data-date');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(dateString)) {
            var dateInMS = parseInt(dateString, 10);
            var date = new Date(dateInMS);
            if (this.isServerRenderer()) {
                var localDate = new Date(+date + (date.getTimezoneOffset() * 60000));
                return new Date(localDate.getTime() + (localDate.getTimezoneOffset() - date.getTimezoneOffset()) * 60000);
            }
            return date;
        }
        return undefined;
    };
    /** @hidden */
    Schedule.prototype.getMsFromDate = function (date) {
        if (this.isServerRenderer()) {
            return new Date(+date - (date.getTimezoneOffset() * 60000)).getTime();
        }
        return date.getTime();
    };
    /** @hidden */
    Schedule.prototype.getTargetElement = function (selector, left, top) {
        var element = document.elementFromPoint(left, top);
        var targetElement;
        if (element) {
            targetElement = element.closest(selector);
        }
        return (targetElement) ? [targetElement] : null;
    };
    /** @hidden */
    Schedule.prototype.getCellHeaderTemplate = function () {
        return this.cellHeaderTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getCellTemplate = function () {
        return this.cellTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getDateHeaderTemplate = function () {
        return this.dateHeaderTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getMajorSlotTemplate = function () {
        return this.majorSlotTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getMinorSlotTemplate = function () {
        return this.minorSlotTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getAppointmentTemplate = function () {
        return this.appointmentTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getEventTooltipTemplate = function () {
        return this.eventTooltipTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getHeaderTooltipTemplate = function () {
        return this.headerTooltipTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getEditorTemplate = function () {
        return this.editorTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getQuickInfoTemplatesHeader = function () {
        return this.quickInfoTemplatesHeaderFn;
    };
    /** @hidden */
    Schedule.prototype.getQuickInfoTemplatesContent = function () {
        return this.quickInfoTemplatesContentFn;
    };
    /** @hidden */
    Schedule.prototype.getQuickInfoTemplatesFooter = function () {
        return this.quickInfoTemplatesFooterFn;
    };
    /** @hidden */
    Schedule.prototype.getResourceHeaderTemplate = function () {
        return this.resourceHeaderTemplateFn;
    };
    /** @hidden */
    Schedule.prototype.getCssProperties = function () {
        var cssProps = {
            border: this.enableRtl ? 'borderLeftWidth' : 'borderRightWidth',
            padding: this.enableRtl ? 'paddingLeft' : 'paddingRight',
            rtlBorder: this.enableRtl ? 'borderRightWidth' : 'borderLeftWidth',
            rtlPadding: this.enableRtl ? 'paddingRight' : 'paddingLeft'
        };
        return cssProps;
    };
    /** @hidden */
    Schedule.prototype.removeNewEventElement = function () {
        var eventClone = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["NEW_EVENT_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventClone)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(eventClone);
        }
    };
    /** @hidden */
    Schedule.prototype.getStartEndTime = function (startEndTime) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startEndTime) && startEndTime !== '') {
            var startEndDate = _base_util__WEBPACK_IMPORTED_MODULE_27__["resetTime"](this.getCurrentTime());
            var timeString = startEndTime.split(':');
            if (timeString.length === 2) {
                startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);
            }
            return startEndDate;
        }
        return null;
    };
    Schedule.prototype.onDocumentClick = function (args) {
        this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["documentClick"], { event: args });
    };
    Schedule.prototype.onScheduleResize = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.activeView)) {
            return;
        }
        if (this.quickPopup) {
            this.quickPopup.onClosePopup();
        }
        if (this.currentView === 'Month' || ((this.currentView !== 'Agenda' && this.currentView !== 'MonthAgenda')
            && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {
            this.activeView.resetColWidth();
            this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["scrollUiUpdate"], { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });
            this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {});
        }
    };
    /** @hidden */
    Schedule.prototype.templateParser = function (template) {
        if (template) {
            try {
                if (document.querySelectorAll(template).length) {
                    return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(document.querySelector(template).innerHTML.trim());
                }
            }
            catch (error) {
                return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["compile"])(template);
            }
        }
        return undefined;
    };
    /** @hidden */
    Schedule.prototype.getAnnocementString = function (event, subject) {
        var resourceName;
        if (this.quickPopup && this.activeViewOptions.group.resources.length > 0) {
            var constantText = '"s event - ';
            resourceName = this.quickPopup.getResourceText({ event: event }, 'event') + constantText;
        }
        var recordSubject = (subject || (event[this.eventFields.subject] || this.eventSettings.fields.subject.default));
        var skeleton = 'full';
        var startDateText = this.globalize.formatDate(event[this.eventFields.startTime], {
            type: 'dateTime', skeleton: skeleton, calendar: this.getCalendarMode()
        });
        var endDateText = this.globalize.formatDate(event[this.eventFields.endTime], {
            type: 'dateTime', skeleton: skeleton, calendar: this.getCalendarMode()
        });
        var annocementString = recordSubject + ' ' + this.localeObj.getConstant('beginFrom') + ' '
            + startDateText + ' ' + this.localeObj.getConstant('endAt') + ' ' + endDateText;
        if (resourceName) {
            annocementString = resourceName + ' ' + annocementString;
        }
        return annocementString;
    };
    /** @hidden */
    Schedule.prototype.boundaryValidation = function (pageY, pageX) {
        var autoScrollDistance = 30;
        var scrollEdges = { left: false, right: false, top: false, bottom: false };
        var viewBoundaries = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["CONTENT_WRAP_CLASS"]).getBoundingClientRect();
        if ((pageY < viewBoundaries.top + autoScrollDistance + window.pageYOffset) &&
            (pageY > viewBoundaries.top + window.pageYOffset)) {
            scrollEdges.top = true;
        }
        if ((pageY > (viewBoundaries.bottom - autoScrollDistance) + window.pageYOffset) &&
            (pageY < viewBoundaries.bottom + window.pageYOffset)) {
            scrollEdges.bottom = true;
        }
        if ((pageX < viewBoundaries.left + autoScrollDistance + window.pageXOffset) &&
            (pageX > viewBoundaries.left + window.pageXOffset)) {
            scrollEdges.left = true;
        }
        if ((pageX > (viewBoundaries.right - autoScrollDistance) + window.pageXOffset) &&
            (pageX < viewBoundaries.right + window.pageXOffset)) {
            scrollEdges.right = true;
        }
        return scrollEdges;
    };
    /**
     * Unbinding events from the element on widget destroy.
     * @hidden
     */
    Schedule.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(window, 'resize', this.onScheduleResize);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(window, 'orientationchange', this.onScheduleResize);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchStartEvent, this.onDocumentClick);
    };
    /**
     * Core method to return the component name.
     * @private
     */
    Schedule.prototype.getModuleName = function () {
        return 'schedule';
    };
    /**
     * Returns the properties to be maintained in the persisted state.
     * @private
     */
    Schedule.prototype.getPersistData = function () {
        return this.addOnPersist(['currentView', 'selectedDate', 'scrollTop', 'scrollLeft']);
    };
    /**
     * Called internally, if any of the property value changed.
     * @private
     */
    Schedule.prototype.onPropertyChanged = function (newProp, oldProp) {
        var state = { isRefresh: false, isResource: false, isDate: false, isView: false, isLayout: false, isDataManager: false };
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'views':
                    this.setViewOptions();
                    if (this.headerModule) {
                        this.headerModule.updateItems();
                    }
                    state.isView = true;
                    break;
                case 'currentView':
                    state.isView = true;
                    break;
                case 'minDate':
                case 'maxDate':
                case 'selectedDate':
                    state.isDate = true;
                    break;
                case 'dateFormat':
                    this.activeViewOptions = this.getActiveViewOptions();
                    if (this.headerModule) {
                        this.headerModule.updateDateRange(this.activeView.getDateRangeText());
                    }
                    break;
                case 'showHeaderBar':
                    this.destroyHeaderModule();
                    if (newProp.showHeaderBar) {
                        this.headerModule = new _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_2__["HeaderRenderer"](this);
                        this.headerModule.updateDateRange(this.activeView.getDateRangeText());
                    }
                    this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["scrollUiUpdate"], { cssProperties: this.getCssProperties() });
                    if (this.activeView.isTimelineView()) {
                        this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {});
                    }
                    break;
                case 'showWeekend':
                case 'workDays':
                case 'startHour':
                case 'endHour':
                case 'workHours':
                case 'readonly':
                case 'headerRows':
                case 'showWeekNumber':
                case 'rowAutoHeight':
                    state.isLayout = true;
                    break;
                case 'locale':
                case 'calendarMode':
                    this.globalize = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Internationalization"](this.locale);
                    this.localeObj = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["L10n"](this.getModuleName(), this.defaultLocale, this.locale);
                    this.setCldrTimeFormat();
                    this.setCalendarMode();
                    state.isRefresh = true;
                    break;
                case 'firstDayOfWeek':
                    this.activeViewOptions.firstDayOfWeek = newProp.firstDayOfWeek;
                    if (this.eventWindow) {
                        this.eventWindow.refreshRecurrenceEditor();
                    }
                    state.isLayout = true;
                    break;
                case 'showTimeIndicator':
                    if (this.activeViewOptions.timeScale.enable && this.activeView) {
                        this.activeView.highlightCurrentTime();
                    }
                    break;
                case 'cellHeaderTemplate':
                    this.activeViewOptions.cellHeaderTemplate = newProp.cellHeaderTemplate;
                    this.cellHeaderTemplateFn = this.templateParser(this.activeViewOptions.cellHeaderTemplate);
                    state.isLayout = true;
                    break;
                case 'cellTemplate':
                    this.activeViewOptions.cellTemplate = newProp.cellTemplate;
                    this.cellTemplateFn = this.templateParser(this.activeViewOptions.cellTemplate);
                    state.isLayout = true;
                    break;
                case 'dateHeaderTemplate':
                    this.activeViewOptions.dateHeaderTemplate = newProp.dateHeaderTemplate;
                    this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
                    state.isLayout = true;
                    break;
                case 'resourceHeaderTemplate':
                    this.activeViewOptions.resourceHeaderTemplate = newProp.resourceHeaderTemplate;
                    this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);
                    state.isLayout = true;
                    break;
                case 'timezone':
                    this.eventBase.timezonePropertyChange(oldProp.timezone);
                    this.headerModule.setCalendarTimezone();
                    break;
                case 'enableRtl':
                    this.setRtlClass();
                    state.isRefresh = true;
                    break;
                default:
                    this.extendedPropertyChange(prop, newProp, oldProp, state);
                    break;
            }
        }
        this.propertyChangeAction(state);
    };
    Schedule.prototype.propertyChangeAction = function (state) {
        if (state.isRefresh) {
            this.refresh();
        }
        else if (state.isResource) {
            this.initializeResources(true);
        }
        else if (state.isView) {
            this.changeView(this.currentView, null, true);
        }
        else if (state.isDate) {
            this.changeDate(this.selectedDate);
        }
        else if (state.isLayout) {
            this.initializeView(this.currentView);
        }
        else if (state.isDataManager && this.renderModule) {
            if (this.dragAndDropModule) {
                this.dragAndDropModule.actionObj.action = '';
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["EVENT_ACTION_CLASS"]);
            }
            this.renderModule.refreshDataManager();
        }
    };
    Schedule.prototype.extendedPropertyChange = function (prop, newProp, oldProp, state) {
        switch (prop) {
            case 'width':
            case 'height':
                this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["uiUpdate"], { module: 'scroll', properties: { width: newProp.width, height: newProp.height } });
                break;
            case 'cssClass':
                if (oldProp.cssClass) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], oldProp.cssClass.split(' '));
                }
                if (newProp.cssClass) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], newProp.cssClass.split(' '));
                }
                break;
            case 'hideEmptyAgendaDays':
            case 'agendaDaysCount':
                this.activeViewOptions = this.getActiveViewOptions();
                state.isView = true;
                break;
            case 'eventSettings':
                this.onEventSettingsPropertyChanged(newProp.eventSettings, oldProp.eventSettings, state);
                break;
            case 'allowKeyboardInteraction':
                if (this.keyboardInteractionModule) {
                    this.keyboardInteractionModule.destroy();
                    this.keyboardInteractionModule = null;
                }
                if (newProp.allowKeyboardInteraction) {
                    this.keyboardInteractionModule = new _actions_keyboard__WEBPACK_IMPORTED_MODULE_5__["KeyboardInteraction"](this);
                }
                break;
            case 'editorTemplate':
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.editorTemplate)) {
                    this.editorTemplateFn = this.templateParser(this.editorTemplate);
                }
                if (this.eventWindow) {
                    this.eventWindow.setDialogContent();
                }
                break;
            case 'quickInfoTemplates':
                if (this.quickInfoTemplates.header) {
                    this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
                }
                if (this.quickInfoTemplates.content) {
                    this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
                }
                if (this.quickInfoTemplates.footer) {
                    this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
                }
                break;
            case 'group':
                this.onGroupSettingsPropertyChanged(newProp.group, oldProp.group, state);
                break;
            case 'resources':
                state.isResource = true;
                break;
            case 'timeScale':
                this.activeViewOptions.timeScale.interval = newProp.timeScale.interval || this.activeViewOptions.timeScale.interval;
                this.activeViewOptions.timeScale.slotCount = newProp.timeScale.slotCount || this.activeViewOptions.timeScale.slotCount;
                if (this.eventWindow) {
                    this.eventWindow.refreshDateTimePicker();
                }
                state.isLayout = true;
                break;
            case 'allowDragAndDrop':
            case 'allowResizing':
                this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {
                    processedData: this.eventBase.processData(this.eventsData)
                });
                break;
            case 'eventDragArea':
                this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {});
                break;
            case 'weekRule':
                state.isLayout = true;
                break;
        }
    };
    Schedule.prototype.setRtlClass = function () {
        if (this.enableRtl) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], 'e-rtl');
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], 'e-rtl');
        }
    };
    /**
     * Refreshes the Scheduler
     * @method refresh
     * @returns {void}
     */
    Schedule.prototype.refresh = function () {
        if (!this.isServerRenderer()) {
            // Temp resource collecgtion required for blazor alone
            this.tempResourceCollection = this.resourceCollection;
            _super.prototype.refresh.call(this);
            this.tempResourceCollection = null;
        }
        else {
            this.setEditorTitles();
            this.destroyHeaderModule();
            if (this.showHeaderBar) {
                this.headerModule = new _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_2__["HeaderRenderer"](this);
                this.renderModule.updateHeader();
            }
            this.destroyPopups();
            this.initializePopups();
            this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["scrollUiUpdate"], { cssProperties: this.getCssProperties() });
            this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {});
        }
    };
    Schedule.prototype.onGroupSettingsPropertyChanged = function (newProp, oldProp, state) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            if (prop === 'headerTooltipTemplate') {
                this.headerTooltipTemplateFn = this.templateParser(newProp[prop]);
            }
            else {
                state.isLayout = true;
                if (this.eventWindow) {
                    this.eventWindow.refresh();
                }
            }
        }
    };
    Schedule.prototype.onEventSettingsPropertyChanged = function (newProp, oldProp, state) {
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'dataSource':
                case 'query':
                case 'fields':
                    this.initializeDataModule();
                    state.isDataManager = true;
                    break;
                case 'template':
                    this.activeViewOptions.eventTemplate = newProp.template;
                    this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);
                    state.isDataManager = true;
                    break;
                case 'enableTooltip':
                    if (this.eventTooltip) {
                        this.eventTooltip.destroy();
                        this.eventTooltip = null;
                    }
                    if (newProp.enableTooltip) {
                        this.eventTooltip = new _popups_event_tooltip__WEBPACK_IMPORTED_MODULE_10__["EventTooltip"](this);
                    }
                    break;
                case 'tooltipTemplate':
                    this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
                    break;
                case 'resourceColorField':
                    if (this.resourceBase) {
                        this.resourceBase.setResourceCollection();
                    }
                    state.isDataManager = true;
                    break;
                case 'editFollowingEvents':
                    if (this.quickPopup) {
                        this.quickPopup.refreshQuickDialog();
                    }
                    break;
                case 'allowAdding':
                case 'allowEditing':
                case 'allowDeleting':
                    if (this.eventWindow) {
                        this.eventWindow.refresh();
                    }
                    break;
                case 'enableMaxHeight':
                case 'enableIndicator':
                    this.notify(_base_constant__WEBPACK_IMPORTED_MODULE_25__["dataReady"], {
                        processedData: this.eventBase.processData(this.eventsData)
                    });
                    break;
                case 'ignoreWhitespace':
                    state.isLayout = true;
                    break;
            }
        }
    };
    Schedule.prototype.destroyHeaderModule = function () {
        if (this.headerModule) {
            this.headerModule.destroy();
            this.headerModule = null;
        }
    };
    Schedule.prototype.destroyPopups = function () {
        if (this.quickPopup) {
            this.quickPopup.destroy();
            this.quickPopup = null;
        }
        if (this.eventWindow) {
            this.eventWindow.destroy();
            this.eventWindow = null;
        }
    };
    /**
     * Allows to show the spinner on schedule at the required scenarios.
     * @method showSpinner
     * @returns {void}
     */
    Schedule.prototype.showSpinner = function () {
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["showSpinner"])(this.element);
    };
    /**
     * When the spinner is shown manually using `showSpinner` method, it can be hidden using this `hideSpinner` method.
     * @method hideSpinner
     * @returns {void}
     */
    Schedule.prototype.hideSpinner = function () {
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["hideSpinner"])(this.element);
    };
    /**
     * Sets different working hours on the required working days by accepting the required start and end time as well as the date collection
     *  as its parameters.
     * @method setWorkHours
     * @param {date} dates Collection of dates on which the given start and end hour range needs to be applied.
     * @param {string} start Defines the work start hour.
     * @param {string} end Defines the work end hour.
     * @param {number} groupIndex Defines the resource index from last level.
     * @returns {void}
     */
    Schedule.prototype.setWorkHours = function (dates, start, end, groupIndex) {
        var cells = [];
        cells = this.getWorkHourCells(dates, start, end, groupIndex);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(cells, _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_HOURS_CLASS"]);
    };
    /**
     * Removes or resets different working hours on the required working days by accepting the required start and end time as well as the
     * date collection as its parameters.
     * if no parameters has been passed to this function, it will remove all the work hours.
     * @param {date} dates Collection of dates on which the given start and end hour range need to be applied.
     * @param {string} start Defines the work start hour.
     * @param {string} end Defines the work end hour.
     * @param {number} groupIndex Defines the resource index from last level.
     * @returns {void}
     */
    Schedule.prototype.resetWorkHours = function (dates, start, end, groupIndex) {
        if (dates === void 0) { dates = this.activeView.renderDates; }
        if (dates && start && end) {
            var cells = this.getWorkHourCells(dates, start, end, groupIndex);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(cells, _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_HOURS_CLASS"]);
        }
        else {
            var workHourCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_HOURS_CLASS"]));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(workHourCells, _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_HOURS_CLASS"]);
        }
    };
    Schedule.prototype.getWorkHourCells = function (dates, start, end, groupIndex) {
        if (['Agenda', 'MonthAgenda', 'Month', 'TimelineMonth'].indexOf(this.currentView) > -1) {
            return [];
        }
        var startHour = this.getStartEndTime(start);
        var endHour = this.getStartEndTime(end);
        var tableEle = this.getContentTable();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startHour) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endHour) || !tableEle) {
            return [];
        }
        startHour.setMilliseconds(0);
        endHour.setMilliseconds(0);
        var viewStartHour = this.activeView.getStartHour();
        if (startHour < viewStartHour) {
            startHour = viewStartHour;
        }
        var viewEndHour = this.activeView.getEndHour();
        if (endHour > viewEndHour) {
            endHour = viewEndHour;
        }
        var msMajorInterval = this.activeViewOptions.timeScale.interval * _base_util__WEBPACK_IMPORTED_MODULE_27__["MS_PER_MINUTE"];
        var msInterval = msMajorInterval / this.activeViewOptions.timeScale.slotCount;
        var startIndex = Math.round((startHour.getTime() - viewStartHour.getTime()) / msInterval);
        var endIndex = Math.ceil((endHour.getTime() - viewStartHour.getTime()) / msInterval);
        var tempStartIndex = startIndex;
        var tempEndIndex = endIndex;
        var cells = [];
        for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
            var date = dates_1[_i];
            date = this.getDateTime(date);
            _base_util__WEBPACK_IMPORTED_MODULE_27__["resetTime"](date);
            var renderDates = this.activeView.renderDates;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex) && this.resourceBase && !this.activeView.isTimelineView()) {
                renderDates = this.resourceBase.lastResourceLevel[groupIndex].renderDates;
            }
            var colIndex = this.getIndexOfDate(renderDates, date);
            if (colIndex >= 0) {
                if (this.activeView.isTimelineView()) {
                    var slotsPerDay = Math.round((viewEndHour.getTime() - viewStartHour.getTime()) / msInterval);
                    startIndex = tempStartIndex + (colIndex * slotsPerDay);
                    endIndex = tempEndIndex + (colIndex * slotsPerDay);
                }
                for (var i = startIndex; i < endIndex; i++) {
                    if (this.activeView.isTimelineView()) {
                        var rowIndex = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) ? groupIndex : 0;
                        cells.push(tableEle.rows[rowIndex].cells[i]);
                    }
                    else {
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
                            var tds = [].slice.call(tableEle.rows[i].querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["WORK_CELLS_CLASS"] + '[data-group-index="' + groupIndex + '"]'));
                            cells.push(tds[colIndex]);
                        }
                        else {
                            cells.push(tableEle.rows[i].cells[colIndex]);
                        }
                    }
                }
            }
        }
        return cells;
    };
    /**
     * Retrieves the start and end time information of the specific cell element.
     * @method getCellDetails
     * @param  {Element} td The cell element whose start and end time details are to be retrieved.
     * @returns {CellClickEventArgs} Object An object holding the startTime, endTime and all-day information along with the target HTML
     *  element will be returned.
     */
    Schedule.prototype.getCellDetails = function (tdCol) {
        var td = (tdCol instanceof Array) ? tdCol : [tdCol];
        var firstTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(td[0]);
        var lastTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(td.slice(-1)[0]);
        var startTime = this.getDateFromElement(firstTd);
        var endTime = this.getDateFromElement(lastTd);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startTime) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endTime)) {
            return undefined;
        }
        var endDateFromColSpan = this.activeView.isTimelineView() && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(lastTd.getAttribute('colSpan')) &&
            this.headerRows.length > 0;
        var duration = endDateFromColSpan ? parseInt(lastTd.getAttribute('colSpan'), 10) : 1;
        if (!this.activeViewOptions.timeScale.enable || endDateFromColSpan || lastTd.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["ALLDAY_CELLS_CLASS"]) ||
            lastTd.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["HEADER_CELLS_CLASS"])) {
            endTime = _base_util__WEBPACK_IMPORTED_MODULE_27__["addDays"](new Date(endTime.getTime()), duration);
        }
        else {
            endTime = this.activeView.getEndDateFromStartDate(endTime);
        }
        var data = {
            startTime: startTime,
            endTime: endTime,
            isAllDay: this.isAllDayCell(firstTd),
            element: tdCol
        };
        var groupIndex = firstTd.getAttribute('data-group-index');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
            data.groupIndex = parseInt(groupIndex, 10);
        }
        return data;
    };
    /**
     * Retrieves the selected cell elements.
     * @method getSelectedElements
     * @returns {Element[]} The elements of currently selected cells will be returned.
     */
    Schedule.prototype.getSelectedElements = function () {
        return [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["SELECTED_CELL_CLASS"]));
    };
    /**
     * To get the resource collection
     * @method getResourceCollections
     * @return {ResourcesModel[]}
     */
    Schedule.prototype.getResourceCollections = function () {
        return this.resourceCollection;
    };
    /**
     * To set the resource collection
     * @method setResourceCollections
     * @param {ResourcesModel[]} resourceCol Accepts the resource collections in ResourcesModel type
     */
    Schedule.prototype.setResourceCollections = function (resourceCol) {
        this.setProperties({ resources: resourceCol }, false);
    };
    /**
     * Current View could be change based on the provided parameters.
     * @method changeCurrentView
     * @param {View} viewName Accept the view in the viewCollections.
     * @param {number} viewIndex Accept the viewIndex in the viewCollections.
     * @public
     */
    Schedule.prototype.changeCurrentView = function (viewName, viewIndex) {
        var index = this.getViewIndex(viewName);
        var view = viewName.charAt(0).toLowerCase() + viewName.slice(1);
        var viewOptions = this.viewOptions[view];
        if (viewOptions) {
            index = this.viewCollections.indexOf(viewOptions[viewIndex || 0]);
        }
        if (index === -1 || index === this.viewIndex) {
            return;
        }
        this.changeView(viewName, null, null, index);
    };
    /**
     * Return the current view Index.
     * @method getCurrentViewIndex
     * @returns {number}
     */
    Schedule.prototype.getCurrentViewIndex = function () {
        return this.viewIndex;
    };
    /**
     * Retrieves the resource details based on the provided resource index.
     * @param {number} index index of the resources at the last level.
     * @returns {ResourceDetails} Object An object holding the details of resource and resourceData.
     * @isGenericType true
     */
    Schedule.prototype.getResourcesByIndex = function (index) {
        if (this.resourceBase && this.resourceBase.lastResourceLevel) {
            if (index < 0 || index >= this.resourceBase.lastResourceLevel.length) {
                return undefined;
            }
            var data = this.resourceBase.lastResourceLevel[index];
            var groupData = {};
            this.resourceBase.setResourceValues(groupData, index);
            return { resource: data.resource, resourceData: data.resourceData, groupData: groupData };
        }
        return undefined;
    };
    /**
     * This method allows to expand the resource that available on the scheduler.
     * @method expandResource
     * @param {string} resourceId Accepts the resource id in string type
     * @param {number} resourceId Accepts the resource id in number type
     * @param {string} name Accepts the name of the resource collection
     */
    Schedule.prototype.expandResource = function (resourceId, name) {
        if (this.activeView.isTimelineView() && this.resourceBase && this.resourceCollection.length > 1) {
            this.resourceBase.resourceExpand(resourceId, name, false);
        }
    };
    /**
     * This method allows to collapse the resource that available on the scheduler.
     * @method collapseResource
     * @param {string} resourceId Accepts the resource id in string type
     * @param {number} resourceId Accepts the resource id in number type
     * @param {string} name Accepts the name of the resource collection
     */
    Schedule.prototype.collapseResource = function (resourceId, name) {
        if (this.activeView.isTimelineView() && this.resourceBase && this.resourceCollection.length > 1) {
            this.resourceBase.resourceExpand(resourceId, name, true);
        }
    };
    /**
     * Scrolls the Schedule content area to the specified time.
     * @method scrollTo
     * @param {string} hour Accepts the time value in the skeleton format of 'Hm'.
     * @param {Date} scrollDate Accepts the date object value.
     * @returns {void}
     */
    Schedule.prototype.scrollTo = function (hour, scrollDate) {
        if (this.activeView.scrollToDate && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(hour) && scrollDate) {
            this.activeView.scrollToDate(scrollDate);
        }
        else if (this.activeView.scrollToHour) {
            this.activeView.scrollToHour(hour, scrollDate);
        }
    };
    /**
     * This method allows scroll to the position of the any resources that available on the scheduler.
     * This method is applicable for without Agenda and Month agenda views of the schedule.
     * @method scrollToResource
     * @param {string} resourceId Accepts the id in string type
     * @param {number} resourceId Accepts the id in number type
     * @param {string} groupName Accepts the name of the resource collection
     * @returns {void}
     */
    Schedule.prototype.scrollToResource = function (resourceId, groupName) {
        if (this.resourceBase && this.resourceBase.lastResourceLevel) {
            this.resourceBase.resourceScroll(resourceId, groupName);
        }
    };
    /**
     * Exports the Scheduler events to a calendar (.ics) file. By default, the calendar is exported with a file name `Calendar.ics`.
     * To change this file name on export, pass the custom string value as `fileName` to get the file downloaded with this provided name.
     * @method exportToICalendar
     * @param {string} fileName Accepts the string value.
     * @returns {void}
     */
    Schedule.prototype.exportToICalendar = function (fileName, customData) {
        if (this.iCalendarExportModule) {
            this.iCalendarExportModule.initializeCalendarExport(fileName, customData);
        }
        else {
            throw Error('Inject ICalendarExport module');
        }
    };
    /**
     * Imports the events from an .ics file downloaded from any of the calendars like Google or Outlook into the Scheduler.
     * This method accepts the blob object or string format of an .ics file to be imported as a mandatory argument.
     * @method importICalendar
     * @param {Blob | string} fileContent Accepts the file object or string format of an .ics file.
     * @returns {void}
     */
    Schedule.prototype.importICalendar = function (fileContent) {
        if (this.iCalendarImportModule) {
            this.iCalendarImportModule.initializeCalendarImport(fileContent);
        }
        else {
            throw Error('Inject ICalendarImport module');
        }
    };
    /**
     * Adds the newly created event into the Schedule dataSource.
     * @method addEvent
     * @param {Object | Object[]} data Single or collection of event objects to be added into Schedule.
     * @returns {void}
     */
    Schedule.prototype.addEvent = function (data) {
        this.crudModule.addEvent(data);
    };
    /**
     * Allows the Scheduler events data to be exported as an Excel file either in .xlsx or .csv file formats.
     * By default, the whole event collection bound to the Scheduler gets exported as an Excel file.
     * To export only the specific events of Scheduler, you need to pass the custom data collection as
     * a parameter to this `exportToExcel` method. This method accepts the export options as arguments such as fileName,
     * exportType, fields, customData, and includeOccurrences. The `fileName` denotes the name to be given for the exported
     * file and the `exportType` allows you to set the format of an Excel file to be exported either as .xlsx or .csv.
     * The custom or specific field collection of event dataSource to be exported can be provided through `fields` option
     * and the custom data collection can be exported by passing them through the `customData` option. There also exists
     * option to export each individual instances of the recurring events to an Excel file, by setting true or false to the
     * `includeOccurrences` option, denoting either to include or exclude the occurrences as separate instances on an exported Excel file.
     * @method exportToExcel
     * @param  {ExportOptions} excelExportOptions The export options to be set before start with
     * exporting the Scheduler events to an Excel file.
     * @return {void}
     */
    Schedule.prototype.exportToExcel = function (excelExportOptions) {
        if (this.excelExportModule) {
            this.excelExportModule.initializeExcelExport(excelExportOptions || {});
        }
        else {
            throw Error('Inject ExcelExport module');
        }
    };
    /** print function */
    Schedule.prototype.print = function () {
        if (this.printModule) {
            this.printModule.printScheduler();
        }
        else {
            throw Error('Inject Print module');
        }
    };
    /**
     * Updates the changes made in the event object by passing it as an parameter into the dataSource.
     * @method saveEvent
     * @param {[key: string]: Object} data Single or collection of event objects to be saved into Schedule.
     * @param {CurrentAction} currentAction Denotes the action that takes place either for editing occurrence or series.
     *  The valid current action names are `EditOccurrence` or `EditSeries`.
     * @returns {void}
     */
    Schedule.prototype.saveEvent = function (data, currentAction) {
        this.crudModule.saveEvent(data, currentAction);
    };
    /**
     * Deletes the events based on the provided ID or event collection in the argument list.
     * @method deleteEvent
     * @param {{[key: string]: Object}} id Single event objects to be removed from the Schedule.
     * @param {{[key: string]: Object }[]} id Collection of event objects to be removed from the Schedule.
     * @param {string | number} id Accepts the ID of the event object which needs to be removed from the Schedule.
     * @param {CurrentAction} currentAction Denotes the delete action that takes place either on occurrence or series events.
     *  The valid current action names are `Delete`, `DeleteOccurrence` or `DeleteSeries`.
     * @returns {void}
     */
    Schedule.prototype.deleteEvent = function (id, currentAction) {
        this.crudModule.deleteEvent(id, currentAction);
    };
    /**
     * Retrieves the entire collection of events bound to the Schedule.
     * @method getEvents
     * @returns {Object[]} Returns the collection of event objects from the Schedule.
     * @isGenericType true
     */
    Schedule.prototype.getEvents = function (startDate, endDate, includeOccurrences) {
        var eventCollections = [];
        if (includeOccurrences) {
            eventCollections = this.eventBase.getProcessedEvents();
        }
        else {
            eventCollections = this.eventsData;
        }
        if (startDate) {
            startDate = this.getDateTime(startDate);
        }
        if (endDate) {
            endDate = this.getDateTime(endDate);
        }
        eventCollections = this.eventBase.filterEventsByRange(eventCollections, startDate, endDate);
        return eventCollections;
    };
    /**
     * Retrieves the entire collection of events bound to the Schedule.
     * @method getBlockEvents
     * @returns {Object[]} Returns the collection of block event objects from the Schedule.
     * @isGenericType true
     */
    Schedule.prototype.getBlockEvents = function (startDate, endDate, includeOccurrences) {
        var eventCollections = [];
        if (includeOccurrences) {
            eventCollections = this.eventBase.getProcessedEvents(this.blockData);
        }
        else {
            eventCollections = this.blockData;
        }
        if (startDate) {
            startDate = this.getDateTime(startDate);
        }
        if (endDate) {
            endDate = this.getDateTime(endDate);
        }
        eventCollections = this.eventBase.filterEventsByRange(eventCollections, startDate, endDate);
        return eventCollections;
    };
    /**
     * Retrieves the occurrences of a single recurrence event based on the provided parent ID.
     * @method getOccurrencesByID
     * @param {number} eventID ID of the parent recurrence data from which the occurrences are fetched.
     * @returns {Object[]} Returns the collection of occurrence event objects.
     * @isGenericType true
     */
    Schedule.prototype.getOccurrencesByID = function (eventID) {
        return this.eventBase.getOccurrencesByID(eventID);
    };
    /**
     * Retrieves all the occurrences that lies between the specific start and end time range.
     * @method getOccurrencesByRange
     * @param {Date} startTime Denotes the start time range.
     * @param {Date} endTime Denotes the end time range.
     * @returns {Object[]} Returns the collection of occurrence event objects that lies between the provided start and end time.
     * @isGenericType true
     */
    Schedule.prototype.getOccurrencesByRange = function (startTime, endTime) {
        startTime = this.getDateTime(startTime);
        endTime = this.getDateTime(endTime);
        return this.eventBase.getOccurrencesByRange(startTime, endTime);
    };
    /**
     * Retrieves the dates that lies on active view of Schedule.
     * @method getCurrentViewDates
     * @returns {Date[]} Returns the collection of dates.
     */
    Schedule.prototype.getCurrentViewDates = function () {
        return this.activeView ? this.activeView.renderDates : [];
    };
    /**
     * Set the recurrence editor instance from custom editor template.
     * @method setRecurrenceEditor
     * @param {RecurrenceEditor} recurrenceEditor instance has passed to fetch the instance in event window.
     * @returns {void}

     */
    Schedule.prototype.setRecurrenceEditor = function (recurrenceEditor) {
        this.eventWindow.setRecurrenceEditor(recurrenceEditor);
    };
    /**
     * Get the maximum id of an event.
     * @method getEventMaxID
     * @returns {number | string}
     */
    Schedule.prototype.getEventMaxID = function () {
        return this.eventBase.getEventMaxID();
    };
    /**
     * Get deleted occurrences from given recurrence series.
     * @method getDeletedOccurrences
     * @param {{[key: string]: Object}} recurrenceData Accepts the parent event object.
     * @param {string | number} recurrenceData Accepts the parent ID of the event object.
     * @returns {Object[]} Returns the collection of deleted occurrence events.
     * @isGenericType true
     */
    Schedule.prototype.getDeletedOccurrences = function (recurrenceData) {
        return this.eventBase.getDeletedOccurrences(recurrenceData);
    };
    /**
     * Retrieves the events that lies on the current date range of the active view of Schedule.
     * @method getCurrentViewEvents
     * @returns {Object[]} Returns the collection of events.
     * @isGenericType true
     */
    Schedule.prototype.getCurrentViewEvents = function () {
        return this.eventsProcessed;
    };
    /**
     * Refreshes the event dataSource. This method may be useful when the events alone in the schedule needs to be re-rendered.
     * @method refreshEvents
     * @returns {void}
     */
    Schedule.prototype.refreshEvents = function () {
        if (this.dragAndDropModule) {
            this.dragAndDropModule.actionObj.action = '';
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_26__["EVENT_ACTION_CLASS"]);
        }
        this.renderModule.refreshDataManager();
    };
    /**
     * To retrieve the appointment object from element.
     * @method getEventDetails
     * @param {Element} element Denotes the event UI element on the Schedule.
     * @returns {Object} Returns the event details.
     * @isGenericType true
     */
    Schedule.prototype.getEventDetails = function (element) {
        element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(element);
        var guid = element.getAttribute('data-guid');
        if (guid) {
            return this.eventBase.getEventByGuid(guid);
        }
        return {};
    };
    /**
     * To check whether the given time range slots are available for event creation or already occupied by other events.
     * @method isSlotAvailable
     * @param {Date | Object} startTime Denotes the start time of the slot.
     * @param {Date} endTime Denotes the end time of the slot.
     * @param {number} groupIndex Defines the resource index from last level.
     * @returns {boolean} Returns true, if the slot that lies in the provided time range does not contain any other events.
     */
    Schedule.prototype.isSlotAvailable = function (startTime, endTime, groupIndex) {
        var _this = this;
        var eventStart;
        var eventEnd;
        var eventObj = this.activeEventData.event;
        if (startTime instanceof Date || typeof (startTime) === 'string') {
            eventStart = startTime;
            eventEnd = endTime;
        }
        else {
            eventObj = startTime;
            eventStart = startTime[this.eventFields.startTime];
            eventEnd = startTime[this.eventFields.endTime];
            if (this.resourceBase) {
                groupIndex = this.eventBase.getGroupIndexFromEvent(startTime);
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventStart) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventEnd)) {
            return true;
        }
        eventStart = this.getDateTime(eventStart);
        eventEnd = this.getDateTime(eventEnd);
        var eventCollection = this.eventBase.filterEvents(eventStart, eventEnd);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex) && this.resourceBase && this.resourceBase.lastResourceLevel.length > 0) {
            eventCollection = this.eventBase.filterEventsByResource(this.resourceBase.lastResourceLevel[groupIndex], eventCollection);
        }
        if (eventObj) {
            if (eventObj.Guid) {
                eventCollection = eventCollection.filter(function (event) { return event.Guid !== eventObj.Guid; });
            }
            else {
                eventCollection = eventCollection.filter(function (event) {
                    return event[_this.eventFields.id] !== eventObj[_this.eventFields.id];
                });
            }
        }
        return (eventCollection.length > 0) ? false : true;
    };
    /**
     * To manually open the event editor on specific time or on certain events.
     * @method openEditor
     * @param {Object} data It can be either cell data or event data.
     * @param {CurrentAction} action Defines the action for which the editor needs to be opened such as either for new event creation or
     *  for editing of existing events. The applicable action names that can be used here are `Add`, `Save`, `EditOccurrence`
     *  and `EditSeries`.
     * @param {boolean} isEventData It allows to decide whether the editor needs to be opened with the clicked cell details or with the
     *  passed event details.
     * @param {number} repeatType It opens the editor with the recurrence options based on the provided repeat type.
     * @returns {void}
     */
    Schedule.prototype.openEditor = function (data, action, isEventData, repeatType) {
        if (action === 'Add' && !isEventData) {
            data.startTime = this.getDateTime(data.startTime);
            data.endTime = this.getDateTime(data.endTime);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.element)) {
                data.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(data.element);
            }
        }
        else {
            data[this.eventFields.startTime] =
                this.getDateTime(data[this.eventFields.startTime]);
            data[this.eventFields.endTime] =
                this.getDateTime(data[this.eventFields.endTime]);
        }
        this.currentAction = action;
        if (action !== 'Add') {
            this.activeEventData.event = data;
        }
        this.eventWindow.openEditor(data, action, isEventData, repeatType);
    };
    /**
     * To manually close the event editor window
     * @method closeEditor
     * @return {void}
     */
    Schedule.prototype.closeEditor = function () {
        if (this.eventWindow) {
            this.eventWindow.dialogClose();
        }
    };
    /**
     * To manually close the quick info popup
     * @method closeQuickInfoPopup
     * @return {void}
     */
    Schedule.prototype.closeQuickInfoPopup = function () {
        if (this.quickPopup) {
            this.quickPopup.quickPopupHide(true);
        }
    };
    /**
     * Adds the resources to the specified index.
     * @param resources
     * @param {string} name Name of the resource defined in resources collection.
     * @param {number} index Index or position where the resource should be added.

     */
    Schedule.prototype.addResource = function (resources, name, index) {
        this.resourceBase.addResource(resources, name, index);
    };
    /**
     * Removes the specified resource.
     * @param resourceId Specifies the resource id to be removed.
     * @param name Specifies the resource name from which the id should be referred.

     */
    Schedule.prototype.removeResource = function (resourceId, name) {
        this.resourceBase.removeResource(resourceId, name);
    };
    /**
     * Destroys the Schedule component.
     * @method destroy
     * @return {void}
     */
    Schedule.prototype.destroy = function () {
        if (this.eventTooltip) {
            this.eventTooltip.destroy();
            this.eventTooltip = null;
        }
        this.destroyPopups();
        this.unwireEvents();
        this.destroyHeaderModule();
        this.workCellAction.destroy();
        this.inlineModule.destroy();
        if (this.keyboardInteractionModule) {
            this.keyboardInteractionModule.destroy();
        }
        if (this.scrollModule) {
            this.scrollModule.destroy();
            this.scrollModule = null;
        }
        if (this.activeView) {
            this.resetTemplates();
            this.activeView.removeEventListener();
            this.activeView.destroy();
            this.activeView = null;
        }
        if (this.scheduleTouchModule) {
            this.scheduleTouchModule.destroy();
            this.scheduleTouchModule = null;
        }
        _super.prototype.destroy.call(this);
        _base_util__WEBPACK_IMPORTED_MODULE_27__["removeChildren"](this.element);
        var removeClasses = [_base_css_constant__WEBPACK_IMPORTED_MODULE_26__["ROOT"]];
        if (this.cssClass) {
            removeClasses = removeClasses.concat(this.cssClass.split(' '));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], removeClasses);
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Schedule.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('auto')
    ], Schedule.prototype, "height", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "showHeaderBar", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "showTimeIndicator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Week')
    ], Schedule.prototype, "currentView", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(['Day', 'Week', 'WorkWeek', 'Month', 'Agenda'])
    ], Schedule.prototype, "views", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date())
    ], Schedule.prototype, "selectedDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(1900, 0, 1))
    ], Schedule.prototype, "minDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(new Date(2099, 11, 31))
    ], Schedule.prototype, "maxDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "dateFormat", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Gregorian')
    ], Schedule.prototype, "calendarMode", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "showWeekend", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(0)
    ], Schedule.prototype, "firstDayOfWeek", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('FirstDay')
    ], Schedule.prototype, "weekRule", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([1, 2, 3, 4, 5])
    ], Schedule.prototype, "workDays", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('00:00')
    ], Schedule.prototype, "startHour", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('24:00')
    ], Schedule.prototype, "endHour", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "allowResizing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _models_work_hours__WEBPACK_IMPORTED_MODULE_13__["WorkHours"])
    ], Schedule.prototype, "workHours", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _models_time_scale__WEBPACK_IMPORTED_MODULE_14__["TimeScale"])
    ], Schedule.prototype, "timeScale", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "allowKeyboardInteraction", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "allowDragAndDrop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "dateHeaderTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "cellHeaderTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "cellTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Schedule.prototype, "readonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "showQuickInfo", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Schedule.prototype, "allowInline", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "allowMultiCellSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "allowMultiRowSelection", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Schedule.prototype, "quickInfoOnSelectionEnd", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Schedule.prototype, "showWeekNumber", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Schedule.prototype, "rowAutoHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "editorTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _models_quick_info_templates__WEBPACK_IMPORTED_MODULE_15__["QuickInfoTemplates"])
    ], Schedule.prototype, "quickInfoTemplates", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(7)
    ], Schedule.prototype, "agendaDaysCount", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "hideEmptyAgendaDays", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Schedule.prototype, "enableRecurrenceValidation", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "timezone", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _models_event_settings__WEBPACK_IMPORTED_MODULE_19__["EventSettings"])
    ], Schedule.prototype, "eventSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "resourceHeaderTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _models_group__WEBPACK_IMPORTED_MODULE_20__["Group"])
    ], Schedule.prototype, "group", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], _models_resources__WEBPACK_IMPORTED_MODULE_21__["Resources"])
    ], Schedule.prototype, "resources", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], _models_header_rows__WEBPACK_IMPORTED_MODULE_16__["HeaderRows"])
    ], Schedule.prototype, "headerRows", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Schedule.prototype, "eventDragArea", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "destroyed", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "cellClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "cellDoubleClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "moreEventsClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "hover", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "actionBegin", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "actionComplete", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "actionFailure", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "navigating", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "renderCell", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "eventClick", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "eventRendered", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "dataBinding", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "popupOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "popupClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "dragStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "drag", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "dragStop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "resizeStart", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "resizing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "resizeStop", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], Schedule.prototype, "dataBound", void 0);
    Schedule = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], Schedule);
    return Schedule;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js":
/*!**************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js ***!
  \**************************************************************************/
/*! exports provided: WEEK_LENGTH, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, addLocalOffset, addLocalOffsetToEvent, capitalizeFirstWord */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WEEK_LENGTH", function() { return WEEK_LENGTH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MS_PER_DAY", function() { return MS_PER_DAY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MS_PER_MINUTE", function() { return MS_PER_MINUTE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementHeightFromClass", function() { return getElementHeightFromClass; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTranslateY", function() { return getTranslateY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekFirstDate", function() { return getWeekFirstDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekLastDate", function() { return getWeekLastDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstDateOfMonth", function() { return firstDateOfMonth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastDateOfMonth", function() { return lastDateOfMonth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekNumber", function() { return getWeekNumber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWeekMiddleDate", function() { return getWeekMiddleDate; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTime", function() { return setTime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetTime", function() { return resetTime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateInMs", function() { return getDateInMs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateCount", function() { return getDateCount; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDays", function() { return addDays; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMonths", function() { return addMonths; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addYears", function() { return addYears; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStartEndHours", function() { return getStartEndHours; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxDays", function() { return getMaxDays; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDaysCount", function() { return getDaysCount; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFromString", function() { return getDateFromString; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollBarWidth", function() { return getScrollBarWidth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndexInData", function() { return findIndexInData; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOuterHeight", function() { return getOuterHeight; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeChildren", function() { return removeChildren; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDaylightSavingTime", function() { return isDaylightSavingTime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLocalOffset", function() { return addLocalOffset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLocalOffsetToEvent", function() { return addLocalOffsetToEvent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "capitalizeFirstWord", function() { return capitalizeFirstWord; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");

/**
 * Schedule common utilities
 */
var WEEK_LENGTH = 7;
var MS_PER_DAY = 86400000;
var MS_PER_MINUTE = 60000;
function getElementHeightFromClass(container, elementClass) {
    var height = 0;
    var el = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: elementClass }).cloneNode();
    el.style.visibility = 'hidden';
    el.style.position = 'absolute';
    container.appendChild(el);
    height = el.getBoundingClientRect().height;
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(el);
    return height;
}
function getTranslateY(element) {
    var style = getComputedStyle(element);
    return window.WebKitCSSMatrix ?
        new WebKitCSSMatrix(style.webkitTransform).m42 : 0;
}
function getWeekFirstDate(date1, firstDayOfWeek) {
    var date = new Date(date1.getTime());
    firstDayOfWeek = (firstDayOfWeek - date.getDay() + 7 * (-1)) % 7;
    return new Date(date.setDate(date.getDate() + firstDayOfWeek));
}
function getWeekLastDate(date, firstDayOfWeek) {
    var weekFirst = getWeekFirstDate(date, firstDayOfWeek);
    var weekLast = new Date(weekFirst.getFullYear(), weekFirst.getMonth(), weekFirst.getDate() + 6);
    return new Date(weekLast.getTime());
}
function firstDateOfMonth(date) {
    return new Date(date.getFullYear(), date.getMonth());
}
function lastDateOfMonth(dt) {
    return new Date(dt.getFullYear(), dt.getMonth() + 1, 0);
}
function getWeekNumber(dt) {
    var date = new Date(dt.getFullYear(), 0, 1).valueOf();
    var currentDate = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate()).valueOf();
    var dayOfYear = ((currentDate - date + MS_PER_DAY) / MS_PER_DAY);
    return Math.ceil(dayOfYear / 7);
}
function getWeekMiddleDate(weekFirst, weekLast) {
    var date = new Date(weekLast.valueOf() - ((weekLast.valueOf() - weekFirst.valueOf()) / 2));
    return date;
}
function setTime(date, time) {
    var tzOffsetBefore = date.getTimezoneOffset();
    var d = new Date(date.getTime() + time);
    var tzOffsetDiff = d.getTimezoneOffset() - tzOffsetBefore;
    date.setTime(d.getTime() + tzOffsetDiff * MS_PER_MINUTE);
    return date;
}
function resetTime(date) {
    return new Date(date.getFullYear(), date.getMonth(), date.getDate());
}
function getDateInMs(date) {
    var sysDateOffset = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0).getTimezoneOffset();
    var dateOffset = date.getTimezoneOffset();
    var tzOffsetDiff = dateOffset - sysDateOffset;
    return ((date.getTime() - new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0).getTime())
        - (tzOffsetDiff * 60 * 1000));
}
function getDateCount(startDate, endDate) {
    return Math.ceil((endDate.getTime() - startDate.getTime()) / MS_PER_DAY);
}
function addDays(date, i) {
    date = new Date('' + date);
    return new Date(date.setDate(date.getDate() + i));
}
function addMonths(date, i) {
    date = new Date('' + date);
    var day = date.getDate();
    date.setDate(1);
    date.setMonth(date.getMonth() + i);
    date.setDate(Math.min(day, getMaxDays(date)));
    return date;
}
function addYears(date, i) {
    date = new Date('' + date);
    var day = date.getDate();
    date.setDate(1);
    date.setFullYear(date.getFullYear() + i);
    date.setDate(Math.min(day, getMaxDays(date)));
    return date;
}
function getStartEndHours(date, startHour, endHour) {
    var date1 = new Date(date.getTime());
    date1.setHours(startHour.getHours());
    date1.setMinutes(startHour.getMinutes());
    date1.setSeconds(startHour.getSeconds());
    var date2 = new Date(date.getTime());
    if (endHour.getHours() === 0) {
        date2 = addDays(date2, 1);
    }
    else {
        date2.setHours(endHour.getHours());
        date2.setMinutes(endHour.getMinutes());
        date2.setSeconds(endHour.getSeconds());
    }
    return { startHour: date1, endHour: date2 };
}
function getMaxDays(d) {
    var date = new Date(d.getFullYear(), d.getMonth() + 1, 0);
    return date.getDate();
}
function getDaysCount(startDate, endDate) {
    var strTime = resetTime(new Date(startDate));
    var endTime = resetTime(new Date(endDate));
    return Math.round((endTime.getTime() - strTime.getTime()) / MS_PER_DAY);
}
function getDateFromString(date) {
    return date.indexOf('Date') !== -1 ? new Date(parseInt(date.match(/\d+/g).toString(), 10)) :
        date.indexOf('T') !== -1 ? new Date(date) : new Date(date.replace(/-/g, '/'));
}
/** @hidden */
var scrollWidth = null;
/** @hidden */
function getScrollBarWidth() {
    if (scrollWidth !== null) {
        return scrollWidth;
    }
    var divNode = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
    var value = 0;
    divNode.style.cssText = 'width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;';
    document.body.appendChild(divNode);
    var ratio = (devicePixelRatio) ? (devicePixelRatio.toFixed(2) === '1.10' || devicePixelRatio <= 1) ?
        Math.ceil(devicePixelRatio % 1) : Math.floor(devicePixelRatio % 1) : 0;
    value = (divNode.offsetWidth - divNode.clientWidth - ratio) | 0;
    document.body.removeChild(divNode);
    return scrollWidth = value;
}
function findIndexInData(data, property, value, event, resourceCollection) {
    for (var i = 0, length_1 = data.length; i < length_1; i++) {
        if (data[i][property] === value) {
            if (event) {
                var field = resourceCollection.slice(-2)[0].field;
                var res = (event[field] instanceof Array ? event[field] : [event[field]]);
                var resData = res.join(',');
                // tslint:disable-next-line:no-any
                if (resData.includes(data[i][resourceCollection.slice(-1)[0].groupIDField])) {
                    return i;
                }
            }
            else {
                return i;
            }
        }
    }
    return -1;
}
function getOuterHeight(element) {
    var style = getComputedStyle(element);
    return element.offsetHeight + (parseInt(style.marginTop, 10) || 0) + (parseInt(style.marginBottom, 10) || 0);
}
function removeChildren(element) {
    var elementChildren = [].slice.call(element.children);
    for (var _i = 0, elementChildren_1 = elementChildren; _i < elementChildren_1.length; _i++) {
        var elementChild = elementChildren_1[_i];
        if (!elementChild.classList.contains('blazor-template')) {
            element.removeChild(elementChild);
        }
    }
}
function isDaylightSavingTime(date) {
    var jan = new Date(date.getFullYear(), 0, 1);
    var jul = new Date(date.getFullYear(), 6, 1);
    return date.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
function addLocalOffset(date) {
    return date;
}
function addLocalOffsetToEvent(event, eventFields) {
    return event;
}
function capitalizeFirstWord(inputString, type) {
    switch (type) {
        case 'multiple':
            inputString = inputString.split(' ').map(function (e) { return e.charAt(0).toLocaleUpperCase() + e.substring(1); }).join(' ');
            break;
        case 'single':
            if (inputString[0] >= '0' && inputString[0] <= '9') {
                var array = inputString.match(/[a-zA-Z]/);
                inputString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(array) ? inputString :
                    inputString.slice(0, array.index) + inputString[array.index].toLocaleUpperCase() + inputString.slice(array.index + 1);
            }
            inputString = inputString[0].toLocaleUpperCase() + inputString.slice(1);
            break;
    }
    return inputString;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/agenda-base.js":
/*!*******************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/agenda-base.js ***!
  \*******************************************************************************************/
/*! exports provided: AgendaBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendaBase", function() { return AgendaBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_lists__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-lists */ "./ej2-resources/18.4.46/scripts/ej2-lists/index.js");
/* harmony import */ var _renderer_view_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../renderer/view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");






var AgendaBase = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for AgendaBase
     */
    function AgendaBase(parent) {
        this.parent = parent;
        this.viewBase = new _renderer_view_base__WEBPACK_IMPORTED_MODULE_2__["ViewBase"](parent);
    }
    AgendaBase.prototype.createAgendaContentElement = function (type, listData, aTd, groupOrder, groupIndex) {
        var listElement;
        var fieldMapping = this.parent.eventFields;
        if (type === 'noEvents') {
            var noEvents = [{ 'subject': this.parent.localeObj.getConstant('noEvents') }];
            listElement = _ej2_lists__WEBPACK_IMPORTED_MODULE_1__["ListBase"].createList(this.parent.createElement, noEvents, {
                moduleName: 'agenda',
                listClass: this.parent.activeView.viewClass,
                itemClass: this.parent.activeView.viewClass,
                template: '<div class=' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_NO_EVENT_CLASS"] + '>${subject}</div>'
            });
        }
        else {
            listElement = _ej2_lists__WEBPACK_IMPORTED_MODULE_1__["ListBase"].createList(this.parent.createElement, listData, {
                moduleName: 'agenda',
                listClass: this.parent.activeView.viewClass,
                itemClass: this.parent.activeView.viewClass
            });
            var _loop_1 = function (li, length_1) {
                var appWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"], attrs: {
                        'data-id': 'Appointment_' + listData[li][this_1.parent.eventFields.id],
                        'data-guid': listData[li].Guid,
                        'role': 'button',
                        'tabindex': '0',
                        'aria-readonly': this_1.parent.eventBase.getReadonlyAttribute(listData[li]),
                        'aria-selected': 'false',
                        'aria-grabbed': 'true',
                        'aria-label': this_1.parent.getAnnocementString(listData[li])
                    }
                });
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
                    appWrapper.setAttribute('data-group-index', groupIndex.toString());
                }
                this_1.parent.eventBase.applyResourceColor(appWrapper, listData[li], 'borderColor', groupOrder);
                var templateEle = void 0;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this_1.parent.activeViewOptions.eventTemplate)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appWrapper], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_TEMPLATE"]);
                    var scheduleId = this_1.parent.element.id + '_';
                    var viewName = this_1.parent.activeViewOptions.eventTemplateName;
                    var templateId = scheduleId + viewName + 'eventTemplate';
                    var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffsetToEvent"](listData[li], this_1.parent.eventFields);
                    templateEle = this_1.parent.getAppointmentTemplate()(templateArgs, this_1.parent, 'eventTemplate', templateId, false);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(listData[li][fieldMapping.recurrenceRule])) {
                        var iconClass = (listData[li][fieldMapping.id] === listData[li][fieldMapping.recurrenceID]) ?
                            _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_ICON_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_EDIT_ICON_CLASS"];
                        appWrapper.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ICON"] + ' ' + iconClass }));
                    }
                }
                else {
                    templateEle = this_1.createAppointment(listData[li]);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(templateEle), appWrapper);
                _base_util__WEBPACK_IMPORTED_MODULE_3__["removeChildren"](listElement.children[li]);
                listElement.children[li].appendChild(appWrapper);
                var args = {
                    data: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, listData[li], null, true),
                    element: listElement.children[li], cancel: false
                };
                this_1.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventRendered"], args, function (eventArgs) {
                    if (eventArgs.cancel) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(listElement.children[li]);
                    }
                });
            };
            var this_1 = this;
            for (var li = 0, length_1 = listData.length; li < length_1; li++) {
                _loop_1(li, length_1);
            }
        }
        aTd.appendChild(listElement);
        if ((this.parent.currentView === 'MonthAgenda' && this.parent.activeViewOptions.group.resources.length > 0)
            || this.parent.currentView === 'Agenda') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([aTd], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_DAY_BORDER_CLASS"]);
        }
        this.parent.renderTemplates();
        return aTd;
    };
    AgendaBase.prototype.createAppointment = function (event) {
        var fieldMapping = this.parent.eventFields;
        var eventSubject = (event[fieldMapping.subject] || this.parent.eventSettings.fields.subject.default);
        var eventLocation = (event[fieldMapping.location] || this.parent.eventSettings.fields.location.default);
        var appSubjectWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_WRAP"] });
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventLocation) && eventLocation !== '') {
            eventSubject += ',';
        }
        appSubjectWrap.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"], innerHTML: eventSubject }));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventLocation) && eventLocation !== '') {
            appSubjectWrap.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["LOCATION_CLASS"], innerHTML: eventLocation }));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event[fieldMapping.recurrenceRule])) {
            var iconClass = (event[fieldMapping.id] === event[fieldMapping.recurrenceID]) ?
                _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_ICON_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_EDIT_ICON_CLASS"];
            appSubjectWrap.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ICON"] + ' ' + iconClass }));
        }
        var strDate = event[fieldMapping.startTime];
        var endDate = event[fieldMapping.endTime];
        var isAllDay = event[fieldMapping.isAllDay];
        var allDayStr = this.parent.localeObj.getConstant('allDay');
        var timeStr = this.parent.getTimeString(strDate) + ' - ' + this.parent.getTimeString(endDate);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event.data)) {
            var milliSeconds = (endDate.getTimezoneOffset() !== strDate.getTimezoneOffset()) ?
                (endDate.getTime() - strDate.getTime() + 3600000) : (endDate.getTime() - strDate.getTime());
            var eventString = (milliSeconds / _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]) >= 1 ? allDayStr : timeStr;
            allDayStr = eventString + ' (' + this.parent.localeObj.getConstant('day') + ' '
                + event.data.index + '/' + event.data.count + ')';
        }
        var displayStr = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event.data) || isAllDay) ? allDayStr : timeStr;
        var appDateTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DATE_TIME_CLASS"], innerHTML: displayStr });
        return [appSubjectWrap, appDateTime];
    };
    AgendaBase.prototype.processAgendaEvents = function (events) {
        var eventsProcessed = [];
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(events)) {
            return eventsProcessed;
        }
        for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
            var event_1 = events_1[_i];
            var splited = this.parent.eventBase.splitEventByDay(event_1);
            eventsProcessed = eventsProcessed.concat(splited.length > 1 ? splited : event_1);
        }
        return eventsProcessed;
    };
    AgendaBase.prototype.wireEventActions = function () {
        var eventElement = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]));
        for (var _i = 0, eventElement_1 = eventElement; _i < eventElement_1.length; _i++) {
            var element = eventElement_1[_i];
            this.parent.eventBase.wireAppointmentEvents(element, null, true);
        }
        var dateHeaderElement = [].slice.call(this.parent.element.querySelectorAll('.e-m-date'));
        for (var _a = 0, dateHeaderElement_1 = dateHeaderElement; _a < dateHeaderElement_1.length; _a++) {
            var element = dateHeaderElement_1[_a];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.parent.agendaModule.dayNavigationClick, this);
        }
    };
    AgendaBase.prototype.calculateResourceTableElement = function (tBody, noOfDays, agendaDate) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.resourceBase.lastResourceLevel)) {
            var level = this.viewBase.getDateSlots(this.viewBase.renderDates, this.parent.activeViewOptions.workDays);
            this.parent.resourceBase.generateResourceLevels(level);
        }
        var agendaLastDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(agendaDate.getTime()), noOfDays);
        var days = (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') ? noOfDays : 1;
        var resColl = this.parent.resourceBase.resourceCollection;
        var resData = this.parent.resourceBase.lastResourceLevel;
        var initialDate = agendaDate;
        for (var i = 0; i < days; i++) {
            var lastLevelInfo = [];
            var tempLastLevelInfo = [];
            var tempIndex = 0;
            var eventObj = void 0;
            var dateObj = void 0;
            var firstDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](initialDate, i);
            var finalDate = (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda')
                ? _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](firstDate, 1) : agendaLastDate;
            var agendaCollection = this.parent.eventBase.filterEvents(firstDate, finalDate);
            if (agendaCollection.length > 0 || !this.parent.hideEmptyAgendaDays || this.parent.currentView === 'MonthAgenda') {
                for (var res = 0; res < resData.length; res++) {
                    noOfDays = (!this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') ? noOfDays : 1;
                    var data = [];
                    agendaDate = firstDate;
                    var resDataCollection = this.parent.eventBase.filterEvents(agendaDate, agendaLastDate, agendaCollection, resData[res]);
                    if (resDataCollection.length > 0 || !this.parent.hideEmptyAgendaDays || this.parent.currentView === 'MonthAgenda') {
                        for (var r = 0; r < noOfDays; r++) {
                            var resDayCollection = this.parent.eventBase.filterEvents(agendaDate, _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](agendaDate, 1), resDataCollection, undefined);
                            if (resDayCollection.length > 0 || !this.parent.hideEmptyAgendaDays ||
                                this.parent.currentView === 'MonthAgenda') {
                                data.push(resDayCollection[0]);
                                eventObj = {
                                    rowSpan: 1, type: 'eventColumn', resource: resColl[resColl.length - 1],
                                    groupIndex: resData[res].groupIndex, groupOrder: resData[res].groupOrder,
                                    resourceData: resData[res].resourceData, eventData: resDayCollection, date: agendaDate
                                };
                                dateObj = {
                                    rowSpan: 1, type: 'dateColumn', resource: resColl[resColl.length - 1],
                                    groupOrder: resData[res].groupOrder, resourceData: resData[res].resourceData,
                                    date: agendaDate
                                };
                                if (!lastLevelInfo[tempIndex]) {
                                    lastLevelInfo[tempIndex] = [];
                                }
                                lastLevelInfo[tempIndex].push(eventObj);
                                lastLevelInfo[tempIndex].push(dateObj);
                                tempIndex++;
                            }
                            agendaDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](agendaDate, 1);
                            if (agendaDate.getTime() >= agendaLastDate.getTime() || this.parent.activeViewOptions.group.byDate
                                || this.parent.currentView === 'MonthAgenda') {
                                lastLevelInfo[lastLevelInfo.length - 1][1].cssClass = _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_DAY_BORDER_CLASS"];
                                var tempObj = {
                                    rowSpan: data.length, type: 'resourceColumn', resource: resColl[resColl.length - 1],
                                    groupOrder: resData[res].groupOrder.slice(0, -1), resourceData: resData[res].resourceData,
                                    groupIndex: (lastLevelInfo.length - data.length), className: [_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["RESOURCE_NAME"]],
                                    date: agendaDate
                                };
                                lastLevelInfo[lastLevelInfo.length - data.length].push(tempObj);
                                tempLastLevelInfo.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, tempObj, null, true));
                                break;
                            }
                        }
                    }
                }
                var topResources = resColl.slice(0, -1);
                var tempGroupedData = [];
                var totalRowSpan = 0;
                for (var y = 0; y < topResources.length; y++) {
                    var data = topResources[topResources.length - (y + 1)]
                        .dataSource;
                    for (var x = 0; x < data.length; x++) {
                        var z = 0;
                        for (var u = 0; u < tempLastLevelInfo.length; u++) {
                            if (tempLastLevelInfo[u].groupOrder[topResources.length - (y + 1)] === data[x][topResources[topResources.length - (y + 1)].idField]) {
                                totalRowSpan = totalRowSpan + tempLastLevelInfo[u].rowSpan;
                                tempGroupedData.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, tempLastLevelInfo[u], null, true));
                            }
                            if (++z === tempLastLevelInfo.length && tempGroupedData.length > 0) {
                                tempGroupedData[0].rowSpan = totalRowSpan;
                                tempGroupedData[0].type = 'parentColumnLevel_' + (y + 1);
                                tempGroupedData[0].resource = topResources[topResources.length - (y + 1)];
                                tempGroupedData[0].resourceData = data[x];
                                tempGroupedData[0].date = agendaDate;
                                lastLevelInfo[tempGroupedData[0].groupIndex].push(tempGroupedData[0]);
                                tempGroupedData = [];
                                totalRowSpan = 0;
                            }
                        }
                    }
                }
                this.createResourceTableRow(lastLevelInfo, tBody);
            }
        }
        var totalCollection = this.parent.eventBase.filterEvents(initialDate, agendaLastDate);
        if (totalCollection.length === 0 && !this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) {
            this.renderEmptyContent(tBody, initialDate);
        }
    };
    AgendaBase.prototype.createResourceTableRow = function (tContent, tBody) {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { role: 'row' } });
        var ntr;
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
        var tempData;
        var rowSpan = 0;
        var level;
        if (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') {
            var tContentCollection = [];
            var parentCollection = this.parent.resourceBase.resourceCollection.slice(0, -1);
            for (var w = 0; w < tContent.length; w++) {
                tContentCollection = tContentCollection.concat(tContent[w]);
            }
            level = (parentCollection.length > 0) ? 'parentColumnLevel_' + parentCollection.length : 'resourceColumn';
            var rowSpanCollection = tContentCollection.filter(function (data) { return data.type === level; });
            for (var x = 0; x < rowSpanCollection.length; x++) {
                rowSpan = rowSpan + rowSpanCollection[x].rowSpan;
            }
        }
        for (var row = 0; row < tContent.length; row++) {
            ntr = tr.cloneNode();
            for (var col = tContent[row].length - 1; col >= 0; col--) {
                var data = tContent[row][col];
                var ntd = td.cloneNode();
                if (data.type === 'dateColumn') {
                    if (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') {
                        tempData = tContent[row][col];
                        continue;
                    }
                    ntd.setAttribute('data-date', data.date.getTime().toString());
                    ntd.appendChild(this.createDateHeaderElement(data.date));
                    var className = [_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_DATE_CLASS"]];
                    if (data.cssClass) {
                        className.push(data.cssClass);
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], className);
                    ntr.appendChild(ntd);
                }
                else if (data.type === 'eventColumn') {
                    var elementType = (data.eventData.length === 0) ? 'noEvents' : 'data';
                    ntd = this.createAgendaContentElement(elementType, data.eventData, ntd, data.groupOrder, data.groupIndex);
                    ntd.setAttribute('data-date', data.date.getTime().toString());
                    if (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], [_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_DAY_PADDING_CLASS"]]);
                    }
                    ntr.appendChild(ntd);
                }
                else {
                    ntd.setAttribute('rowspan', data.rowSpan.toString());
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_RESOURCE_CLASS"]);
                    this.viewBase.setResourceHeaderContent(ntd, data, data.className[0]);
                    ntr.appendChild(ntd);
                }
            }
            if (this.parent.activeViewOptions.group.byDate && row === 0 && this.parent.currentView !== 'MonthAgenda') {
                var ntd = td.cloneNode();
                ntd.setAttribute('data-date', tempData.date.getTime().toString());
                ntd.setAttribute('rowspan', rowSpan.toString());
                ntd.appendChild(this.createDateHeaderElement(tempData.date));
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], [_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_DATE_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DATE_BORDER_CLASS"]]);
                var daysCount = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDaysCount"](this.parent.selectedDate.getTime(), tempData.date.getTime());
                ntr.setAttribute('aria-rowindex', daysCount.toString());
                if (this.parent.element.querySelector(".e-agenda-view tr[aria-rowindex=\"" + daysCount + "\"]")) {
                    break;
                }
                ntr.insertBefore(ntd, ntr.childNodes[0]);
            }
            tBody.appendChild(ntr);
        }
    };
    AgendaBase.prototype.createDateHeaderElement = function (date) {
        var dateHeader;
        if (this.parent.activeViewOptions.dateHeaderTemplate) {
            dateHeader = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_HEADER_CLASS"] });
            var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffset"](date);
            var args = { date: dateValue, type: 'dateHeader' };
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.dateHeaderTemplateName;
            var templateId = scheduleId + viewName + 'dateHeaderTemplate';
            var dateTemplate = [].slice.call(this.parent.getDateHeaderTemplate()(args, this.parent, 'dateHeaderTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(dateTemplate, dateHeader);
        }
        else {
            dateHeader = this.viewBase.getMobileDateElement(date, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_HEADER_CLASS"]);
        }
        return dateHeader;
    };
    AgendaBase.prototype.renderEmptyContent = function (tBody, agendaDate) {
        var eTr = this.createTableRowElement(agendaDate, 'noEvents');
        var eTd = eTr.children[0];
        var noEvents = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_EMPTY_EVENT_CLASS"],
            innerHTML: this.parent.localeObj.getConstant('noEvents')
        });
        eTd.appendChild(noEvents);
        tBody.appendChild(eTr);
    };
    AgendaBase.prototype.createTableRowElement = function (date, type) {
        var daysCount = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDaysCount"](this.parent.selectedDate.getTime(), date.getTime());
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { 'role': 'row', 'aria-rowindex': daysCount.toString() } });
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
            attrs: {
                'class': (type === 'monthHeader') ? _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MONTH_HEADER_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_CELLS_CLASS"],
                'role': 'gridcell',
                'aria-selected': 'false',
                'aria-colindex': daysCount.toString(),
                'data-date': date.getTime().toString()
            }
        });
        var dTd = td.cloneNode();
        var aTd = td.cloneNode();
        tr.appendChild(dTd);
        if (type !== 'noEvents') {
            tr.appendChild(aTd);
        }
        return tr;
    };
    return AgendaBase;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/event-base.js":
/*!******************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/event-base.js ***!
  \******************************************************************************************/
/*! exports provided: EventBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBase", function() { return EventBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../recurrence-editor/date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");







/**
 * EventBase for appointment rendering
 */
var EventBase = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for EventBase
     */
    function EventBase(parent) {
        this.slots = [];
        this.isDoubleTapped = false;
        this.parent = parent;
    }
    EventBase.prototype.processData = function (events, timeZonePropChanged, oldTimezone) {
        var _this = this;
        var start = this.parent.activeView.startDate();
        var end = this.parent.activeView.endDate();
        var fields = this.parent.eventFields;
        var processed = [];
        var temp = 1;
        var generateID = false;
        var resourceCollection = this.parent.resourceBase ? this.parent.resourceBase.resourceCollection : [];
        if (events.length > 0 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(events[0][fields.id])) {
            generateID = true;
        }
        var _loop_1 = function (event_1) {
            if (generateID) {
                event_1[fields.id] = temp++;
            }
            if (typeof event_1[fields.startTime] === 'string') {
                event_1[fields.startTime] = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDateFromString"](event_1[fields.startTime]);
            }
            if (typeof event_1[fields.endTime] === 'string') {
                event_1[fields.endTime] = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDateFromString"](event_1[fields.endTime]);
            }
            if (timeZonePropChanged) {
                this_1.processTimezoneChange(event_1, oldTimezone);
            }
            else {
                event_1 = this_1.processTimezone(event_1);
            }
            for (var level = 0; level < resourceCollection.length; level++) {
                if (event_1[resourceCollection[level].field] === null || event_1[resourceCollection[level].field] === 0) {
                    event_1[resourceCollection[level].field] = undefined;
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_1[fields.recurrenceRule]) && event_1[fields.recurrenceRule] === '') {
                event_1[fields.recurrenceRule] = null;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_1[fields.recurrenceRule]) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_1[fields.recurrenceID]) &&
                !(this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction)) {
                processed = processed.concat(this_1.generateOccurrence(event_1, null, oldTimezone, true));
            }
            else {
                if (this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction) {
                    var recEvent = void 0;
                    var app = void 0;
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_1[fields.recurrenceRule]) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_1[fields.recurrenceID])) {
                        recEvent = this_1.generateOccurrence(event_1, null, oldTimezone, true);
                        for (var k = 0; k < recEvent.length; k++) {
                            event_1 = recEvent[k];
                            app = this_1.parent.eventsProcessed.filter(function (data) {
                                return (data[_this.parent.eventFields.startTime].getTime() -
                                    event_1[_this.parent.eventFields.startTime].getTime() === 0 &&
                                    data[_this.parent.eventFields.id] === event_1[_this.parent.eventFields.id]);
                            });
                            event_1.Guid = (app.length > 0) ? app[0].Guid : this_1.generateGuid();
                            processed.push(event_1);
                        }
                    }
                    else {
                        app = this_1.parent.eventsProcessed.filter(function (data) {
                            return data[_this.parent.eventFields.id] === event_1[_this.parent.eventFields.id];
                        });
                        event_1.Guid = (app.length > 0) ? app[0].Guid : this_1.generateGuid();
                        processed.push(event_1);
                    }
                }
                else {
                    event_1.Guid = this_1.generateGuid();
                    processed.push(event_1);
                }
            }
        };
        var this_1 = this;
        for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
            var event_1 = events_1[_i];
            _loop_1(event_1);
        }
        this.parent.eventsProcessed = [];
        var eventData = processed.filter(function (data) { return !data[_this.parent.eventFields.isBlock]; });
        this.parent.eventsProcessed = this.filterEvents(start, end, eventData);
        var blockData = processed.filter(function (data) { return data[_this.parent.eventFields.isBlock]; });
        for (var i = 0, len = blockData.length; i < len; i++) {
            var eventObj = blockData[i];
            if (eventObj[fields.isAllDay]) {
                eventObj[fields.startTime] = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](eventObj[fields.startTime]);
                eventObj[fields.endTime] = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](eventObj[fields.endTime]), 1);
            }
        }
        this.parent.blockProcessed = blockData;
        return eventData;
    };
    EventBase.prototype.getProcessedEvents = function (eventCollection) {
        if (eventCollection === void 0) { eventCollection = this.parent.eventsData; }
        var processed = [];
        for (var _i = 0, _a = eventCollection; _i < _a.length; _i++) {
            var event_2 = _a[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_2[this.parent.eventFields.recurrenceRule]) &&
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_2[this.parent.eventFields.recurrenceID])) {
                processed = processed.concat(this.generateOccurrence(event_2));
            }
            else {
                processed.push(event_2);
            }
        }
        return processed;
    };
    EventBase.prototype.timezonePropertyChange = function (oldTimezone) {
        var data = this.parent.eventsData.concat(this.parent.blockData);
        var processed = this.processData(data, true, oldTimezone);
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["dataReady"], { processedData: processed });
    };
    /** @private */
    EventBase.prototype.timezoneConvert = function (eventData) {
        var fields = this.parent.eventFields;
        eventData[fields.startTimezone] = eventData[fields.startTimezone] || eventData[fields.endTimezone];
        eventData[fields.endTimezone] = eventData[fields.endTimezone] || eventData[fields.startTimezone];
        if (this.parent.timezone) {
            var startTz = eventData[fields.startTimezone];
            var endTz = eventData[fields.endTimezone];
            eventData[fields.startTime] = this.parent.tzModule.convert(eventData[fields.startTime], this.parent.timezone, startTz);
            eventData[fields.endTime] = this.parent.tzModule.convert(eventData[fields.endTime], this.parent.timezone, endTz);
        }
    };
    EventBase.prototype.processTimezoneChange = function (event, oldTimezone) {
        var fields = this.parent.eventFields;
        if (event[fields.isAllDay]) {
            return;
        }
        if (oldTimezone && this.parent.timezone) {
            event[fields.startTime] = this.parent.tzModule.convert(event[fields.startTime], oldTimezone, this.parent.timezone);
            event[fields.endTime] = this.parent.tzModule.convert(event[fields.endTime], oldTimezone, this.parent.timezone);
        }
        else if (!oldTimezone && this.parent.timezone) {
            event[fields.startTime] = this.parent.tzModule.add(event[fields.startTime], this.parent.timezone);
            event[fields.endTime] = this.parent.tzModule.add(event[fields.endTime], this.parent.timezone);
        }
        else if (oldTimezone && !this.parent.timezone) {
            event[fields.startTime] = this.parent.tzModule.remove(event[fields.startTime], oldTimezone);
            event[fields.endTime] = this.parent.tzModule.remove(event[fields.endTime], oldTimezone);
        }
    };
    EventBase.prototype.processTimezone = function (event, isReverse) {
        if (isReverse === void 0) { isReverse = false; }
        var fields = this.parent.eventFields;
        if (event[fields.startTimezone] || event[fields.endTimezone]) {
            var startTimezone = event[fields.startTimezone] || event[fields.endTimezone];
            var endTimezone = event[fields.endTimezone] || event[fields.startTimezone];
            if (isReverse) {
                if (this.parent.timezone) {
                    event[fields.startTime] =
                        this.parent.tzModule.convert(event[fields.startTime], startTimezone, this.parent.timezone);
                    event[fields.endTime] = this.parent.tzModule.convert(event[fields.endTime], endTimezone, this.parent.timezone);
                    event[fields.startTime] = this.parent.tzModule.remove(event[fields.startTime], this.parent.timezone);
                    event[fields.endTime] = this.parent.tzModule.remove(event[fields.endTime], this.parent.timezone);
                }
                else {
                    event[fields.startTime] = this.parent.tzModule.remove(event[fields.startTime], startTimezone);
                    event[fields.endTime] = this.parent.tzModule.remove(event[fields.endTime], endTimezone);
                }
            }
            else {
                event[fields.startTime] = this.parent.tzModule.add(event[fields.startTime], startTimezone);
                event[fields.endTime] = this.parent.tzModule.add(event[fields.endTime], endTimezone);
                if (this.parent.timezone) {
                    event[fields.startTime] =
                        this.parent.tzModule.convert(event[fields.startTime], startTimezone, this.parent.timezone);
                    event[fields.endTime] = this.parent.tzModule.convert(event[fields.endTime], endTimezone, this.parent.timezone);
                }
            }
        }
        else if (this.parent.timezone) {
            if (isReverse) {
                event[fields.startTime] = this.parent.tzModule.remove(event[fields.startTime], this.parent.timezone);
                event[fields.endTime] = this.parent.tzModule.remove(event[fields.endTime], this.parent.timezone);
            }
            else {
                event[fields.startTime] = this.parent.tzModule.add(event[fields.startTime], this.parent.timezone);
                event[fields.endTime] = this.parent.tzModule.add(event[fields.endTime], this.parent.timezone);
            }
        }
        return event;
    };
    EventBase.prototype.filterBlockEvents = function (eventObj) {
        var eStart = eventObj[this.parent.eventFields.startTime];
        var eEnd = eventObj[this.parent.eventFields.endTime];
        var resourceData;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var data = this.getGroupIndexFromEvent(eventObj);
            resourceData = this.parent.resourceBase.lastResourceLevel[data];
        }
        return this.filterEvents(eStart, eEnd, this.parent.blockProcessed, resourceData);
    };
    EventBase.prototype.filterEvents = function (startDate, endDate, appointments, resourceTdData) {
        if (appointments === void 0) { appointments = this.parent.eventsProcessed; }
        var fieldMapping = this.parent.eventFields;
        var predicate = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fieldMapping.startTime, 'greaterthanorequal', startDate).
            and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fieldMapping.endTime, 'greaterthanorequal', startDate)).
            and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fieldMapping.startTime, 'lessthan', endDate)).
            or(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fieldMapping.startTime, 'lessthanorequal', startDate).
            and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fieldMapping.endTime, 'greaterthan', startDate)));
        var filter = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"]({ json: appointments }).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(predicate));
        if (resourceTdData) {
            filter = this.filterEventsByResource(resourceTdData, filter);
        }
        return this.sortByTime(filter);
    };
    EventBase.prototype.filterEventsByRange = function (eventCollection, startDate, endDate) {
        var _this = this;
        var filteredEvents = [];
        if (startDate && endDate) {
            filteredEvents = this.filterEvents(startDate, endDate, eventCollection);
        }
        else if (startDate && !endDate) {
            filteredEvents = eventCollection.filter(function (e) { return e[_this.parent.eventFields.startTime] >= startDate; });
        }
        else if (!startDate && endDate) {
            filteredEvents = eventCollection.filter(function (e) { return e[_this.parent.eventFields.endTime] <= endDate; });
        }
        else {
            filteredEvents = eventCollection;
        }
        return this.sortByTime(filteredEvents);
    };
    EventBase.prototype.filterEventsByResource = function (resourceTdData, appointments) {
        if (appointments === void 0) { appointments = this.parent.eventsProcessed; }
        var predicate = {};
        var resourceCollection = this.parent.resourceBase.resourceCollection;
        for (var level = 0; level < resourceCollection.length; level++) {
            predicate[resourceCollection[level].field] = resourceTdData.groupOrder[level];
        }
        var keys = Object.keys(predicate);
        var filteredCollection = appointments.filter(function (eventObj) { return keys.every(function (key) {
            if (eventObj[key] instanceof Array) {
                return eventObj[key].indexOf(predicate[key]) > -1;
            }
            else {
                return eventObj[key] === predicate[key];
            }
        }); });
        return filteredCollection;
    };
    EventBase.prototype.sortByTime = function (appointments) {
        var fieldMapping = this.parent.eventFields;
        appointments.sort(function (a, b) {
            var d1 = a[fieldMapping.startTime];
            var d2 = b[fieldMapping.startTime];
            return d1.getTime() - d2.getTime();
        });
        return appointments;
    };
    EventBase.prototype.sortByDateTime = function (appointments) {
        var fieldMapping = this.parent.eventFields;
        appointments.sort(function (object1, object2) {
            var d3 = object1[fieldMapping.startTime];
            var d4 = object2[fieldMapping.startTime];
            var d5 = object1[fieldMapping.endTime];
            var d6 = object2[fieldMapping.endTime];
            var d1 = d5.getTime() - d3.getTime();
            var d2 = d6.getTime() - d4.getTime();
            return (d3.getTime() - d4.getTime() || d2 - d1);
        });
        return appointments;
    };
    EventBase.prototype.getSmallestMissingNumber = function (array) {
        var large = Math.max.apply(Math, array);
        for (var i = 0; i < large; i++) {
            if (array.indexOf(i) === -1) {
                return i;
            }
        }
        return large + 1;
    };
    EventBase.prototype.splitEventByDay = function (event) {
        var eventFields = this.parent.eventFields;
        var data = [];
        var eventStartTime = event[eventFields.startTime];
        var eventEndTime = event[eventFields.endTime];
        var isDifferentDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(eventStartTime.getTime())) <
            _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(eventEndTime.getTime()));
        if (isDifferentDate) {
            var start = new Date(eventStartTime.getTime());
            var end = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(eventStartTime.getTime())), 1);
            var endDate = (eventEndTime.getHours() === 0 && eventEndTime.getMinutes() === 0) ?
                eventEndTime : _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](eventEndTime, 1);
            var index = 1;
            var eventLength = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDaysCount"](eventStartTime.getTime(), endDate.getTime());
            while (end <= eventEndTime && start.getTime() !== end.getTime()) {
                var app = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event);
                app[eventFields.startTime] = start;
                app[eventFields.endTime] = end;
                app.data = { index: index, count: eventLength };
                app.Guid = this.generateGuid();
                app.isSpanned = true;
                data.push(app);
                start = end;
                if ((_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(start.getTime())).getTime() === _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(eventEndTime.getTime())).getTime())
                    && !(end.getTime() === eventEndTime.getTime())) {
                    end = new Date(start.getTime());
                    end = new Date(end.setHours(eventEndTime.getHours(), eventEndTime.getMinutes(), eventEndTime.getSeconds()));
                }
                else {
                    end = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(start.getTime())), 1);
                }
                index++;
            }
        }
        else {
            data.push(event);
        }
        return data;
    };
    EventBase.prototype.splitEvent = function (event, dateRender) {
        var fields = this.parent.eventFields;
        var start = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(event[fields.startTime] + '')).getTime();
        var end = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(event[fields.endTime] + '')).getTime();
        if (_base_util__WEBPACK_IMPORTED_MODULE_3__["getDateInMs"](event[fields.endTime]) <= 0) {
            var temp = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(event[fields.endTime] + '')), -1).getTime();
            end = start > temp ? start : temp;
        }
        var orgStart = start;
        var orgEnd = end;
        var ranges = [];
        if (start !== end) {
            if (start < dateRender[0].getTime()) {
                start = dateRender[0].getTime();
            }
            if (end > dateRender[dateRender.length - 1].getTime()) {
                end = dateRender[dateRender.length - 1].getTime();
            }
            var cStart = start;
            for (var level = 0; level < this.slots.length; level++) {
                var slot = this.slots[level];
                if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek'
                    || this.parent.activeViewOptions.group.byDate || this.parent.activeViewOptions.showWeekend) {
                    var slotDates = [];
                    for (var _i = 0, slot_1 = slot; _i < slot_1.length; _i++) {
                        var s = slot_1[_i];
                        slotDates.push(new Date(s));
                    }
                    var renderedDates = this.getRenderedDates(slotDates);
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(renderedDates) && renderedDates.length > 0) {
                        slot = [];
                        for (var _a = 0, renderedDates_1 = renderedDates; _a < renderedDates_1.length; _a++) {
                            var date = renderedDates_1[_a];
                            slot.push(date.getTime());
                        }
                    }
                }
                var firstSlot = slot[0];
                cStart = (cStart <= firstSlot && end >= firstSlot) ? firstSlot : cStart;
                if (cStart > end || firstSlot > end) {
                    break;
                }
                if (!this.parent.activeViewOptions.group.byDate && this.parent.activeViewOptions.showWeekend &&
                    this.parent.currentView !== 'WorkWeek' && this.parent.currentView !== 'TimelineWorkWeek') {
                    var startIndex = slot.indexOf(cStart);
                    if (startIndex !== -1) {
                        var endIndex = slot.indexOf(end);
                        var hasBreak = endIndex !== -1;
                        endIndex = hasBreak ? endIndex : slot.length - 1;
                        var count = ((endIndex - startIndex) + 1);
                        var isLeft = (slot[startIndex] !== orgStart);
                        var isRight = (slot[endIndex] !== orgEnd);
                        ranges.push(this.cloneEventObject(event, slot[startIndex], slot[endIndex], count, isLeft, isRight));
                        if (hasBreak) {
                            break;
                        }
                    }
                }
                else {
                    if (this.dateInRange(cStart, slot[0], slot[slot.length - 1])) {
                        var availSlot = [];
                        for (var i = 0; i < slot.length; i++) {
                            if (this.dateInRange(slot[i], orgStart, orgEnd)) {
                                availSlot.push(slot[i]);
                            }
                        }
                        if (availSlot.length > 0) {
                            if (!this.parent.activeViewOptions.group.byDate) {
                                var isLeft = (availSlot[0] !== orgStart);
                                var isRight = (availSlot[availSlot.length - 1] !== orgEnd);
                                ranges.push(this.cloneEventObject(event, availSlot[0], availSlot[availSlot.length - 1], availSlot.length, isLeft, isRight));
                            }
                            else {
                                for (var _b = 0, availSlot_1 = availSlot; _b < availSlot_1.length; _b++) {
                                    var slot_2 = availSlot_1[_b];
                                    ranges.push(this.cloneEventObject(event, slot_2, slot_2, 1, (slot_2 !== orgStart), (slot_2 !== orgEnd)));
                                }
                            }
                        }
                    }
                }
            }
        }
        else {
            ranges.push(this.cloneEventObject(event, start, end, 1, false, false));
        }
        return ranges;
    };
    EventBase.prototype.cloneEventObject = function (event, start, end, count, isLeft, isRight) {
        var fields = this.parent.eventFields;
        var e = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true);
        var data = { count: count, isLeft: isLeft, isRight: isRight };
        data[fields.startTime] = event[fields.startTime];
        data[fields.endTime] = event[fields.endTime];
        e.data = data;
        e[fields.startTime] = new Date(start);
        e[fields.endTime] = new Date(end);
        return e;
    };
    EventBase.prototype.dateInRange = function (date, start, end) {
        return start <= date && date <= end;
    };
    EventBase.prototype.getSelectedEventElements = function (target) {
        this.removeSelectedAppointmentClass();
        if (this.parent.selectedElements.length <= 0) {
            this.parent.selectedElements.push(target);
        }
        else {
            var isAlreadySelected = this.parent.selectedElements.filter(function (element) {
                return element.getAttribute('data-guid') === target.getAttribute('data-guid');
            });
            if (isAlreadySelected.length <= 0) {
                var elementSelector = 'div[data-guid="' + target.getAttribute('data-guid') + '"]';
                var focusElements = [].slice.call(this.parent.element.querySelectorAll(elementSelector));
                for (var _i = 0, focusElements_1 = focusElements; _i < focusElements_1.length; _i++) {
                    var element = focusElements_1[_i];
                    this.parent.selectedElements.push(element);
                }
            }
            else {
                var selectedElements = this.parent.selectedElements.filter(function (element) {
                    return element.getAttribute('data-guid') !== target.getAttribute('data-guid');
                });
                this.parent.selectedElements = selectedElements;
            }
        }
        if (target && this.parent.selectedElements.length > 0) {
            this.addSelectedAppointments(this.parent.selectedElements);
        }
        return this.parent.selectedElements;
    };
    EventBase.prototype.getSelectedEvents = function () {
        var _this = this;
        var eventSelect = [];
        var elementSelect = [];
        var selectAppointments = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_BORDER"]));
        selectAppointments.filter(function (element) {
            var isAlreadyAdded = eventSelect.filter(function (event) {
                return event.Guid === element.getAttribute('data-guid');
            });
            if (isAlreadyAdded.length === 0) {
                eventSelect.push(_this.getEventByGuid(element.getAttribute('data-guid')));
            }
            elementSelect.push(element);
        });
        return {
            event: eventSelect.length > 1 ? eventSelect : eventSelect[0],
            element: elementSelect.length > 1 ? elementSelect : elementSelect[0]
        };
    };
    EventBase.prototype.removeSelectedAppointmentClass = function () {
        var selectedAppointments = this.getSelectedAppointments();
        for (var _i = 0, selectedAppointments_1 = selectedAppointments; _i < selectedAppointments_1.length; _i++) {
            var appointment = selectedAppointments_1[_i];
            appointment.setAttribute('aria-selected', 'false');
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selectedAppointments, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_BORDER"]);
        if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selectedAppointments, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_SELECTED_CELL"]);
        }
    };
    EventBase.prototype.addSelectedAppointments = function (cells) {
        for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
            var cell = cells_1[_i];
            cell.setAttribute('aria-selected', 'true');
        }
        if (this.parent.currentView !== 'MonthAgenda') {
            this.parent.removeSelectedClass();
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(cells, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_BORDER"]);
    };
    EventBase.prototype.getSelectedAppointments = function () {
        return [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_BORDER"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"] + ':focus'));
    };
    EventBase.prototype.focusElement = function () {
        if (this.parent.eventWindow.dialogObject && this.parent.eventWindow.dialogObject.visible) {
            return;
        }
        var selectedCell = this.parent.getSelectedElements();
        if (selectedCell.length > 0) {
            if (this.parent.keyboardInteractionModule) {
                var target = ((!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeCellsData) &&
                    this.parent.activeCellsData.element) || selectedCell[selectedCell.length - 1]);
                this.parent.keyboardInteractionModule.selectCells(target instanceof Array, target);
            }
            return;
        }
        var selectedAppointments = this.getSelectedAppointments();
        if (selectedAppointments.length > 0) {
            selectedAppointments[selectedAppointments.length - 1].focus();
            return;
        }
    };
    EventBase.prototype.selectWorkCellByTime = function (eventsData) {
        var target;
        if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
            return target;
        }
        if (eventsData.length > 0) {
            var selectedObject = eventsData[eventsData.length - 1];
            var eventStartTime = selectedObject[this.parent.eventFields.startTime];
            var nearestTime = new Date(+eventStartTime).setMinutes(0, 0, 0);
            var isAllDay = this.isAllDayAppointment(selectedObject);
            if (this.parent.currentView === 'Month' || isAllDay) {
                nearestTime = new Date(+eventStartTime).setHours(0, 0, 0, 0);
            }
            var targetArea = void 0;
            if (isAllDay && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) !== -1) {
                targetArea = this.parent.getAllDayRow();
            }
            else {
                targetArea = this.parent.getContentTable();
            }
            var queryString = '[data-date="' + this.parent.getMsFromDate(new Date(nearestTime)) + '"]';
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                queryString += '[data-group-index="' + this.getGroupIndexFromEvent(selectedObject) + '"]';
            }
            target = targetArea.querySelector(queryString);
            if (target) {
                this.parent.activeCellsData = this.parent.getCellDetails(target);
                if (this.parent.keyboardInteractionModule) {
                    this.parent.keyboardInteractionModule.selectCells(false, target);
                }
                return target;
            }
        }
        return target;
    };
    EventBase.prototype.getGroupIndexFromEvent = function (eventData) {
        var levelIndex;
        var resource;
        var levelName;
        var idField;
        for (var i = this.parent.resourceBase.resourceCollection.length - 1; i >= 0; i--) {
            var resourceData = eventData[this.parent.resourceBase.resourceCollection[i].field];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceData)) {
                resource = this.parent.resourceBase.resourceCollection[i];
                levelIndex = i;
                levelName = resource.name;
                idField = resource.field;
                break;
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(levelName) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(levelIndex)) {
            levelName = this.parent.resourceCollection.slice(-1)[0].name;
            levelIndex = this.parent.resourceCollection.length - 1;
            idField = this.parent.resourceCollection.slice(-1)[0].field;
            resource = this.parent.resourceCollection.filter(function (e, index) {
                if (e.name === levelName) {
                    levelIndex = index;
                    return e;
                }
                return null;
            })[0];
        }
        var id = ((eventData[idField] instanceof Array) ?
            eventData[idField][0] : eventData[idField]);
        if (levelIndex > 0) {
            var parentField = this.parent.resourceCollection[levelIndex - 1].field;
            return this.parent.resourceBase.getIndexFromResourceId(id, levelName, resource, eventData, parentField);
        }
        else {
            return this.parent.resourceBase.getIndexFromResourceId(id, levelName, resource);
        }
    };
    EventBase.prototype.isAllDayAppointment = function (event) {
        var fieldMapping = this.parent.eventFields;
        var isAllDay = event[fieldMapping.isAllDay];
        var isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
            / _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]) >= 1;
        return (isAllDay || isFullDay) ? true : false;
    };
    EventBase.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["documentClick"], this.appointmentBorderRemove, this);
    };
    EventBase.prototype.appointmentBorderRemove = function (event) {
        var element = event.event.target;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"])) {
            if (this.parent.currentView !== 'MonthAgenda') {
                this.parent.removeSelectedClass();
            }
        }
        else if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["POPUP_OPEN"])) {
            this.removeSelectedAppointmentClass();
        }
    };
    EventBase.prototype.wireAppointmentEvents = function (element, event, isPreventCrud) {
        if (isPreventCrud === void 0) { isPreventCrud = false; }
        var isReadOnly = (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event)) ? event[this.parent.eventFields.isReadonly] : false;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.eventClick, this);
        if (!this.parent.isAdaptive) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'touchstart', this.eventTouchClick, this);
        }
        if (!this.parent.isAdaptive && !this.parent.activeViewOptions.readonly && !isReadOnly) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'dblclick', this.eventDoubleClick, this);
        }
        if (!this.parent.activeViewOptions.readonly && !isReadOnly && !isPreventCrud) {
            if (this.parent.resizeModule) {
                this.parent.resizeModule.wireResizeEvent(element);
            }
            if (this.parent.dragAndDropModule) {
                this.parent.dragAndDropModule.wireDragEvent(element);
            }
        }
    };
    EventBase.prototype.eventTouchClick = function (e) {
        var _this = this;
        setTimeout(function () { return _this.isDoubleTapped = false; }, 250);
        e.preventDefault();
        if (this.isDoubleTapped) {
            this.eventDoubleClick(e);
        }
        else if (!this.isDoubleTapped) {
            this.isDoubleTapped = true;
            this.eventClick(e);
        }
    };
    EventBase.prototype.renderResizeHandler = function (element, spanEvent, isReadOnly) {
        if (!this.parent.resizeModule || !this.parent.allowResizing || this.parent.activeViewOptions.readonly || isReadOnly) {
            return;
        }
        for (var _i = 0, _a = Object.keys(spanEvent); _i < _a.length; _i++) {
            var resizeEdge = _a[_i];
            var resizeHandler = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RESIZE_CLASS"] });
            switch (resizeEdge) {
                case 'isLeft':
                    if (!spanEvent.isLeft) {
                        resizeHandler.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-left-right-resize' }));
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([resizeHandler], this.parent.enableRtl ? _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["RIGHT_RESIZE_HANDLER"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["LEFT_RESIZE_HANDLER"]);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([resizeHandler], element);
                    }
                    break;
                case 'isRight':
                    if (!spanEvent.isRight) {
                        resizeHandler.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-left-right-resize' }));
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([resizeHandler], this.parent.enableRtl ? _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["LEFT_RESIZE_HANDLER"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["RIGHT_RESIZE_HANDLER"]);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([resizeHandler], element);
                    }
                    break;
                case 'isTop':
                    if (!spanEvent.isTop) {
                        resizeHandler.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-top-bottom-resize' }));
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([resizeHandler], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["TOP_RESIZE_HANDLER"]);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([resizeHandler], element);
                    }
                    break;
                case 'isBottom':
                    if (!spanEvent.isBottom) {
                        resizeHandler.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-top-bottom-resize' }));
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([resizeHandler], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["BOTTOM_RESIZE_HANDLER"]);
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([resizeHandler], element);
                    }
                    break;
            }
        }
    };
    EventBase.prototype.eventClick = function (eventData) {
        var _this = this;
        var target = eventData.target;
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DRAG_CLONE_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["RESIZE_CLONE_CLASS"])) {
            return;
        }
        if (eventData.ctrlKey && eventData.which === 1 && this.parent.keyboardInteractionModule) {
            this.parent.quickPopup.quickPopup.hide();
            this.parent.selectedElements = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_BORDER"]));
            var target_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(eventData.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
            this.getSelectedEventElements(target_1);
            this.activeEventData(eventData, false);
            var selectArgs = {
                data: this.parent.activeEventData.event,
                element: this.parent.activeEventData.element,
                event: eventData, requestType: 'eventSelect'
            };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["select"], selectArgs);
            var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeEventData, { cancel: false, originalEvent: eventData });
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventClick"], args);
        }
        else {
            this.removeSelectedAppointmentClass();
            this.activeEventData(eventData, true);
            var selectEventArgs = {
                data: this.parent.activeEventData.event,
                element: this.parent.activeEventData.element,
                event: eventData, requestType: 'eventSelect'
            };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["select"], selectEventArgs);
            var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeEventData, { cancel: false, originalEvent: eventData });
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventClick"], args, function (eventClickArgs) {
                if (eventClickArgs.cancel) {
                    _this.removeSelectedAppointmentClass();
                    if (_this.parent.quickPopup) {
                        _this.parent.quickPopup.quickPopupHide();
                    }
                }
                else {
                    if (_this.parent.currentView === 'Agenda' || _this.parent.currentView === 'MonthAgenda') {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.parent.activeEventData.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["AGENDA_SELECTED_CELL"]);
                    }
                    if (_this.parent.allowInline) {
                        var inlineArgs = {
                            data: eventClickArgs.event,
                            element: eventClickArgs.element,
                            type: 'Event'
                        };
                        _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["inlineClick"], inlineArgs);
                    }
                    else {
                        _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventClick"], eventClickArgs);
                    }
                }
            });
        }
    };
    EventBase.prototype.eventDoubleClick = function (e) {
        this.parent.quickPopup.quickPopupHide(true);
        if (e.type === 'touchstart') {
            this.activeEventData(e, true);
        }
        this.removeSelectedAppointmentClass();
        if (this.parent.activeEventData.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_APPOINTMENT_CLASS"]) ||
            this.parent.activeEventData.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"])) {
            return;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeEventData.event) &&
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeEventData.event[this.parent.eventFields.recurrenceID])) {
            this.parent.eventWindow.openEditor(this.parent.activeEventData.event, 'Save');
        }
        else {
            this.parent.currentAction = 'EditOccurrence';
            this.parent.quickPopup.openRecurrenceAlert();
        }
    };
    EventBase.prototype.getEventByGuid = function (guid) {
        return this.parent.eventsProcessed.filter(function (data) { return data.Guid === guid; })[0];
    };
    EventBase.prototype.getEventById = function (id) {
        var _this = this;
        return this.parent.eventsData.filter(function (data) {
            return data[_this.parent.eventFields.id] === id;
        })[0];
    };
    EventBase.prototype.generateGuid = function () {
        return 'xyxxxxyx-xxxy-yxxx-xyxx-xxyxxxxyyxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0;
            var v = (c === 'x') ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    };
    EventBase.prototype.getEventIDType = function () {
        if (this.parent.eventsData.length !== 0) {
            return typeof (this.parent.eventsData[0][this.parent.eventFields.id]);
        }
        if (this.parent.blockData.length !== 0) {
            return typeof (this.parent.blockData[0][this.parent.eventFields.id]);
        }
        return 'string';
    };
    EventBase.prototype.getEventMaxID = function (resourceId) {
        var _this = this;
        if (this.parent.eventsData.length < 1 && this.parent.blockData.length < 1) {
            return 1;
        }
        var eventId;
        var idType = this.getEventIDType();
        if (idType === 'string') {
            eventId = this.generateGuid();
        }
        if (idType === 'number') {
            var datas = this.parent.eventsData.concat(this.parent.blockData);
            var maxId = Math.max.apply(Math, datas.map(function (event) { return event[_this.parent.eventFields.id]; }));
            maxId = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceId) ? maxId : maxId + resourceId;
            eventId = maxId + 1;
        }
        return eventId;
    };
    EventBase.prototype.activeEventData = function (eventData, isMultiple) {
        var _this = this;
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(eventData.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
        var guid = target.getAttribute('data-guid');
        if (isMultiple) {
            this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]')));
            target.focus();
        }
        var eventObject = this.getEventByGuid(guid);
        if (eventObject && eventObject.isSpanned) {
            eventObject = this.parent.eventsData.filter(function (obj) {
                return obj[_this.parent.eventFields.id] === eventObject[_this.parent.eventFields.id];
            })[0];
        }
        this.parent.activeEventData = { event: eventObject, element: target };
    };
    EventBase.prototype.generateOccurrence = function (event, viewDate, oldTimezone, isMaxCount) {
        var startDate = event[this.parent.eventFields.startTime];
        var endDate = event[this.parent.eventFields.endTime];
        var eventRule = event[this.parent.eventFields.recurrenceRule];
        var duration = endDate.getTime() - startDate.getTime();
        viewDate = new Date((viewDate || this.parent.activeView.startDate()).getTime() - duration);
        var exception = event[this.parent.eventFields.recurrenceException];
        var maxCount;
        if (this.parent.currentView !== 'Agenda' && isMaxCount) {
            maxCount = _base_util__WEBPACK_IMPORTED_MODULE_3__["getDateCount"](this.parent.activeView.startDate(), this.parent.activeView.endDate()) + 1;
        }
        var newTimezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
        var firstDay = this.parent.activeViewOptions.firstDayOfWeek;
        var calendarMode = this.parent.calendarMode;
        var dates = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_2__["generate"])(startDate, eventRule, exception, firstDay, maxCount, viewDate, calendarMode, oldTimezone, newTimezone);
        if (this.parent.currentView === 'Agenda' && eventRule.indexOf('COUNT') === -1 && eventRule.indexOf('UNTIL') === -1) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event.generatedDates)) {
                event.generatedDates = { start: new Date(dates[0]), end: new Date(dates[dates.length - 1]) };
            }
            else {
                if (dates[0] < event.generatedDates.start.getTime()) {
                    event.generatedDates.start = new Date(dates[0]);
                }
                if (dates[dates.length - 1] > event.generatedDates.end.getTime()) {
                    event.generatedDates.end = new Date(dates[dates.length - 1]);
                }
            }
        }
        var occurrenceCollection = [];
        for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
            var date = dates_1[_i];
            var clonedObject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true);
            clonedObject[this.parent.eventFields.startTime] = new Date(date);
            clonedObject[this.parent.eventFields.endTime] = new Date(new Date(date).setMilliseconds(duration));
            clonedObject[this.parent.eventFields.recurrenceID] = clonedObject[this.parent.eventFields.id];
            delete clonedObject[this.parent.eventFields.recurrenceException];
            delete clonedObject[this.parent.eventFields.followingID];
            clonedObject.Guid = this.generateGuid();
            occurrenceCollection.push(clonedObject);
        }
        return occurrenceCollection;
    };
    EventBase.prototype.getParentEvent = function (eventObj, isParent) {
        if (isParent === void 0) { isParent = false; }
        var parentEvent;
        do {
            eventObj = this.getFollowingEvent(eventObj);
            if (eventObj) {
                parentEvent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
            }
        } while (eventObj && isParent);
        if (isParent && parentEvent) {
            var collection = this.getEventCollections(parentEvent);
            var followObj = collection.follow.slice(-1)[0];
            if (collection.occurrence.length > 0 && !parentEvent[this.parent.eventFields.recurrenceException]) {
                followObj = collection.occurrence.slice(-1)[0];
            }
            if (followObj) {
                parentEvent[this.parent.eventFields.recurrenceRule] = followObj[this.parent.eventFields.recurrenceRule];
            }
        }
        return parentEvent;
    };
    EventBase.prototype.getEventCollections = function (parentObj, childObj) {
        var followingCollection = [];
        var occurrenceCollection = [];
        var followingEvent = parentObj;
        do {
            followingEvent = this.getFollowingEvent(followingEvent, true);
            if (followingEvent) {
                followingCollection.push(followingEvent);
            }
            occurrenceCollection = occurrenceCollection.concat(this.getOccurrenceEvent(followingEvent || parentObj));
        } while (followingEvent);
        var collections = {};
        if (childObj) {
            var fields_1 = this.parent.eventFields;
            collections = {
                follow: followingCollection.filter(function (eventData) {
                    return eventData[fields_1.startTime] >= childObj[fields_1.startTime];
                }),
                occurrence: occurrenceCollection.filter(function (eventData) {
                    return eventData[fields_1.startTime] >= childObj[fields_1.startTime];
                })
            };
        }
        else {
            collections = { follow: followingCollection, occurrence: occurrenceCollection };
        }
        return collections;
    };
    EventBase.prototype.getFollowingEvent = function (parentObj, isReverse) {
        var fields = this.parent.eventFields;
        var fieldValue;
        if (isReverse) {
            fieldValue = parentObj[fields.id];
        }
        else {
            fieldValue = (parentObj[fields.recurrenceID] || parentObj[fields.followingID]);
        }
        var parentApp = this.parent.eventsData.filter(function (data) {
            return data[isReverse ? fields.followingID : fields.id] === fieldValue;
        });
        return parentApp.shift();
    };
    EventBase.prototype.isFollowingEvent = function (parentObj, childObj) {
        var parentStart = parentObj[this.parent.eventFields.startTime];
        var childStart = childObj[this.parent.eventFields.startTime];
        return parentStart.getHours() === childStart.getHours() && parentStart.getMinutes() === childStart.getMinutes() &&
            parentStart.getSeconds() === childStart.getSeconds();
    };
    EventBase.prototype.getOccurrenceEvent = function (eventObj, isGuid, isFollowing) {
        if (isGuid === void 0) { isGuid = false; }
        if (isFollowing === void 0) { isFollowing = false; }
        var idField = isGuid ? 'Guid' : (isFollowing) ? this.parent.eventFields.followingID : this.parent.eventFields.recurrenceID;
        var fieldKey = isGuid ? 'Guid' : this.parent.eventFields.id;
        var dataSource = isGuid ? this.parent.eventsProcessed : this.parent.eventsData;
        return dataSource.filter(function (data) { return data[idField] === eventObj[fieldKey]; });
    };
    EventBase.prototype.getOccurrencesByID = function (id) {
        var fields = this.parent.eventFields;
        var occurrenceCollection = [];
        var parentObject = this.parent.eventsData.filter(function (obj) { return obj[fields.id] === id; });
        for (var _i = 0, _a = parentObject; _i < _a.length; _i++) {
            var event_3 = _a[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_3[fields.recurrenceRule])) {
                occurrenceCollection = occurrenceCollection.concat(this.generateOccurrence(event_3));
            }
        }
        return occurrenceCollection;
    };
    EventBase.prototype.getOccurrencesByRange = function (startTime, endTime) {
        var fields = this.parent.eventFields;
        var occurrenceCollection = [];
        for (var _i = 0, _a = this.parent.eventsData; _i < _a.length; _i++) {
            var event_4 = _a[_i];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_4[fields.recurrenceRule])) {
                occurrenceCollection = occurrenceCollection.concat(this.generateOccurrence(event_4));
            }
        }
        var filter = occurrenceCollection.filter(function (obj) {
            return obj[fields.startTime] >= startTime && obj[fields.endTime] <= endTime && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(obj[fields.recurrenceID]);
        });
        return filter;
    };
    EventBase.prototype.getDeletedOccurrences = function (recurrenceData) {
        var fields = this.parent.eventFields;
        var parentObject;
        var deletedOccurrences = [];
        if (typeof recurrenceData === 'string' || typeof recurrenceData === 'number') {
            parentObject = this.parent.eventsData.filter(function (obj) {
                return obj[fields.id] === recurrenceData;
            })[0];
        }
        else {
            parentObject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, recurrenceData, null, true);
        }
        if (parentObject[fields.recurrenceException]) {
            var exDateString_1 = parentObject[fields.recurrenceException].split(',');
            var _loop_2 = function (i, len) {
                var edited = this_2.parent.eventsData.filter(function (eventObj) {
                    return eventObj[fields.recurrenceID] === parentObject[fields.id] && eventObj[fields.recurrenceException] === exDateString_1[i];
                });
                if (edited.length === 0) {
                    var exDate = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_2__["getDateFromRecurrenceDateString"])(exDateString_1[i]);
                    var childObject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, recurrenceData, null, true);
                    childObject[fields.recurrenceID] = parentObject[fields.id];
                    delete childObject[fields.followingID];
                    childObject[fields.recurrenceException] = exDateString_1[i];
                    var startDate = new Date(exDate.getTime());
                    var time = parentObject[fields.endTime].getTime() - parentObject[fields.startTime].getTime();
                    var endDate = new Date(startDate.getTime());
                    endDate.setMilliseconds(time);
                    childObject[fields.startTime] = new Date(startDate.getTime());
                    childObject[fields.endTime] = new Date(endDate.getTime());
                    deletedOccurrences.push(childObject);
                }
            };
            var this_2 = this;
            for (var i = 0, len = exDateString_1.length; i < len; i++) {
                _loop_2(i, len);
            }
        }
        return deletedOccurrences;
    };
    EventBase.prototype.applyResourceColor = function (element, data, type, index, alpha) {
        if (!this.parent.resourceBase) {
            return;
        }
        var alphaColor = function (color, alpha) {
            color = color.replace('#', '');
            var r = parseInt(color.substring(0, color.length / 3), 16);
            var g = parseInt(color.substring(color.length / 3, 2 * color.length / 3), 16);
            var b = parseInt(color.substring(2 * color.length / 3, 3 * color.length / 3), 16);
            return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
        };
        // index refers groupOrder
        var color = this.parent.resourceBase.getResourceColor(data, index);
        if (color) {
            // tslint:disable-next-line:no-any
            element.style[type] = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(alpha) ? alphaColor(color, alpha) : color;
        }
    };
    EventBase.prototype.createBlockAppointmentElement = function (record, resIndex) {
        var eventSubject = (record[this.parent.eventFields.subject] || this.parent.eventSettings.fields.subject.default);
        var appointmentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["BLOCK_APPOINTMENT_CLASS"],
            attrs: {
                'data-id': 'Appointment_' + record[this.parent.eventFields.id],
                'aria-readonly': 'true', 'aria-selected': 'false'
            }
        });
        var templateElement;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeViewOptions.eventTemplate)) {
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.eventTemplateName;
            var templateId = scheduleId + viewName + 'eventTemplate';
            var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffsetToEvent"](record, this.parent.eventFields);
            templateElement = this.parent.getAppointmentTemplate()(templateArgs, this.parent, 'eventTemplate', templateId, false);
        }
        else {
            var appointmentSubject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"], innerHTML: eventSubject
            });
            templateElement = [appointmentSubject];
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(templateElement, appointmentWrapper);
        this.setWrapperAttributes(appointmentWrapper, resIndex);
        return appointmentWrapper;
    };
    EventBase.prototype.setWrapperAttributes = function (appointmentWrapper, resIndex) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentWrapper], this.cssClass);
        }
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            appointmentWrapper.setAttribute('data-group-index', resIndex.toString());
        }
    };
    EventBase.prototype.getReadonlyAttribute = function (event) {
        return (event[this.parent.eventFields.isReadonly] || this.parent.readonly).toString();
    };
    EventBase.prototype.isBlockRange = function (eventData) {
        var eventCollection = (eventData instanceof Array) ? eventData : [eventData];
        var isBlockAlert = false;
        var fields = this.parent.eventFields;
        for (var _i = 0, _a = eventCollection; _i < _a.length; _i++) {
            var event_5 = _a[_i];
            var dataCol = [];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_5[fields.recurrenceRule]) &&
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(event_5[fields.recurrenceID]) || event_5[fields.id] === event_5[fields.recurrenceID])) {
                dataCol = this.generateOccurrence(event_5);
            }
            else {
                dataCol.push(event_5);
            }
            for (var _b = 0, dataCol_1 = dataCol; _b < dataCol_1.length; _b++) {
                var data = dataCol_1[_b];
                var filterBlockEvents = this.filterBlockEvents(data);
                if (filterBlockEvents.length > 0) {
                    isBlockAlert = true;
                    break;
                }
            }
        }
        this.parent.uiStateValues.isBlock = isBlockAlert;
        return isBlockAlert;
    };
    EventBase.prototype.getFilterEventsList = function (dataSource, query) {
        return new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["DataManager"](dataSource).executeLocal(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]().where(query));
    };
    EventBase.prototype.getSeriesEvents = function (parentEvent, startTime) {
        var fields = this.parent.eventFields;
        startTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startTime) ? parentEvent[fields.startTime] : startTime;
        var deleteFutureEditEvents;
        var futureEvents;
        var deleteFutureEditEventList = [];
        var delId = parentEvent[fields.id];
        var followingId = parentEvent[fields.followingID];
        var deleteFutureEvent;
        var startTimeQuery = this.parent.currentAction === 'EditSeries' ? 'greaterthan' : 'greaterthanorequal';
        do {
            deleteFutureEvent = ((new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.followingID, 'equal', delId))).
                and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.startTime, startTimeQuery, startTime));
            futureEvents = this.getFilterEventsList(this.parent.eventsData, deleteFutureEvent);
            deleteFutureEditEvents = futureEvents.slice(-1)[0];
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(deleteFutureEditEvents) && deleteFutureEditEvents[fields.id] !== followingId) {
                deleteFutureEditEventList.push(deleteFutureEditEvents);
                delId = deleteFutureEditEvents[fields.id];
                followingId = deleteFutureEditEvents[fields.followingID];
            }
            else {
                followingId = null;
            }
        } while (futureEvents.length === 1 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(deleteFutureEditEvents[fields.followingID]));
        return deleteFutureEditEventList;
    };
    EventBase.prototype.getEditedOccurrences = function (deleteFutureEditEventList, startTime) {
        var fields = this.parent.eventFields;
        var deleteRecurrenceEventList = [];
        var delEditedEvents;
        for (var _i = 0, deleteFutureEditEventList_1 = deleteFutureEditEventList; _i < deleteFutureEditEventList_1.length; _i++) {
            var event_6 = deleteFutureEditEventList_1[_i];
            var delEventQuery = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.recurrenceID, 'equal', event_6[fields.id]).
                or(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.recurrenceID, 'equal', event_6[fields.followingID]).
                and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.recurrenceID, 'notequal', undefined)).
                and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.recurrenceID, 'notequal', null)));
            if (this.parent.currentAction === 'EditFollowingEvents' || this.parent.currentAction === 'DeleteFollowingEvents') {
                delEventQuery = delEventQuery.and(new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Predicate"](fields.startTime, 'greaterthanorequal', startTime));
            }
            delEditedEvents = this.getFilterEventsList(this.parent.eventsData, delEventQuery);
            deleteRecurrenceEventList = deleteRecurrenceEventList.concat(delEditedEvents);
        }
        return deleteRecurrenceEventList;
    };
    EventBase.prototype.getRenderedDates = function (dateRender) {
        var firstDate = 0;
        var lastDate = dateRender.length;
        var filteredDates;
        if (dateRender[0] < this.parent.minDate && dateRender[dateRender.length - 1] > this.parent.maxDate) {
            for (var i = 0; i < dateRender.length; i++) {
                if (_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](dateRender[i]).getTime() === _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(this.parent.minDate)).getTime()) {
                    firstDate = i;
                }
                if (_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](dateRender[i]).getTime() === _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(this.parent.maxDate)).getTime()) {
                    lastDate = i;
                }
            }
            filteredDates = dateRender.filter(function (date) { return date >= dateRender[firstDate] && date <= dateRender[lastDate]; });
        }
        return filteredDates;
    };
    EventBase.prototype.isValidEvent = function (eventObj, start, end, schedule) {
        var isHourRange = end.getTime() > schedule.startHour.getTime() && start.getTime() < schedule.endHour.getTime();
        var isSameRange = schedule.startHour.getTime() <= start.getTime() &&
            eventObj[this.parent.eventFields.startTime].getTime() >= schedule.startHour.getTime() &&
            eventObj[this.parent.eventFields.endTime].getTime() < schedule.endHour.getTime() && start.getTime() === end.getTime();
        return isHourRange || isSameRange;
    };
    return EventBase;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/inline-edit.js":
/*!*******************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/inline-edit.js ***!
  \*******************************************************************************************/
/*! exports provided: InlineEdit */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InlineEdit", function() { return InlineEdit; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../event-renderer/vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/vertical-view.js");
/* harmony import */ var _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
/* harmony import */ var _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../event-renderer/timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");







/**
 * Inline Edit interactions
 */
var InlineEdit = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for InlineEdit
     */
    function InlineEdit(parent) {
        this.parent = parent;
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["inlineClick"], this.inlineEdit, this);
    }
    InlineEdit.prototype.inlineEdit = function (args) {
        this.parent.quickPopup.quickPopupHide();
        if (args.type === 'Cell') {
            this.removeInlineAppointmentElement();
            this.cellEdit(args);
        }
        else {
            if (this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]) !==
                args.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"])) {
                this.removeInlineAppointmentElement();
            }
            this.eventEdit(args);
        }
    };
    InlineEdit.prototype.cellEdit = function (args) {
        var saveObj = this.generateEventData();
        var cellIndex = args.element.cellIndex;
        var count = this.getEventDaysCount(saveObj);
        if (count > 1) {
            count = Math.round(count);
            count--;
            cellIndex = cellIndex - count;
        }
        var start = _base_util__WEBPACK_IMPORTED_MODULE_6__["resetTime"](new Date('' + saveObj[this.parent.eventFields.startTime])).getTime();
        var end = _base_util__WEBPACK_IMPORTED_MODULE_6__["resetTime"](new Date('' + saveObj[this.parent.eventFields.endTime])).getTime();
        var resIndex = args.groupIndex || 0;
        if (this.parent.currentView === 'Day' || this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek') {
            var dayIndex = saveObj[this.parent.eventFields.startTime].getDay();
            this.createVerticalViewInline(saveObj, dayIndex, resIndex, cellIndex);
        }
        else if (this.parent.currentView === 'Month') {
            this.createMonthViewInline(saveObj, resIndex, start, end);
        }
        else {
            this.createTimelineViewInline(saveObj, start, end, resIndex);
        }
        var inlineSubject = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        if (inlineSubject) {
            inlineSubject.focus();
        }
    };
    InlineEdit.prototype.eventEdit = function (args) {
        var inlineSubject = args.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        var subject;
        if (inlineSubject) {
            subject = inlineSubject.value;
        }
        else {
            var subEle = args.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"]);
            var timeEle = args.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"]);
            subject = subEle.innerText;
            inlineSubject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('input', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"], attrs: { value: subject } });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([subEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(args.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MORE_POPUP_WRAPPER_CLASS"])) {
                args.element.insertBefore(inlineSubject, subEle);
            }
            else if (['Agenda', 'MonthAgenda'].indexOf(this.parent.currentView) > -1) {
                var subjectWrap = args.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_WRAP"]);
                subjectWrap.insertBefore(inlineSubject, subjectWrap.firstChild);
            }
            else {
                var elementSelector = ['TimelineWeek', 'TimelineMonth'].indexOf(this.parent.currentView) > -1 ?
                    '.e-inner-wrap' : '.e-appointment-details';
                args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);
            }
        }
        inlineSubject.focus();
        inlineSubject.setSelectionRange(subject.length, subject.length);
    };
    InlineEdit.prototype.createVerticalViewInline = function (saveObj, dayIndex, resIndex, daysCount) {
        var count = this.getEventDaysCount(saveObj);
        var verticalEvent = new _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_1__["VerticalEvent"](this.parent);
        verticalEvent.initializeValues();
        var index = verticalEvent.dateRender[resIndex].map(function (date) { return date.getDay(); }).indexOf(dayIndex);
        if (count >= 1) {
            verticalEvent.allDayElement = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_CELLS_CLASS"]));
            verticalEvent.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
            var allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_CLASS"]));
            var allDayLevel = 0;
            if (allDayElements.length > 0) {
                allDayLevel = Math.floor(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_ROW_CLASS"]).getBoundingClientRect().height /
                    allDayElements[0].offsetHeight) - 1;
            }
            verticalEvent.allDayLevel = allDayLevel;
            verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
        }
        else {
            verticalEvent.renderNormalEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
        }
    };
    InlineEdit.prototype.createMonthViewInline = function (saveObj, index, start, end) {
        var count = this.getEventDaysCount(saveObj);
        var saveObject = this.parent.eventBase.cloneEventObject(saveObj, start, end, count, false, false);
        var monthEvent = new _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__["MonthEvent"](this.parent);
        monthEvent.dateRender = this.parent.activeView.renderDates;
        monthEvent.inlineValue = this.parent.allowInline;
        var renderDates = this.parent.activeView.renderDates;
        var workDays = this.parent.activeViewOptions.workDays;
        var monthCellSelector = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["WORK_CELLS_CLASS"];
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            monthCellSelector += '[data-group-index="' + index + '"]';
            var resourceData = this.parent.resourceBase.lastResourceLevel[index];
            renderDates = resourceData.renderDates;
            workDays = resourceData.workDays;
        }
        monthEvent.workCells = [].slice.call(this.parent.element.querySelectorAll(monthCellSelector));
        monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
        monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
        monthEvent.eventHeight = _base_util__WEBPACK_IMPORTED_MODULE_6__["getElementHeightFromClass"](this.parent.monthModule.element, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
        monthEvent.getSlotDates(workDays);
        var filteredDates = monthEvent.getRenderedDates(renderDates);
        var splittedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
        for (var _i = 0, splittedEvents_1 = splittedEvents; _i < splittedEvents_1.length; _i++) {
            var eventData = splittedEvents_1[_i];
            monthEvent.renderEvents(eventData, index);
        }
        var inlineSubject = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        inlineSubject.focus();
    };
    InlineEdit.prototype.createTimelineViewInline = function (saveObj, start, end, resIndex) {
        var count = this.getEventDaysCount(saveObj);
        var saveObject = this.parent.eventBase.cloneEventObject(saveObj, start, end, count, false, false);
        var timelineView = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_3__["TimelineEvent"](this.parent, this.parent.activeViewOptions.timeScale.enable ? 'hour' : 'day');
        timelineView.dateRender = this.parent.activeView.renderDates;
        timelineView.eventContainers = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CONTAINER_CLASS"]));
        var workCell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["WORK_CELLS_CLASS"]);
        timelineView.inlineValue = this.parent.allowInline;
        timelineView.cellWidth = workCell.offsetWidth;
        timelineView.cellHeight = workCell.offsetHeight;
        var dayLength = this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["CONTENT_TABLE_CLASS"] + ' tbody tr').length === 0 ?
            0 : this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["CONTENT_TABLE_CLASS"] + ' tbody tr')[0].children.length;
        timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
        timelineView.eventHeight = _base_util__WEBPACK_IMPORTED_MODULE_6__["getElementHeightFromClass"](timelineView.element, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
        timelineView.renderEvents(saveObject, resIndex);
    };
    InlineEdit.prototype.getEventDaysCount = function (saveObj) {
        var startDate = saveObj[this.parent.eventFields.startTime];
        var endDate = saveObj[this.parent.eventFields.endTime];
        var daysCount = Math.abs(endDate.getTime() - startDate.getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_6__["MS_PER_DAY"];
        return daysCount;
    };
    InlineEdit.prototype.generateEventData = function (target) {
        var inlineElement = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        var subject = inlineElement ? inlineElement.value : target ? target.innerHTML : '';
        var saveObj = {};
        saveObj[this.parent.eventFields.id] = this.parent.eventBase.getEventMaxID();
        saveObj[this.parent.eventFields.subject] = subject;
        saveObj[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;
        saveObj[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;
        saveObj[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;
        this.parent.eventWindow.setDefaultValueToObject(saveObj);
        if (this.parent.resourceBase) {
            this.parent.resourceBase.setResourceValues(saveObj, this.parent.activeCellsData.groupIndex);
        }
        return saveObj;
    };
    InlineEdit.prototype.documentClick = function () {
        var target = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        if (target && target.value !== '') {
            this.inlineCrudActions(target);
        }
    };
    InlineEdit.prototype.inlineCrudActions = function (target) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_APPOINTMENT_CLASS"])) {
            var saveObj = this.generateEventData(target);
            this.parent.addEvent(saveObj);
        }
        else {
            var eventTarget = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
            var eventDetails = this.parent.getEventDetails(eventTarget);
            eventDetails[this.parent.eventFields.subject] = target.value;
            var currentAction = void 0;
            if (eventDetails[this.parent.eventFields.id] === eventDetails[this.parent.eventFields.recurrenceID]) {
                currentAction = 'EditOccurrence';
                eventDetails[this.parent.eventFields.id] = this.parent.eventBase.getEventMaxID();
            }
            this.parent.saveEvent(eventDetails, currentAction);
        }
        this.removeInlineAppointmentElement();
    };
    InlineEdit.prototype.createInlineAppointmentElement = function (inlineData) {
        var inlineAppointmentElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_APPOINTMENT_CLASS"]
        });
        var inlineDetails = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_DETAILS"] });
        inlineAppointmentElement.appendChild(inlineDetails);
        var inline = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('input', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"] });
        inlineDetails.appendChild(inline);
        if (inlineData) {
            this.parent.eventBase.applyResourceColor(inlineAppointmentElement, inlineData, 'backgroundColor');
        }
        return inlineAppointmentElement;
    };
    InlineEdit.prototype.removeInlineAppointmentElement = function () {
        var inlineAppointment = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_APPOINTMENT_CLASS"]));
        if (inlineAppointment.length > 0) {
            inlineAppointment.forEach(function (node) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(node); });
        }
        var inlineSubject = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["INLINE_SUBJECT_CLASS"]);
        if (inlineSubject) {
            var appointmentSubject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(inlineSubject, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([appointmentSubject.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(inlineSubject);
        }
    };
    InlineEdit.prototype.destroy = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["inlineClick"], this.inlineEdit);
    };
    return InlineEdit;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js ***!
  \*************************************************************************************/
/*! exports provided: MonthEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonthEvent", function() { return MonthEvent; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _event_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/event-base.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






var EVENT_GAP = 0;
/**
 * Month view events render
 */
var MonthEvent = /** @__PURE__ @class */ (function (_super) {
    __extends(MonthEvent, _super);
    /**
     * Constructor for month events
     */
    function MonthEvent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.renderedEvents = [];
        _this.monthHeaderHeight = 0;
        _this.moreIndicatorHeight = 19;
        _this.renderType = 'day';
        _this.element = _this.parent.activeView.getPanel();
        _this.fields = _this.parent.eventFields;
        _this.maxHeight = _this.parent.eventSettings.enableMaxHeight && !_this.parent.eventSettings.enableIndicator
            && !_this.parent.rowAutoHeight;
        _this.withIndicator = _this.parent.eventSettings.enableMaxHeight && _this.parent.eventSettings.enableIndicator
            && !_this.parent.rowAutoHeight;
        _this.maxOrIndicator = (_this.maxHeight || _this.withIndicator);
        _this.moreIndicatorHeight =
            (_this.parent.rowAutoHeight && _this.parent.eventSettings.ignoreWhitespace) ? 0 : _this.moreIndicatorHeight;
        _this.addEventListener();
        return _this;
    }
    MonthEvent.prototype.removeEventWarapper = function (appElement) {
        if (appElement.length > 0) {
            appElement = (this.parent.currentView === 'Month') ? appElement : [appElement[0]];
            for (var _i = 0, appElement_1 = appElement; _i < appElement_1.length; _i++) {
                var wrap = appElement_1[_i];
                if (!wrap.classList.contains('e-more-indicator') && wrap.parentElement && wrap.parentElement.parentNode) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrap.parentElement);
                }
            }
        }
    };
    MonthEvent.prototype.renderAppointments = function () {
        var conWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_WRAP_CLASS"]);
        if (this.parent.rowAutoHeight) {
            this.parent.uiStateValues.top = conWrap.scrollTop;
            this.parent.uiStateValues.left = conWrap.scrollLeft;
        }
        var appointmentWrapper = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"]));
        if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
            for (var i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
                var appElement = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index="' +
                    this.parent.crudModule.crudObj.sourceEvent[i].groupIndex + '"]'));
                this.removeEventWarapper(appElement);
                if (this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
                    this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
                    var ele = [].slice.call(this.element.querySelectorAll('.e-appointment-wrapper ' + '[data-group-index="' +
                        this.parent.crudModule.crudObj.targetEvent[i].groupIndex + '"]'));
                    this.removeEventWarapper(ele);
                }
            }
        }
        else {
            for (var _i = 0, appointmentWrapper_1 = appointmentWrapper; _i < appointmentWrapper_1.length; _i++) {
                var wrap = appointmentWrapper_1[_i];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrap);
            }
        }
        this.removeHeightProperty(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["CONTENT_TABLE_CLASS"]);
        if (!this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"])) {
            return;
        }
        this.eventHeight = _base_util__WEBPACK_IMPORTED_MODULE_4__["getElementHeightFromClass"](this.element, _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"]);
        var scrollTop = conWrap.scrollTop;
        if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.currentAction)) {
            conWrap.scrollTop = conWrap.scrollTop - 1;
        }
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.renderResourceEvents();
        }
        else {
            this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays);
        }
        if (this.parent.rowAutoHeight) {
            this.updateBlockElements();
            var data = {
                cssProperties: this.parent.getCssProperties(),
                module: this.parent.getModuleName(),
                isPreventScrollUpdate: true,
                scrollPosition: { left: this.parent.uiStateValues.left, top: this.parent.uiStateValues.top }
            };
            if (this.parent.virtualScrollModule) {
                if (this.parent.currentAction) {
                    conWrap.scrollTop = scrollTop;
                    this.parent.currentAction = null;
                }
                else {
                    this.parent.virtualScrollModule.updateVirtualScrollHeight();
                }
            }
            this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_3__["scrollUiUpdate"], data);
        }
        this.parent.renderTemplates();
    };
    MonthEvent.prototype.renderEventsHandler = function (dateRender, workDays, resData) {
        this.renderedEvents = [];
        var eventsList;
        var blockList;
        var resIndex = 0;
        if (resData) {
            resIndex = resData.groupIndex;
            this.cssClass = resData.cssClass;
            this.groupOrder = resData.groupOrder;
            eventsList = this.parent.eventBase.filterEventsByResource(resData, this.parent.eventsProcessed);
            blockList = this.parent.eventBase.filterEventsByResource(resData, this.parent.blockProcessed);
            this.workCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"] + '[data-group-index="' + resIndex + '"]'));
        }
        else {
            eventsList = this.parent.eventsProcessed;
            blockList = this.parent.blockProcessed;
            this.workCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"]));
        }
        this.sortByDateTime(eventsList);
        this.sortByDateTime(blockList);
        if (this.parent.currentView === 'Month' && this.parent.rowAutoHeight) {
            var totalCells = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
            var height_1 = this.parent.element.querySelector('.e-schedule-table').clientHeight / totalCells.length;
            totalCells.forEach(function (cell) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cell, { 'height': height_1 + 'px' });
            });
        }
        var cellDetail = this.workCells.slice(-1)[0].getBoundingClientRect();
        this.cellWidth = cellDetail.width;
        this.cellHeight = cellDetail.height;
        this.dateRender = dateRender;
        var filteredDates = this.getRenderedDates(dateRender);
        this.getSlotDates(workDays);
        this.processBlockEvents(blockList, resIndex, resData);
        for (var _i = 0, eventsList_1 = eventsList; _i < eventsList_1.length; _i++) {
            var event_1 = eventsList_1[_i];
            if (this.parent.resourceBase && !resData) {
                this.cssClass = this.parent.resourceBase.getCssClass(event_1);
            }
            var splittedEvents = this.splitEvent(event_1, filteredDates || this.dateRender);
            for (var _a = 0, splittedEvents_1 = splittedEvents; _a < splittedEvents_1.length; _a++) {
                var event_2 = splittedEvents_1[_a];
                if (this.maxHeight) {
                    var sDate = this.parent.currentView === 'Month' ? event_2[this.fields.startTime] :
                        this.getStartTime(event_2, event_2.data);
                    if (this.getIndex(sDate) > 0) {
                        continue;
                    }
                }
                this.updateIndicatorIcon(event_2);
                this.renderEvents(event_2, resIndex, eventsList);
            }
        }
        this.cssClass = null;
        this.groupOrder = null;
    };
    MonthEvent.prototype.processBlockEvents = function (blockEvents, resIndex, resData) {
        for (var _i = 0, blockEvents_1 = blockEvents; _i < blockEvents_1.length; _i++) {
            var event_3 = blockEvents_1[_i];
            if (this.parent.resourceBase && !resData) {
                this.cssClass = this.parent.resourceBase.getCssClass(event_3);
            }
            var blockSpannedList = [];
            if (this.renderType === 'day' && !event_3[this.fields.isAllDay]) {
                var temp = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event_3, null, true);
                var isSameDate = this.isSameDate(temp[this.fields.startTime], temp[this.fields.endTime]);
                temp.isBlockIcon = isSameDate;
                if (!isSameDate && _base_util__WEBPACK_IMPORTED_MODULE_4__["getDateInMs"](temp[this.fields.startTime]) > 0) {
                    var e = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event_3, null, true);
                    e[this.fields.endTime] = _base_util__WEBPACK_IMPORTED_MODULE_4__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date(event_3[this.fields.startTime] + '')), 1);
                    e.isBlockIcon = true;
                    temp[this.fields.startTime] = e[this.fields.endTime];
                    blockSpannedList.push(e);
                }
                isSameDate = this.isSameDate(temp[this.fields.startTime], temp[this.fields.endTime]);
                if (!isSameDate && _base_util__WEBPACK_IMPORTED_MODULE_4__["getDateInMs"](temp[this.fields.endTime]) > 0) {
                    var e = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event_3, null, true);
                    e[this.fields.startTime] = _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date(event_3[this.fields.endTime] + ''));
                    e.isBlockIcon = true;
                    blockSpannedList.push(e);
                    temp[this.fields.endTime] = e[this.fields.startTime];
                }
                blockSpannedList.push(temp);
            }
            else {
                blockSpannedList.push(event_3);
            }
            for (var _a = 0, blockSpannedList_1 = blockSpannedList; _a < blockSpannedList_1.length; _a++) {
                var blockEvent = blockSpannedList_1[_a];
                var splittedEvents = this.splitEvent(blockEvent, this.dateRender);
                for (var _b = 0, splittedEvents_2 = splittedEvents; _b < splittedEvents_2.length; _b++) {
                    var event_4 = splittedEvents_2[_b];
                    this.renderBlockEvents(event_4, resIndex, !!blockEvent.isBlockIcon);
                }
            }
        }
    };
    MonthEvent.prototype.isSameDate = function (start, end) {
        return new Date(+start).setHours(0, 0, 0, 0) === new Date(+end).setHours(0, 0, 0, 0);
    };
    MonthEvent.prototype.renderBlockEvents = function (event, resIndex, isIcon) {
        var eventData = event.data;
        var startTime = this.getStartTime(event, eventData);
        var endTime = this.getEndTime(event, eventData);
        var day = this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date(startTime.getTime())));
        if (day < 0 || startTime > endTime) {
            return;
        }
        var cellTd = this.getCellTd(day);
        var position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], day);
        if (!isIcon) {
            var diffInDays = eventData.count;
            var appWidth = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
            appWidth = (appWidth <= 0) ? this.cellWidth : appWidth;
            var appLeft = (this.parent.enableRtl) ? 0 : position;
            var appRight = (this.parent.enableRtl) ? position : 0;
            this.renderWrapperElement(cellTd);
            var appHeight = this.cellHeight - this.monthHeaderHeight;
            var appTop = this.getRowTop(resIndex);
            var blockElement = this.createBlockAppointmentElement(event, resIndex);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(blockElement, {
                'width': appWidth + 'px', 'height': appHeight + 'px', 'left': appLeft + 'px',
                'right': appRight + 'px', 'top': appTop + 'px'
            });
            this.renderEventElement(event, blockElement, cellTd);
        }
        else {
            this.renderBlockIndicator(cellTd, position, resIndex);
        }
    };
    MonthEvent.prototype.renderBlockIndicator = function (cellTd, position, resIndex) {
        var blockIndicator = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-icons ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["BLOCK_INDICATOR_CLASS"] });
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["BLOCK_INDICATOR_CLASS"]))) {
            cellTd.appendChild(blockIndicator);
        }
    };
    MonthEvent.prototype.getStartTime = function (event, eventData) {
        return event[this.fields.startTime];
    };
    MonthEvent.prototype.getEndTime = function (event, eventData) {
        return event[this.fields.endTime];
    };
    MonthEvent.prototype.getCellTd = function (day) {
        return this.workCells[day];
    };
    MonthEvent.prototype.getEventWidth = function (startDate, endDate, isAllDay, count) {
        return count * this.cellWidth - 1;
    };
    MonthEvent.prototype.getPosition = function (startTime, endTime, isAllDay, day) {
        return 0;
    };
    MonthEvent.prototype.getRowTop = function (resIndex) {
        return 0;
    };
    MonthEvent.prototype.updateIndicatorIcon = function (event) {
        if (this.parent.currentView.indexOf('Timeline') === -1 || this.parent.currentView === 'TimelineMonth'
            || event[this.fields.isAllDay]) {
            return;
        }
        var cloneData = event.data;
        var startHour = _base_util__WEBPACK_IMPORTED_MODULE_4__["getStartEndHours"](event[this.fields.startTime], this.parent.activeView.getStartHour(), this.parent.activeView.getEndHour());
        var endHour = _base_util__WEBPACK_IMPORTED_MODULE_4__["getStartEndHours"](event[this.fields.endTime], this.parent.activeView.getStartHour(), this.parent.activeView.getEndHour());
        cloneData.isLeft = cloneData.isLeft || cloneData[this.fields.startTime].getTime() < startHour.startHour.getTime();
        cloneData.isRight = cloneData.isRight || cloneData[this.fields.endTime].getTime() > endHour.endHour.getTime();
    };
    MonthEvent.prototype.renderResourceEvents = function () {
        var resources = this.parent.uiStateValues.isGroupAdaptive ?
            [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
            this.parent.resourceBase.lastResourceLevel;
        if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
            for (var i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
                var sourceRes = this.parent.crudModule.crudObj.sourceEvent[i];
                this.renderEventsHandler(sourceRes.renderDates, sourceRes.workDays, sourceRes);
                if (this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
                    this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
                    var target = this.parent.crudModule.crudObj.targetEvent[i];
                    this.renderEventsHandler(target.renderDates, target.workDays, target);
                }
            }
            this.parent.crudModule.crudObj.isCrudAction = false;
        }
        else {
            for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {
                var slotData = resources_1[_i];
                this.renderEventsHandler(slotData.renderDates, slotData.workDays, slotData);
            }
        }
    };
    MonthEvent.prototype.getSlotDates = function (workDays) {
        this.slots = [];
        var dates = this.dateRender.map(function (date) { return +date; });
        var noOfDays = this.parent.activeViewOptions.showWeekend ? _base_util__WEBPACK_IMPORTED_MODULE_4__["WEEK_LENGTH"] : workDays.length;
        while (dates.length > 0) {
            this.slots.push(dates.splice(0, noOfDays));
        }
    };
    MonthEvent.prototype.createAppointmentElement = function (record, resIndex, isCloneElement) {
        if (isCloneElement === void 0) { isCloneElement = false; }
        var eventSubject = (record[this.fields.subject] || this.parent.eventSettings.fields.subject.default);
        var newRecord = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, record, record.data, true);
        var appointmentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"],
            attrs: {
                'data-id': 'Appointment_' + record[this.fields.id],
                'role': 'button', 'tabindex': '0',
                'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record), 'aria-selected': 'false', 'aria-grabbed': 'true',
                'aria-label': this.parent.getAnnocementString(newRecord, eventSubject)
            }
        });
        if (!isCloneElement) {
            appointmentWrapper.setAttribute('data-guid', record.Guid);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentWrapper], this.cssClass);
        }
        if (record[this.fields.isReadonly]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentWrapper], 'e-read-only');
        }
        var appointmentDetails = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_DETAILS"] });
        appointmentWrapper.appendChild(appointmentDetails);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            appointmentWrapper.setAttribute('data-group-index', resIndex.toString());
        }
        var templateElement;
        var eventData = record.data;
        var eventObj = this.getEventData(record);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeViewOptions.eventTemplate)) {
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.eventTemplateName;
            var templateId = scheduleId + viewName + 'eventTemplate';
            var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_4__["addLocalOffsetToEvent"](eventObj, this.parent.eventFields);
            templateElement = this.parent.getAppointmentTemplate()(templateArgs, this.parent, 'eventTemplate', templateId, false);
        }
        else {
            var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
            var appointmentSubject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["SUBJECT_CLASS"],
                innerHTML: (eventSubject + (eventLocation ? ';&nbsp' + eventLocation : ''))
            });
            var appointmentStartTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["DISABLE_CLASS"] : ''),
                innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])
            });
            var appointmentEndTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["DISABLE_CLASS"] : ''),
                innerHTML: this.parent.getTimeString(eventData[this.fields.endTime])
            });
            if (this.parent.currentView === 'Month') {
                if (record[this.fields.isAllDay]) {
                    templateElement = [appointmentSubject];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentSubject], 'e-text-center');
                }
                else if (eventData.count <= 1 && !eventData.isLeft && !eventData.isRight) {
                    templateElement = [appointmentStartTime, appointmentSubject];
                }
                else {
                    templateElement = [];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentSubject], 'e-text-center');
                    if (!eventData.isLeft) {
                        templateElement.push(appointmentStartTime);
                    }
                    templateElement.push(appointmentSubject);
                    if (!eventData.isRight) {
                        templateElement.push(appointmentEndTime);
                    }
                }
            }
            else {
                var innerElement = void 0;
                if (record[this.fields.isAllDay]) {
                    var allDayString = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                        className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_TIME"], innerHTML: this.parent.localeObj.getConstant('allDay')
                    });
                    innerElement = [appointmentSubject, allDayString];
                }
                else {
                    var timeString = this.parent.getTimeString(eventData[this.fields.startTime])
                        + ' - ' + this.parent.getTimeString(eventData[this.fields.endTime]);
                    var appTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                        className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["DISABLE_CLASS"] : ''), innerHTML: timeString,
                    });
                    var appLocation = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["LOCATION_CLASS"], innerHTML: eventLocation });
                    innerElement = [appointmentSubject, appTime, appLocation];
                }
                var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-inner-wrap' });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(innerElement, wrap);
                templateElement = [wrap];
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(templateElement, appointmentDetails);
        this.appendEventIcons(record, appointmentDetails);
        this.renderResizeHandler(appointmentWrapper, record.data, record[this.fields.isReadonly]);
        return appointmentWrapper;
    };
    MonthEvent.prototype.appendEventIcons = function (record, appointmentDetails) {
        var eventData = record.data;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(record[this.fields.recurrenceRule]) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(record[this.fields.recurrenceID])) {
            var iconClass = (record[this.fields.id] === record[this.fields.recurrenceID]) ?
                _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_RECURRENCE_ICON_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_RECURRENCE_EDIT_ICON_CLASS"];
            appointmentDetails.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ICON"] + ' ' + iconClass + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["DISABLE_CLASS"] : '')
            }));
        }
        if (eventData.isLeft) {
            var iconLeft = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_INDICATOR_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_ICON_LEFT_CLASS"]
            });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([iconLeft], appointmentDetails);
        }
        if (eventData.isRight) {
            var iconRight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_INDICATOR_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_ICON_RIGHT_CLASS"]
            });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([iconRight], appointmentDetails);
        }
    };
    MonthEvent.prototype.renderEvents = function (event, resIndex, eventsList) {
        var startTime = event[this.fields.startTime];
        var endTime = event[this.fields.endTime];
        var day = this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](startTime));
        if (day < 0) {
            return;
        }
        if ((startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {
            return;
        }
        var overlapCount = this.getIndex(startTime);
        event.Index = overlapCount;
        var appHeight = this.eventHeight;
        this.renderedEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true));
        var diffInDays = event.data.count;
        if (startTime.getTime() <= endTime.getTime()) {
            var appWidth = (diffInDays * this.cellWidth) - 5;
            var cellTd = this.workCells[day];
            var appTop = (overlapCount * (appHeight + EVENT_GAP));
            this.renderWrapperElement(cellTd);
            var height = this.monthHeaderHeight + ((overlapCount + 1) * (appHeight + EVENT_GAP)) + this.moreIndicatorHeight;
            var enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
            if (this.parent.rowAutoHeight || enableAppRender) {
                var appointmentElement = void 0;
                if (this.inlineValue) {
                    appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();
                }
                else {
                    appointmentElement = this.createAppointmentElement(event, resIndex);
                }
                this.applyResourceColor(appointmentElement, event, 'backgroundColor', this.groupOrder);
                this.wireAppointmentEvents(appointmentElement, event);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'width': appWidth + 'px', 'top': appTop + 'px' });
                this.renderEventElement(event, appointmentElement, cellTd);
                if (this.parent.rowAutoHeight) {
                    var firstChild = cellTd.parentElement.firstElementChild;
                    this.updateCellHeight(firstChild, height);
                }
            }
            else {
                for (var i = 0; i < diffInDays; i++) {
                    var cellTd_1 = this.workCells[day + i];
                    if (cellTd_1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(cellTd_1.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"]))) {
                        var startDate = new Date(this.dateRender[day + i].getTime());
                        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_4__["addDays"](this.dateRender[day + i], 1);
                        var groupIndex = cellTd_1.getAttribute('data-group-index');
                        var filterEvents = this.getFilteredEvents(startDate, endDate, groupIndex);
                        var appArea = this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight;
                        appHeight = this.withIndicator ? appArea : appHeight;
                        var renderedAppCount = Math.floor(appArea / (appHeight + EVENT_GAP));
                        var count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);
                        var moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
                            moreIndicatorElement.setAttribute('data-group-index', groupIndex);
                        }
                        moreIndicatorElement.style.top = appArea + 'px';
                        moreIndicatorElement.style.width = cellTd_1.offsetWidth - 2 + 'px';
                        this.renderElement(cellTd_1, moreIndicatorElement);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
                    }
                }
            }
        }
    };
    MonthEvent.prototype.updateCellHeight = function (cell, height) {
        if ((height > cell.offsetHeight)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cell, { 'height': height + 'px' });
        }
    };
    MonthEvent.prototype.updateBlockElements = function () {
        var blockElement = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["BLOCK_APPOINTMENT_CLASS"]));
        for (var _i = 0, blockElement_1 = blockElement; _i < blockElement_1.length; _i++) {
            var element = blockElement_1[_i];
            var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, 'tr');
            this.monthHeaderHeight = element.offsetParent.offsetTop - target.offsetTop;
            element.style.height = ((target.offsetHeight - 1) - this.monthHeaderHeight) + 'px';
            var firstChild = target.firstElementChild;
            var width = Math.round(element.offsetWidth / firstChild.offsetWidth);
            element.style.width = (firstChild.offsetWidth * width) + 'px';
        }
    };
    MonthEvent.prototype.getFilteredEvents = function (startDate, endDate, groupIndex, eventsList) {
        var filteredEvents;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
            filteredEvents = this.filterEvents(startDate, endDate);
        }
        else {
            var data = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)];
            filteredEvents = this.filterEvents(startDate, endDate, Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventsList) ? undefined : eventsList, data);
        }
        return filteredEvents;
    };
    MonthEvent.prototype.getOverlapEvents = function (date, appointments) {
        var appointmentsList = [];
        for (var _i = 0, appointments_1 = appointments; _i < appointments_1.length; _i++) {
            var app = appointments_1[_i];
            if ((_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](app[this.fields.startTime]).getTime() <= _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](date).getTime()) &&
                (_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](app[this.fields.endTime]).getTime() >= _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](date).getTime())) {
                appointmentsList.push(app);
            }
        }
        return appointmentsList;
    };
    MonthEvent.prototype.getIndex = function (date) {
        var appIndex = -1;
        var appointments = this.renderedEvents;
        if (appointments.length > 0) {
            var appointmentsList = this.getOverlapEvents(date, appointments);
            var appLevel = appointmentsList.map(function (obj) { return obj.Index; });
            appIndex = (appLevel.length > 0) ? this.getSmallestMissingNumber(appLevel) : 0;
        }
        return (appIndex === -1) ? 0 : appIndex;
    };
    MonthEvent.prototype.moreIndicatorClick = function (event) {
        var _this = this;
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(event.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"]);
        var startDate = new Date(parseInt(target.getAttribute('data-start-date'), 10));
        var endDate = new Date(parseInt(target.getAttribute('data-end-date'), 10));
        var groupIndex = target.getAttribute('data-group-index');
        var moreArgs = {
            cancel: false, event: event, element: target, isPopupOpen: true,
            startTime: startDate, endTime: endDate, viewName: this.parent.getNavigateView()
        };
        if (groupIndex) {
            moreArgs.groupIndex = parseInt(groupIndex, 10);
        }
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["moreEventsClick"], moreArgs, function (clickArgs) {
            if (!clickArgs.cancel) {
                if (clickArgs.isPopupOpen) {
                    var filteredEvents = _this.getFilteredEvents(startDate, endDate, groupIndex);
                    var moreEventArgs = { date: startDate, event: filteredEvents, element: event.target };
                    _this.parent.quickPopup.moreEventClick(moreEventArgs, endDate, groupIndex);
                }
                else {
                    _this.parent.setScheduleProperties({ selectedDate: startDate });
                    _this.parent.changeView(clickArgs.viewName, event);
                }
            }
        });
    };
    MonthEvent.prototype.renderEventElement = function (event, appointmentElement, cellTd) {
        var _this = this;
        var eventType = appointmentElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["BLOCK_APPOINTMENT_CLASS"]) ? 'blockEvent' : 'event';
        var isAppointment = appointmentElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"]);
        var eventObj = this.getEventData(event);
        var args = { data: eventObj, element: appointmentElement, cancel: false, type: eventType };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["eventRendered"], args, function (eventArgs) {
            if (eventArgs.cancel) {
                _this.renderedEvents.pop();
            }
            else {
                _this.renderElement(cellTd, appointmentElement, isAppointment);
            }
        });
    };
    MonthEvent.prototype.getEventData = function (event) {
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true);
        eventObj[this.fields.startTime] = event.data[this.fields.startTime];
        eventObj[this.fields.endTime] = event.data[this.fields.endTime];
        return eventObj;
    };
    MonthEvent.prototype.renderElement = function (cellTd, element, isAppointment) {
        if (isAppointment === void 0) { isAppointment = false; }
        if (this.maxOrIndicator && isAppointment) {
            this.setMaxEventHeight(element, cellTd);
        }
        if (cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"])) {
            cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"]).appendChild(element);
        }
        else {
            var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"] });
            wrapper.appendChild(element);
            cellTd.appendChild(wrapper);
        }
    };
    MonthEvent.prototype.renderWrapperElement = function (cellTd) {
        var element = cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(element)) {
            this.monthHeaderHeight = element.offsetTop - cellTd.offsetTop;
        }
        else {
            var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_WRAPPER_CLASS"] });
            cellTd.appendChild(wrapper);
            this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
        }
    };
    MonthEvent.prototype.getMoreIndicatorElement = function (count, startDate, endDate) {
        var moreIndicatorElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["MORE_INDICATOR_CLASS"],
            innerHTML: '+' + count + '&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')),
            attrs: {
                'tabindex': '0',
                'data-start-date': startDate.getTime().toString(),
                'data-end-date': endDate.getTime().toString(),
                'role': 'list'
            }
        });
        return moreIndicatorElement;
    };
    MonthEvent.prototype.removeHeightProperty = function (selector) {
        var rows = [].slice.call(this.element.querySelectorAll('.' + selector + ' tbody tr'));
        for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
            var row = rows_1[_i];
            row.firstElementChild.style.height = '';
        }
    };
    MonthEvent.prototype.setMaxEventHeight = function (event, cell) {
        var headerHeight = _base_util__WEBPACK_IMPORTED_MODULE_4__["getOuterHeight"](cell.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["DATE_HEADER_CLASS"]));
        var height = (cell.offsetHeight - headerHeight) - (this.maxHeight ? 0 : this.moreIndicatorHeight);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(event, { 'height': height + 'px', 'align-items': 'center' });
    };
    return MonthEvent;
}(_event_base__WEBPACK_IMPORTED_MODULE_1__["EventBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js":
/*!*********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js ***!
  \*********************************************************************************************/
/*! exports provided: TimelineEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineEvent", function() { return TimelineEvent; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _month__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();




var EVENT_GAP = 2;
var BLOCK_INDICATOR_WIDTH = 22;
var BLOCK_INDICATOR_HEIGHT = 18;
/**
 * Timeline view events render
 */
var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
    __extends(TimelineEvent, _super);
    /**
     * Constructor for timeline views
     */
    function TimelineEvent(parent, type) {
        var _this = _super.call(this, parent) || this;
        _this.startHour = _this.parent.activeView.getStartHour();
        _this.endHour = _this.parent.activeView.getEndHour();
        _this.slotCount = _this.parent.activeViewOptions.timeScale.slotCount;
        _this.interval = _this.parent.activeViewOptions.timeScale.interval;
        _this.day = 0;
        _this.rowIndex = 0;
        _this.renderType = type;
        _this.eventContainers = [].slice.call(_this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_CONTAINER_CLASS"]));
        var tr = [].slice.call(_this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_TABLE_CLASS"] + ' tbody tr'));
        _this.dayLength = tr.length === 0 ? 0 : tr[0].children.length;
        _this.content = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_TABLE_CLASS"]);
        return _this;
    }
    TimelineEvent.prototype.getSlotDates = function () {
        this.slots = [];
        this.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
        if (this.parent.headerRows.length > 0 &&
            this.parent.headerRows[this.parent.headerRows.length - 1].option !== 'Hour') {
            this.renderType = 'day';
            this.cellWidth = this.content.offsetWidth / this.dateRender.length;
            this.slotsPerDay = 1;
        }
        else {
            this.slotsPerDay = (this.dayLength / this.dateRender.length);
        }
    };
    TimelineEvent.prototype.getOverlapEvents = function (date, appointments) {
        var appointmentsList = [];
        if (this.renderType === 'day') {
            for (var _i = 0, appointments_1 = appointments; _i < appointments_1.length; _i++) {
                var app = appointments_1[_i];
                if ((_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](app[this.fields.startTime]).getTime() <= _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(date.getTime())).getTime()) &&
                    (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](app[this.fields.endTime]).getTime() >= _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(date.getTime())).getTime())) {
                    appointmentsList.push(app);
                }
            }
        }
        else {
            for (var _a = 0, appointments_2 = appointments; _a < appointments_2.length; _a++) {
                var app = appointments_2[_a];
                var eventData = app.data;
                if (eventData.trimStartTime.getTime() <= date.getTime() &&
                    eventData.trimEndTime.getTime() > date.getTime()) {
                    appointmentsList.push(app);
                }
            }
        }
        return appointmentsList;
    };
    TimelineEvent.prototype.renderResourceEvents = function () {
        this.removeHeightProperty(_base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESOURCE_COLUMN_TABLE_CLASS"]);
        var resources = this.parent.uiStateValues.isGroupAdaptive ?
            [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
            this.parent.resourceBase.renderedResources;
        if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
            for (var i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
                var source = this.parent.crudModule.crudObj.sourceEvent[i];
                this.rowIndex = source.groupIndex;
                this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, source);
                if (this.parent.crudModule.crudObj.sourceEvent[i].groupIndex !==
                    this.parent.crudModule.crudObj.targetEvent[i].groupIndex) {
                    var target = this.parent.crudModule.crudObj.targetEvent[i];
                    this.rowIndex = target.groupIndex;
                    this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, target);
                }
            }
            this.parent.crudModule.crudObj.isCrudAction = false;
        }
        else {
            for (var i = 0; i < resources.length; i++) {
                this.rowIndex = i;
                this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, resources[i]);
            }
        }
    };
    // tslint:disable-next-line:max-func-body-length
    TimelineEvent.prototype.renderEvents = function (event, resIndex, appointmentsList) {
        var startTime = event[this.fields.startTime];
        var endTime = event[this.fields.endTime];
        if ((startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {
            return;
        }
        var eventData = event.data;
        startTime = this.getStartTime(event, eventData);
        endTime = this.getEndTime(event, eventData);
        this.day = this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(startTime.getTime())));
        if (this.day < 0) {
            return;
        }
        var cellTd = this.getCellTd();
        var overlapCount = this.getIndex(startTime);
        event.Index = overlapCount;
        var elem = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_CLASS"]);
        var eleHeight = (elem) ? elem.getBoundingClientRect().height : 0;
        var appHeight = (elem && eleHeight > 0) ? eleHeight : this.eventHeight;
        var diffInDays = eventData.count;
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true);
        eventObj[this.fields.startTime] = eventData[this.fields.startTime];
        eventObj[this.fields.endTime] = eventData[this.fields.endTime];
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(this.dateRender[this.day].getTime()));
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](currentDate, this.startHour, this.endHour);
        var isValidEvent = this.isValidEvent(eventObj, startTime, endTime, schedule);
        if (startTime <= endTime && isValidEvent) {
            var appWidth_1 = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
            appWidth_1 = this.renderType === 'day' ? appWidth_1 - 2 : appWidth_1;
            var appLeft = 0;
            var appRight = 0;
            var position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], this.day);
            appWidth_1 = (appWidth_1 <= 0) ? this.cellWidth : appWidth_1; // appWidth 0 when start and end time as same
            this.renderedEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event, null, true));
            var top_1 = this.getRowTop(resIndex);
            var appTop = (top_1 + (this.maxHeight ? 0 : EVENT_GAP)) + (overlapCount * (appHeight + EVENT_GAP));
            appLeft = (this.parent.enableRtl) ? 0 : position;
            appRight = (this.parent.enableRtl) ? position : 0;
            var height = ((overlapCount + 1) * (appHeight + EVENT_GAP)) + this.moreIndicatorHeight;
            var renderApp = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
            if (this.parent.rowAutoHeight || renderApp) {
                var appointmentElement = void 0;
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.inlineValue)) {
                    appointmentElement = this.createAppointmentElement(event, resIndex);
                }
                else {
                    appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();
                }
                this.applyResourceColor(appointmentElement, event, 'backgroundColor', this.groupOrder);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, {
                    'width': appWidth_1 + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
                });
                this.wireAppointmentEvents(appointmentElement, event);
                this.renderEventElement(event, appointmentElement, cellTd);
                if (this.parent.rowAutoHeight) {
                    var firstChild = this.getFirstChild(resIndex);
                    this.updateCellHeight(firstChild, height);
                }
                if (this.parent.activeViewOptions.option !== 'TimelineMonth' && this.parent.activeViewOptions.timeScale.enable
                    && appWidth_1 < this.cellWidth) {
                    var resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_RESIZE_CLASS"]));
                    resizeHandlers.forEach(function (resizeHandler) {
                        resizeHandler.style.width = Math.ceil(appWidth_1 / resizeHandler.getBoundingClientRect().width) + 'px';
                    });
                }
            }
            else {
                for (var i = 0; i < diffInDays; i++) {
                    var moreIndicator = cellTd.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["MORE_INDICATOR_CLASS"]);
                    var appPos = (this.parent.enableRtl) ? appRight : appLeft;
                    appPos = (Math.floor(appPos / this.cellWidth) * this.cellWidth);
                    if ((cellTd && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(moreIndicator)) ||
                        (!this.isAlreadyAvail(appPos, cellTd))) {
                        var interval = this.interval / this.slotCount;
                        var startDate = new Date(this.dateRender[this.day + i].getTime());
                        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.dateRender[this.day + i], 1);
                        var startDateTime = new Date(+startTime);
                        var slotStartTime = (new Date(startDateTime.setMinutes(Math.floor(startDateTime.getMinutes() / interval) * interval)));
                        var slotEndTime = new Date(slotStartTime.getTime() + (60000 * interval));
                        var groupIndex = void 0;
                        if (this.parent.activeViewOptions.group.resources.length > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resIndex)) {
                            groupIndex = resIndex.toString();
                        }
                        var filterEvents = this.getFilterEvents(startDate, endDate, slotStartTime, slotEndTime, groupIndex, appointmentsList);
                        var appArea = this.cellHeight - this.moreIndicatorHeight;
                        appHeight = this.withIndicator ? appArea - EVENT_GAP : appHeight;
                        var renderedAppCount = Math.floor(appArea / (appHeight + EVENT_GAP));
                        var count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);
                        var moreIndicatorElement = void 0;
                        if (this.renderType === 'day') {
                            moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);
                        }
                        else {
                            moreIndicatorElement = this.getMoreIndicatorElement(count, slotStartTime, slotEndTime);
                        }
                        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
                            moreIndicatorElement.setAttribute('data-group-index', groupIndex);
                        }
                        moreIndicatorElement.style.top = top_1 + appArea + 'px';
                        moreIndicatorElement.style.width = this.cellWidth + 'px';
                        moreIndicatorElement.style.left = (Math.floor(appLeft / this.cellWidth) * this.cellWidth) + 'px';
                        moreIndicatorElement.style.right = (Math.floor(appRight / this.cellWidth) * this.cellWidth) + 'px';
                        this.renderElement(cellTd, moreIndicatorElement);
                        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
                    }
                }
            }
        }
        this.parent.renderTemplates();
    };
    TimelineEvent.prototype.updateCellHeight = function (cell, height) {
        if ((height > cell.getBoundingClientRect().height)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(cell, { 'height': height + 'px' });
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                var resourceCell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESOURCE_COLUMN_TABLE_CLASS"] + ' ' + 'tbody td[data-group-index="' +
                    cell.getAttribute('data-group-index') + '"]');
                if (resourceCell) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(resourceCell, { 'height': height + 'px' });
                }
            }
            var monthHeader = this.parent.element.querySelector('.e-month-header-wrapper table tr:nth-child(' +
                (cell.parentElement.rowIndex + 1) + ') td');
            if (monthHeader) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(monthHeader, { 'height': height + 'px' });
            }
        }
    };
    TimelineEvent.prototype.getFirstChild = function (index) {
        var query = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_TABLE_CLASS"] + ' tbody td';
        var groupIndex = '';
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            groupIndex = '[data-group-index="' + index.toString() + '"]';
        }
        var td = this.parent.element.querySelector(query + groupIndex);
        return td;
    };
    TimelineEvent.prototype.updateBlockElements = function () {
        var blockElement = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["BLOCK_APPOINTMENT_CLASS"]));
        for (var _i = 0, blockElement_1 = blockElement; _i < blockElement_1.length; _i++) {
            var element = blockElement_1[_i];
            var resIndex = parseInt(element.getAttribute('data-group-index'), 10);
            var firstChild = this.getFirstChild(resIndex);
            element.style.height = firstChild.offsetHeight + 'px';
            var width = Math.round(element.offsetWidth / firstChild.offsetWidth);
            element.style.width = (firstChild.offsetWidth * width) + 'px';
        }
        var blockIndicator = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["BLOCK_INDICATOR_CLASS"]));
        for (var _a = 0, blockIndicator_1 = blockIndicator; _a < blockIndicator_1.length; _a++) {
            var element = blockIndicator_1[_a];
            var resIndex = parseInt(element.getAttribute('data-group-index'), 10);
            element.style.top = this.getRowTop(resIndex) +
                this.getFirstChild(resIndex).offsetHeight - BLOCK_INDICATOR_HEIGHT + 'px';
        }
    };
    TimelineEvent.prototype.getStartTime = function (event, eventData) {
        var startTime = event[this.fields.startTime];
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](startTime, this.startHour, this.endHour);
        if (schedule.startHour.getTime() >= eventData[this.fields.startTime]) {
            startTime = schedule.startHour;
        }
        else if (schedule.endHour.getTime() <= eventData[this.fields.startTime]) {
            startTime = this.getNextDay(schedule.startHour, eventData);
        }
        else {
            startTime = eventData[this.fields.startTime];
        }
        // To overcome the overflow
        eventData.trimStartTime = (event[this.fields.isAllDay]) ? schedule.startHour : eventData[this.fields.startTime];
        return startTime;
    };
    TimelineEvent.prototype.getNextDay = function (startTime, eventData) {
        var startDate;
        for (var i = 1; i <= this.dateRender.length; i++) {
            startDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](startTime, i);
            if (this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(startTime.getTime()))) !== -1) {
                eventData.count = eventData.count - 1;
                return startDate;
            }
        }
        return startDate;
    };
    TimelineEvent.prototype.getEndTime = function (event, eventData) {
        var endTime = event[this.fields.endTime];
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](endTime, this.startHour, this.endHour);
        if (schedule.endHour.getTime() <= eventData[this.fields.endTime]) {
            endTime = schedule.endHour;
        }
        else {
            endTime = eventData[this.fields.endTime];
        }
        // To overcome the overflow
        eventData.trimEndTime = (event[this.fields.isAllDay]) ? schedule.endHour : eventData[this.fields.endTime];
        return endTime;
    };
    TimelineEvent.prototype.getEventWidth = function (startDate, endDate, isAllDay, count) {
        if (this.renderType === 'day' || isAllDay) {
            return (count * this.slotsPerDay) * this.cellWidth;
        }
        if (this.isSameDay(startDate, endDate)) {
            return this.getSameDayEventsWidth(startDate, endDate);
        }
        else {
            return this.getSpannedEventsWidth(startDate, endDate, count);
        }
    };
    TimelineEvent.prototype.getSameDayEventsWidth = function (startDate, endDate) {
        return (((endDate.getTime() - startDate.getTime())) / (60 * 1000) * (this.cellWidth * this.slotCount) / this.interval);
    };
    TimelineEvent.prototype.getSpannedEventsWidth = function (startDate, endDate, diffInDays) {
        var width = (diffInDays * this.slotsPerDay) * this.cellWidth;
        var startWidth;
        var endWidth;
        var start = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(startDate.getTime())), this.startHour, this.endHour);
        startWidth = this.getSameDayEventsWidth(start.startHour, startDate);
        if (this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(endDate.getTime()))) === -1) {
            endWidth = 0;
        }
        else {
            var end = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(endDate.getTime())), this.startHour, this.endHour);
            endWidth = this.getSameDayEventsWidth(endDate, end.endHour);
            endWidth = ((this.slotsPerDay * this.cellWidth) === endWidth) ? 0 : endWidth;
        }
        var spannedWidth = startWidth + endWidth;
        return (width > spannedWidth) ? width - spannedWidth : endWidth - startWidth;
    };
    TimelineEvent.prototype.isSameDay = function (startTime, endTime) {
        var startDay = this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(startTime.getTime())));
        var endDay = this.parent.getIndexOfDate(this.dateRender, _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(endTime.getTime())));
        return (startDay === endDay);
    };
    TimelineEvent.prototype.getAppointmentLeft = function (schedule, startTime, day) {
        var slotTd = (this.isSameDay(startTime, schedule.startHour)) ?
            ((startTime.getTime() - schedule.startHour.getTime()) / ((60 * 1000) * this.interval)) * this.slotCount : 0;
        if (day === 0) {
            return slotTd;
        }
        else {
            var daySlot = Math.round((((schedule.endHour.getTime() - schedule.startHour.getTime()) / (60 * 1000)) / this.interval) * this.slotCount);
            return (daySlot * day) + slotTd;
        }
    };
    TimelineEvent.prototype.getPosition = function (startTime, endTime, isAllDay, day) {
        if (this.renderType === 'day' || isAllDay) {
            return (day * this.slotsPerDay) * this.cellWidth;
        }
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(this.dateRender[day].getTime()));
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](currentDate, this.startHour, this.endHour);
        var cellIndex;
        if (schedule.endHour.getTime() <= endTime.getTime() && schedule.startHour.getTime() >= startTime.getTime()) {
            cellIndex = this.getAppointmentLeft(schedule, schedule.startHour, day);
        }
        else if (schedule.endHour.getTime() <= endTime.getTime()) {
            cellIndex = this.getAppointmentLeft(schedule, startTime, day);
        }
        else if (schedule.startHour.getTime() >= startTime.getTime()) {
            cellIndex = this.getAppointmentLeft(schedule, schedule.startHour, day);
        }
        else {
            cellIndex = this.getAppointmentLeft(schedule, startTime, day);
        }
        return cellIndex * this.cellWidth;
    };
    //tslint:disable-next-line:max-line-length
    TimelineEvent.prototype.getFilterEvents = function (startDate, endDate, startTime, endTime, gIndex, eventsList) {
        if (this.renderType === 'day') {
            return this.getFilteredEvents(startDate, endDate, gIndex, eventsList);
        }
        else {
            return this.getFilteredEvents(startTime, endTime, gIndex, eventsList);
        }
    };
    TimelineEvent.prototype.isAlreadyAvail = function (appPos, cellTd) {
        var moreIndicator = [].slice.call(cellTd.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["MORE_INDICATOR_CLASS"]));
        for (var i = 0; i < moreIndicator.length; i++) {
            var indicatorPos = void 0;
            if (moreIndicator) {
                indicatorPos = (this.parent.enableRtl) ? moreIndicator[i].style.right : moreIndicator[i].style.left;
            }
            if (parseInt(indicatorPos, 10) === Math.floor(appPos)) {
                return true;
            }
        }
        return false;
    };
    TimelineEvent.prototype.getCellHeight = function (resIndex) {
        var heightValue = 0;
        for (var i = 0; i < resIndex; i++) {
            heightValue += this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"] +
                '[data-group-index="' + i.toString() + '"]').offsetHeight;
        }
        return heightValue;
    };
    TimelineEvent.prototype.getRowTop = function (resIndex) {
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            return ((this.parent.activeViewOptions.group.resources.length > 1 || this.parent.virtualScrollModule ||
                this.parent.rowAutoHeight) ? this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_WRAP_CLASS"] +
                ' ' + 'tbody td[data-group-index="' + resIndex.toString() + '"]').offsetTop : this.getCellHeight(resIndex));
        }
        return 0;
    };
    TimelineEvent.prototype.getCellTd = function () {
        var wrapIndex = this.parent.uiStateValues.isGroupAdaptive ? 0 : this.rowIndex;
        return this.eventContainers[wrapIndex];
    };
    TimelineEvent.prototype.renderBlockIndicator = function (cellTd, position, resIndex) {
        // No need to render block icon for Year, Month and Week header rows
        if (this.parent.headerRows.length > 0 &&
            (this.parent.headerRows[this.parent.headerRows.length - 1].option !== 'Hour' ||
                this.parent.headerRows[this.parent.headerRows.length - 1].option !== 'Date')) {
            return;
        }
        position = (Math.floor(position / this.cellWidth) * this.cellWidth) + this.cellWidth - BLOCK_INDICATOR_WIDTH;
        if (!this.isAlreadyAvail(position, cellTd)) {
            var blockIndicator = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-icons ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["BLOCK_INDICATOR_CLASS"] });
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                blockIndicator.setAttribute('data-group-index', resIndex.toString());
            }
            if (this.parent.enableRtl) {
                blockIndicator.style.right = position + 'px';
            }
            else {
                blockIndicator.style.left = position + 'px';
            }
            blockIndicator.style.top = this.getRowTop(resIndex) + this.cellHeight - BLOCK_INDICATOR_HEIGHT + 'px';
            this.renderElement(cellTd, blockIndicator);
        }
    };
    TimelineEvent.prototype.setMaxEventHeight = function (event, cell) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(event, {
            'height': (this.cellHeight - (this.maxHeight ? 0 : EVENT_GAP) -
                (this.maxHeight ? 0 : this.moreIndicatorHeight)) + 'px'
        });
    };
    return TimelineEvent;
}(_month__WEBPACK_IMPORTED_MODULE_3__["MonthEvent"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/vertical-view.js":
/*!*********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/vertical-view.js ***!
  \*********************************************************************************************/
/*! exports provided: VerticalEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalEvent", function() { return VerticalEvent; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _event_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/event-base.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






/**
 * Vertical view appointment rendering
 */
var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
    __extends(VerticalEvent, _super);
    /**
     * Constructor for vertical view
     */
    function VerticalEvent(parent) {
        var _this = _super.call(this, parent) || this;
        _this.dateRender = [];
        _this.renderedEvents = [];
        _this.renderedAllDayEvents = [];
        _this.overlapEvents = [];
        _this.moreEvents = [];
        _this.overlapList = [];
        _this.allDayEvents = [];
        _this.slotCount = _this.parent.activeViewOptions.timeScale.slotCount;
        _this.interval = _this.parent.activeViewOptions.timeScale.interval;
        _this.allDayLevel = 0;
        _this.startHour = _this.parent.activeView.getStartHour();
        _this.endHour = _this.parent.activeView.getEndHour();
        _this.element = _this.parent.activeView.getPanel();
        _this.fields = _this.parent.eventFields;
        _this.animation = new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Animation"]({ progress: _this.animationUiUpdate.bind(_this) });
        _this.addEventListener();
        return _this;
    }
    VerticalEvent.prototype.renderAppointments = function () {
        var wrapperElements = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["BLOCK_APPOINTMENT_CLASS"] +
            ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ROW_COUNT_WRAPPER_CLASS"]));
        var isDragging = (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) ? true : false;
        for (var _i = 0, wrapperElements_1 = wrapperElements; _i < wrapperElements_1.length; _i++) {
            var wrapper = wrapperElements_1[_i];
            if (isDragging && !(wrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_CLASS"]) ||
                wrapper.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ROW_COUNT_WRAPPER_CLASS"]))) {
                var groupIndex = parseInt(wrapper.getAttribute('data-group-index'), 10);
                for (var j = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; j < len; j++) {
                    if (groupIndex === this.parent.crudModule.crudObj.sourceEvent[j].groupIndex ||
                        groupIndex === this.parent.crudModule.crudObj.targetEvent[j].groupIndex) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrapper);
                    }
                }
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrapper);
            }
        }
        if (!this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["WORK_CELLS_CLASS"])) {
            return;
        }
        this.allDayElement = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_CELLS_CLASS"]));
        this.setAllDayRowHeight(0);
        if (this.parent.eventsProcessed.length === 0 && this.parent.blockProcessed.length === 0) {
            return;
        }
        var expandCollapse = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_SECTION_CLASS"]);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(expandCollapse, 'click', this.rowExpandCollapse);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(expandCollapse, 'click', this.rowExpandCollapse, this);
        this.renderedEvents = [];
        this.renderedAllDayEvents = [];
        this.initializeValues();
        this.processBlockEvents();
        this.renderEvents('normalEvents');
        if (this.allDayEvents.length > 0) {
            this.allDayEvents = this.allDayEvents.filter(function (item, index, arr) {
                return index === arr.map(function (item) { return item.Guid; }).indexOf(item.Guid);
            });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.allDayElement, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_ROW_ANIMATE_CLASS"]);
            this.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
            this.renderEvents('allDayEvents');
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_3__["contentReady"], {});
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(this.allDayElement, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_ROW_ANIMATE_CLASS"]);
        if (isDragging) {
            this.parent.crudModule.crudObj.isCrudAction = false;
        }
        this.parent.renderTemplates();
    };
    VerticalEvent.prototype.initializeValues = function () {
        this.resources = (this.parent.activeViewOptions.group.resources.length > 0) ? this.parent.uiStateValues.isGroupAdaptive ?
            [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
            this.parent.resourceBase.lastResourceLevel : [];
        this.cellHeight =
            parseFloat(this.parent.element.querySelector('.e-content-wrap tbody tr').getBoundingClientRect().height.toFixed(2));
        this.dateRender[0] = this.parent.activeView.renderDates;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            for (var i = 0, len = this.resources.length; i < len; i++) {
                this.dateRender[i] = this.resources[i].renderDates;
            }
        }
    };
    VerticalEvent.prototype.getHeight = function (start, end) {
        var appHeight = (end.getTime() - start.getTime()) / (60 * 1000) * (this.cellHeight * this.slotCount) / this.interval;
        appHeight = (appHeight <= 0) ? this.cellHeight : appHeight;
        return appHeight;
    };
    VerticalEvent.prototype.appendEvent = function (eventObj, appointmentElement, index, appLeft) {
        var appointmentWrap = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"]));
        if (this.parent.enableRtl) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'right': appLeft });
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'left': appLeft });
        }
        var eventType = appointmentElement.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["BLOCK_APPOINTMENT_CLASS"]) ? 'blockEvent' : 'event';
        var args = {
            data: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true),
            element: appointmentElement, cancel: false, type: eventType
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["eventRendered"], args, function (eventArgs) {
            if (!eventArgs.cancel) {
                appointmentWrap[index].appendChild(appointmentElement);
            }
        });
    };
    VerticalEvent.prototype.processBlockEvents = function () {
        var resources = this.getResourceList();
        var dateCount = 0;
        for (var _i = 0, resources_1 = resources; _i < resources_1.length; _i++) {
            var resource = resources_1[_i];
            var renderDates = this.dateRender[resource];
            for (var day = 0, length_1 = renderDates.length; day < length_1; day++) {
                var startDate = new Date(renderDates[day].getTime());
                var endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](renderDates[day], 1);
                var filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[resource]);
                for (var _a = 0, filterEvents_1 = filterEvents; _a < filterEvents_1.length; _a++) {
                    var event_1 = filterEvents_1[_a];
                    if (this.parent.resourceBase) {
                        this.setValues(event_1, resource);
                    }
                    this.renderBlockEvents(event_1, day, resource, dateCount);
                    this.cssClass = null;
                    this.groupOrder = null;
                }
                dateCount += 1;
            }
        }
    };
    VerticalEvent.prototype.renderBlockEvents = function (eventObj, dayIndex, resource, dayCount) {
        var spannedData = this.isSpannedEvent(eventObj, dayIndex, resource);
        var eStart = spannedData[this.fields.startTime];
        var eEnd = spannedData[this.fields.endTime];
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(this.dateRender[resource][dayIndex].getTime()));
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](currentDate, this.startHour, this.endHour);
        if (eStart <= eEnd && this.isValidEvent(eventObj, eStart, eEnd, schedule)) {
            var blockTop = void 0;
            var blockHeight = void 0;
            if (spannedData[this.fields.isAllDay]) {
                var contentWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["CONTENT_WRAP_CLASS"] + ' table');
                blockHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(contentWrap.offsetHeight);
                blockTop = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(0);
            }
            else {
                blockHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.getHeight(eStart, eEnd));
                blockTop = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.getTopValue(eStart, dayIndex, resource));
            }
            var appointmentElement = this.createBlockAppointmentElement(eventObj, resource);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
            var index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
            this.appendEvent(eventObj, appointmentElement, index, '0px');
        }
    };
    VerticalEvent.prototype.renderEvents = function (eventType) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.allDayElement, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_ROW_ANIMATE_CLASS"]);
        var eventCollection = (eventType === 'allDayEvents') ? this.sortByDateTime(this.allDayEvents) : undefined;
        var resources = this.getResourceList();
        var dateCount = 0;
        var isRender;
        var _loop_1 = function (resource) {
            isRender = true;
            if (this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction && eventType !== 'allDayEvents') {
                if (this_1.parent.crudModule.crudObj.sourceEvent.filter(function (data) { return data.groupIndex === resource; }).length === 0 &&
                    this_1.parent.crudModule.crudObj.targetEvent.filter(function (data) { return data.groupIndex === resource; }).length === 0) {
                    isRender = false;
                }
            }
            this_1.slots = [];
            var renderDates = this_1.dateRender[resource];
            var renderedDate = this_1.getRenderedDates(renderDates) || renderDates;
            this_1.slots.push(renderDates.map(function (date) { return +date; }));
            for (var day = 0, length_2 = renderDates.length; day < length_2 &&
                renderDates[day] <= renderedDate[renderedDate.length - 1]; day++) {
                this_1.renderedEvents = [];
                var startDate = new Date(renderDates[day].getTime());
                var endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](renderDates[day], 1);
                var filterEvents = this_1.filterEvents(startDate, endDate, eventCollection, this_1.resources[resource]);
                if (isRender) {
                    for (var _i = 0, filterEvents_2 = filterEvents; _i < filterEvents_2.length; _i++) {
                        var event_2 = filterEvents_2[_i];
                        if (this_1.parent.resourceBase) {
                            this_1.setValues(event_2, resource);
                        }
                        if (eventType === 'allDayEvents') {
                            this_1.renderAllDayEvents(event_2, day, resource, dateCount);
                        }
                        else {
                            if (this_1.isAllDayAppointment(event_2)) {
                                this_1.allDayEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event_2, null, true));
                            }
                            else {
                                if (this_1.parent.eventSettings.enableMaxHeight) {
                                    if (this_1.getOverlapIndex(event_2, day, false, resource) > 0) {
                                        continue;
                                    }
                                }
                                this_1.renderNormalEvents(event_2, day, resource, dateCount);
                            }
                        }
                        this_1.cssClass = null;
                        this_1.groupOrder = null;
                    }
                }
                else {
                    for (var _a = 0, filterEvents_3 = filterEvents; _a < filterEvents_3.length; _a++) {
                        var event_3 = filterEvents_3[_a];
                        if (this_1.isAllDayAppointment(event_3)) {
                            this_1.allDayEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, event_3, null, true));
                        }
                    }
                }
                dateCount += 1;
            }
        };
        var this_1 = this;
        for (var _i = 0, resources_2 = resources; _i < resources_2.length; _i++) {
            var resource = resources_2[_i];
            _loop_1(resource);
        }
    };
    VerticalEvent.prototype.setValues = function (event, resourceIndex) {
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.cssClass = this.resources[resourceIndex].cssClass;
            this.groupOrder = this.resources[resourceIndex].groupOrder;
        }
        else {
            this.cssClass = this.parent.resourceBase.getCssClass(event);
        }
    };
    VerticalEvent.prototype.getResourceList = function () {
        var resources = Array.apply(null, {
            length: (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) ?
                this.resources.length : 1
        }).map(function (value, index) { return index; });
        return resources;
    };
    VerticalEvent.prototype.createAppointmentElement = function (record, isAllDay, data, resource) {
        var fieldMapping = this.parent.eventFields;
        var recordSubject = (record[fieldMapping.subject] || this.parent.eventSettings.fields.subject.default);
        var appointmentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"],
            attrs: {
                'data-id': 'Appointment_' + record[fieldMapping.id],
                'data-guid': record.Guid,
                'role': 'button',
                'tabindex': '0',
                'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record),
                'aria-selected': 'false',
                'aria-grabbed': 'true',
                'aria-label': this.parent.getAnnocementString(record)
            }
        });
        if (record[this.fields.isReadonly]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentWrapper], 'e-read-only');
        }
        var appointmentDetails = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_DETAILS"] });
        appointmentWrapper.appendChild(appointmentDetails);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var resourceIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : resource;
            appointmentWrapper.setAttribute('data-group-index', resourceIndex.toString());
        }
        var templateElement;
        var eventData = data;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeViewOptions.eventTemplate)) {
            var elementId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.eventTemplateName;
            var templateId = elementId + viewName + 'eventTemplate';
            var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_2__["addLocalOffsetToEvent"](record, this.parent.eventFields);
            templateElement = this.parent.getAppointmentTemplate()(templateArgs, this.parent, 'eventTemplate', templateId, false);
        }
        else {
            var appointmentSubject = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"], innerHTML: recordSubject });
            if (isAllDay) {
                if (record[fieldMapping.isAllDay]) {
                    templateElement = [appointmentSubject];
                }
                else {
                    templateElement = [];
                    var appointmentStartTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                        className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"] : ''),
                        innerHTML: this.parent.getTimeString(record[fieldMapping.startTime])
                    });
                    var appointmentEndTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                        className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"] : ''),
                        innerHTML: this.parent.getTimeString(record[fieldMapping.endTime]),
                    });
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentSubject], 'e-text-center');
                    if (!eventData.isLeft) {
                        templateElement.push(appointmentStartTime);
                    }
                    templateElement.push(appointmentSubject);
                    if (!eventData.isRight) {
                        templateElement.push(appointmentEndTime);
                    }
                }
            }
            else {
                var timeStr = this.parent.getTimeString(record[fieldMapping.startTime]) + ' - ' +
                    this.parent.getTimeString(record[fieldMapping.endTime]);
                var appointmentTime = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"] : ''),
                    innerHTML: timeStr,
                });
                var appointmentLocation = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["LOCATION_CLASS"],
                    innerHTML: (record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || '')
                });
                templateElement = [appointmentSubject, appointmentTime, appointmentLocation];
            }
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(templateElement, appointmentDetails);
        if (!this.parent.isAdaptive &&
            (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(record[fieldMapping.recurrenceRule]) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(record[fieldMapping.recurrenceID]))) {
            var iconClass = (record[fieldMapping.id] === record[fieldMapping.recurrenceID]) ?
                _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_ICON_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RECURRENCE_EDIT_ICON_CLASS"];
            var recurrenceIcon = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ICON"] + ' ' + iconClass });
            isAllDay ? appointmentDetails.appendChild(recurrenceIcon) : appointmentWrapper.appendChild(recurrenceIcon);
        }
        this.renderSpannedIcon(isAllDay ? appointmentDetails : appointmentWrapper, eventData);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.cssClass)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentWrapper], this.cssClass);
        }
        this.applyResourceColor(appointmentWrapper, record, 'backgroundColor', this.groupOrder);
        this.renderResizeHandler(appointmentWrapper, eventData, record[this.fields.isReadonly]);
        return appointmentWrapper;
    };
    VerticalEvent.prototype.createMoreIndicator = function (allDayRow, count, currentDay) {
        var index = currentDay + count;
        var countWrapper = allDayRow[index];
        if (countWrapper.childElementCount <= 0) {
            var innerCountWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ROW_COUNT_WRAPPER_CLASS"],
                id: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ROW_COUNT_WRAPPER_CLASS"] + '-' + index.toString()
            });
            var moreIndicatorElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MORE_INDICATOR_CLASS"],
                attrs: { 'tabindex': '0', 'role': 'list', 'data-index': index.toString(), 'data-count': '1' },
                innerHTML: '+1&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more'))
            });
            innerCountWrap.appendChild(moreIndicatorElement);
            countWrapper.appendChild(innerCountWrap);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(moreIndicatorElement, 'click', this.rowExpandCollapse, this);
        }
        else {
            var countCell = countWrapper.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MORE_INDICATOR_CLASS"]);
            var moreCount = parseInt(countCell.getAttribute('data-count'), 10) + 1;
            countCell.setAttribute('data-count', moreCount.toString());
            countCell.innerHTML = '+' + moreCount + '&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more'));
        }
    };
    VerticalEvent.prototype.renderSpannedIcon = function (element, spanEvent) {
        var iconElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_INDICATOR_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ICON"] });
        if (spanEvent.isLeft) {
            var iconLeft = iconElement.cloneNode();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([iconLeft], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_ICON_LEFT_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([iconLeft], element);
        }
        if (spanEvent.isRight) {
            var iconRight = iconElement.cloneNode();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([iconRight], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_ICON_RIGHT_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([iconRight], element);
        }
        if (spanEvent.isTop) {
            var iconTop = iconElement.cloneNode();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([iconTop], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_ICON_UP_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([iconTop], element);
        }
        if (spanEvent.isBottom) {
            var iconBottom = iconElement.cloneNode();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([iconBottom], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_ICON_DOWN_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([iconBottom], element);
        }
    };
    VerticalEvent.prototype.isSpannedEvent = function (record, day, resource) {
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.dateRender[resource][day]);
        var renderedDate = this.getRenderedDates(this.dateRender[resource]) || [currentDate];
        var currentDay = renderedDate.filter(function (date) { return date.getDay() === day; });
        if (currentDay.length === 0) {
            currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](renderedDate[0]);
        }
        var fieldMapping = this.parent.eventFields;
        var startEndHours = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](currentDate, this.startHour, this.endHour);
        var event = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, record, null, true);
        event.isSpanned = { isBottom: false, isTop: false };
        if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) {
            event[fieldMapping.startTime] = startEndHours.startHour;
            event.isSpanned.isTop = true;
        }
        if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) {
            event[fieldMapping.endTime] = startEndHours.endHour;
            event.isSpanned.isBottom = true;
        }
        return event;
    };
    VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline) {
        var _this = this;
        var currentDates = this.getRenderedDates(this.dateRender[resource]) || this.dateRender[resource];
        if (this.parent.activeViewOptions.group.byDate) {
            this.slots[0] = [this.dateRender[resource][dayIndex].getTime()];
            currentDates = [this.dateRender[resource][dayIndex]];
        }
        var record = this.splitEvent(eventObj, currentDates)[0];
        var allDayRowCell = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_CELLS_CLASS"] + ':first-child');
        var cellTop = allDayRowCell.offsetTop;
        var eStart = new Date(record[this.parent.eventFields.startTime].getTime());
        var eEnd = new Date(record[this.parent.eventFields.endTime].getTime());
        var appWidth = 0;
        var appLeft = '0%';
        var topValue = 1;
        var appLevel = 0;
        var isDateRange = currentDates[0].getTime() <= eStart.getTime() &&
            _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](currentDates.slice(-1)[0], 1).getTime() >= eStart.getTime();
        if (eStart <= eEnd && isDateRange) {
            var isAlreadyRendered = [];
            if (this.renderedAllDayEvents[resource]) {
                isAlreadyRendered = this.renderedAllDayEvents[resource].filter(function (event) {
                    return event.Guid === eventObj.Guid;
                });
                if (this.parent.activeViewOptions.group.byDate) {
                    isAlreadyRendered = isAlreadyRendered.filter(function (event) {
                        return event[_this.parent.eventFields.startTime] >= currentDates[dayIndex] &&
                            event[_this.parent.eventFields.endTime] <= _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(+currentDates[dayIndex]), 1);
                    });
                }
            }
            if (isAlreadyRendered.length === 0) {
                var allDayDifference_1 = record.data.count;
                var allDayIndex_1 = this.getOverlapIndex(record, dayIndex, true, resource);
                record.Index = allDayIndex_1;
                this.allDayLevel = (this.allDayLevel < allDayIndex_1) ? allDayIndex_1 : this.allDayLevel;
                var widthAdjustment = record.data.isRight ? 0 :
                    this.parent.currentView === 'Day' ? 4 : 7;
                if (allDayDifference_1 >= 0) {
                    appWidth = (allDayDifference_1 * 100) - widthAdjustment;
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.renderedAllDayEvents[resource])) {
                    this.renderedAllDayEvents[resource] = [];
                }
                this.renderedAllDayEvents[resource].push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, record, null, true));
                var allDayRow_1 = [].slice.call(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_ROW_CLASS"]).children);
                var wIndex_1 = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
                var eventWrapper_1 = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"] +
                    ':nth-child(' + (wIndex_1 + 1) + ')');
                var appointmentElement_1;
                if (inline) {
                    appointmentElement_1 = this.parent.inlineModule.createInlineAppointmentElement(eventObj);
                }
                else {
                    appointmentElement_1 = this.createAppointmentElement(eventObj, true, record.data, resource);
                }
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([appointmentElement_1], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_CLASS"]);
                var args = { data: eventObj, element: appointmentElement_1, cancel: false };
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["eventRendered"], args, function (eventArgs) {
                    if (!eventArgs.cancel) {
                        eventWrapper_1.appendChild(appointmentElement_1);
                        var appHeight = appointmentElement_1.offsetHeight;
                        topValue += (allDayIndex_1 === 0 ? cellTop : (cellTop + (allDayIndex_1 * appHeight))) + 1;
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement_1, { 'width': appWidth + '%', 'top': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(topValue) });
                        if (allDayIndex_1 > 1) {
                            _this.moreEvents.push(appointmentElement_1);
                            for (var count = 0, length_3 = allDayDifference_1; count < length_3; count++) {
                                _this.createMoreIndicator(allDayRow_1, count, wIndex_1);
                            }
                        }
                        allDayRowCell.setAttribute('data-count', _this.allDayLevel.toString());
                        var allDayRowHeight = ((!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) ?
                            (3 * appHeight) : ((_this.allDayLevel + 1) * appHeight)) + 4;
                        _this.setAllDayRowHeight(allDayRowHeight);
                        _this.addOrRemoveClass();
                        _this.wireAppointmentEvents(appointmentElement_1, eventObj);
                    }
                });
            }
        }
    };
    VerticalEvent.prototype.renderNormalEvents = function (eventObj, dayIndex, resource, dayCount, inline) {
        var record = this.isSpannedEvent(eventObj, dayIndex, resource);
        var eStart = record[this.fields.startTime];
        var eEnd = record[this.fields.endTime];
        var appWidth = '0%';
        var appLeft = '0%';
        var topValue = 0;
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(this.dateRender[resource][dayIndex].getTime()));
        var schedule = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](currentDate, this.startHour, this.endHour);
        var isValidEvent = this.isValidEvent(eventObj, eStart, eEnd, schedule);
        if (eStart <= eEnd && isValidEvent) {
            var appHeight = this.getHeight(eStart, eEnd);
            if (eStart.getTime() > schedule.startHour.getTime()) {
                topValue = this.getTopValue(eStart, dayIndex, resource);
            }
            var appIndex = this.getOverlapIndex(record, dayIndex, false, resource);
            record.Index = appIndex;
            this.overlapList.push(record);
            if (this.overlapList.length > 1) {
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.overlapEvents[appIndex])) {
                    this.overlapEvents[appIndex] = [];
                }
                this.overlapEvents[appIndex].push(record);
            }
            else {
                this.overlapEvents = [];
                this.overlapEvents.push([record]);
            }
            appWidth = this.getEventWidth();
            var argsData = {
                index: appIndex, left: appLeft, width: appWidth,
                day: dayIndex, dayIndex: dayCount, record: record, resource: resource
            };
            var tempData = this.adjustOverlapElements(argsData);
            appWidth = (tempData.appWidth);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.renderedEvents[resource])) {
                this.renderedEvents[resource] = [];
            }
            this.renderedEvents[resource].push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, record, null, true));
            var appointmentElement_2;
            if (inline) {
                appointmentElement_2 = this.parent.inlineModule.createInlineAppointmentElement(eventObj);
            }
            else {
                appointmentElement_2 = this.createAppointmentElement(eventObj, false, record.isSpanned, resource);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(appointmentElement_2, {
                'width': (this.parent.eventSettings.enableMaxHeight ? '100%' : tempData.appWidth),
                'height': appHeight + 'px', 'top': topValue + 'px'
            });
            var iconHeight = appointmentElement_2.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_INDICATOR_CLASS"]).length * 15;
            var maxHeight = appHeight - 40 - iconHeight;
            var subjectElement = appointmentElement_2.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"]);
            if (!this.parent.isAdaptive && subjectElement) {
                subjectElement.style.maxHeight = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(maxHeight);
            }
            var index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
            this.appendEvent(eventObj, appointmentElement_2, index, tempData.appLeft);
            this.wireAppointmentEvents(appointmentElement_2, eventObj);
            if (appointmentElement_2.offsetHeight < this.cellHeight) {
                var resizeHandlers = [].slice.call(appointmentElement_2.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_RESIZE_CLASS"]));
                resizeHandlers.forEach(function (resizeHandler) {
                    resizeHandler.style.height = Math.ceil(appointmentElement_2.offsetHeight / resizeHandler.offsetHeight) + 'px';
                });
            }
        }
    };
    VerticalEvent.prototype.getEventWidth = function () {
        var width = this.parent.currentView === 'Day' ? 97 : 94;
        var tempWidth = ((width - this.overlapEvents.length) / this.overlapEvents.length);
        return (tempWidth < 0 ? 0 : tempWidth) + '%';
    };
    VerticalEvent.prototype.getEventLeft = function (appWidth, index) {
        var tempLeft = (parseFloat(appWidth) + 1) * index;
        return (tempLeft > 99 ? 99 : tempLeft) + '%';
    };
    VerticalEvent.prototype.getTopValue = function (date, day, resource) {
        var startEndHours = _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.dateRender[resource][day]), this.startHour, this.endHour);
        var startHour = startEndHours.startHour;
        var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
        return (this.parent.activeViewOptions.timeScale.enable) ? ((diffInMinutes * this.cellHeight * this.slotCount) / this.interval) : 0;
    };
    VerticalEvent.prototype.getOverlapIndex = function (record, day, isAllDay, resource) {
        var _this = this;
        var fieldMapping = this.parent.eventFields;
        var eventsList = [];
        var appIndex = -1;
        this.overlapEvents = [];
        if (isAllDay) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.renderedAllDayEvents[resource])) {
                var date_1 = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(this.dateRender[resource][day].getTime()));
                eventsList = this.renderedAllDayEvents[resource].filter(function (app) {
                    return _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](app[fieldMapping.startTime]).getTime() <= date_1.getTime() &&
                        _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](app[fieldMapping.endTime]).getTime() >= date_1.getTime();
                });
                if (this.parent.activeViewOptions.group.resources.length > 0) {
                    eventsList = this.filterEventsByResource(this.resources[resource], eventsList);
                }
            }
        }
        else {
            var appointmentList_1 = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.renderedEvents[resource]) ? this.renderedEvents[resource] : [];
            var appointment_1 = [];
            var recordStart_1 = record[fieldMapping.startTime];
            var recordEnd_1 = record[fieldMapping.endTime];
            this.overlapList = appointmentList_1.filter(function (data) {
                return (data[fieldMapping.endTime] > recordStart_1 && data[fieldMapping.startTime] <= recordEnd_1) ||
                    (data[fieldMapping.startTime] >= recordEnd_1 && data[fieldMapping.endTime] <= recordStart_1);
            });
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                this.overlapList = this.filterEventsByResource(this.resources[resource], this.overlapList);
            }
            this.overlapList.forEach(function (obj) {
                var filterList = appointmentList_1.filter(function (data) {
                    return data[fieldMapping.endTime] >= obj[fieldMapping.startTime] && data[fieldMapping.startTime] <= obj[fieldMapping.endTime];
                });
                if (_this.parent.activeViewOptions.group.resources.length > 0) {
                    filterList = _this.filterEventsByResource(_this.resources[resource], filterList);
                }
                var collection = _this.overlapList.filter(function (val) { return filterList.indexOf(val) === -1; });
                return appointment_1.concat(collection);
            });
            this.overlapList = this.overlapList.concat(appointment_1);
            eventsList = this.overlapList;
            for (var _i = 0, eventsList_1 = eventsList; _i < eventsList_1.length; _i++) {
                var event_4 = eventsList_1[_i];
                var record_1 = event_4;
                var index = record_1.Index;
                (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.overlapEvents[index])) ? this.overlapEvents[index] = [event_4] :
                    this.overlapEvents[index].push(event_4);
            }
        }
        if (eventsList.length > 0) {
            var appLevel = eventsList.map(function (obj) { return obj.Index; });
            appIndex = (appLevel.length > 0) ? this.getSmallestMissingNumber(appLevel) : 0;
        }
        return (appIndex === -1) ? 0 : appIndex;
    };
    VerticalEvent.prototype.adjustOverlapElements = function (args) {
        var data = { appWidth: args.width, appLeft: args.left };
        for (var i = 0, length1 = this.overlapEvents.length; i < length1; i++) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.overlapEvents[i])) {
                for (var j = 0, length2 = this.overlapEvents[i].length; j < length2; j++) {
                    var dayCount = this.parent.activeViewOptions.group.byDate ? (this.resources.length * args.day) + args.resource :
                        args.dayIndex;
                    var element = this.element.querySelector('#e-appointment-wrapper-' + dayCount);
                    if (element.childElementCount > 0) {
                        var eleGuid = this.overlapEvents[i][j].Guid;
                        if (element.querySelectorAll('div[data-guid="' + eleGuid + '"]').length > 0 && eleGuid !== args.record.Guid) {
                            var apps = element.querySelector('div[data-guid="' + eleGuid + '"]');
                            if (parseFloat(args.width) <= parseFloat(apps.style.width)) {
                                (this.parent.enableRtl) ? apps.style.right = this.getEventLeft(args.width, i) :
                                    apps.style.left = this.getEventLeft(args.width, i);
                                apps.style.width = ((parseFloat(args.width))) + '%';
                                data.appWidth = apps.style.width;
                            }
                            else {
                                data.appWidth = apps.style.width;
                            }
                        }
                        else {
                            var appWidth = args.width;
                            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.overlapEvents[i - 1])) {
                                appWidth = this.getEventWidth();
                            }
                            data.appWidth = appWidth;
                            data.appLeft = this.getEventLeft(appWidth, args.index);
                        }
                    }
                }
            }
        }
        return data;
    };
    VerticalEvent.prototype.setAllDayRowHeight = function (height) {
        for (var _i = 0, _a = this.allDayElement; _i < _a.length; _i++) {
            var element = _a[_i];
            element.style.height = (height / 12) + 'em';
        }
        this.animation.animate(this.allDayElement[0]);
    };
    VerticalEvent.prototype.addOrRemoveClass = function () {
        var _this = this;
        this.moreEvents.filter(function (element) {
            if (!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_COUNT_CLASS"]);
                element.setAttribute('tabindex', '-1');
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_COUNT_CLASS"]);
                element.setAttribute('tabindex', '0');
            }
        });
        var moreEventCount = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_SECTION_CLASS"]);
        if (this.parent.uiStateValues.expand) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_ROW_EXPAND_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_ROW_COLLAPSE_CLASS"]);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_ROW_COLLAPSE_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_ROW_EXPAND_CLASS"]);
        }
        (this.allDayLevel > 2) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([moreEventCount], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]);
        var countCell = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ROW_COUNT_WRAPPER_CLASS"]));
        countCell.filter(function (element) {
            (!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]) :
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"]);
        });
    };
    VerticalEvent.prototype.getEventHeight = function () {
        var eventElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"], styles: 'visibility:hidden' });
        var eventWrapper = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"] + ':first-child');
        eventWrapper.appendChild(eventElement);
        var height = eventElement.offsetHeight;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(eventElement);
        return height;
    };
    VerticalEvent.prototype.rowExpandCollapse = function () {
        var target = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["ALLDAY_APPOINTMENT_SECTION_CLASS"]);
        this.parent.uiStateValues.expand = target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_ROW_EXPAND_CLASS"]);
        var rowHeight;
        if (this.parent.uiStateValues.expand) {
            target.setAttribute('title', this.parent.localeObj.getConstant('collapseAllDaySection'));
            target.setAttribute('aria-label', 'Collapse section');
            rowHeight = ((this.allDayLevel + 1) * this.getEventHeight()) + 4;
        }
        else {
            target.setAttribute('title', this.parent.localeObj.getConstant('expandAllDaySection'));
            target.setAttribute('aria-label', 'Expand section');
            rowHeight = (3 * this.getEventHeight()) + 4;
        }
        this.setAllDayRowHeight(rowHeight);
        this.addOrRemoveClass();
        this.animation.animate(target);
    };
    VerticalEvent.prototype.animationUiUpdate = function () {
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_3__["contentReady"], {});
    };
    return VerticalEvent;
}(_event_base__WEBPACK_IMPORTED_MODULE_1__["EventBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/year.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/year.js ***!
  \************************************************************************************/
/*! exports provided: YearEvent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "YearEvent", function() { return YearEvent; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _timeline_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






var EVENT_GAP = 2;
/**
 * Year view events render
 */
var YearEvent = /** @__PURE__ @class */ (function (_super) {
    __extends(YearEvent, _super);
    /**
     * Constructor for year events
     */
    function YearEvent(parent) {
        var _this = _super.call(this, parent, 'day') || this;
        _this.isResource = false;
        return _this;
    }
    YearEvent.prototype.renderAppointments = function () {
        this.fields = this.parent.eventFields;
        var elementSelector = (this.parent.currentView === 'Year') ? '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"] :
            '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MORE_INDICATOR_CLASS"];
        var eventWrappers = [].slice.call(this.parent.element.querySelectorAll(elementSelector));
        for (var _i = 0, eventWrappers_1 = eventWrappers; _i < eventWrappers_1.length; _i++) {
            var wrapper = eventWrappers_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(wrapper);
        }
        this.renderedEvents = [];
        if (this.parent.currentView === 'Year') {
            this.yearViewEvents();
        }
        else {
            this.removeCellHeight();
            if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                this.isResource = true;
                this.timelineResourceEvents();
            }
            else {
                this.timelineYearViewEvents();
            }
        }
        this.parent.renderTemplates();
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_3__["contentReady"], {});
    };
    YearEvent.prototype.yearViewEvents = function () {
        for (var month = 0; month < 12; month++) {
            var queryString = ".e-month-calendar:nth-child(" + (month + 1) + ") td.e-work-cells";
            var workCells = [].slice.call(this.parent.element.querySelectorAll(queryString));
            var monthDate = new Date(this.parent.selectedDate.getFullYear(), month, this.parent.selectedDate.getDate());
            var monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
            var monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
            var startDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"](monthStart, this.parent.firstDayOfWeek);
            var endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekLastDate"](monthEnd, this.parent.firstDayOfWeek), 1);
            for (var index = 0; startDate.getTime() < endDate.getTime(); index++) {
                var start = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(startDate.getTime()));
                var end = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(start.getTime()), 1);
                var filterEvents = this.parent.eventBase.filterEvents(start, end);
                if (filterEvents.length > 0) {
                    var workCell = workCells[index];
                    if (workCell) {
                        workCell.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"] }));
                    }
                }
                startDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(startDate.getTime()), 1);
            }
        }
    };
    YearEvent.prototype.timelineYearViewEvents = function () {
        var workCell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["WORK_CELLS_CLASS"]);
        this.cellWidth = workCell.offsetWidth;
        this.cellHeader = _base_util__WEBPACK_IMPORTED_MODULE_2__["getOuterHeight"](workCell.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DATE_HEADER_CLASS"]));
        var eventTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_TABLE_CLASS"]);
        this.eventHeight = _base_util__WEBPACK_IMPORTED_MODULE_2__["getElementHeightFromClass"](eventTable, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
        var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CONTAINER_CLASS"]));
        for (var row = 0; row < 12; row++) {
            var wrapper = wrapperCollection[row];
            var td = row + 1;
            var eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"] });
            wrapper.appendChild(eventWrapper);
            var monthStart = new Date(this.parent.selectedDate.getFullYear(), row, 1);
            var monthEnd = new Date(monthStart.getFullYear(), monthStart.getMonth() + 1, 0);
            var dayIndex = monthStart.getDay();
            var isSpannedCollection = [];
            if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                this.renderedEvents = [];
            }
            while (monthStart.getTime() <= monthEnd.getTime()) {
                var leftValue = void 0;
                var rightValue = void 0;
                if (this.parent.activeViewOptions.orientation === 'Vertical') {
                    var wrapper_1 = wrapperCollection[dayIndex];
                    td = dayIndex + 1;
                    var eventWrapper_1 = wrapper_1.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"]);
                    if (!eventWrapper_1) {
                        eventWrapper_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"] });
                        wrapper_1.appendChild(eventWrapper_1);
                    }
                    this.parent.enableRtl ? (rightValue = row * this.cellWidth) : (leftValue = row * this.cellWidth);
                }
                else {
                    this.parent.enableRtl ? (rightValue = ((dayIndex + monthStart.getDate()) - 1) * this.cellWidth) :
                        (leftValue = ((dayIndex + monthStart.getDate()) - 1) * this.cellWidth);
                }
                var rowTd = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + td + ") td");
                this.cellHeight = rowTd.offsetHeight;
                var dayStart = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(monthStart.getTime()));
                var dayEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(dayStart.getTime()), 1);
                var resource = void 0;
                if (this.parent.uiStateValues.isGroupAdaptive) {
                    resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
                }
                var dayEvents = this.parent.eventBase.filterEvents(dayStart, dayEnd, undefined, resource);
                var _loop_1 = function (index, count) {
                    var eventData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, dayEvents[index], null, true);
                    this_1.updateSpannedEvents(eventData, dayStart, dayEnd);
                    var overlapIndex = this_1.getIndex(dayStart);
                    eventData.Index = overlapIndex;
                    var availedHeight = this_1.cellHeader + (this_1.eventHeight * (index + 1)) + EVENT_GAP + this_1.moreIndicatorHeight;
                    if (this_1.parent.activeViewOptions.orientation === 'Horizontal') {
                        var isRendered = this_1.renderedEvents.filter(function (eventObj) {
                            return eventObj.Guid === eventData.Guid;
                        });
                        var isSpanned = isSpannedCollection.filter(function (eventObj) {
                            return eventObj.Guid === eventData.Guid;
                        });
                        if (isRendered.length > 0 || isSpanned.length > 0) {
                            return "continue";
                        }
                    }
                    var isRowAutoHeight = this_1.parent.rowAutoHeight && this_1.parent.activeViewOptions.orientation === 'Horizontal';
                    if (isRowAutoHeight || this_1.cellHeight > availedHeight) {
                        this_1.renderEvent(eventWrapper, eventData, row, leftValue, rightValue, dayIndex);
                        this_1.updateCellHeight(rowTd, availedHeight);
                        isSpannedCollection.push(eventData);
                    }
                    else {
                        var moreIndex = this_1.parent.activeViewOptions.orientation === 'Horizontal' ? row : dayIndex;
                        this_1.renderMoreIndicatior(eventWrapper, count - index, dayStart, moreIndex, leftValue, rightValue);
                        if (this_1.parent.activeViewOptions.orientation === 'Horizontal') {
                            for (var a = index; a < dayEvents.length; a++) {
                                var moreData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, dayEvents[a], { Index: overlapIndex + a }, true);
                                this_1.renderedEvents.push(moreData);
                                isSpannedCollection.push(eventData);
                            }
                        }
                        return "break";
                    }
                };
                var this_1 = this;
                for (var index = 0, count = dayEvents.length; index < count; index++) {
                    var state_1 = _loop_1(index, count);
                    if (state_1 === "break")
                        break;
                }
                monthStart = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(monthStart.getTime()), 1);
                if (this.parent.activeViewOptions.orientation === 'Vertical') {
                    dayIndex++;
                    this.renderedEvents = [];
                }
            }
        }
    };
    YearEvent.prototype.updateSpannedEvents = function (eventObj, dayStart, dayEnd) {
        var isLeftRightResize = (this.isResource && this.parent.activeViewOptions.orientation === 'Vertical') ||
            (!this.isResource && this.parent.activeViewOptions.orientation === 'Horizontal');
        var data = { isLeft: true, isRight: true, isBottom: true, isTop: true };
        if (dayStart.getTime() <= eventObj[this.fields.startTime].getTime()) {
            if (isLeftRightResize) {
                data.isLeft = false;
            }
            else {
                data.isTop = false;
            }
        }
        if ((dayEnd.getTime() >= eventObj[this.fields.endTime].getTime()) || (isLeftRightResize && !this.isResource &&
            _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](dayEnd, -1).getMonth() === eventObj[this.fields.endTime].getMonth())) {
            if (isLeftRightResize) {
                data.isRight = false;
            }
            else {
                data.isBottom = false;
            }
        }
        eventObj.data = data;
    };
    YearEvent.prototype.timelineResourceEvents = function () {
        var workCell = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["WORK_CELLS_CLASS"]);
        this.cellWidth = workCell.offsetWidth;
        this.cellHeader = 0;
        var eventTable = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["EVENT_TABLE_CLASS"]);
        this.eventHeight = _base_util__WEBPACK_IMPORTED_MODULE_2__["getElementHeightFromClass"](eventTable, _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"]);
        var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CONTAINER_CLASS"]));
        var resources = this.parent.uiStateValues.isGroupAdaptive ?
            [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] : this.parent.resourceBase.lastResourceLevel;
        if (this.parent.activeViewOptions.orientation === 'Horizontal') {
            for (var month = 0; month < 12; month++) {
                for (var i = 0, len = resources.length; i < len; i++) {
                    this.renderedEvents = [];
                    this.renderResourceEvent(wrapperCollection[i], resources[i], month, i);
                }
            }
        }
        else {
            for (var i = 0, len = resources.length; i < len; i++) {
                this.renderedEvents = [];
                for (var month = 0; month < 12; month++) {
                    this.renderResourceEvent(wrapperCollection[i], resources[i], month, i);
                }
            }
        }
    };
    YearEvent.prototype.renderResourceEvent = function (wrapper, resource, month, index) {
        var eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_WRAPPER_CLASS"] });
        wrapper.appendChild(eventWrapper);
        var monthStart = _base_util__WEBPACK_IMPORTED_MODULE_2__["firstDateOfMonth"](new Date(this.parent.selectedDate.getFullYear(), month, 1));
        var monthEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_2__["lastDateOfMonth"](new Date(monthStart.getTime())), 1);
        var eventDatas = this.parent.eventBase.filterEvents(monthStart, monthEnd, undefined, resource);
        var rowIndex = this.parent.activeViewOptions.orientation === 'Vertical' ? index : month;
        var td = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + (rowIndex + 1) + ") td");
        this.cellHeight = td.offsetHeight;
        for (var a = 0; a < eventDatas.length; a++) {
            var data = eventDatas[a];
            var overlapIndex = void 0;
            var eventData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, data, null, true);
            if (this.parent.activeViewOptions.group.resources.length > 0) {
                var eventObj = this.isSpannedEvent(eventData, month);
                overlapIndex = this.getIndex(eventObj[this.fields.startTime]);
                eventData.Index = overlapIndex;
            }
            else {
                overlapIndex = this.getIndex(eventData[this.fields.startTime]);
                eventData.Index = overlapIndex;
            }
            var availedHeight = this.cellHeader + (this.eventHeight * (a + 1)) + EVENT_GAP + this.moreIndicatorHeight;
            var leftValue = (this.parent.activeViewOptions.orientation === 'Vertical') ?
                month * this.cellWidth : index * this.cellWidth;
            if (this.parent.rowAutoHeight || this.cellHeight > availedHeight) {
                this.renderEvent(eventWrapper, eventData, month, leftValue, leftValue, index);
                this.updateCellHeight(td, availedHeight);
            }
            else {
                var moreIndex = this.parent.activeViewOptions.orientation === 'Horizontal' ? month : index;
                this.renderMoreIndicatior(eventWrapper, eventDatas.length - a, monthStart, moreIndex, leftValue, leftValue, index);
                if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                    for (var i = index; i < eventDatas.length; i++) {
                        var moreData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventDatas[i], { Index: overlapIndex + i }, true);
                        this.renderedEvents.push(moreData);
                    }
                }
                break;
            }
        }
    };
    YearEvent.prototype.renderEvent = function (wrapper, eventData, row, left, right, rowIndex) {
        var _this = this;
        var eventObj = this.isSpannedEvent(eventData, row);
        var wrap = this.createEventElement(eventObj);
        var width;
        var index;
        if (eventObj.isSpanned.count === 1) {
            var endTime = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](eventObj[this.fields.endTime], -1);
            eventObj[this.fields.endTime] = (endTime > eventObj[this.fields.startTime]) ? endTime : eventObj[this.fields.endTime];
        }
        if (eventObj[this.fields.startTime] > eventObj[this.fields.endTime]) {
            return;
        }
        if (this.parent.activeViewOptions.orientation === 'Horizontal') {
            index = row + 1;
            if (eventObj[this.fields.startTime].getTime() === eventObj[this.fields.endTime].getTime()) {
                eventObj.isSpanned.count = 1;
            }
            width = eventObj.isSpanned.count * this.cellWidth;
        }
        else {
            index = rowIndex + 1;
            width = this.cellWidth;
        }
        var rowTd = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + index + ") td");
        var top = rowTd.offsetTop + this.cellHeader + (this.eventHeight * eventObj.Index) + EVENT_GAP;
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(wrap, {
            'width': width + 'px', 'height': this.eventHeight + 'px', 'left': left + 'px', 'right': right + 'px', 'top': top + 'px'
        });
        var args = { data: eventObj, element: wrap, cancel: false, type: 'event' };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["eventRendered"], args, function (eventArgs) {
            if (!eventArgs.cancel) {
                wrapper.appendChild(wrap);
                _this.wireAppointmentEvents(wrap, eventObj);
                if (_this.parent.activeViewOptions.group.resources.length > 0) {
                    _this.renderedEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true));
                }
                else if (!eventObj.isSpanned.isRight) {
                    _this.renderedEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true));
                }
                else if ((eventObj.isSpanned.isRight
                    || eventObj.isSpanned.isLeft)
                    && _this.parent.activeViewOptions.orientation === 'Horizontal') {
                    _this.renderedEvents.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true));
                }
            }
        });
    };
    YearEvent.prototype.renderMoreIndicatior = function (wrapper, count, startDate, row, left, right, index) {
        var endDate;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_2__["lastDateOfMonth"](new Date(startDate.getTime())), 1);
        }
        else {
            endDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(startDate.getTime()), 1);
        }
        var moreIndicator = this.getMoreIndicatorElement(count, startDate, endDate);
        var rowTr = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + (row + 1) + ")");
        var top = rowTr.offsetTop + (this.cellHeight - this.moreIndicatorHeight);
        left = (Math.floor(left / this.cellWidth) * this.cellWidth);
        right = (Math.floor(right / this.cellWidth) * this.cellWidth);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(moreIndicator, { 'width': this.cellWidth + 'px', 'left': left + 'px', 'right': right + 'px', 'top': top + 'px' });
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            moreIndicator.setAttribute('data-group-index', index.toString());
        }
        wrapper.appendChild(moreIndicator);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(moreIndicator, 'click', this.moreIndicatorClick, this);
    };
    YearEvent.prototype.createEventElement = function (record) {
        var eventSubject = (record[this.fields.subject] || this.parent.eventSettings.fields.subject.default);
        var eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_CLASS"],
            attrs: {
                'data-id': 'Appointment_' + record[this.fields.id],
                'data-guid': record.Guid,
                'role': 'button', 'tabindex': '0',
                'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record), 'aria-selected': 'false', 'aria-grabbed': 'true',
                'aria-label': this.parent.getAnnocementString(record)
            }
        });
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([eventWrapper], this.cssClass);
        }
        if (record[this.fields.isReadonly]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([eventWrapper], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["READ_ONLY"]);
        }
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var resIndex = this.getGroupIndexFromEvent(record);
            eventWrapper.setAttribute('data-group-index', resIndex.toString());
        }
        var templateElement = [];
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, record, null, true);
        if (this.parent.activeViewOptions.eventTemplate) {
            var templateId = this.parent.element.id + '_' + this.parent.activeViewOptions.eventTemplateName + 'eventTemplate';
            var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_2__["addLocalOffsetToEvent"](eventObj, this.parent.eventFields);
            templateElement = this.parent.getAppointmentTemplate()(templateArgs, this.parent, 'eventTemplate', templateId, false);
        }
        else {
            var locationEle = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
            var subjectEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["SUBJECT_CLASS"],
                innerHTML: (eventSubject + (locationEle ? ';&nbsp' + locationEle : ''))
            });
            var startTimeEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"] : ''),
                innerHTML: this.parent.getTimeString(eventObj[this.fields.startTime])
            });
            var endTimeEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_TIME"] + (this.parent.isAdaptive ? ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["DISABLE_CLASS"] : ''),
                innerHTML: this.parent.getTimeString(eventObj[this.fields.endTime])
            });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([subjectEle], 'e-text-center');
            if (record[this.fields.isAllDay]) {
                templateElement = [subjectEle];
            }
            else if (!eventObj.isLeft && !eventObj.isRight) {
                templateElement = [startTimeEle, subjectEle, endTimeEle];
            }
            else {
                if (!eventObj.isLeft) {
                    templateElement.push(startTimeEle);
                }
                templateElement.push(subjectEle);
                if (!eventObj.isRight) {
                    templateElement.push(endTimeEle);
                }
            }
        }
        var appointmentDetails = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["APPOINTMENT_DETAILS"] });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(templateElement, appointmentDetails);
        eventWrapper.appendChild(appointmentDetails);
        this.renderResizeHandler(eventWrapper, record.data, record[this.fields.isReadonly]);
        this.applyResourceColor(eventWrapper, eventObj, 'backgroundColor', this.groupOrder);
        return eventWrapper;
    };
    YearEvent.prototype.isSpannedEvent = function (eventObj, month) {
        var monthStart = new Date(this.parent.selectedDate.getFullYear(), month, 1);
        var monthEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](new Date(this.parent.selectedDate.getFullYear(), month + 1, 0), 1);
        var eventData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
        var eventStart = eventData[this.fields.startTime];
        var eventEnd = eventData[this.fields.endTime];
        var isSpanned = { isLeft: false, isRight: false, count: 1 };
        if (this.isResource) {
            this.updateSpannedEvents(eventObj, monthStart, monthEnd);
        }
        if (eventStart.getTime() < monthStart.getTime()) {
            eventData[this.fields.startTime] = monthStart;
            isSpanned.isLeft = true;
        }
        if (eventEnd.getTime() > monthEnd.getTime()) {
            eventData[this.fields.endTime] = monthEnd;
            isSpanned.isRight = true;
        }
        if (this.parent.activeViewOptions.group.resources.length === 0) {
            isSpanned.count = Math.ceil((eventData[this.fields.endTime].getTime() -
                eventData[this.fields.startTime].getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_2__["MS_PER_DAY"]);
        }
        eventData.isSpanned = isSpanned;
        if (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](eventStart).getTime() < _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.parent.minDate).getTime()) {
            eventData[this.fields.startTime] = this.parent.minDate;
        }
        if (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](eventEnd).getTime() > _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.parent.maxDate).getTime()) {
            eventData[this.fields.endTime] = this.parent.maxDate;
        }
        return eventData;
    };
    YearEvent.prototype.getOverlapEvents = function (date, appointments) {
        var appointmentsList = [];
        var dateStart;
        var dateEnd;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(date.getTime()));
            var monthEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.parent.calendarUtil.getMonthEndDate(new Date(date.getTime())), -1);
            dateStart = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(monthStart.getTime())).getTime();
            dateEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(monthEnd.getTime())).getTime();
        }
        else {
            if (this.parent.rowAutoHeight) {
                dateStart = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(date.getTime())).getTime();
                dateEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(date.getTime())), 1).getTime();
            }
            else {
                dateStart = dateEnd = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(date.getTime())).getTime();
            }
        }
        for (var _i = 0, _a = appointments; _i < _a.length; _i++) {
            var app = _a[_i];
            var appStart = new Date(app[this.fields.startTime].getTime());
            var appEnd = new Date(app[this.fields.endTime].getTime());
            if (this.parent.activeViewOptions.orientation === 'Vertical' &&
                this.parent.activeViewOptions.group.resources.length > 0) {
                if ((_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appStart).getTime() >= dateStart)
                    && (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appEnd).getTime() <= dateEnd)) {
                    appointmentsList.push(app);
                }
            }
            else {
                if (this.parent.rowAutoHeight && (((_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appStart).getTime() <= dateStart)
                    && (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appEnd).getTime() >= dateEnd)) || (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appStart).getTime() >= dateStart)
                    && (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appEnd).getTime() <= dateEnd))) {
                    appointmentsList.push(app);
                }
                if (!this.parent.rowAutoHeight && (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appStart).getTime() <= dateStart)
                    && (_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](appEnd).getTime() >= dateEnd)) {
                    appointmentsList.push(app);
                }
            }
        }
        return appointmentsList;
    };
    YearEvent.prototype.removeCellHeight = function () {
        var elementSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["MONTH_HEADER_WRAPPER"] + " tbody tr,." + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["RESOURCE_COLUMN_TABLE_CLASS"] + " tbody tr,." + _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["CONTENT_TABLE_CLASS"] + " tbody tr";
        var rows = [].slice.call(this.element.querySelectorAll(elementSelector));
        for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
            var row = rows_1[_i];
            row.firstElementChild.style.height = '';
        }
    };
    return YearEvent;
}(_timeline_view__WEBPACK_IMPORTED_MODULE_1__["TimelineEvent"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-export.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-export.js ***!
  \****************************************************************************************/
/*! exports provided: ICalendarExport */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICalendarExport", function() { return ICalendarExport; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../recurrence-editor/date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");


/**
 * ICalendar Export Module
 */
var ICalendarExport = /** @__PURE__ @class */ (function () {
    function ICalendarExport(parent) {
        this.parent = parent;
    }
    ICalendarExport.prototype.initializeCalendarExport = function (fileName, customData) {
        var _this = this;
        var eventsData = (customData) ? customData : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], this.parent.eventsData, null, true);
        eventsData = this.parent.eventBase.sortByTime(eventsData);
        var SEPARATOR = (navigator.appVersion.indexOf('Win') !== -1) ? '\r\n' : '\n';
        var iCalendarEvents = [];
        var filterCollection = [];
        var timeZone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
        var fields = this.parent.eventFields;
        eventsData.forEach(function (eventObj) {
            var uId = _this.parent.eventBase.generateGuid();
            var editedExDate = [];
            if (eventObj[fields.recurrenceID]) {
                var filter = _this.filterEvents(filterCollection, fields.id, eventObj[fields.recurrenceID]);
                uId = filter[0].UID;
            }
            if (!eventObj[fields.recurrenceID] && eventObj[fields.recurrenceRule] && eventObj[fields.recurrenceException]) {
                var exceptionDateList = void 0;
                var exDate = (eventObj[fields.recurrenceException]).split(',');
                var editedObj = _this.filterEvents(eventsData, fields.recurrenceID, eventObj[fields.id]);
                editedObj.forEach(function (edited) {
                    editedExDate.push(Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(edited[fields.startTime]));
                });
                exceptionDateList = exDate.filter(function (value) { return (editedExDate.indexOf(value) === -1); });
                eventObj[fields.recurrenceException] = (exceptionDateList.length > 0) ? (exceptionDateList.join(',') + ',') : '';
            }
            var startZone = (eventObj[fields.startTimezone] || timeZone);
            var endZone = (eventObj[fields.endTimezone] || timeZone);
            var calendarEvent = [
                'BEGIN:VEVENT',
                'LOCATION:' + (eventObj[fields.location] || ''),
                'SUMMARY:' + (eventObj[fields.subject] || ''),
                'UID:' + uId,
                'DESCRIPTION:' + (eventObj[fields.description] || ''),
                'END:VEVENT'
            ];
            if (eventObj[fields.isAllDay]) {
                calendarEvent.splice(4, 0, 'DTEND;VALUE=DATE:' + _this.convertDateToString(eventObj[fields.endTime], true));
                calendarEvent.splice(4, 0, 'DTSTART;VALUE=DATE:' + _this.convertDateToString(eventObj[fields.startTime], true));
            }
            else if (!eventObj[fields.isAllDay] && !eventObj[fields.recurrenceRule]) {
                calendarEvent.splice(4, 0, 'DTEND:' + _this.convertDateToString(eventObj[fields.endTime]));
                calendarEvent.splice(4, 0, 'DTSTART:' + _this.convertDateToString(eventObj[fields.startTime]));
            }
            else {
                calendarEvent.splice(4, 0, 'DTEND;TZID="' + endZone + '":' + _this.convertDateToString(eventObj[fields.endTime]));
                calendarEvent.splice(4, 0, 'DTSTART;TZID="' + startZone + '":'
                    + _this.convertDateToString(eventObj[fields.startTime]));
            }
            if (eventObj[fields.recurrenceRule]) {
                calendarEvent.splice(4, 0, 'RRULE:' + eventObj[fields.recurrenceRule]);
            }
            if (eventObj[fields.recurrenceException]) {
                var exDate = eventObj[fields.recurrenceException].split(',');
                for (var i = 0; i < exDate.length - 1; i++) {
                    calendarEvent.splice(5, 0, 'EXDATE:' +
                        _this.convertDateToString(Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getDateFromRecurrenceDateString"])(exDate[i]), eventObj[fields.isAllDay]));
                }
            }
            if (eventObj[fields.recurrenceID]) {
                calendarEvent.splice(4, 0, 'RECURRENCE-ID;TZID="' + startZone + '":'
                    + _this.convertDateToString(eventObj[fields.startTime], eventObj[fields.isAllDay]));
            }
            var customFields = _this.customFieldFilter(eventObj, fields);
            if (customFields.length > 0) {
                customFields.forEach(function (customField) {
                    return calendarEvent.splice(4, 0, customField + ':' + (eventObj[customField] || ''));
                });
            }
            var app = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj);
            app.UID = uId;
            filterCollection.push(app);
            iCalendarEvents.push(calendarEvent.join(SEPARATOR));
        });
        var iCalendar = [
            'BEGIN:VCALENDAR',
            'PRODID:-//Syncfusion Inc//Scheduler//EN',
            'VERSION:2.0',
            'CALSCALE:GREGORIAN',
            'METHOD:PUBLISH',
            'X-WR-CALNAME:' + (fileName || 'Calendar'),
            'X-WR-TIMEZONE:' + timeZone,
        ].join(SEPARATOR);
        var icsString = iCalendar + SEPARATOR + iCalendarEvents.join(SEPARATOR) + SEPARATOR + 'END:VCALENDAR';
        this.download(icsString, fileName);
    };
    ICalendarExport.prototype.customFieldFilter = function (eventObj, fields) {
        var defaultFields = Object.keys(fields).map(function (key) { return fields[key]; });
        var eventFields = Object.keys(eventObj);
        return eventFields.filter(function (value) { return (defaultFields.indexOf(value) === -1) && (value !== 'Guid'); });
    };
    ICalendarExport.prototype.convertDateToString = function (eventDate, allDay) {
        var year = ('0000' + (eventDate.getFullYear().toString())).slice(-4);
        var month = ('00' + ((eventDate.getMonth() + 1).toString())).slice(-2);
        var date = ('00' + ((eventDate.getDate()).toString())).slice(-2);
        var hours = ('00' + (eventDate.getHours().toString())).slice(-2);
        var minutes = ('00' + (eventDate.getMinutes().toString())).slice(-2);
        var seconds = ('00' + (eventDate.getSeconds().toString())).slice(-2);
        var timeString = (allDay) ? year + month + date : year + month + date + 'T' + hours + minutes + seconds;
        return timeString;
    };
    ICalendarExport.prototype.download = function (icsString, fileName) {
        var buffer = new Blob([icsString], { type: 'data:text/calendar;charset=utf8' });
        fileName = (fileName || 'Calendar') + '.ics';
        if (!(!navigator.msSaveBlob)) {
            navigator.msSaveBlob(buffer, fileName);
        }
        else {
            var downloadLink_1 = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
            downloadLink_1.download = fileName;
            downloadLink_1.href = URL.createObjectURL(buffer);
            var event_1 = document.createEvent('MouseEvent');
            event_1.initEvent('click', true, true);
            downloadLink_1.dispatchEvent(event_1);
            setTimeout(function () {
                URL.revokeObjectURL(downloadLink_1.href);
                downloadLink_1.href = undefined;
            });
        }
    };
    ICalendarExport.prototype.filterEvents = function (data, field, value) {
        return data.filter(function (e) { return e[field] === value; });
    };
    /**
     * Get module name.
     */
    ICalendarExport.prototype.getModuleName = function () {
        return 'iCalendarExport';
    };
    /**
     * To destroy the ICalendarExport.
     * @return {void}
     * @private
     */
    ICalendarExport.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent = null;
    };
    return ICalendarExport;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-import.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-import.js ***!
  \****************************************************************************************/
/*! exports provided: ICalendarImport */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICalendarImport", function() { return ICalendarImport; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../recurrence-editor/date-generator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/date-generator.js");


/**
 * ICalendar Import Module
 */
var ICalendarImport = /** @__PURE__ @class */ (function () {
    function ICalendarImport(parent) {
        this.allDay = false;
        this.parent = parent;
    }
    ICalendarImport.prototype.initializeCalendarImport = function (fileContent) {
        var _this = this;
        if (fileContent && fileContent instanceof Blob) {
            var fileReader_1 = new FileReader();
            fileReader_1.onload = function (event) {
                var iCalString = fileReader_1.result;
                _this.iCalendarParser(iCalString);
            };
            fileReader_1.readAsText(fileContent, 'UTF-8');
        }
        else if (fileContent && typeof fileContent === 'string') {
            this.iCalendarParser(fileContent);
        }
    };
    ICalendarImport.prototype.iCalendarParser = function (iCalString) {
        var _this = this;
        var fields = this.parent.eventFields;
        var events = [];
        var uId = 'UID';
        var calArray = iCalString.replace(new RegExp('\\r', 'g'), '').split('\n');
        var isEvent = false;
        var curEvent = null;
        var id = this.parent.eventBase.getEventMaxID();
        calArray.forEach(function (element) {
            var index;
            var type;
            var value;
            if (!isEvent && element === 'BEGIN:VEVENT') {
                isEvent = true;
                curEvent = {};
            }
            if (isEvent && element === 'END:VEVENT') {
                isEvent = false;
                events.push(curEvent);
                curEvent = null;
            }
            if (isEvent) {
                index = element.indexOf(':');
                type = element.substr(0, index).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
                value = element.substr(index + 1, element.length - (index + 1)).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
                if (element.indexOf('SUMMARY') !== -1) {
                    type = 'SUMMARY';
                }
                if (element.indexOf('DTSTART') !== -1) {
                    curEvent[fields.startTime] = _this.dateParsing(element);
                    curEvent[fields.isAllDay] = _this.allDay;
                    _this.allDay = false;
                }
                else if (element.indexOf('DTEND') !== -1) {
                    curEvent[fields.endTime] = _this.dateParsing(element);
                }
                else if (element.indexOf('EXDATE') !== -1) {
                    value = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(_this.dateParsing(element));
                    curEvent[fields.recurrenceException] = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(curEvent[fields.recurrenceException])) ?
                        value : curEvent[fields.recurrenceException] + ',' + value;
                }
                else if (element.indexOf('RECURRENCE-ID') !== -1) {
                    value = Object(_recurrence_editor_date_generator__WEBPACK_IMPORTED_MODULE_1__["getRecurrenceStringFromDate"])(_this.dateParsing(element));
                    curEvent[fields.recurrenceException] = value;
                    curEvent[fields.recurrenceID] = value;
                }
                else {
                    switch (type) {
                        case 'BEGIN':
                            break;
                        case 'UID':
                            curEvent[uId] = value;
                            curEvent[fields.id] = id++;
                            break;
                        case 'SUMMARY':
                            curEvent[fields.subject] = value;
                            break;
                        case 'LOCATION':
                            curEvent[fields.location] = value;
                            break;
                        case 'DESCRIPTION':
                            curEvent[fields.description] = value;
                            break;
                        case 'RRULE':
                            curEvent[fields.recurrenceRule] = value;
                            break;
                        default:
                            curEvent[type] = value;
                    }
                }
            }
        });
        var app = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], events, null, true);
        this.parent.addEvent(this.processOccurrence(app));
    };
    ICalendarImport.prototype.processOccurrence = function (app) {
        var appoint = [];
        var uId = 'UID';
        var fields = this.parent.eventFields;
        app.forEach(function (eventObj) {
            var parentObj;
            var id;
            if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
                parentObj = eventObj;
                id = eventObj[fields.id];
            }
            var data = app.filter(function (data) {
                return data.UID === eventObj[uId];
            });
            if (data.length > 1 && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[fields.recurrenceID])) {
                for (var i = 0; i < data.length; i++) {
                    if (data[i].hasOwnProperty(fields.recurrenceID)) {
                        var exdate = data[i][fields.recurrenceID];
                        data[i][fields.recurrenceID] = id;
                        data[i][fields.recurrenceException] = null;
                        parentObj[fields.recurrenceException] = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(parentObj[fields.recurrenceException])) ?
                            exdate : parentObj[fields.recurrenceException] + ',' + exdate;
                        appoint.push(data[i]);
                    }
                }
                appoint.push(parentObj);
            }
            else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
                appoint.push(eventObj);
            }
        });
        return appoint;
    };
    ICalendarImport.prototype.getDateString = function (value) {
        value = value || '';
        return (value
            .replace(/\\\,/g, ',')
            .replace(/\\\;/g, ';')
            .replace(/\\[nN]/g, '\n')
            .replace(/\\\\/g, '\\'));
    };
    ICalendarImport.prototype.dateParsing = function (element) {
        var expression = /([^':;]+)((?:;(?:[^':;]+)(?:=(?:(?:'[^']*')|(?:[^':;]+))))*):(.*)/;
        var split = (element.match(expression)).slice(1);
        var value = split[split.length - 1];
        var newDate = new Date(this.getDateString(value));
        if (element && element.indexOf('VALUE=DATE') > -1) {
            var data_1 = /^(\d{4})(\d{2})(\d{2})$/.exec(value);
            if (data_1 !== null) {
                newDate = new Date(parseInt(data_1[1], 10), parseInt(data_1[2], 10) - 1, parseInt(data_1[3], 10));
            }
            if (element.indexOf('DTSTART') > -1) {
                this.allDay = true;
            }
        }
        var data = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(Z)?$/.exec(value);
        if (data !== null) {
            if (data[7] === 'Z') {
                newDate = new Date(Date.UTC(parseInt(data[1], 10), parseInt(data[2], 10) - 1, parseInt(data[3], 10), parseInt(data[4], 10), parseInt(data[5], 10), parseInt(data[6], 10)));
            }
            else {
                newDate = new Date(parseInt(data[1], 10), parseInt(data[2], 10) - 1, parseInt(data[3], 10), parseInt(data[4], 10), parseInt(data[5], 10), parseInt(data[6], 10));
            }
        }
        return newDate;
    };
    /**
     * Get module name.
     */
    ICalendarImport.prototype.getModuleName = function () {
        return 'iCalendarImport';
    };
    /**
     * To destroy the ICalendarImport.
     * @return {void}
     * @private
     */
    ICalendarImport.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
    };
    return ICalendarImport;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/excel-export.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/excel-export.js ***!
  \*************************************************************************************/
/*! exports provided: ExcelExport */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExcelExport", function() { return ExcelExport; });
/* harmony import */ var _ej2_excel_export__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-excel-export */ "./ej2-resources/18.4.46/scripts/ej2-excel-export/index.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");


/**
 * Excel Export Module
 */
var ExcelExport = /** @__PURE__ @class */ (function () {
    function ExcelExport(parent) {
        this.parent = parent;
    }
    ExcelExport.prototype.initializeExcelExport = function (excelExportOptions) {
        var _this = this;
        var exportFields = excelExportOptions.fields || Object.keys(this.parent.eventFields).map(function (field) {
            return _this.parent.eventFields[field];
        });
        var exportName = excelExportOptions.fileName || 'Schedule';
        var exportType = excelExportOptions.exportType || 'xlsx';
        var isIncludeOccurrences = excelExportOptions.includeOccurrences || false;
        var eventCollection;
        if (excelExportOptions.customData) {
            eventCollection = !isIncludeOccurrences ? excelExportOptions.customData :
                this.parent.eventBase.getProcessedEvents(excelExportOptions.customData);
        }
        else {
            eventCollection = (!isIncludeOccurrences ? this.parent.eventsData : this.parent.eventsProcessed);
        }
        this.processWorkbook(exportFields, exportName, exportType, eventCollection);
    };
    ExcelExport.prototype.processWorkbook = function (fields, name, type, eventCollection) {
        var _this = this;
        var columns = [];
        var rows = [];
        var columnHeader = [];
        fields.forEach(function (field, i) { return columns.push({ index: i + 1, width: (field === 'Id' ? 20 : 150) }); });
        var style = { fontSize: 12, borders: { color: '#E0E0E0' }, bold: true };
        fields.forEach(function (field, i) { return columnHeader.push({ index: i + 1, value: field, style: style }); });
        rows.push({ index: 1, cells: columnHeader });
        var i = 2;
        var _loop_1 = function (event_1) {
            var columnData = [];
            fields.forEach(function (field, n) {
                var columnRule = { index: n + 1, value: event_1[field] || '' };
                if (field === _this.parent.eventFields.startTime || field === _this.parent.eventFields.endTime) {
                    var styleRule = { fontSize: 12, numberFormat: 'm/d/yyyy h:mm AM/PM' };
                    columnRule = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["extend"])({}, columnRule, { style: styleRule }, true);
                }
                columnData.push(columnRule);
            });
            rows.push({ index: i, cells: columnData });
            i++;
        };
        for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {
            var event_1 = eventCollection_1[_i];
            _loop_1(event_1);
        }
        var workSheet = [{ columns: columns, rows: rows }];
        var book = new _ej2_excel_export__WEBPACK_IMPORTED_MODULE_0__["Workbook"]({ worksheets: workSheet }, type, this.parent.locale);
        book.save(name + '.' + type);
    };
    ExcelExport.prototype.getModuleName = function () {
        return 'excelExport';
    };
    ExcelExport.prototype.destroy = function () {
        this.parent = null;
    };
    return ExcelExport;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/index.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/index.js ***!
  \******************************************************************************/
/*! exports provided: ICalendarExport, ICalendarImport, ExcelExport, Print */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _calendar_export__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calendar-export */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-export.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarExport", function() { return _calendar_export__WEBPACK_IMPORTED_MODULE_0__["ICalendarExport"]; });

/* harmony import */ var _calendar_import__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./calendar-import */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/calendar-import.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarImport", function() { return _calendar_import__WEBPACK_IMPORTED_MODULE_1__["ICalendarImport"]; });

/* harmony import */ var _excel_export__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./excel-export */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/excel-export.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExcelExport", function() { return _excel_export__WEBPACK_IMPORTED_MODULE_2__["ExcelExport"]; });

/* harmony import */ var _print__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./print */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/print.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Print", function() { return _print__WEBPACK_IMPORTED_MODULE_3__["Print"]; });

/**
 * Exporting modules
 */






/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/print.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/print.js ***!
  \******************************************************************************/
/*! exports provided: Print */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Print", function() { return Print; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");

/**
 * Print Module
 */
var Print = /** @__PURE__ @class */ (function () {
    function Print(parent) {
        this.parent = parent;
    }
    Print.prototype.printScheduler = function () {
        var clone = this.parent.element.cloneNode(true);
        clone.id = this.parent.element.id + '_print';
        document.body.appendChild(clone);
        var scrollableEle = this.getScrollableElement(this.parent.element);
        this.print(clone, scrollableEle.scrollTop, scrollableEle.scrollLeft);
    };
    Print.prototype.getScrollableElement = function (element) {
        if (this.parent.currentView === 'MonthAgenda') {
            return element.querySelector('.e-appointment-wrap');
        }
        return element.querySelector('.e-content-wrap');
    };
    Print.prototype.print = function (clone, top, left) {
        var _this = this;
        var links = [].slice.call(document.getElementsByTagName('head')[0].querySelectorAll('link, style'));
        var reference = '';
        for (var i = 0, len = links.length; i < len; i++) {
            reference += links[i].outerHTML;
        }
        var div = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
        clone.style.width = this.parent.element.offsetWidth + 'px';
        var elementWidth = Math.round((parseInt(clone.style.width, 10)) / 100) * 100;
        div.appendChild(clone);
        var printWindow = window.open('', 'print', 'height=550,width=' + elementWidth + ',tabbar=no');
        printWindow.document.write('<!DOCTYPE html> <html><head>' + reference + '</head><body>' + div.innerHTML +
            '<script> (function() { window.ready = true; })(); </script>' + '</body></html>');
        printWindow.document.close();
        printWindow.focus();
        setTimeout(function () {
            // tslint:disable-next-line:no-any
            if (printWindow.ready) {
                _this.scrolledScheduler(printWindow, top, left);
                printWindow.print();
                printWindow.close();
            }
        }, 500);
    };
    Print.prototype.scrolledScheduler = function (printWindow, top, left) {
        var scrollableEle = this.getScrollableElement(printWindow.document.body);
        scrollableEle.scrollLeft = left;
        scrollableEle.scrollTop = top;
        var headerTimeCellsScroll = printWindow.document.querySelector('.e-date-header-wrap');
        if (this.parent.activeView.isTimelineView()) {
            headerTimeCellsScroll.scrollLeft = left;
        }
        if (this.parent.currentView === 'Day' || this.parent.currentView === 'Week' || this.parent.currentView === 'WorkWeek') {
            var timeCellsScroll = printWindow.document.querySelector('.e-time-cells-wrap');
            timeCellsScroll.scrollTop = top;
            headerTimeCellsScroll.scrollLeft = left;
        }
        if (this.parent.currentView === 'Month') {
            headerTimeCellsScroll.scrollLeft = left;
        }
    };
    /**
     * For internal use only - Get the module name.
     * @private
     */
    Print.prototype.getModuleName = function () {
        return 'print';
    };
    Print.prototype.destroy = function () {
        this.parent = null;
    };
    return Print;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/index.js":
/*!**********************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/index.js ***!
  \**********************************************************************/
/*! exports provided: Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, addLocalOffset, addLocalOffsetToEvent, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewHelper, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _base_schedule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base/schedule */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/schedule.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Schedule", function() { return _base_schedule__WEBPACK_IMPORTED_MODULE_0__["Schedule"]; });

/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["cellClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellDoubleClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["cellDoubleClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "moreEventsClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["moreEventsClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "select", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["select"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hover", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["hover"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionBegin", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["actionBegin"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionComplete", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["actionComplete"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "actionFailure", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["actionFailure"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "navigating", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["navigating"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "renderCell", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["renderCell"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["eventClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventRendered", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["eventRendered"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataBinding", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["dataBinding"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataBound", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["dataBound"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "popupOpen", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["popupOpen"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "popupClose", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["popupClose"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragStart", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["dragStart"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["drag"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragStop", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["dragStop"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizeStart", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["resizeStart"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizing", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["resizing"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resizeStop", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["resizeStop"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inlineClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["inlineClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialLoad", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["initialLoad"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialEnd", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["initialEnd"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dataReady", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["dataReady"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eventsLoaded", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["eventsLoaded"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contentReady", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["contentReady"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scroll", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["scroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "virtualScroll", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["virtualScroll"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scrollUiUpdate", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["scrollUiUpdate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uiUpdate", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["uiUpdate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "documentClick", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["documentClick"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cellMouseDown", function() { return _base_constant__WEBPACK_IMPORTED_MODULE_1__["cellMouseDown"]; });

/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WEEK_LENGTH", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["WEEK_LENGTH"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MS_PER_DAY", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["MS_PER_DAY"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MS_PER_MINUTE", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["MS_PER_MINUTE"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getElementHeightFromClass", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getElementHeightFromClass"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTranslateY", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getTranslateY"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekFirstDate", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekLastDate", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekLastDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "firstDateOfMonth", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["firstDateOfMonth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastDateOfMonth", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["lastDateOfMonth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekNumber", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekNumber"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getWeekMiddleDate", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekMiddleDate"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setTime", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["setTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "resetTime", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateInMs", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateInMs"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateCount", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateCount"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addDays", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addMonths", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["addMonths"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addYears", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["addYears"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStartEndHours", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getStartEndHours"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMaxDays", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getMaxDays"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDaysCount", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getDaysCount"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getDateFromString", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateFromString"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getScrollBarWidth", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getScrollBarWidth"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndexInData", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["findIndexInData"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getOuterHeight", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["getOuterHeight"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeChildren", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["removeChildren"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDaylightSavingTime", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["isDaylightSavingTime"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addLocalOffset", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["addLocalOffset"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addLocalOffsetToEvent", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["addLocalOffsetToEvent"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalizeFirstWord", function() { return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"]; });

/* harmony import */ var _actions_resize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actions/resize */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/resize.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Resize", function() { return _actions_resize__WEBPACK_IMPORTED_MODULE_3__["Resize"]; });

/* harmony import */ var _actions_drag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./actions/drag */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/drag.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragAndDrop", function() { return _actions_drag__WEBPACK_IMPORTED_MODULE_4__["DragAndDrop"]; });

/* harmony import */ var _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./renderer/header-renderer */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/header-renderer.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRenderer", function() { return _renderer_header_renderer__WEBPACK_IMPORTED_MODULE_5__["HeaderRenderer"]; });

/* harmony import */ var _renderer_view_base__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./renderer/view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewHelper", function() { return _renderer_view_base__WEBPACK_IMPORTED_MODULE_6__["ViewHelper"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewBase", function() { return _renderer_view_base__WEBPACK_IMPORTED_MODULE_6__["ViewBase"]; });

/* harmony import */ var _renderer_day__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./renderer/day */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/day.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Day", function() { return _renderer_day__WEBPACK_IMPORTED_MODULE_7__["Day"]; });

/* harmony import */ var _renderer_week__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./renderer/week */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/week.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Week", function() { return _renderer_week__WEBPACK_IMPORTED_MODULE_8__["Week"]; });

/* harmony import */ var _renderer_work_week__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./renderer/work-week */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/work-week.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WorkWeek", function() { return _renderer_work_week__WEBPACK_IMPORTED_MODULE_9__["WorkWeek"]; });

/* harmony import */ var _renderer_month__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Month", function() { return _renderer_month__WEBPACK_IMPORTED_MODULE_10__["Month"]; });

/* harmony import */ var _renderer_year__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./renderer/year */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/year.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Year", function() { return _renderer_year__WEBPACK_IMPORTED_MODULE_11__["Year"]; });

/* harmony import */ var _renderer_agenda__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./renderer/agenda */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/agenda.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Agenda", function() { return _renderer_agenda__WEBPACK_IMPORTED_MODULE_12__["Agenda"]; });

/* harmony import */ var _renderer_month_agenda__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./renderer/month-agenda */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month-agenda.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MonthAgenda", function() { return _renderer_month_agenda__WEBPACK_IMPORTED_MODULE_13__["MonthAgenda"]; });

/* harmony import */ var _renderer_timeline_view__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./renderer/timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-view.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineViews", function() { return _renderer_timeline_view__WEBPACK_IMPORTED_MODULE_14__["TimelineViews"]; });

/* harmony import */ var _renderer_timeline_month__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./renderer/timeline-month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-month.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineMonth", function() { return _renderer_timeline_month__WEBPACK_IMPORTED_MODULE_15__["TimelineMonth"]; });

/* harmony import */ var _renderer_timeline_year__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./renderer/timeline-year */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-year.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimelineYear", function() { return _renderer_timeline_year__WEBPACK_IMPORTED_MODULE_16__["TimelineYear"]; });

/* harmony import */ var _timezone_timezone__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./timezone/timezone */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timezone", function() { return _timezone_timezone__WEBPACK_IMPORTED_MODULE_17__["Timezone"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timezoneData", function() { return _timezone_timezone__WEBPACK_IMPORTED_MODULE_17__["timezoneData"]; });

/* harmony import */ var _exports_index__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./exports/index */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/exports/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarExport", function() { return _exports_index__WEBPACK_IMPORTED_MODULE_18__["ICalendarExport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ICalendarImport", function() { return _exports_index__WEBPACK_IMPORTED_MODULE_18__["ICalendarImport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExcelExport", function() { return _exports_index__WEBPACK_IMPORTED_MODULE_18__["ExcelExport"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Print", function() { return _exports_index__WEBPACK_IMPORTED_MODULE_18__["Print"]; });

/**
 * Schedule component exported items
 */





















/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/event-settings.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/event-settings.js ***!
  \**************************************************************************************/
/*! exports provided: EventSettings */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventSettings", function() { return EventSettings; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _fields__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fields */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/fields.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};


/**
 * Holds the configuration of event related options and dataSource binding to Schedule.
 */
var EventSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(EventSettings, _super);
    function EventSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], EventSettings.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], EventSettings.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], EventSettings.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({}, _fields__WEBPACK_IMPORTED_MODULE_1__["Field"])
    ], EventSettings.prototype, "fields", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], EventSettings.prototype, "enableTooltip", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], EventSettings.prototype, "tooltipTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], EventSettings.prototype, "resourceColorField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], EventSettings.prototype, "editFollowingEvents", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], EventSettings.prototype, "allowAdding", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], EventSettings.prototype, "allowEditing", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], EventSettings.prototype, "allowDeleting", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], EventSettings.prototype, "enableMaxHeight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], EventSettings.prototype, "enableIndicator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], EventSettings.prototype, "ignoreWhitespace", void 0);
    return EventSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/field-options.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/field-options.js ***!
  \*************************************************************************************/
/*! exports provided: FieldOptions */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldOptions", function() { return FieldOptions; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * Configuration that applies on each appointment field options of scheduler.
 */
var FieldOptions = /** @__PURE__ @class */ (function (_super) {
    __extends(FieldOptions, _super);
    function FieldOptions() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldOptions.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldOptions.prototype, "default", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], FieldOptions.prototype, "title", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])({})
    ], FieldOptions.prototype, "validation", void 0);
    return FieldOptions;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/fields.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/fields.js ***!
  \******************************************************************************/
/*! exports provided: Field */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Field", function() { return Field; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _field_options__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./field-options */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/field-options.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};


/**
 * A Class that holds the collection of event fields that requires to be mapped with the dataSource
 * fields along with its available configuration settings. Each field in it accepts both string and Object
 *  data type. When each of the field is assigned with simple `string` value, it is assumed that the dataSource field
 *  name is mapped with it. If the `object` type is defined on each fields, then the validation related settings and mapping of
 *  those fields with dataSource can be given altogether within it.
 */
var Field = /** @__PURE__ @class */ (function (_super) {
    __extends(Field, _super);
    function Field() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Id')
    ], Field.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('IsBlock')
    ], Field.prototype, "isBlock", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'Subject' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "subject", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'StartTime' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "startTime", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'EndTime' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "endTime", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'StartTimezone' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "startTimezone", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'EndTimezone' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "endTimezone", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'Location' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "location", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'Description' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "description", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'IsAllDay' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "isAllDay", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'RecurrenceID' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "recurrenceID", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'RecurrenceRule' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "recurrenceRule", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Complex"])({ name: 'RecurrenceException' }, _field_options__WEBPACK_IMPORTED_MODULE_1__["FieldOptions"])
    ], Field.prototype, "recurrenceException", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('IsReadonly')
    ], Field.prototype, "isReadonly", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('FollowingID')
    ], Field.prototype, "followingID", void 0);
    return Field;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/group.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/group.js ***!
  \*****************************************************************************/
/*! exports provided: Group */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Group", function() { return Group; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that holds the resource grouping related configurations on Schedule.
 */
var Group = /** @__PURE__ @class */ (function (_super) {
    __extends(Group, _super);
    function Group() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Group.prototype, "byDate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Group.prototype, "byGroupID", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Group.prototype, "allowGroupEdit", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], Group.prototype, "resources", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], Group.prototype, "enableCompactView", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Group.prototype, "headerTooltipTemplate", void 0);
    return Group;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/header-rows.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/header-rows.js ***!
  \***********************************************************************************/
/*! exports provided: HeaderRows */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRows", function() { return HeaderRows; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that represents the header rows related configurations on timeline views.
 */
var HeaderRows = /** @__PURE__ @class */ (function (_super) {
    __extends(HeaderRows, _super);
    function HeaderRows() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], HeaderRows.prototype, "option", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], HeaderRows.prototype, "template", void 0);
    return HeaderRows;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/quick-info-templates.js":
/*!********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/quick-info-templates.js ***!
  \********************************************************************************************/
/*! exports provided: QuickInfoTemplates */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInfoTemplates", function() { return QuickInfoTemplates; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that defines the template options available to customize the quick popup of scheduler.
 */
var QuickInfoTemplates = /** @__PURE__ @class */ (function (_super) {
    __extends(QuickInfoTemplates, _super);
    function QuickInfoTemplates() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Both')
    ], QuickInfoTemplates.prototype, "templateType", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], QuickInfoTemplates.prototype, "header", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], QuickInfoTemplates.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], QuickInfoTemplates.prototype, "footer", void 0);
    return QuickInfoTemplates;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/resources.js":
/*!*********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/resources.js ***!
  \*********************************************************************************/
/*! exports provided: Resources */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Resources", function() { return Resources; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that represents the resource related configurations and its data binding options.
 */
var Resources = /** @__PURE__ @class */ (function (_super) {
    __extends(Resources, _super);
    function Resources() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Resources.prototype, "field", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Resources.prototype, "title", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Resources.prototype, "name", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Resources.prototype, "allowMultiple", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])([])
    ], Resources.prototype, "dataSource", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], Resources.prototype, "query", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Id')
    ], Resources.prototype, "idField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Text')
    ], Resources.prototype, "textField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Expanded')
    ], Resources.prototype, "expandedField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('GroupID')
    ], Resources.prototype, "groupIDField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Color')
    ], Resources.prototype, "colorField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('StartHour')
    ], Resources.prototype, "startHourField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('EndHour')
    ], Resources.prototype, "endHourField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('WorkDays')
    ], Resources.prototype, "workDaysField", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('CssClass')
    ], Resources.prototype, "cssClassField", void 0);
    return Resources;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/time-scale.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/time-scale.js ***!
  \**********************************************************************************/
/*! exports provided: TimeScale */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeScale", function() { return TimeScale; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that represents the configuration of options related to timescale on scheduler.
 */
var TimeScale = /** @__PURE__ @class */ (function (_super) {
    __extends(TimeScale, _super);
    function TimeScale() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], TimeScale.prototype, "enable", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(60)
    ], TimeScale.prototype, "interval", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(2)
    ], TimeScale.prototype, "slotCount", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TimeScale.prototype, "minorSlotTemplate", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])()
    ], TimeScale.prototype, "majorSlotTemplate", void 0);
    return TimeScale;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/work-hours.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/models/work-hours.js ***!
  \**********************************************************************************/
/*! exports provided: WorkHours */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkHours", function() { return WorkHours; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * A class that represents the configuration of working hours related options of scheduler.
 */
var WorkHours = /** @__PURE__ @class */ (function (_super) {
    __extends(WorkHours, _super);
    function WorkHours() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(true)
    ], WorkHours.prototype, "highlight", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('09:00')
    ], WorkHours.prototype, "start", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('18:00')
    ], WorkHours.prototype, "end", void 0);
    return WorkHours;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-tooltip.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-tooltip.js ***!
  \*************************************************************************************/
/*! exports provided: EventTooltip */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventTooltip", function() { return EventTooltip; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");




/**
 * Tooltip for Schedule
 */
var EventTooltip = /** @__PURE__ @class */ (function () {
    function EventTooltip(parent) {
        this.parent = parent;
        this.tooltipObj = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Tooltip"]({
            animation: { close: { effect: 'FadeOut' } },
            content: 'No title',
            position: 'BottomRight',
            offsetY: 10,
            mouseTrail: this.parent.isAdaptive ? false : true,
            showTipPointer: false,
            cssClass: this.parent.cssClass + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_TOOLTIP_ROOT_CLASS"],
            target: this.getTargets(),
            beforeRender: this.onBeforeRender.bind(this),
            beforeClose: this.onBeforeClose.bind(this),
            enableRtl: this.parent.enableRtl
        });
        this.tooltipObj.appendTo(this.parent.element);
        this.tooltipObj.isStringTemplate = true;
    }
    EventTooltip.prototype.getTargets = function () {
        var targets = [];
        if (this.parent.activeViewOptions.group.headerTooltipTemplate) {
            targets.push('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_CELLS_CLASS"]);
        }
        if (this.parent.eventSettings.enableTooltip) {
            targets.push('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["APPOINTMENT_CLASS"]);
        }
        return targets.join(',');
    };
    // tslint:disable-next-line:max-func-body-length
    EventTooltip.prototype.onBeforeRender = function (args) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(args.target.getAttribute('data-tooltip-id'))) {
            return;
        }
        if (args.target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["RESOURCE_CELLS_CLASS"]) && this.parent.activeViewOptions.group.resources.length > 0) {
            var resCollection = void 0;
            if (this.parent.activeView.isTimelineView()) {
                var index = parseInt(args.target.getAttribute('data-group-index'), 0);
                resCollection = this.parent.resourceBase.lastResourceLevel[index];
            }
            else {
                var rowIndex = args.target.parentNode.sectionRowIndex;
                var cellIndex = args.target.cellIndex;
                resCollection = this.parent.activeView.getColumnLevels()[rowIndex][cellIndex];
            }
            var data = {
                resource: resCollection.resource,
                resourceData: resCollection.resourceData
            };
            var contentContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
            var templateId = this.parent.element.id + '_headerTooltipTemplate';
            var tooltipTemplate = [].slice.call(this.parent.getHeaderTooltipTemplate()(data, this.parent, 'headerTooltipTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tooltipTemplate, contentContainer);
            this.setContent(contentContainer);
            this.parent.renderTemplates();
            return;
        }
        var record = this.parent.eventBase.getEventByGuid(args.target.getAttribute('data-guid'));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.eventSettings.tooltipTemplate)) {
            var contentContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
            var templateId = this.parent.element.id + '_tooltipTemplate';
            var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffsetToEvent"](record, this.parent.eventFields);
            var tooltipTemplate = [].slice.call(this.parent.getEventTooltipTemplate()(templateArgs, this.parent, 'tooltipTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tooltipTemplate, contentContainer);
            this.setContent(contentContainer);
        }
        else {
            var globalize = this.parent.globalize;
            var fields = this.parent.eventFields;
            var eventStart = new Date('' + record[fields.startTime]);
            var eventEnd = new Date('' + record[fields.endTime]);
            eventEnd = (eventEnd.getHours() === 0 && eventEnd.getMinutes() === 0) ? new Date(eventEnd.setMilliseconds(-1000)) : eventEnd;
            var startDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date('' + eventStart));
            var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date('' + eventEnd));
            var tooltipSubject = (record[fields.subject] || this.parent.eventSettings.fields.subject.default);
            var tooltipLocation = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(record[fields.location]) ? record[fields.location] : '';
            var startMonthDate = '';
            var startMonthYearDate = '';
            var endMonthYearDate = '';
            startMonthDate = globalize.formatDate(eventStart, {
                type: 'date', skeleton: 'MMMd', calendar: this.parent.getCalendarMode()
            });
            startMonthYearDate = globalize.formatDate(eventStart, {
                type: 'date', skeleton: 'medium', calendar: this.parent.getCalendarMode()
            });
            endMonthYearDate = globalize.formatDate(eventEnd, {
                type: 'date', skeleton: 'medium', calendar: this.parent.getCalendarMode()
            });
            startMonthDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](startMonthDate, 'single');
            startMonthYearDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](startMonthYearDate, 'single');
            endMonthYearDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](endMonthYearDate, 'single');
            var skeleton = 'short';
            var startTime = globalize.formatDate(eventStart, {
                type: 'time', skeleton: skeleton, calendar: this.parent.getCalendarMode()
            });
            var endTime = globalize.formatDate(eventEnd, {
                type: 'time', skeleton: skeleton, calendar: this.parent.getCalendarMode()
            });
            var tooltipDetails = void 0;
            if (startDate.getTime() === endDate.getTime()) {
                tooltipDetails =
                    globalize.formatDate(eventStart, {
                        type: 'date', skeleton: 'long', calendar: this.parent.getCalendarMode()
                    });
                tooltipDetails = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](tooltipDetails, 'single');
            }
            else {
                tooltipDetails = (startDate.getFullYear() === endDate.getFullYear()) ? (startMonthDate + ' - ' + endMonthYearDate) :
                    (startMonthYearDate + ' - ' + endMonthYearDate);
            }
            var tooltipTime = (record[fields.isAllDay]) ? this.parent.localeObj.getConstant('allDay') :
                (startTime + ' - ' + endTime);
            var content = '<div><div class="e-subject">' + tooltipSubject + '</div>' +
                '<div class="e-location">' + tooltipLocation + '</div>' +
                '<div class="e-details">' + tooltipDetails + '</div>' +
                '<div class="e-all-day">' + tooltipTime + '</div></div>';
            this.setContent(content);
        }
        this.parent.renderTemplates();
    };
    EventTooltip.prototype.onBeforeClose = function () {
        this.parent.resetTemplates(['tooltipTemplate', 'headerTooltipTemplate']);
    };
    EventTooltip.prototype.setContent = function (content) {
        this.tooltipObj.setProperties({ content: content }, true);
    };
    EventTooltip.prototype.close = function () {
        this.tooltipObj.close();
    };
    /**
     * To destroy the event tooltip.
     * @return {void}
     * @private
     */
    EventTooltip.prototype.destroy = function () {
        this.tooltipObj.destroy();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.parent.element], 'e-control');
        this.tooltipObj = null;
    };
    return EventTooltip;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-window.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-window.js ***!
  \************************************************************************************/
/*! exports provided: EventWindow */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventWindow", function() { return EventWindow; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-data */ "./ej2-resources/18.4.46/scripts/ej2-data/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../ej2-dropdowns */ "./ej2-resources/18.4.46/scripts/ej2-dropdowns/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _ej2_calendars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../ej2-calendars */ "./ej2-resources/18.4.46/scripts/ej2-calendars/index.js");
/* harmony import */ var _timezone_timezone__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../timezone/timezone */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js");
/* harmony import */ var _form_validator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./form-validator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/form-validator.js");
/* harmony import */ var _recurrence_editor_recurrence_editor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../recurrence-editor/recurrence-editor */ "./ej2-resources/18.4.46/scripts/ej2-schedule/recurrence-editor/recurrence-editor.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");















var EVENT_FIELD = 'e-field';
var REPEAT_CONTAINER_CLASS = 'e-recurrence-container';
var REPEAT_BUTTON_ICON_CLASS = 'e-recurrence-edit';
var REPEAT_BUTTON_CLASS = 'e-recurrence-edit-button';
var REPEAT_DIALOG_CLASS = 'e-recurrence-dialog';
var HIDE_STYLE_CLASS = 'e-hide';
/**
 * Event editor window
 */
var EventWindow = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for event window
     */
    function EventWindow(parent) {
        this.parent = parent;
        this.l10n = this.parent.localeObj;
        this.fields = this.parent.eventFields;
        this.eventWindowTime = { startTime: new Date(), endTime: new Date() };
        this.fieldValidator = new _form_validator__WEBPACK_IMPORTED_MODULE_8__["FieldValidator"]();
        this.renderEventWindow();
    }
    EventWindow.prototype.renderEventWindow = function () {
        this.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: this.parent.element.id + '_dialog_wrapper' });
        this.parent.element.appendChild(this.element);
        var dialogModel = {
            animationSettings: { effect: 'Zoom' },
            content: this.getEventWindowContent(),
            cssClass: _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"],
            enableRtl: this.parent.enableRtl,
            height: this.parent.isAdaptive ? '100%' : 'auto',
            minHeight: '300px',
            isModal: true,
            showCloseIcon: this.parent.isAdaptive ? false : true,
            target: document.body,
            visible: false,
            width: '500px',
            beforeOpen: this.onBeforeOpen.bind(this),
            beforeClose: this.onBeforeClose.bind(this)
        };
        if (this.parent.isAdaptive) {
            dialogModel.cssClass = _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DEVICE_CLASS"];
            dialogModel.header = '<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">' +
                this.l10n.getConstant('newEvent') + '</div><div class="e-save-icon e-icons"></div></div>';
        }
        else {
            dialogModel.buttons = [{
                    buttonModel: {
                        content: this.l10n.getConstant('deleteButton'), cssClass: _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DELETE_EVENT_CLASS"],
                        disabled: !this.parent.eventSettings.allowDeleting || this.parent.readonly
                    },
                    click: this.eventDelete.bind(this)
                }, {
                    buttonModel: {
                        content: this.l10n.getConstant('saveButton'), cssClass: 'e-primary ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_BUTTON_CLASS"],
                        isPrimary: true, disabled: !this.parent.eventSettings.allowAdding || this.parent.readonly
                    },
                    click: this.eventSave.bind(this)
                }, {
                    buttonModel: { cssClass: _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_CANCEL_BUTTON_CLASS"], content: this.l10n.getConstant('cancelButton') },
                    click: this.dialogClose.bind(this)
                }];
            dialogModel.header = '<div class="e-title-text">' + this.l10n.getConstant('newEvent') + '</div>';
        }
        this.dialogObject = new _ej2_popups__WEBPACK_IMPORTED_MODULE_3__["Dialog"](dialogModel, this.element);
        this.dialogObject.isStringTemplate = true;
        if (this.dialogObject.element.querySelector('.e-dlg-closeicon-btn')) {
            this.dialogObject.element.querySelector('.e-dlg-closeicon-btn').setAttribute('title', this.l10n.getConstant('close'));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element.parentElement], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"] + '-container');
        if (this.parent.isAdaptive) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_BACK_ICON_CLASS"]), 'click', this.dialogClose, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_ICON_CLASS"]), 'click', this.eventSave, this);
        }
        this.applyFormValidation();
    };
    EventWindow.prototype.updateEditorTemplate = function () {
        if (this.parent.editorTemplate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.parent.element.id + '_editorTemplate', 'EditorTemplate', this.parent);
        }
    };
    EventWindow.prototype.resetEditorTemplate = function () {
        if (this.parent.editorTemplate) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.parent.element.id + '_editorTemplate', 'EditorTemplate');
        }
    };
    EventWindow.prototype.refresh = function () {
        this.destroy();
        this.renderEventWindow();
    };
    EventWindow.prototype.refreshRecurrenceEditor = function () {
        if (this.recurrenceEditor) {
            var recurrenceEditor = this.recurrenceEditor.element;
            this.recurrenceEditor.destroy();
            this.createRecurrenceEditor(recurrenceEditor);
        }
    };
    EventWindow.prototype.setRecurrenceEditor = function (recurrenceEditor) {
        if (this.parent.editorTemplate) {
            this.recurrenceEditor = recurrenceEditor;
        }
    };
    EventWindow.prototype.openEditor = function (data, type, isEventData, repeatType) {
        this.parent.currentAction = type;
        this.parent.removeNewEventElement();
        this.parent.quickPopup.quickPopupHide(true);
        this.parent.inlineModule.removeInlineAppointmentElement();
        if (type === 'Add') {
            var eventObj = {};
            this.cellClickAction = !isEventData;
            this.parent.activeCellsData = data;
            var event_1 = data;
            if (this.cellClickAction) {
                this.convertToEventData(event_1, eventObj);
            }
            else {
                this.parent.activeCellsData = {
                    startTime: (event_1.startTime || event_1[this.fields.startTime]),
                    endTime: (event_1.endTime || event_1[this.fields.endTime]),
                    isAllDay: (event_1.isAllDay || event_1[this.fields.isAllDay]),
                    element: event_1.element,
                    groupIndex: event_1.groupIndex
                };
                eventObj = event_1;
            }
            data = eventObj;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);
        }
        if (!this.parent.isAdaptive && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.dialogObject.element.querySelector('.e-recurrenceeditor')], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
        }
        if (this.recurrenceEditor) {
            this.recurrenceEditor.firstDayOfWeek = this.parent.activeViewOptions.firstDayOfWeek;
        }
        switch (type) {
            case 'Add':
                this.onCellDetailsUpdate(data, repeatType);
                break;
            case 'Save':
            case 'EditOccurrence':
            case 'EditSeries':
            case 'EditFollowingEvents':
                if (type === 'EditOccurrence' && !this.parent.isAdaptive && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.dialogObject.element.querySelector('.e-recurrenceeditor')], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
                }
                this.cellClickAction = false;
                this.onEventDetailsUpdate(data);
                break;
        }
    };
    EventWindow.prototype.setDialogContent = function () {
        this.dialogObject.content = this.getEventWindowContent();
        this.dialogObject.dataBind();
    };
    EventWindow.prototype.onBeforeOpen = function (args) {
        var _this = this;
        var eventProp = {
            type: 'Editor',
            data: this.eventData,
            cancel: false,
            element: this.element,
            target: (this.cellClickAction ? this.parent.activeCellsData.element : this.parent.activeEventData.element)
        };
        if (this.cellClickAction) {
            eventProp.duration = this.getSlotDuration();
        }
        var saveObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_BUTTON_CLASS"]);
        if (saveObj) {
            saveObj.disabled = !(this.cellClickAction ? this.parent.eventSettings.allowAdding : this.parent.eventSettings.allowEditing);
            saveObj.dataBind();
        }
        var deleteObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DELETE_EVENT_CLASS"]);
        if (deleteObj) {
            deleteObj.disabled = !this.parent.eventSettings.allowDeleting;
            deleteObj.dataBind();
        }
        var callBackPromise = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Deferred"]();
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_11__["popupOpen"], eventProp, function (popupArgs) {
            args.cancel = popupArgs.cancel;
            _this.duration = _this.cellClickAction ? popupArgs.duration : null;
            _this.refreshDateTimePicker(_this.duration);
            if (_this.cellClickAction && popupArgs.duration !== _this.getSlotDuration() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(_this.parent.editorTemplate)) {
                var startObj = _this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]);
                var endObj = _this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]);
                endObj.value = new Date(startObj.value.getTime() + (_base_util__WEBPACK_IMPORTED_MODULE_12__["MS_PER_MINUTE"] * popupArgs.duration));
                endObj.dataBind();
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && _this.parent.editorTemplate && _this.element.querySelector('.e-recurrenceeditor') && !_this.recurrenceEditor) {
                _this.recurrenceEditor = _this.getInstance('e-recurrenceeditor');
            }
            callBackPromise.resolve(args);
        });
        return callBackPromise;
    };
    EventWindow.prototype.onBeforeClose = function (args) {
        var _this = this;
        if (args.isInteracted) {
            this.isCrudAction = false;
        }
        var eventProp = {
            type: 'Editor',
            data: this.eventCrudData,
            cancel: false,
            element: this.element,
            target: (this.cellClickAction ? this.parent.activeCellsData.element : this.parent.activeEventData.element)
        };
        var callBackPromise = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Deferred"]();
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_11__["popupClose"], eventProp, function (popupArgs) {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
                var eventFields = _this.parent.eventFields;
                if (popupArgs.data) {
                    var eventObj = popupArgs.data;
                    eventObj[eventFields.startTime] = _this.parent.getDateTime(eventObj[eventFields.startTime]);
                    eventObj[eventFields.endTime] = _this.parent.getDateTime(eventObj[eventFields.endTime]);
                }
                if (popupArgs.element) {
                    popupArgs.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(popupArgs.element);
                }
                if (popupArgs.target) {
                    popupArgs.target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(popupArgs.target);
                }
            }
            args.cancel = popupArgs.cancel;
            if (!popupArgs.cancel) {
                _this.resetEditorTemplate();
                _this.updateEditorTemplate();
                if (_this.isCrudAction) {
                    args.cancel = _this.processCrudActions(popupArgs.data);
                    _this.isCrudAction = args.cancel;
                }
                if (!_this.isCrudAction) {
                    _this.resetForm();
                    _this.parent.eventBase.focusElement();
                    _this.eventCrudData = null;
                }
            }
            callBackPromise.resolve(args);
        });
        return callBackPromise;
    };
    EventWindow.prototype.getEventWindowContent = function () {
        var container = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CONTAINER_CLASS"] });
        var form = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('form', {
            id: this.parent.element.id + 'EditForm',
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"],
            attrs: { onsubmit: 'return false;' }
        });
        this.renderFormElements(form);
        container.appendChild(form);
        return container;
    };
    EventWindow.prototype.renderFormElements = function (form, args) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            if (args) {
                // tslint:disable-next-line:no-any
                if (!this.parent.isReact) {
                    if (this.recurrenceEditor) {
                        this.recurrenceEditor.destroy();
                        this.recurrenceEditor = null;
                    }
                    this.destroyComponents();
                }
                var formElements = [].slice.call(form.children);
                for (var _i = 0, formElements_1 = formElements; _i < formElements_1.length; _i++) {
                    var element = formElements_1[_i];
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(element);
                }
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() || (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && args)) {
                var templateId = this.parent.element.id + '_editorTemplate';
                var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tempEle, form);
                this.parent.renderTemplates();
                this.updateEditorTemplate();
            }
        }
        else {
            form.appendChild(this.getDefaultEventWindowContent());
        }
    };
    EventWindow.prototype.getDefaultEventWindowContent = function () {
        var parentDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_PARENT_CLASS"]);
        var titleLocationDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TITLE_LOCATION_DIV_CLASS"]);
        parentDiv.appendChild(titleLocationDiv);
        titleLocationDiv.appendChild(this.renderTextBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["SUBJECT_CLASS"]));
        titleLocationDiv.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["SUBJECT_CLASS"]).setAttribute('title', this.parent.editorTitles.subject);
        titleLocationDiv.appendChild(this.renderTextBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["LOCATION_CLASS"]));
        titleLocationDiv.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["LOCATION_CLASS"]).setAttribute('title', this.parent.editorTitles.location);
        var startEndDateTimeDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_END_DIV_CLASS"]);
        parentDiv.appendChild(startEndDateTimeDiv);
        startEndDateTimeDiv.appendChild(this.renderDateTimePicker(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"], this.onTimeChange.bind(this)));
        startEndDateTimeDiv.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]).setAttribute('title', this.parent.editorTitles.startTime);
        startEndDateTimeDiv.appendChild(this.renderDateTimePicker(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]));
        startEndDateTimeDiv.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]).setAttribute('title', this.parent.editorTitles.endTime);
        var allDayTimezoneDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ALLDAY_TZ_DIV_CLASS"]);
        parentDiv.appendChild(allDayTimezoneDiv);
        allDayTimezoneDiv.appendChild(this.renderCheckBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ALL_DAY_CLASS"]));
        allDayTimezoneDiv.appendChild(this.renderCheckBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"]));
        var timezoneParentDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TIME_ZONE_DIV_CLASS"]);
        parentDiv.appendChild(timezoneParentDiv);
        timezoneParentDiv.appendChild(this.renderDropDown(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_TZ_CLASS"]));
        timezoneParentDiv.appendChild(this.renderDropDown(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_TZ_CLASS"]));
        var repeatParentDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_REPEAT_DIV_CLASS"]);
        parentDiv.appendChild(repeatParentDiv);
        var repeatDiv = this.renderCheckBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_REPEAT_CLASS"]);
        var repeatEditConainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', { className: REPEAT_CONTAINER_CLASS });
        var button = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('button', {
            className: REPEAT_BUTTON_CLASS,
            attrs: { type: 'button', 'title': this.l10n.getConstant('editRecurrence') }
        });
        this.buttonObj = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__["Button"]({ iconCss: REPEAT_BUTTON_ICON_CLASS + ' e-icons', cssClass: 'e-medium ' + this.parent.cssClass });
        repeatEditConainer.appendChild(button);
        this.buttonObj.appendTo(button);
        this.buttonObj.isStringTemplate = true;
        repeatDiv.appendChild(repeatEditConainer);
        repeatParentDiv.appendChild(repeatDiv);
        if (this.parent.isAdaptive) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(button, 'click', this.loadRecurrenceEditor, this);
        }
        else {
            this.createRecurrenceEditor(parentDiv);
        }
        if (this.parent.resourceCollection.length > 0) {
            var resourceParentDiv = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_RESOURCES_DIV_CLASS"]);
            for (var _i = 0, _a = this.parent.resourceBase.resourceCollection; _i < _a.length; _i++) {
                var resource = _a[_i];
                resourceParentDiv.appendChild(this.renderResourceDetails(resource));
            }
            parentDiv.appendChild(resourceParentDiv);
        }
        var description = this.createDivElement(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"] + '-row');
        description.appendChild(this.renderTextBox(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"]));
        description.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"]).setAttribute('title', this.parent.editorTitles.description);
        parentDiv.appendChild(description);
        var submit = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('button', { attrs: { type: 'hidden', title: 'submit', style: 'display:none' } });
        parentDiv.appendChild(submit);
        return parentDiv;
    };
    EventWindow.prototype.createRecurrenceEditor = function (parentDiv) {
        var recurrenceEditor = this.createDivElement();
        parentDiv.appendChild(recurrenceEditor);
        this.recurrenceEditor = this.renderRecurrenceEditor();
        this.recurrenceEditor.appendTo(recurrenceEditor);
        this.updateMinMaxDateToEditor();
    };
    EventWindow.prototype.createDivElement = function (className) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: className });
    };
    EventWindow.prototype.createInputElement = function (className, fieldName, type) {
        return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])(type || 'input', {
            className: className, attrs: {
                type: 'text', name: fieldName, value: '', id: fieldName,
                title: ((this.l10n.getConstant(fieldName.charAt(0).toLowerCase() + fieldName.slice(1))) === '') ?
                    fieldName : this.l10n.getConstant(fieldName.charAt(0).toLowerCase() + fieldName.slice(1))
            }
        });
    };
    EventWindow.prototype.getSlotDuration = function () {
        return this.parent.activeViewOptions.timeScale.interval / this.parent.activeViewOptions.timeScale.slotCount;
    };
    EventWindow.prototype.renderDateTimePicker = function (value, changeEvent) {
        var dateTimeDiv = this.createDivElement(value + '-container');
        var fieldName = this.getFieldName(value);
        var dateTimeInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);
        dateTimeDiv.appendChild(dateTimeInput);
        var dateTimePicker = new _ej2_calendars__WEBPACK_IMPORTED_MODULE_6__["DateTimePicker"]({
            change: changeEvent,
            firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
            calendarMode: this.parent.calendarMode,
            min: this.parent.minDate,
            max: new Date(new Date(+this.parent.maxDate).setHours(23, 59, 59)),
            cssClass: this.parent.cssClass,
            enableRtl: this.parent.enableRtl,
            locale: this.parent.locale,
            floatLabelType: 'Always',
            format: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.dateFormat) ?
                this.getFormat('dateFormats') : this.parent.dateFormat) + ' ' + this.getFormat('timeFormats'),
            placeholder: this.getFieldLabel(value),
            step: this.getSlotDuration(),
            width: '100%'
        });
        dateTimePicker.isStringTemplate = true;
        dateTimePicker.appendTo(dateTimeInput);
        return dateTimeDiv;
    };
    EventWindow.prototype.refreshDateTimePicker = function (duration) {
        var elementSelector = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"];
        var startEndElement = [].slice.call(this.element.querySelectorAll(elementSelector));
        for (var _i = 0, startEndElement_1 = startEndElement; _i < startEndElement_1.length; _i++) {
            var element = startEndElement_1[_i];
            var instance = element.ej2_instances[0];
            instance.firstDayOfWeek = this.parent.activeViewOptions.firstDayOfWeek;
            instance.step = duration || this.getSlotDuration();
            instance.dataBind();
        }
    };
    EventWindow.prototype.onTimeChange = function () {
        var startObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]);
        if (startObj.element.parentElement.classList.contains('e-input-focus')) {
            var endObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]);
            var duration = 0;
            if (this.cellClickAction) {
                duration = _base_util__WEBPACK_IMPORTED_MODULE_12__["MS_PER_MINUTE"] * this.duration;
                this.eventWindowTime.startTime = startObj.value;
            }
            else {
                duration = this.eventData[this.fields.endTime].getTime() - this.eventData[this.fields.startTime].getTime();
            }
            var endDate = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startObj.value)) ? null : new Date(startObj.value.getTime() + duration);
            if (this.cellClickAction) {
                this.eventWindowTime.endTime = endDate;
            }
            endObj.value = endDate;
            endObj.dataBind();
        }
        if (this.recurrenceEditor) {
            this.recurrenceEditor.updateRuleUntilDate(this.eventWindowTime.startTime);
        }
    };
    EventWindow.prototype.renderResourceDetails = function (resourceData) {
        var fieldName = resourceData.field;
        var value = 'e-' + fieldName;
        var labelValue = resourceData.title;
        var resourceDiv = this.createDivElement(value + '-container' + ' ' + 'e-resources');
        var resourceInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);
        resourceDiv.appendChild(resourceInput);
        var resourceTemplate = '<div class="e-resource-template"><div class="e-resource-color" style="background-color:${' +
            resourceData.colorField + '}"></div><div class="e-resource-text">${' + resourceData.textField + '}</div></div>';
        if (resourceData.allowMultiple) {
            var listObj = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_4__["MultiSelect"]({
                cssClass: this.parent.cssClass || '',
                dataSource: resourceData.dataSource,
                change: this.onMultiselectResourceChange.bind(this),
                itemTemplate: resourceTemplate,
                fields: {
                    text: resourceData.textField,
                    value: resourceData.idField
                },
                htmlAttributes: { 'title': labelValue, 'name': fieldName },
                floatLabelType: 'Always',
                placeholder: labelValue,
                popupHeight: '230px',
                popupWidth: '447px',
                mode: 'Box'
            });
            listObj.appendTo(resourceInput);
            listObj.isStringTemplate = true;
        }
        else {
            var drowDownList = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_4__["DropDownList"]({
                cssClass: this.parent.cssClass || '',
                change: this.onDropdownResourceChange.bind(this),
                dataSource: resourceData.dataSource,
                enableRtl: this.parent.enableRtl,
                fields: {
                    text: resourceData.textField,
                    value: resourceData.idField
                },
                htmlAttributes: { 'title': labelValue, 'name': fieldName },
                floatLabelType: 'Always',
                placeholder: labelValue,
                popupHeight: '230px',
                popupWidth: '447px',
                itemTemplate: resourceTemplate
            });
            drowDownList.appendTo(resourceInput);
            drowDownList.isStringTemplate = true;
        }
        return resourceDiv;
    };
    EventWindow.prototype.renderDropDown = function (value) {
        var fieldName = this.getFieldName(value);
        var timezoneDiv = this.createDivElement(value + '-container');
        var timezoneInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);
        timezoneDiv.appendChild(timezoneInput);
        var drowDownList = new _ej2_dropdowns__WEBPACK_IMPORTED_MODULE_4__["DropDownList"]({
            allowFiltering: true,
            change: this.onTimezoneChange.bind(this),
            cssClass: this.parent.cssClass || '',
            dataSource: _timezone_timezone__WEBPACK_IMPORTED_MODULE_7__["timezoneData"],
            enableRtl: this.parent.enableRtl,
            fields: { text: 'Text', value: 'Value' },
            filterBarPlaceholder: 'Search Timezone',
            filtering: function (e) {
                var query = new _ej2_data__WEBPACK_IMPORTED_MODULE_1__["Query"]();
                query = (e.text !== '') ? query.where('Text', 'contains', e.text, true) : query;
                e.updateData(_timezone_timezone__WEBPACK_IMPORTED_MODULE_7__["timezoneData"], query);
            },
            htmlAttributes: { 'title': this.getFieldLabel(value), 'name': fieldName },
            floatLabelType: 'Always',
            placeholder: this.getFieldLabel(value),
            popupHeight: '230px',
        });
        drowDownList.appendTo(timezoneInput);
        drowDownList.isStringTemplate = true;
        return timezoneDiv;
    };
    EventWindow.prototype.onMultiselectResourceChange = function (args) {
        if (!args.value || !this.parent.activeViewOptions.group.byGroupID || this.parent.resourceCollection.length <= 1) {
            return;
        }
        var resourceCollection = this.parent.resourceBase.resourceCollection;
        var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);
        for (var i = 0; i < resourceCollection.length; i++) {
            if (resourceCollection[i].field === fieldName && i < resourceCollection.length - 1) {
                var resObject = this.createInstance(i);
                var datasource = [];
                var _loop_1 = function (j) {
                    var resourceModel = resourceCollection[i + 1];
                    var filter = resourceModel.dataSource.filter(function (data) {
                        return data[resourceModel.groupIDField] === args.value[j];
                    })[0];
                    var groupId = filter[resourceCollection[i + 1].groupIDField];
                    var filterRes = this_1.filterDatasource(i, groupId);
                    datasource = datasource.concat(filterRes);
                };
                var this_1 = this;
                for (var j = 0; j < args.value.length; j++) {
                    _loop_1(j);
                }
                resObject.dataSource = datasource;
                resObject.dataBind();
            }
        }
    };
    EventWindow.prototype.createInstance = function (index) {
        var resourceData = this.parent.resourceBase.resourceCollection[index + 1];
        var resObject = this.element.querySelector('.e-' + resourceData.field).
            ej2_instances[0];
        return resObject;
    };
    EventWindow.prototype.onDropdownResourceChange = function (args) {
        if (!args.value || this.parent.resourceCollection.length <= 1 || !this.parent.activeViewOptions.group.byGroupID) {
            return;
        }
        var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);
        var resourceCollection = this.parent.resourceBase.resourceCollection;
        for (var i = 0; i < resourceCollection.length; i++) {
            if ((i < resourceCollection.length - 1) && resourceCollection[i].field === fieldName) {
                var resObj = this.createInstance(i);
                var groupId = args.itemData[resourceCollection[i].idField];
                resObj.dataSource = this.filterDatasource(i, groupId);
                resObj.dataBind();
                var resValue = resObj.dataSource[0][resourceCollection[i + 1].idField];
                resObj.value = (resourceCollection[i + 1].allowMultiple) ? [resValue] : resValue;
                resObj.dataBind();
            }
        }
    };
    EventWindow.prototype.filterDatasource = function (index, groupId) {
        var resourceData = this.parent.resourceBase.resourceCollection[index + 1];
        var filter = resourceData.dataSource.filter(function (data) {
            return data[resourceData.groupIDField] === groupId;
        });
        return filter;
    };
    EventWindow.prototype.onTimezoneChange = function (args) {
        var fieldName = args.element.getAttribute('name') || this.getColumnName(args.element);
        if (fieldName === this.parent.eventFields.startTimezone) {
            var startTimezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_TZ_CLASS"]);
            var endTimezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_TZ_CLASS"]);
            endTimezoneObj.value = startTimezoneObj.value;
            endTimezoneObj.dataBind();
        }
    };
    EventWindow.prototype.renderCheckBox = function (value) {
        var checkBoxDiv = this.createDivElement(value + '-container');
        var fieldName = this.getFieldName(value);
        var checkBoxInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName);
        checkBoxDiv.appendChild(checkBoxInput);
        var checkBox = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__["CheckBox"]({
            change: this.onChange.bind(this),
            cssClass: value + ' ' + this.parent.cssClass,
            enableRtl: this.parent.enableRtl,
            label: this.getFieldLabel(value)
        });
        checkBox.appendTo(checkBoxInput);
        checkBox.isStringTemplate = true;
        checkBoxInput.setAttribute('name', fieldName);
        if (fieldName === 'Repeat') {
            this.repeatStatus = checkBox;
        }
        return checkBoxDiv;
    };
    EventWindow.prototype.renderTextBox = function (value) {
        var textBoxDiv = this.createDivElement(value + '-container');
        var fieldName = this.getFieldName(value);
        var elementType = (value === _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"]) ? 'textarea' : 'input';
        var textBoxInput = this.createInputElement(value + ' ' + EVENT_FIELD, fieldName, elementType);
        textBoxDiv.appendChild(textBoxInput);
        _ej2_inputs__WEBPACK_IMPORTED_MODULE_5__["Input"].createInput({
            element: textBoxInput,
            floatLabelType: 'Always',
            properties: {
                enableRtl: this.parent.enableRtl,
                placeholder: this.getFieldLabel(value)
            }
        });
        return textBoxDiv;
    };
    EventWindow.prototype.getFieldName = function (name) {
        var fieldName = '';
        switch (name) {
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["SUBJECT_CLASS"]:
                fieldName = this.fields.subject;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["LOCATION_CLASS"]:
                fieldName = this.fields.location;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]:
                fieldName = this.fields.startTime;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]:
                fieldName = this.fields.endTime;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"]:
                fieldName = this.fields.description;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ALL_DAY_CLASS"]:
                fieldName = this.fields.isAllDay;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_TZ_CLASS"]:
                fieldName = this.fields.startTimezone;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_TZ_CLASS"]:
                fieldName = this.fields.endTimezone;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"]:
                fieldName = 'Timezone';
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_REPEAT_CLASS"]:
                fieldName = 'Repeat';
                break;
        }
        return fieldName;
    };
    EventWindow.prototype.getFieldLabel = function (fieldName) {
        var labelText = '';
        switch (fieldName) {
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["SUBJECT_CLASS"]:
                labelText = this.parent.editorTitles.subject;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["LOCATION_CLASS"]:
                labelText = this.parent.editorTitles.location;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DESCRIPTION_CLASS"]:
                labelText = this.parent.editorTitles.description;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]:
                labelText = this.parent.editorTitles.startTime;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]:
                labelText = this.parent.editorTitles.endTime;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_TZ_CLASS"]:
                labelText = this.parent.editorTitles.startTimezone;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_TZ_CLASS"]:
                labelText = this.parent.editorTitles.endTimezone;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_REPEAT_CLASS"]:
                labelText = this.parent.editorTitles.recurrenceRule;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ALL_DAY_CLASS"]:
                labelText = this.parent.editorTitles.isAllDay;
                break;
            case _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"]:
                labelText = this.l10n.getConstant('timezone');
                break;
        }
        return labelText;
    };
    EventWindow.prototype.onChange = function (args) {
        var target = (args.event.target);
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ALL_DAY_CLASS"])) {
            this.onAllDayChange(args.checked);
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"])) {
            this.timezoneChangeStyle(args.checked);
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_REPEAT_CLASS"])) {
            this.onRepeatChange(args.checked);
        }
    };
    EventWindow.prototype.renderRepeatDialog = function () {
        var element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
        this.repeatDialogObject = new _ej2_popups__WEBPACK_IMPORTED_MODULE_3__["Dialog"]({
            header: this.l10n.getConstant('recurrence'),
            visible: false,
            content: '<div class="e-rec-editor"></div>',
            closeOnEscape: true,
            width: '90%',
            buttons: [{
                    click: this.repeatSaveDialog.bind(this),
                    buttonModel: { content: this.l10n.getConstant('save'), cssClass: 'e-save', isPrimary: true }
                },
                { click: this.repeatCancelDialog.bind(this), buttonModel: { cssClass: 'e-cancel', content: this.l10n.getConstant('cancel') } }],
            target: this.element,
            animationSettings: { effect: 'Zoom' },
            enableRtl: this.parent.enableRtl,
            isModal: true,
            cssClass: REPEAT_DIALOG_CLASS,
            open: this.repeatOpenDialog.bind(this)
        });
        this.element.appendChild(element);
        this.repeatDialogObject.appendTo(element);
        this.repeatDialogObject.isStringTemplate = true;
        this.createRecurrenceEditor(this.repeatDialogObject.element.querySelector('.e-rec-editor'));
    };
    EventWindow.prototype.loadRecurrenceEditor = function () {
        this.repeatDialogObject.show();
        if (this.recurrenceEditor && this.repeatRule) {
            this.recurrenceEditor.setRecurrenceRule(this.repeatRule);
        }
    };
    EventWindow.prototype.onRepeatChange = function (state) {
        if (state) {
            if (!this.repeatDialogObject) {
                this.renderRepeatDialog();
            }
            this.recurrenceEditor.setProperties({ startDate: this.repeatStartDate, selectedType: 0 });
            this.loadRecurrenceEditor();
        }
        else {
            if (this.repeatDialogObject) {
                this.repeatDialogObject.hide();
            }
            this.repeatRule = '';
            if (this.recurrenceEditor) {
                this.recurrenceEditor.setRecurrenceRule(this.repeatRule);
                this.updateRepeatLabel(this.repeatRule);
            }
            var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], HIDE_STYLE_CLASS);
        }
    };
    EventWindow.prototype.repeatSaveDialog = function () {
        this.repeatRule = this.recurrenceEditor.getRecurrenceRule();
        var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);
        if (this.recurrenceEditor.getRecurrenceRule()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], HIDE_STYLE_CLASS);
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], HIDE_STYLE_CLASS);
            this.repeatStatus.setProperties({ checked: false });
        }
        this.updateRepeatLabel(this.repeatRule);
        this.closeRepeatDialog();
    };
    EventWindow.prototype.closeRepeatDialog = function () {
        this.repeatDialogObject.hide();
    };
    EventWindow.prototype.repeatCancelDialog = function () {
        this.closeRepeatDialog();
        if (this.recurrenceEditor) {
            this.recurrenceEditor.setRecurrenceRule(this.repeatTempRule);
        }
        if (!this.repeatTempRule) {
            this.repeatStatus.setProperties({ checked: false });
        }
    };
    EventWindow.prototype.repeatOpenDialog = function () {
        this.repeatTempRule = this.recurrenceEditor.getRecurrenceRule();
    };
    EventWindow.prototype.onCellDetailsUpdate = function (eventObj, repeatType) {
        if (!this.parent.eventSettings.allowAdding) {
            return;
        }
        this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"]).removeAttribute('data-id');
        this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TITLE_TEXT_CLASS"]).innerHTML = this.l10n.getConstant('newEvent');
        eventObj.Timezone = false;
        this.repeatStartDate = eventObj[this.fields.startTime];
        this.repeatRule = '';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.eventSettings.fields.subject.default)) {
            eventObj[this.fields.subject] = this.parent.eventSettings.fields.subject.default;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.eventSettings.fields.location.default)) {
            eventObj[this.fields.location] = this.parent.eventSettings.fields.location.default;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.eventSettings.fields.description.default)) {
            eventObj[this.fields.description] = this.parent.eventSettings.fields.description.default;
        }
        this.showDetails(eventObj);
        if (eventObj[this.fields.recurrenceRule] && this.recurrenceEditor) {
            this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);
            this.repeatRule = eventObj[this.fields.recurrenceRule];
        }
        var deleteButton = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DELETE_EVENT_CLASS"]);
        if (deleteButton) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([deleteButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
        }
        if (this.recurrenceEditor) {
            this.recurrenceEditor.setProperties({
                startDate: eventObj[this.fields.startTime],
                selectedType: !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(repeatType) ? repeatType : !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.recurrenceRule]) ?
                    this.recurrenceEditor.selectedType : 0
            });
        }
        if (this.parent.isAdaptive && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], HIDE_STYLE_CLASS);
            this.updateRepeatLabel(this.repeatRule);
        }
        else {
            var saveButton = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_BUTTON_CLASS"]);
            this.disableButton(saveButton, false);
        }
        this.dialogObject.show();
    };
    EventWindow.prototype.convertToEventData = function (cellsData, eventObj) {
        if (cellsData.subject) {
            eventObj[this.fields.subject] = cellsData.subject;
        }
        eventObj[this.fields.startTime] = cellsData.startTime;
        eventObj[this.fields.endTime] = cellsData.endTime;
        eventObj[this.fields.isAllDay] = cellsData.isAllDay;
        if (cellsData.RecurrenceRule) {
            eventObj[this.fields.recurrenceRule] = cellsData.RecurrenceRule;
        }
        if (this.parent.resourceCollection.length > 0 || this.parent.activeViewOptions.group.resources.length > 0) {
            this.parent.resourceBase.setResourceValues(eventObj);
        }
    };
    EventWindow.prototype.applyFormValidation = function () {
        var getValidationRule = function (rules) { return (rules && Object.keys(rules).length > 0) ? rules : undefined; };
        var form = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"]);
        var rules = {};
        rules[this.parent.eventSettings.fields.subject.name] = getValidationRule(this.parent.eventSettings.fields.subject.validation);
        rules[this.parent.eventSettings.fields.location.name] = getValidationRule(this.parent.eventSettings.fields.location.validation);
        rules[this.parent.eventSettings.fields.startTime.name] = getValidationRule(this.parent.eventSettings.fields.startTime.validation);
        rules[this.parent.eventSettings.fields.endTime.name] = getValidationRule(this.parent.eventSettings.fields.endTime.validation);
        rules[this.parent.eventSettings.fields.description.name] =
            getValidationRule(this.parent.eventSettings.fields.description.validation);
        this.fieldValidator.renderFormValidator(form, rules, this.element);
    };
    EventWindow.prototype.showDetails = function (eventData) {
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventData, null, true);
        if (eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
            this.trimAllDay(eventObj);
        }
        this.eventData = eventObj;
        var formelement = this.getFormElements(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"]);
        var keyNames = Object.keys(eventObj);
        for (var _i = 0, formelement_1 = formelement; _i < formelement_1.length; _i++) {
            var curElement = formelement_1[_i];
            var columnName = curElement.name || this.getColumnName(curElement);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(columnName) && columnName !== '') {
                if (keyNames.indexOf(columnName) !== -1) {
                    this.setValueToElement(curElement, eventObj[columnName]);
                }
                else {
                    this.setDefaultValueToElement(curElement);
                }
            }
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            this.onAllDayChange(eventObj[this.fields.isAllDay]);
            var timezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"] + '.' + EVENT_FIELD);
            if (!(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.startTimezone]) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.endTimezone]))) {
                timezoneObj.checked = true;
                timezoneObj.dataBind();
            }
            this.timezoneChangeStyle(timezoneObj.checked);
            delete eventObj.Timezone;
        }
    };
    EventWindow.prototype.getColumnName = function (element) {
        var attrName = element.getAttribute('data-name') || '';
        if (attrName === '') {
            var isDropDowns = false;
            var fieldSelector = '';
            if (element.classList.contains('e-dropdownlist')) {
                fieldSelector = 'e-ddl';
                isDropDowns = true;
            }
            else if (element.classList.contains('e-multiselect')) {
                fieldSelector = 'e-multiselect';
                isDropDowns = true;
            }
            else if (element.classList.contains('e-datetimepicker')) {
                fieldSelector = 'e-datetimepicker';
            }
            else if (element.classList.contains('e-datepicker')) {
                fieldSelector = 'e-datepicker';
            }
            else if (element.classList.contains('e-checkbox')) {
                fieldSelector = 'e-checkbox';
            }
            var classSelector = isDropDowns ? "." + fieldSelector + ":not(.e-control)" : "." + fieldSelector;
            var control = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(element, classSelector) || element.querySelector("." + fieldSelector);
            if (control) {
                var attrEle = control.querySelector('[name]');
                if (attrEle) {
                    attrName = attrEle.name;
                }
            }
        }
        return attrName;
    };
    EventWindow.prototype.onAllDayChange = function (allDayStatus) {
        var startObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"]);
        var endObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_CLASS"]);
        var timezoneDiv = this.element.querySelector('.e-time-zone-container');
        var format;
        if (allDayStatus) {
            format = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.dateFormat)) ? this.getFormat('dateFormats') : this.parent.dateFormat;
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(this.element.querySelectorAll('.e-time-icon'), _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ICON_DISABLE_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([timezoneDiv], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
            if (this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TIME_ZONE_DIV_CLASS"])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TIME_ZONE_DIV_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ENABLE_CLASS"]);
            }
            startObj.format = endObj.format = format;
        }
        else {
            format = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.dateFormat)) ? this.getFormat('dateFormats') + ' ' + this.getFormat('timeFormats') :
                this.parent.dateFormat + ' ' + this.getFormat('timeFormats');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.element.querySelectorAll('.e-time-icon'), _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_ICON_DISABLE_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([timezoneDiv], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
            if (this.element.querySelector('.e-checkbox-wrapper .e-time-zone').checked) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TIME_ZONE_DIV_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ENABLE_CLASS"]);
            }
            startObj.format = endObj.format = format;
        }
        if (this.cellClickAction) {
            this.updateDateTime(allDayStatus, startObj, endObj);
        }
        startObj.dataBind();
        endObj.dataBind();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.recurrenceEditor)) {
            this.recurrenceEditor.updateRuleUntilDate(startObj.value);
        }
    };
    EventWindow.prototype.updateDateTime = function (allDayStatus, startObj, endObj) {
        var startDate;
        var endDate;
        if (allDayStatus) {
            startDate = _base_util__WEBPACK_IMPORTED_MODULE_12__["resetTime"](new Date(this.eventWindowTime.startTime.getTime()));
            if (this.parent.activeCellsData.isAllDay) {
                var temp = _base_util__WEBPACK_IMPORTED_MODULE_12__["addDays"](new Date(this.eventWindowTime.endTime.getTime()), -1).getTime();
                endDate = (+this.eventWindowTime.startTime > temp) ? this.eventWindowTime.endTime : new Date(temp);
            }
            else {
                endDate = _base_util__WEBPACK_IMPORTED_MODULE_12__["resetTime"](new Date(this.eventWindowTime.endTime.getTime()));
            }
        }
        else {
            var start = this.parent.activeCellsData.startTime;
            startDate = new Date(this.eventWindowTime.startTime.getTime());
            startDate.setHours(start.getHours(), start.getMinutes(), start.getSeconds());
            if (this.parent.activeCellsData.isAllDay) {
                var startHour = this.parent.getStartEndTime(this.parent.workHours.start);
                startDate.setHours(startHour.getHours(), startHour.getMinutes(), startHour.getSeconds());
                endDate = new Date(startDate.getTime());
                endDate.setMilliseconds(_base_util__WEBPACK_IMPORTED_MODULE_12__["MS_PER_MINUTE"] * this.getSlotDuration());
            }
            else {
                endDate = new Date(startDate.getTime());
                endDate.setMilliseconds(this.parent.activeCellsData.endTime.getTime() - this.parent.activeCellsData.startTime.getTime());
            }
        }
        this.eventWindowTime = { startTime: new Date(startDate.getTime()), endTime: new Date(endDate.getTime()) };
        startObj.value = startDate;
        endObj.value = endDate;
        startObj.dataBind();
        endObj.dataBind();
    };
    EventWindow.prototype.getFormat = function (formatType) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            if (formatType === 'dateFormats') {
                return _ej2_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].compareBlazorDateFormats({ skeleton: 'd' }, this.parent.locale).format;
            }
            return _ej2_base__WEBPACK_IMPORTED_MODULE_0__["IntlBase"].compareBlazorDateFormats({ skeleton: 't' }, this.parent.locale).format;
        }
        var format;
        if (this.parent.locale === 'en' || this.parent.locale === 'en-US') {
            format = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(formatType + '.short', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(this.parent.getCalendarMode()));
        }
        else {
            format = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])(
            // tslint:disable-next-line:max-line-length
            'main.' + '' + this.parent.locale + '.dates.calendars.' + this.parent.getCalendarMode() + '.' + formatType + '.short', _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]);
        }
        return format;
    };
    EventWindow.prototype.onEventDetailsUpdate = function (eventObj) {
        if (!this.parent.eventSettings.allowEditing) {
            return;
        }
        if (!this.parent.isAdaptive) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DELETE_EVENT_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DISABLE_CLASS"]);
        }
        this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TITLE_TEXT_CLASS"]).innerHTML = this.l10n.getConstant('editEvent');
        this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"]).setAttribute('data-id', eventObj[this.fields.id].toString());
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
            var timezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["TIME_ZONE_CLASS"] + '.' + EVENT_FIELD);
            var timezoneValue = void 0;
            if (eventObj[this.fields.startTimezone] || eventObj[this.fields.endTimezone]) {
                timezoneValue = true;
                this.parent.eventBase.timezoneConvert(eventObj);
            }
            else {
                timezoneValue = false;
            }
            eventObj.Timezone = timezoneValue;
            timezoneObj.checked = timezoneValue;
            timezoneObj.dataBind();
        }
        this.showDetails(eventObj);
        if (eventObj[this.fields.recurrenceRule] && this.recurrenceEditor) {
            this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);
        }
        else if (!this.parent.isAdaptive && this.recurrenceEditor) {
            this.recurrenceEditor.setProperties({ startDate: eventObj[this.fields.startTime] });
            this.recurrenceEditor.setRecurrenceRule('');
        }
        this.repeatStartDate = eventObj[this.fields.startTime];
        this.repeatRule = '';
        if (eventObj[this.fields.recurrenceRule]) {
            if (this.recurrenceEditor) {
                this.recurrenceEditor.setRecurrenceRule(eventObj[this.fields.recurrenceRule], eventObj[this.fields.startTime]);
            }
            this.repeatRule = eventObj[this.fields.recurrenceRule];
        }
        if (this.parent.isAdaptive && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);
            if (eventObj[this.fields.recurrenceRule]) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([element], HIDE_STYLE_CLASS);
                this.repeatStatus.setProperties({ checked: true });
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], HIDE_STYLE_CLASS);
                this.repeatStatus.setProperties({ checked: false });
            }
            this.updateRepeatLabel(this.repeatRule);
        }
        var isDisable = (this.parent.readonly || eventObj[this.fields.isReadonly]);
        if (!this.parent.isAdaptive) {
            var saveButton = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_BUTTON_CLASS"]);
            var deleteButton = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["DELETE_EVENT_CLASS"]);
            this.disableButton(saveButton, isDisable);
            this.disableButton(deleteButton, isDisable);
        }
        else {
            var saveIcon = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_SAVE_ICON_CLASS"]);
            if (saveIcon) {
                if (isDisable) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([saveIcon], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ICON_DISABLE_CLASS"]);
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([saveIcon], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ICON_DISABLE_CLASS"]);
                }
            }
        }
        this.dialogObject.show();
    };
    EventWindow.prototype.disableButton = function (element, value) {
        if (element) {
            element.ej2_instances[0].disabled = value;
        }
    };
    EventWindow.prototype.renderRecurrenceEditor = function () {
        return new _recurrence_editor_recurrence_editor__WEBPACK_IMPORTED_MODULE_9__["RecurrenceEditor"]({
            calendarMode: this.parent.calendarMode,
            cssClass: this.parent.cssClass,
            dateFormat: this.parent.dateFormat,
            enableRtl: this.parent.enableRtl,
            firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
            locale: this.parent.locale
        });
    };
    EventWindow.prototype.updateMinMaxDateToEditor = function () {
        var startDate = this.element.querySelector('.e-start');
        var endDate = this.element.querySelector('.e-end');
        if (startDate && endDate) {
            var startObj = startDate.ej2_instances[0];
            var endObj = endDate.ej2_instances[0];
            startObj.min = this.parent.minDate;
            startObj.max = this.parent.maxDate;
            endObj.min = this.parent.minDate;
            endObj.max = this.parent.maxDate;
            startObj.dataBind();
            endObj.dataBind();
        }
        if (this.recurrenceEditor) {
            var untilDate = this.recurrenceEditor.element.querySelector('.e-until-date');
            if (untilDate) {
                var untilObj = untilDate.ej2_instances[0];
                untilObj.min = this.parent.minDate;
                untilObj.max = this.parent.maxDate;
                untilObj.dataBind();
            }
        }
    };
    EventWindow.prototype.updateRepeatLabel = function (repeatRule) {
        if (this.parent.isAdaptive && !this.repeatDialogObject) {
            this.renderRepeatDialog();
        }
        var data = repeatRule ?
            (this.l10n.getConstant('repeats') + ' ' + this.recurrenceEditor.getRuleSummary(repeatRule)) : this.l10n.getConstant('repeat');
        this.repeatStatus.setProperties({ label: data });
    };
    EventWindow.prototype.dialogClose = function () {
        this.isCrudAction = false;
        this.parent.activeEventData = { event: undefined, element: undefined };
        this.parent.currentAction = null;
        this.dialogObject.hide();
    };
    EventWindow.prototype.resetForm = function () {
        this.fieldValidator.destroyToolTip();
        this.resetFormFields();
        if (!this.parent.isAdaptive && this.recurrenceEditor && !this.recurrenceEditor.isDestroyed) {
            this.recurrenceEditor.resetFields();
        }
    };
    EventWindow.prototype.timezoneChangeStyle = function (value) {
        var timezoneDiv = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_TIME_ZONE_DIV_CLASS"]);
        var localTimezoneName = this.parent.tzModule.getLocalTimezoneName();
        if (value) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([timezoneDiv], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ENABLE_CLASS"]);
            var startTimezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_TZ_CLASS"]);
            var endTimezoneObj = this.getInstance(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_END_TZ_CLASS"]);
            var timezone = startTimezoneObj.dataSource;
            if (!startTimezoneObj.value || !this.parent.timezone) {
                var found = timezone.some(function (tz) { return tz.Value === localTimezoneName; });
                if (!found) {
                    timezone.push({ Value: localTimezoneName, Text: localTimezoneName });
                    startTimezoneObj.dataSource = timezone;
                    endTimezoneObj.dataSource = timezone;
                    startTimezoneObj.dataBind();
                    endTimezoneObj.dataBind();
                }
            }
            startTimezoneObj.value = startTimezoneObj.value || this.parent.timezone || localTimezoneName;
            endTimezoneObj.value = endTimezoneObj.value || this.parent.timezone || localTimezoneName;
            startTimezoneObj.dataBind();
            endTimezoneObj.dataBind();
        }
        else {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([timezoneDiv], _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["ENABLE_CLASS"]);
        }
    };
    EventWindow.prototype.resetFormFields = function () {
        var formElement = this.getFormElements(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"]);
        for (var _i = 0, formElement_1 = formElement; _i < formElement_1.length; _i++) {
            var currentElement = formElement_1[_i];
            var columnName = currentElement.name || this.getColumnName(currentElement);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(columnName) && columnName !== '') {
                this.setDefaultValueToElement(currentElement);
            }
        }
    };
    EventWindow.prototype.eventSave = function (alert) {
        var formElement = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"]);
        if (formElement && formElement.classList.contains('e-formvalidator') &&
            !formElement.ej2_instances[0].validate()) {
            return;
        }
        var dataCollection = this.getEventDataFromEditor();
        if (this.processEventValidation(dataCollection.tempData, alert)) {
            return;
        }
        this.eventCrudData = dataCollection.eventData;
        this.isCrudAction = true;
        this.dialogObject.hide();
    };
    EventWindow.prototype.getEventDataFromEditor = function () {
        var eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.getObjectFromFormData(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"]));
        if (!eventObj.Timezone) {
            eventObj[this.fields.startTimezone] = null;
            eventObj[this.fields.endTimezone] = null;
        }
        delete eventObj.Timezone;
        delete eventObj.Repeat;
        this.setDefaultValueToObject(eventObj);
        eventObj[this.fields.recurrenceRule] = this.recurrenceEditor ? this.recurrenceEditor.getRecurrenceRule() || null : undefined;
        var tempObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
        if (eventObj[this.fields.isAllDay]) {
            eventObj[this.fields.startTime] = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.startTime])) ? null
                : _base_util__WEBPACK_IMPORTED_MODULE_12__["resetTime"](new Date(eventObj[this.fields.startTime].getTime()));
            eventObj[this.fields.endTime] = (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.endTime])) ? null
                : _base_util__WEBPACK_IMPORTED_MODULE_12__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_12__["resetTime"](new Date(eventObj[this.fields.endTime].getTime())), 1);
        }
        return { eventData: eventObj, tempData: tempObj };
    };
    EventWindow.prototype.processEventValidation = function (eventObj, alert) {
        var alertType;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.editorTemplate)) {
            if (!eventObj[this.fields.startTime] || !eventObj[this.fields.endTime]) {
                this.parent.quickPopup.openValidationError('invalidDateError');
                return true;
            }
            if (eventObj[this.fields.startTime] > eventObj[this.fields.endTime]) {
                this.parent.quickPopup.openValidationError('startEndError');
                return true;
            }
        }
        if (this.recurrenceEditor && this.recurrenceEditor.value && this.recurrenceEditor.value !== '') {
            alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
            var isShowAlert = true;
            if (alertType === 'seriesChangeAlert' && this.parent.uiStateValues.isIgnoreOccurrence) {
                isShowAlert = false;
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(alertType) && isShowAlert
                && ((!this.parent.enableRecurrenceValidation && alertType === 'wrongPattern') || this.parent.enableRecurrenceValidation)) {
                this.parent.quickPopup.openRecurrenceValidationAlert(alertType);
                return true;
            }
        }
        return false;
    };
    EventWindow.prototype.processCrudActions = function (eventObj) {
        var _this = this;
        this.parent.uiStateValues.isBlock = false;
        var resourceData = this.getResourceData(eventObj);
        var isResourceEventExpand = (this.parent.activeViewOptions.group.resources.length > 0 ||
            this.parent.resourceCollection.length > 0) && !this.parent.activeViewOptions.group.allowGroupEdit
            && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceData);
        var eventId = this.getEventIdFromForm();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventId)) {
            var eveId_1 = this.parent.eventBase.getEventIDType() === 'string' ? eventId : parseInt(eventId, 10);
            var editedData = this.parent.eventsData.filter(function (data) {
                return data[_this.fields.id] === eveId_1;
            })[0];
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(editedData)) {
                editedData = this.parent.blockData.filter(function (data) {
                    return data[_this.fields.id] === eveId_1;
                })[0];
            }
            eventObj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, editedData, eventObj);
            if (eventObj[this.fields.isReadonly]) {
                return false;
            }
            var currentAction = void 0;
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(editedData[this.fields.recurrenceRule])) {
                currentAction = this.parent.currentAction;
                eventObj.Guid = this.parent.activeEventData.event.Guid;
                if (this.parent.currentAction === 'EditOccurrence') {
                    if (!eventObj[this.fields.recurrenceID]) {
                        eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();
                        eventObj.Guid = this.parent.activeEventData.event.Guid;
                    }
                    else {
                        eveId_1 = eventObj[this.fields.recurrenceID];
                        currentAction = null;
                    }
                    if (this.parent.enableRecurrenceValidation && this.editOccurrenceValidation(eveId_1, eventObj)) {
                        this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
                        return true;
                    }
                }
                if (this.parent.currentAction === 'EditSeries' || eventObj[this.fields.id] !== editedData[this.fields.id]) {
                    eventObj[this.fields.recurrenceID] = editedData[this.fields.id];
                }
                else if (this.parent.currentAction === 'EditFollowingEvents') {
                    eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();
                    eventObj[this.fields.followingID] = editedData[this.fields.id];
                }
            }
            if (isResourceEventExpand) {
                this.resourceSaveEvent(eventObj, 'Save', currentAction);
            }
            else {
                this.parent.saveEvent(eventObj, currentAction);
            }
        }
        else {
            this.parent.currentAction = 'Add';
            if (isResourceEventExpand) {
                this.resourceSaveEvent(eventObj, this.parent.currentAction);
            }
            else {
                eventObj[this.fields.id] = this.parent.eventBase.getEventMaxID();
                this.parent.addEvent(eventObj);
            }
        }
        return this.parent.uiStateValues.isBlock;
    };
    EventWindow.prototype.getResourceData = function (eventObj) {
        var resourceData = null;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.resourceBase) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.resourceBase.resourceCollection)
            && this.parent.resourceBase.resourceCollection.length > 0) {
            var lastResouceData = this.parent.resourceBase.resourceCollection.slice(-1)[0];
            resourceData = eventObj[lastResouceData.field];
        }
        return resourceData;
    };
    EventWindow.prototype.getObjectFromFormData = function (className) {
        var formElement = this.getFormElements(className);
        var eventObj = {};
        for (var _i = 0, formElement_2 = formElement; _i < formElement_2.length; _i++) {
            var currentElement = formElement_2[_i];
            var columnName = currentElement.name || this.getColumnName(currentElement);
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(columnName) && columnName !== '') {
                eventObj[columnName] = this.getValueFromElement(currentElement);
            }
        }
        return eventObj;
    };
    EventWindow.prototype.setDefaultValueToObject = function (eventObj) {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.subject])) {
            eventObj[this.fields.subject] = eventObj[this.fields.subject] || this.parent.eventSettings.fields.subject.default
                || this.l10n.getConstant('addTitle');
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.location])) {
            eventObj[this.fields.location] = eventObj[this.fields.location] || this.parent.eventSettings.fields.location.default;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj[this.fields.description])) {
            eventObj[this.fields.description] = eventObj[this.fields.description] || this.parent.eventSettings.fields.description.default;
        }
    };
    EventWindow.prototype.recurrenceValidation = function (startDate, endDate, alert) {
        var alertMessage;
        var recEditor = this.recurrenceEditor;
        var interval = this.getInstance('e-repeat-interval.e-numerictextbox').value;
        if (alert !== this.l10n.getConstant('ok')) {
            var activeEvent = this.parent.activeEventData.event;
            var excludedEvents = [];
            if ((this.parent.currentAction === 'EditSeries' || this.parent.currentAction === 'EditFollowingEvents')
                && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeEvent)) {
                var eventStartTime = activeEvent[this.parent.eventFields.startTime];
                var seriesEvents = this.parent.eventBase.getSeriesEvents(this.eventData, eventStartTime);
                if (seriesEvents.length > 0) {
                    excludedEvents = this.parent.eventBase.getEditedOccurrences(seriesEvents, eventStartTime);
                }
                else {
                    var event_2 = this.parent.eventBase.getEventById(activeEvent[this.parent.eventFields.id]);
                    excludedEvents = this.parent.eventBase.getEditedOccurrences([event_2], eventStartTime);
                }
                if (this.parent.currentAction === 'EditSeries'
                    && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.eventData[this.parent.eventFields.recurrenceException])) {
                    excludedEvents.push(this.eventData);
                }
            }
            if (excludedEvents.length > 0) {
                alertMessage = 'seriesChangeAlert';
            }
            if (this.getInstance('e-end-on-left .e-ddl .e-dropdownlist').value === 'until' &&
                this.getInstance('e-end-on-date .e-datepicker').value < startDate) {
                alertMessage = 'wrongPattern';
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(alertMessage)) {
                switch (recEditor.value.split(';')[0].split('=')[1]) {
                    case 'DAILY':
                        if ((((endDate.getTime() - startDate.getTime()) / (1000 * 3600)) > (interval * 24))) {
                            alertMessage = 'createError';
                        }
                        break;
                    case 'WEEKLY':
                        var types = recEditor.value.split(';')[1].split('=')[1].split(',');
                        var obj = { 'SU': 0, 'MO': 1, 'TU': 2, 'WE': 3, 'TH': 4, 'FR': 5, 'SA': 6 };
                        var temp = [];
                        var tempDiff = [];
                        for (var index = 0; index < types.length * (interval + 1); index++) {
                            temp[index] = (types.length > index) ? obj[types[index]] : temp[index - types.length] + (7 * interval);
                        }
                        var tempvalue = temp.sort(function (a, b) { return a - b; });
                        for (var index = 1; index < tempvalue.length; index++) {
                            tempDiff.push(tempvalue[index] - tempvalue[index - 1]);
                        }
                        if ((((endDate.getTime() - startDate.getTime()) / (1000 * 3600)) >= Math.min.apply(Math, tempDiff) * 24)
                            || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(interval)) {
                            alertMessage = 'createError';
                        }
                        break;
                    case 'MONTHLY':
                        if (endDate.getTime() >= new Date(+startDate).setMonth(startDate.getMonth() + interval)) {
                            alertMessage = 'createError';
                        }
                        break;
                    case 'YEARLY':
                        if (endDate.getTime() >= new Date(+startDate).setFullYear(startDate.getFullYear() + interval)) {
                            alertMessage = 'createError';
                        }
                        break;
                }
            }
        }
        else {
            if (endDate.getTime() >= new Date(+startDate).setMonth(startDate.getMonth() + interval)) {
                alertMessage = 'createError';
            }
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(alertMessage)) {
                this.parent.quickPopup.quickDialog.hide();
            }
        }
        return alertMessage;
    };
    EventWindow.prototype.getRecurrenceIndex = function (recColl, event) {
        var recIndex;
        for (var index = 0; index < recColl.length; index++) {
            if (event[this.fields.startTime].valueOf() === recColl[index][this.fields.startTime].valueOf()) {
                recIndex = index;
                break;
            }
        }
        return recIndex;
    };
    EventWindow.prototype.trimAllDay = function (data) {
        if (data[this.fields.isAllDay]) {
            var temp = _base_util__WEBPACK_IMPORTED_MODULE_12__["addDays"](new Date(+data[this.fields.endTime]), -1).getTime();
            data[this.fields.endTime] = (+data[this.fields.startTime] > temp) ? data[this.fields.endTime] : new Date(temp);
        }
    };
    EventWindow.prototype.editOccurrenceValidation = function (eventId, currentData, editData) {
        var _this = this;
        if (editData === void 0) {
            editData = this.eventData;
        }
        var recurColl = this.parent.getOccurrencesByID(eventId);
        var excludedDatas = this.parent.eventsData.filter(function (data) {
            return data[_this.fields.recurrenceID] === eventId;
        });
        excludedDatas.map(function (data) { return recurColl.push(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, data)); });
        currentData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, currentData);
        this.trimAllDay(currentData);
        for (var _i = 0, recurColl_1 = recurColl; _i < recurColl_1.length; _i++) {
            var data = recurColl_1[_i];
            this.trimAllDay(data);
        }
        this.parent.eventBase.sortByTime(recurColl);
        var index = this.getRecurrenceIndex(recurColl, editData);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(index)) {
            return false;
        }
        if (index === 0) {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(recurColl[index + 1])) {
                return (!(new Date(+recurColl[index + 1][this.fields.startTime]).setHours(0, 0, 0, 0) >
                    new Date(+currentData[this.fields.endTime]).setHours(0, 0, 0, 0)));
            }
            return false;
        }
        else {
            if (index === recurColl.length - 1) {
                if (!(new Date(+recurColl[index - 1][this.fields.endTime]).setHours(0, 0, 0, 0) <
                    new Date(+currentData[this.fields.startTime]).setHours(0, 0, 0, 0))) {
                    return true;
                }
            }
            else if (!((new Date(+recurColl[index - 1][this.fields.endTime]).setHours(0, 0, 0, 0) <
                new Date(+currentData[this.fields.startTime]).setHours(0, 0, 0, 0)) &&
                (new Date(+recurColl[index + 1][this.fields.startTime]).setHours(0, 0, 0, 0) >
                    new Date(+currentData[this.fields.endTime]).setHours(0, 0, 0, 0)))) {
                return true;
            }
        }
        return false;
    };
    EventWindow.prototype.resourceSaveEvent = function (eventObj, action, currentAction) {
        var _this = this;
        var lastResouceData = this.parent.resourceBase.resourceCollection.slice(-1)[0];
        var resourceData = eventObj[lastResouceData.field];
        resourceData = (resourceData instanceof Array) ? resourceData : [resourceData];
        var lastlevel = this.parent.resourceBase.lastResourceLevel;
        var eventList = [];
        var _loop_2 = function (i) {
            var events = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventObj, null, true);
            events[this_2.fields.id] = this_2.parent.eventBase.getEventMaxID();
            var temp = [];
            var addValues = function () {
                if (action === 'Save' && i === resourceData.length - 1) {
                    if (temp.length > 0) {
                        temp[0][_this.fields.id] = eventObj[_this.fields.id];
                        for (var k = 1; k < temp.length; k++) {
                            temp[k][_this.fields.id] = _this.parent.eventBase.getEventMaxID(i);
                            eventList.push(temp[k]);
                            _this.parent.saveEvent(temp[0], currentAction);
                        }
                    }
                    else {
                        events[_this.fields.id] = eventObj[_this.fields.id];
                        _this.parent.saveEvent(events, currentAction);
                    }
                }
                else {
                    if (temp.length > 0) {
                        for (var j = 0; j < temp.length; j++) {
                            temp[j][_this.fields.id] = _this.parent.eventBase.getEventMaxID(j);
                            eventList.push(temp[j]);
                        }
                    }
                    else {
                        events[_this.fields.id] = _this.parent.eventBase.getEventMaxID(i);
                        eventList.push(events);
                    }
                }
            };
            if (this_2.parent.activeViewOptions.group.byGroupID && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(lastlevel))) {
                var lastResource = lastResouceData.dataSource;
                var resCol = this_2.parent.resourceCollection;
                var index = void 0;
                if (resCol.length > 1) {
                    index =
                        _base_util__WEBPACK_IMPORTED_MODULE_12__["findIndexInData"](lastResource, lastResouceData.idField, resourceData[i], events, resCol);
                }
                else {
                    index = _base_util__WEBPACK_IMPORTED_MODULE_12__["findIndexInData"](lastResource, lastResouceData.idField, resourceData[i]);
                }
                if (index < 0) {
                    return { value: void 0 };
                }
                var groupId_1 = lastResource[index][lastResouceData.groupIDField];
                var filter = lastlevel.filter(function (obj) { return obj.resourceData[lastResouceData.idField] === resourceData[i]; }).
                    filter(function (obj) { return obj.resourceData[lastResouceData.groupIDField] === groupId_1; })[0];
                var groupOrder = filter.groupOrder;
                for (var index_1 = 0; index_1 < this_2.parent.resourceBase.resourceCollection.length; index_1++) {
                    var field = this_2.parent.resourceBase.resourceCollection[index_1].field;
                    events[field] = (groupOrder[index_1] instanceof Array) ? groupOrder[index_1][0] : groupOrder[index_1];
                }
                addValues();
            }
            else {
                for (var index = 0; index < this_2.parent.resourceBase.resourceCollection.length - 1; index++) {
                    var field = this_2.parent.resourceBase.resourceCollection[index].field;
                    if (events[field] instanceof Array && events[field].length > 1) {
                        for (var k = 0; k < events[field].length; k++) {
                            var event_3 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, events, null, true);
                            event_3[field] = eventObj[field][k];
                            event_3[lastResouceData.field] = resourceData[i];
                            temp.push(event_3);
                        }
                    }
                    else {
                        if (temp.length === 0) {
                            events[field] = (eventObj[field] instanceof Array) ?
                                eventObj[field][0] : eventObj[field];
                            events[lastResouceData.field] = resourceData[i];
                        }
                        else {
                            for (var l = 0; l < temp.length; l++) {
                                temp[l][field] = (eventObj[field] instanceof Array) ?
                                    eventObj[field][0] : eventObj[field];
                            }
                        }
                    }
                }
                events[lastResouceData.field] = resourceData[i];
                addValues();
            }
        };
        var this_2 = this;
        for (var i = 0; i < resourceData.length; i++) {
            var state_1 = _loop_2(i);
            if (typeof state_1 === "object")
                return state_1.value;
        }
        if (eventList.length > 0) {
            for (var _i = 0, eventList_1 = eventList; _i < eventList_1.length; _i++) {
                var event_4 = eventList_1[_i];
                event_4[this.fields.recurrenceException] = null;
                event_4[this.fields.recurrenceID] = null;
            }
            this.parent.addEvent(eventList);
        }
    };
    EventWindow.prototype.getEventIdFromForm = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["FORM_CLASS"]).getAttribute('data-id');
    };
    EventWindow.prototype.getFormElements = function (className) {
        var elements = [];
        if (className === _base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"]) {
            elements = [].slice.call(this.element.querySelectorAll('.' + EVENT_FIELD));
        }
        else {
            elements = [].slice.call(this.parent.element.querySelectorAll('.' + className + ' .' + EVENT_FIELD));
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            return elements;
        }
        var validElements = [];
        for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
            var element = elements_1[_i];
            if (element.classList.contains('e-control')) {
                validElements.push(element);
            }
            else if (element.querySelector('.e-control')) {
                validElements.push(element.querySelector('.e-control'));
            }
            else {
                validElements.push(element);
            }
        }
        return validElements;
    };
    EventWindow.prototype.getValueFromElement = function (element) {
        var value;
        if (element.classList.contains('e-datepicker')) {
            value = element.ej2_instances[0].value;
        }
        else if (element.classList.contains('e-datetimepicker')) {
            value = element.ej2_instances[0].value;
        }
        else if (element.classList.contains('e-dropdownlist')) {
            value = element.ej2_instances[0].value;
        }
        else if (element.classList.contains('e-multiselect')) {
            value = element.ej2_instances[0].value;
        }
        else if (element.classList.contains('e-checkbox')) {
            value = element.ej2_instances[0].checked;
        }
        else {
            if (element.type === 'checkbox') {
                value = element.checked;
            }
            else {
                value = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(element.value);
            }
        }
        return value;
    };
    EventWindow.prototype.setValueToElement = function (element, value) {
        if (element.classList.contains('e-datepicker')) {
            var instance = element.ej2_instances[0];
            instance.value = value;
            instance.dataBind();
        }
        else if (element.classList.contains('e-datetimepicker')) {
            var instance = element.ej2_instances[0];
            if (instance.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_START_CLASS"])) {
                this.eventWindowTime.startTime = new Date('' + value);
            }
            else {
                this.eventWindowTime.endTime = new Date('' + value);
            }
            instance.value = value;
            instance.dataBind();
        }
        else if (element.classList.contains('e-dropdownlist')) {
            var instance = element.ej2_instances[0];
            instance.value = value;
            instance.dataBind();
        }
        else if (element.classList.contains('e-multiselect')) {
            var instance = element.ej2_instances[0];
            instance.value = [];
            instance.value = ((value instanceof Array) ? value : [value]);
            instance.dataBind();
        }
        else if (element.classList.contains('e-checkbox')) {
            var instance = element.ej2_instances[0];
            instance.checked = value;
            instance.dataBind();
        }
        else {
            if (element.type !== 'checkbox') {
                element.value = value || '';
            }
            else {
                element.checked = value;
            }
        }
    };
    EventWindow.prototype.setDefaultValueToElement = function (element) {
        if (element.classList.contains('e-datepicker')) {
            var instance = element.ej2_instances[0];
            instance.value = this.parent.getCurrentTime();
            instance.dataBind();
        }
        else if (element.classList.contains('e-datetimepicker')) {
            var instance = element.ej2_instances[0];
            var dateValue = this.parent.getCurrentTime();
            this.eventWindowTime = { startTime: dateValue, endTime: dateValue };
            instance.value = dateValue;
            instance.dataBind();
        }
        else if (element.classList.contains('e-dropdownlist')) {
            var instance = element.ej2_instances[0];
            instance.value = null;
            instance.dataBind();
        }
        else if (element.classList.contains('e-multiselect')) {
            var instance = element.ej2_instances[0];
            instance.value = [];
            instance.dataBind();
        }
        else if (element.classList.contains('e-checkbox')) {
            var instance = element.ej2_instances[0];
            instance.checked = false;
            instance.dataBind();
        }
        else {
            if (element.type === 'checkbox') {
                element.checked = false;
            }
            else {
                element.value = '';
            }
        }
    };
    EventWindow.prototype.getInstance = function (className) {
        var element = this.element.querySelector('.' + className);
        return element ? element.ej2_instances[0] : null;
    };
    EventWindow.prototype.eventDelete = function () {
        switch (this.parent.currentAction) {
            case 'EditOccurrence':
                var fields = this.parent.eventFields;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeEventData.event[fields.recurrenceRule])) {
                    this.parent.currentAction = 'DeleteOccurrence';
                }
                else {
                    this.parent.currentAction = 'Delete';
                }
                break;
            case 'EditSeries':
                this.parent.currentAction = 'DeleteSeries';
                break;
            case 'Save':
                this.parent.currentAction = 'Delete';
                break;
        }
        this.isCrudAction = false;
        this.dialogObject.hide();
        this.parent.quickPopup.openDeleteAlert();
    };
    EventWindow.prototype.getRecurrenceEditorInstance = function () {
        if (this.parent.isAdaptive && !this.repeatDialogObject) {
            this.renderRepeatDialog();
        }
        return this.recurrenceEditor;
    };
    EventWindow.prototype.destroyComponents = function () {
        var formelement = this.getFormElements(_base_css_constant__WEBPACK_IMPORTED_MODULE_10__["EVENT_WINDOW_DIALOG_CLASS"]);
        for (var _i = 0, formelement_2 = formelement; _i < formelement_2.length; _i++) {
            var element = formelement_2[_i];
            var instance = void 0;
            if (element.classList.contains('e-datetimepicker')) {
                instance = element.ej2_instances;
            }
            else if (element.classList.contains('e-datepicker')) {
                instance = element.ej2_instances;
            }
            else if (element.classList.contains('e-checkbox')) {
                instance = element.ej2_instances;
            }
            else if (element.classList.contains('e-dropdownlist')) {
                instance = element.ej2_instances;
            }
            else if (element.classList.contains('e-multiselect')) {
                instance = element.ej2_instances;
            }
            if (instance && instance[0]) {
                instance[0].destroy();
            }
        }
        if (this.buttonObj) {
            this.buttonObj.destroy();
        }
    };
    /**
     * To destroy the event window.
     * @return {void}
     * @private
     */
    EventWindow.prototype.destroy = function () {
        if (!this.parent.isDestroyed) {
            this.resetEditorTemplate();
            this.updateEditorTemplate();
            this.parent.resetTemplates(['editorTemplate']);
        }
        if (this.recurrenceEditor) {
            this.recurrenceEditor.destroy();
        }
        this.destroyComponents();
        this.fieldValidator.destroy();
        if (this.repeatDialogObject) {
            this.repeatDialogObject.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.repeatDialogObject.element);
        }
        if (this.dialogObject) {
            this.dialogObject.destroy();
            this.dialogObject = null;
        }
        if (this.element) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.element = null;
        }
    };
    return EventWindow;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/form-validator.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/form-validator.js ***!
  \**************************************************************************************/
/*! exports provided: FieldValidator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldValidator", function() { return FieldValidator; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");



/**
 * Appointment window field validation
 */
var FieldValidator = /** @__PURE__ @class */ (function () {
    function FieldValidator() {
    }
    FieldValidator.prototype.renderFormValidator = function (form, rules, element) {
        var _this = this;
        this.element = element;
        this.formObj = new _ej2_inputs__WEBPACK_IMPORTED_MODULE_1__["FormValidator"](form, {
            customPlacement: function (inputElement, error) {
                _this.errorPlacement(inputElement, error);
            },
            rules: rules,
            validationComplete: function (args) {
                _this.validationComplete(args);
            },
            focusout: function (args) {
                _this.focusOut(args);
            }
        });
    };
    FieldValidator.prototype.focusOut = function (args) {
        var target = args.relatedTarget;
        if (target && (target.classList.contains('e-dlg-closeicon-btn') || target.classList.contains('e-close')
            || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ALLDAY_CELLS_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["HEADER_CELLS_CLASS"])
            || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["QUICK_POPUP_EVENT_DETAILS_CLASS"]) || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["WORK_CELLS_CLASS"])
            || target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["EVENT_WINDOW_CANCEL_BUTTON_CLASS"]))) {
            this.ignoreError = true;
        }
        else {
            this.ignoreError = false;
        }
    };
    FieldValidator.prototype.validationComplete = function (args) {
        var elem = this.element.querySelector('#' + args.inputName + '_Error');
        if (elem) {
            elem.style.display = (args.status === 'failure') ? '' : 'none';
        }
    };
    FieldValidator.prototype.errorPlacement = function (inputElement, error) {
        var id = error.getAttribute('for');
        var elem = this.element.querySelector('#' + id + '_Error');
        if (!elem && !this.ignoreError) {
            this.createTooltip(inputElement, error, id, '');
        }
    };
    FieldValidator.prototype.createTooltip = function (element, error, name, display) {
        var dlgContent;
        var client;
        var inputClient = element.getBoundingClientRect();
        if (this.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_2__["POPUP_WRAPPER_CLASS"])) {
            dlgContent = this.element;
            client = this.element.getBoundingClientRect();
        }
        else {
            dlgContent = this.element.querySelector('.e-schedule-dialog .e-dlg-content');
            client = dlgContent.getBoundingClientRect();
        }
        var div = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: 'e-tooltip-wrap e-popup ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ERROR_VALIDATION_CLASS"],
            id: name + '_Error',
            styles: 'display:' + display + ';top:' +
                (inputClient.bottom - client.top + dlgContent.scrollTop + 9) + 'px;left:' +
                (inputClient.left - client.left + dlgContent.scrollLeft + inputClient.width / 2) + 'px;'
        });
        var content = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-tip-content' });
        content.appendChild(error);
        var arrow = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-arrow-tip e-tip-top' });
        arrow.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-arrow-tip-outer e-tip-top' }));
        arrow.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-arrow-tip-inner e-tip-top' }));
        div.appendChild(content);
        div.appendChild(arrow);
        dlgContent.appendChild(div);
        div.style.left = (parseInt(div.style.left, 10) - div.offsetWidth / 2) + 'px';
    };
    FieldValidator.prototype.destroyToolTip = function () {
        if (this.element) {
            var elements = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_2__["ERROR_VALIDATION_CLASS"]));
            for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
                var elem = elements_1[_i];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(elem);
            }
        }
        if (this.formObj && this.formObj.element) {
            this.formObj.reset();
        }
    };
    /**
     * @hidden
     */
    FieldValidator.prototype.destroy = function () {
        if (this.formObj && this.formObj.element && !this.formObj.isDestroyed) {
            this.formObj.destroy();
        }
    };
    return FieldValidator;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/quick-popups.js":
/*!************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/quick-popups.js ***!
  \************************************************************************************/
/*! exports provided: QuickPopups */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickPopups", function() { return QuickPopups; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_inputs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ej2-inputs */ "./ej2-resources/18.4.46/scripts/ej2-inputs/index.js");
/* harmony import */ var _form_validator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./form-validator */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/form-validator.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");










var EVENT_FIELD = 'e-field';
/**
 * Quick Popups interactions
 */
var QuickPopups = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for QuickPopups
     */
    function QuickPopups(parent) {
        this.isMultipleEventSelect = false;
        this.isCrudAction = false;
        this.parent = parent;
        this.l10n = this.parent.localeObj;
        this.fieldValidator = new _form_validator__WEBPACK_IMPORTED_MODULE_4__["FieldValidator"]();
        this.render();
        this.addEventListener();
    }
    QuickPopups.prototype.render = function () {
        this.renderQuickPopup();
        this.renderMorePopup();
        this.renderQuickDialog();
    };
    QuickPopups.prototype.renderQuickPopup = function () {
        var quickPopupWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_WRAPPER_CLASS"] + ' e-popup-close' });
        if (this.parent.isAdaptive) {
            document.body.appendChild(quickPopupWrapper);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([quickPopupWrapper], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DEVICE_CLASS"]);
        }
        else {
            this.parent.element.appendChild(quickPopupWrapper);
        }
        this.quickPopup = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](quickPopupWrapper, {
            targetType: (this.parent.isAdaptive ? 'container' : 'relative'),
            enableRtl: this.parent.enableRtl,
            open: this.quickPopupOpen.bind(this),
            close: this.quickPopupClose.bind(this),
            hideAnimation: (this.parent.isAdaptive ? { name: 'ZoomOut' } : { name: 'FadeOut', duration: 150 }),
            showAnimation: (this.parent.isAdaptive ? { name: 'ZoomIn' } : { name: 'FadeIn', duration: 150 }),
            collision: (this.parent.isAdaptive ? { X: 'fit', Y: 'fit' } :
                (this.parent.enableRtl ? { X: 'flip', Y: 'fit' } : { X: 'none', Y: 'fit' })),
            position: (this.parent.isAdaptive || this.parent.enableRtl ? { X: 'left', Y: 'top' } : { X: 'right', Y: 'top' }),
            viewPortElement: (this.parent.isAdaptive ? document.body : this.parent.element),
            zIndex: (this.parent.isAdaptive ? 1004 : 3)
        });
        this.quickPopup.isStringTemplate = true;
    };
    QuickPopups.prototype.renderMorePopup = function () {
        var moreEventPopup = "<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"] + "\"><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_CLASS"] + "\">" +
            ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CLOSE_CLASS"] + "\" title=\"" + this.l10n.getConstant('close') + "\" tabindex=\"0\"></div>") +
            ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_DATE_HEADER_CLASS"] + "\"><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DAY_CLASS"] + "\"></div>") +
            ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DATE_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["NAVIGATE_CLASS"] + "\" tabindex=\"0\"></div></div></div></div>");
        var moreEventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_POPUP_WRAPPER_CLASS"] + ' e-popup-close',
            innerHTML: moreEventPopup
        });
        if (this.parent.isAdaptive) {
            document.body.appendChild(moreEventWrapper);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([moreEventWrapper], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DEVICE_CLASS"]);
        }
        else {
            this.parent.element.appendChild(moreEventWrapper);
        }
        this.morePopup = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Popup"](moreEventWrapper, {
            targetType: (this.parent.isAdaptive ? 'container' : 'relative'),
            enableRtl: this.parent.enableRtl,
            hideAnimation: { name: 'ZoomOut', duration: 300 },
            showAnimation: { name: 'ZoomIn', duration: 300 },
            open: this.morePopupOpen.bind(this),
            close: this.morePopupClose.bind(this),
            collision: (this.parent.isAdaptive ? { X: 'fit', Y: 'fit' } :
                (this.parent.enableRtl ? { X: 'flip', Y: 'fit' } : { X: 'flip', Y: 'flip' })),
            viewPortElement: (this.parent.isAdaptive ? document.body : this.parent.element),
            zIndex: (this.parent.isAdaptive ? 1002 : 2)
        });
        this.morePopup.isStringTemplate = true;
        var closeButton = this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CLOSE_CLASS"]);
        this.renderButton('e-round', _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_ICON_CLASS"], false, closeButton, this.closeClick);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DATE_CLASS"]), 'click', this.navigationClick, this);
    };
    QuickPopups.prototype.renderQuickDialog = function () {
        var buttonModel = [
            { buttonModel: { cssClass: 'e-quick-alertok e-flat', isPrimary: true }, click: this.dialogButtonClick.bind(this) },
            { buttonModel: { cssClass: 'e-quick-alertcancel e-flat', isPrimary: false }, click: this.dialogButtonClick.bind(this) },
            {
                buttonModel: { cssClass: 'e-quick-dialog-cancel e-disable e-flat', isPrimary: false },
                click: this.dialogButtonClick.bind(this)
            }
        ];
        if (this.parent.eventSettings.editFollowingEvents) {
            var followingSeriesButton = {
                buttonModel: { cssClass: 'e-quick-alertfollowing e-flat', isPrimary: false }, click: this.dialogButtonClick.bind(this)
            };
            buttonModel.splice(1, 0, followingSeriesButton);
        }
        this.quickDialog = new _ej2_popups__WEBPACK_IMPORTED_MODULE_1__["Dialog"]({
            animationSettings: { effect: 'Zoom' },
            buttons: buttonModel,
            cssClass: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CLASS"],
            closeOnEscape: true,
            enableRtl: this.parent.enableRtl,
            beforeClose: this.beforeQuickDialogClose.bind(this),
            isModal: true,
            position: { X: 'center', Y: 'center' },
            showCloseIcon: true,
            target: document.body,
            visible: false,
            width: 'auto'
        });
        var dialogElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { id: this.parent.element.id + 'QuickDialog' });
        this.parent.element.appendChild(dialogElement);
        this.quickDialog.appendTo(dialogElement);
        this.quickDialog.isStringTemplate = true;
        var okButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        if (okButton) {
            okButton.setAttribute('aria-label', this.l10n.getConstant('occurrence'));
            okButton.setAttribute('aria-label', okButton.innerHTML);
        }
        var cancelButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        if (cancelButton) {
            cancelButton.setAttribute('aria-label', this.l10n.getConstant('series'));
            cancelButton.setAttribute('aria-label', cancelButton.innerHTML);
        }
        if (this.quickDialog.element.querySelector('.e-dlg-closeicon-btn')) {
            this.quickDialog.element.querySelector('.e-dlg-closeicon-btn').setAttribute('title', this.l10n.getConstant('close'));
        }
    };
    QuickPopups.prototype.renderButton = function (className, iconName, isDisabled, element, clickEvent) {
        var buttonObj = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_2__["Button"]({
            cssClass: className,
            disabled: isDisabled,
            enableRtl: this.parent.enableRtl,
            iconCss: iconName
        });
        buttonObj.appendTo(element);
        buttonObj.isStringTemplate = true;
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', clickEvent, this);
    };
    QuickPopups.prototype.quickDialogClass = function (action) {
        var classList = [
            _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_OCCURRENCE_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_SERIES_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_DELETE_CLASS"],
            _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CANCEL_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_BTN_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]
        ];
        var okButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        var cancelButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        var followingEventButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_FOLLOWING"]);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([okButton, cancelButton], classList);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CANCEL_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
        if (this.parent.eventSettings.editFollowingEvents) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([followingEventButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.quickDialog.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["FOLLOWING_EVENTS_DIALOG"]);
        }
        switch (action) {
            case 'Recurrence':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([okButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_OCCURRENCE_CLASS"]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_SERIES_CLASS"]);
                if (this.parent.eventSettings.editFollowingEvents) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([followingEventButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.quickDialog.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["FOLLOWING_EVENTS_DIALOG"]);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([followingEventButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_FOLLOWING_EVENTS_CLASS"]);
                }
                break;
            case 'Delete':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([okButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_DELETE_CLASS"]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CANCEL_CLASS"]);
                break;
            case 'Alert':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([okButton], [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_BTN_CLASS"]]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]]);
                break;
        }
    };
    QuickPopups.prototype.applyFormValidation = function () {
        var form = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["FORM_CLASS"]);
        var rules = {};
        rules[this.parent.eventSettings.fields.subject.name] = this.parent.eventSettings.fields.subject.validation;
        this.fieldValidator.renderFormValidator(form, rules, this.quickPopup.element);
    };
    QuickPopups.prototype.openRecurrenceAlert = function () {
        var editDeleteOnly = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        if (editDeleteOnly) {
            editDeleteOnly.innerHTML = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteEvent' : 'editEvent');
            editDeleteOnly.setAttribute('aria-label', editDeleteOnly.innerHTML);
        }
        var editFollowingEventsOnly = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_FOLLOWING"]);
        if (editFollowingEventsOnly) {
            editFollowingEventsOnly.innerHTML = this.l10n.getConstant('editFollowingEvent');
            editFollowingEventsOnly.setAttribute('aria-label', editFollowingEventsOnly.innerHTML);
        }
        var editDeleteSeries = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        if (editDeleteSeries) {
            editDeleteSeries.innerHTML = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteSeries' : 'editSeries');
            editDeleteSeries.setAttribute('aria-label', editDeleteSeries.innerHTML);
        }
        this.quickDialog.content = this.l10n.getConstant('editContent');
        this.quickDialog.header = this.l10n.getConstant(this.parent.currentAction === 'Delete' ? 'deleteTitle' : 'editTitle');
        this.quickDialogClass('Recurrence');
        var activeEvent = this.parent.activeEventData.event;
        if (this.parent.eventSettings.editFollowingEvents && this.parent.currentAction === 'EditOccurrence'
            && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(activeEvent[this.parent.eventFields.recurrenceID]) && activeEvent[this.parent.eventFields.recurrenceID]
            !== activeEvent[this.parent.eventFields.id]) {
            var followingEventButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_FOLLOWING"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([followingEventButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
        }
        this.showQuickDialog('RecurrenceAlert');
    };
    QuickPopups.prototype.openRecurrenceValidationAlert = function (type) {
        this.quickDialogClass('Alert');
        var okButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        okButton.innerHTML = this.l10n.getConstant('ok');
        okButton.setAttribute('aria-label', okButton.innerHTML);
        var cancelButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        cancelButton.innerHTML = this.l10n.getConstant('cancel');
        cancelButton.setAttribute('aria-label', cancelButton.innerHTML);
        this.quickDialog.header = this.l10n.getConstant('alert');
        switch (type) {
            case 'wrongPattern':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
                this.quickDialog.content = this.l10n.getConstant('wrongPattern');
                break;
            case 'createError':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
                this.quickDialog.content = this.l10n.getConstant('createError');
                break;
            case 'sameDayAlert':
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([cancelButton], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
                this.quickDialog.content = this.l10n.getConstant('sameDayAlert');
                break;
            case 'seriesChangeAlert':
                var dialogCancel = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CANCEL_CLASS"]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([cancelButton, dialogCancel], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]);
                this.quickDialog.content = this.l10n.getConstant('seriesChangeAlert');
                okButton.innerHTML = this.l10n.getConstant('yes');
                cancelButton.innerHTML = this.l10n.getConstant('no');
                dialogCancel.innerHTML = this.l10n.getConstant('cancel');
                break;
        }
        if ((!this.parent.enableRecurrenceValidation && type === 'wrongPattern') || this.parent.enableRecurrenceValidation) {
            this.showQuickDialog('RecurrenceValidationAlert');
        }
    };
    QuickPopups.prototype.openDeleteAlert = function () {
        if (this.parent.activeViewOptions.readonly) {
            return;
        }
        var okButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        if (okButton) {
            okButton.innerHTML = this.l10n.getConstant('delete');
            okButton.setAttribute('aria-label', okButton.innerHTML);
        }
        var cancelButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        if (cancelButton) {
            cancelButton.innerHTML = this.l10n.getConstant('cancel');
            cancelButton.setAttribute('aria-label', cancelButton.innerHTML);
        }
        this.quickDialog.content = (this.parent.activeEventData.event.length > 1) ?
            this.l10n.getConstant('deleteMultipleContent') : this.l10n.getConstant('deleteContent');
        this.quickDialog.header = (this.parent.activeEventData.event.length > 1) ?
            this.l10n.getConstant('deleteMultipleEvent') : this.l10n.getConstant('deleteEvent');
        this.quickDialogClass('Delete');
        this.showQuickDialog('DeleteAlert');
    };
    QuickPopups.prototype.openValidationError = function (type, eventData) {
        this.quickDialog.header = this.l10n.getConstant('alert');
        this.quickDialog.content = this.l10n.getConstant(type);
        var okButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]);
        if (okButton) {
            okButton.innerHTML = this.l10n.getConstant('ok');
            okButton.setAttribute('aria-label', okButton.innerHTML);
        }
        var cancelButton = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        if (cancelButton) {
            cancelButton.innerHTML = this.l10n.getConstant('cancel');
            okButton.setAttribute('aria-label', cancelButton.innerHTML);
        }
        this.quickDialogClass('Alert');
        this.showQuickDialog('ValidationAlert', eventData);
    };
    QuickPopups.prototype.showQuickDialog = function (popupType, eventData) {
        var _this = this;
        this.quickDialog.dataBind();
        var eventProp = {
            type: popupType, cancel: false, data: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, (eventData || this.parent.activeEventData.event), null, true),
            element: this.quickDialog.element
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["popupOpen"], eventProp, function (popupArgs) {
            if (!popupArgs.cancel) {
                _this.quickDialog.show();
            }
        });
    };
    QuickPopups.prototype.createMoreEventList = function (eventCollection, groupOrder, groupIndex) {
        var _this = this;
        var fields = this.parent.eventFields;
        var moreEventContentEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CONTENT_CLASS"] });
        var moreEventWrapperEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_WRAPPER_CLASS"] });
        if (eventCollection.length === 0) {
            moreEventWrapperEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CONTENT_CLASS"],
                innerHTML: this.l10n.getConstant('emptyContainer')
            });
        }
        else {
            var _loop_1 = function (eventData) {
                var eventText = (eventData[fields.subject] || this_1.parent.eventSettings.fields.subject.default);
                var appointmentElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"],
                    attrs: {
                        'data-id': '' + eventData[fields.id],
                        'data-guid': eventData.Guid, 'role': 'button', 'tabindex': '0',
                        'aria-readonly': this_1.parent.eventBase.getReadonlyAttribute(eventData),
                        'aria-selected': 'false', 'aria-grabbed': 'true', 'aria-label': this_1.parent.getAnnocementString(eventData)
                    }
                });
                var templateElement = void 0;
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this_1.parent.activeViewOptions.eventTemplate)) {
                    var tempId = this_1.parent.element.id + '_' + this_1.parent.activeViewOptions.eventTemplateName + 'eventTemplate';
                    var templateArgs = _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffsetToEvent"](eventData, this_1.parent.eventFields);
                    templateElement = this_1.parent.getAppointmentTemplate()(templateArgs, this_1.parent, 'eventTemplate', tempId, false);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(templateElement, appointmentElement);
                }
                else {
                    appointmentElement.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"], innerHTML: eventText }));
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
                    appointmentElement.setAttribute('data-group-index', groupIndex);
                }
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventData[fields.recurrenceRule])) {
                    var iconClass = (eventData[fields.id] === eventData[fields.recurrenceID]) ?
                        _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_RECURRENCE_ICON_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_RECURRENCE_EDIT_ICON_CLASS"];
                    appointmentElement.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + iconClass }));
                }
                var args = {
                    data: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, eventData, null, true),
                    element: appointmentElement, cancel: false
                };
                this_1.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventRendered"], args, function (eventArgs) {
                    if (!eventArgs.cancel) {
                        moreEventWrapperEle.appendChild(appointmentElement);
                        var isPreventCrud = _this.parent.isAdaptive || _this.parent.currentView === 'Year';
                        _this.parent.eventBase.wireAppointmentEvents(appointmentElement, eventData, isPreventCrud);
                        _this.parent.eventBase.applyResourceColor(appointmentElement, eventData, 'backgroundColor', groupOrder);
                    }
                });
            };
            var this_1 = this;
            for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {
                var eventData = eventCollection_1[_i];
                _loop_1(eventData);
            }
        }
        moreEventContentEle.appendChild(moreEventWrapperEle);
        return moreEventContentEle;
    };
    QuickPopups.prototype.tapHoldEventPopup = function (e) {
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"]);
        this.isMultipleEventSelect = false;
        this.parent.selectedElements = [];
        this.isMultipleEventSelect = true;
        this.parent.eventBase.getSelectedEventElements(target);
        this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();
        var guid = target.getAttribute('data-guid');
        var eventObj = this.parent.eventBase.getEventByGuid(guid);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(eventObj)) {
            return;
        }
        var eventTitle = (eventObj[this.parent.eventFields.subject] || this.l10n.getConstant('noTitle'));
        var eventTemplate = "<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MULTIPLE_EVENT_POPUP_CLASS"] + "\"><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_HEADER_CLASS"] + "\">" +
            ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"] + "\" title=\"" + this.l10n.getConstant('close') + "\"></button>") +
            ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"] + "\">" + eventTitle + "</div>") +
            ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"] + "\" title=\"" + this.l10n.getConstant('edit') + "\"></button>") +
            ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_CLASS"] + "\" title=\"" + this.l10n.getConstant('delete') + "\"></button></div></div>");
        this.quickPopup.element.innerHTML = eventTemplate;
        var closeIcon = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"]);
        this.renderButton('e-flat e-round e-small', _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_ICON_CLASS"], false, closeIcon, this.closeClick);
        var readonly = this.parent.activeViewOptions.readonly || eventObj[this.parent.eventFields.isReadonly];
        var editIcon = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"]);
        this.renderButton('e-flat e-round e-small', _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_ICON_CLASS"], readonly, editIcon, this.editClick);
        var deleteIcon = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_CLASS"]);
        this.renderButton('e-flat e-round e-small', _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_ICON_CLASS"], readonly, deleteIcon, this.deleteClick);
        this.beforeQuickPopupOpen(target);
    };
    QuickPopups.prototype.isCellBlocked = function (args) {
        var tempObj = {};
        tempObj[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;
        tempObj[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;
        tempObj[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            var targetCell = args.element instanceof Array ? args.element[0] : args.element;
            var groupIndex = parseInt(targetCell.getAttribute('data-group-index'), 10);
            this.parent.resourceBase.setResourceValues(tempObj, isNaN(groupIndex) ? null : groupIndex);
        }
        return this.parent.eventBase.isBlockRange(tempObj);
    };
    // tslint:disable-next-line:max-func-body-length
    QuickPopups.prototype.cellClick = function (args) {
        var date = new Date(args.startTime.getTime());
        if (!this.parent.showQuickInfo || !this.parent.eventSettings.allowAdding ||
            this.parent.currentView === 'MonthAgenda' || this.isCellBlocked(args) ||
            !this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {
            this.quickPopupHide();
            return;
        }
        var targetEle = args.event.target;
        if (this.parent.isAdaptive) {
            this.quickPopupHide();
            var newEventClone = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["NEW_EVENT_CLASS"]);
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(newEventClone)) {
                newEventClone = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["NEW_EVENT_CLASS"],
                    innerHTML: "<div class=\"e-title\">+ " + this.l10n.getConstant('newEvent') + "</div>"
                });
            }
            var targetCell = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(targetEle, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"]);
            if (targetCell) {
                targetCell.appendChild(newEventClone);
            }
            return;
        }
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(targetEle, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"] + ',.' +
            _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(target) || targetEle.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_INDICATOR_CLASS"])) {
            return;
        }
        var isSameTarget = this.quickPopup.relateTo === target;
        if (isSameTarget && this.quickPopup.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) {
            var subjectElement_1 = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]);
            if (subjectElement_1) {
                subjectElement_1.focus();
            }
            return;
        }
        this.resetQuickPopupTemplates();
        var temp = {};
        temp[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;
        temp[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;
        temp[this.parent.eventFields.isAllDay] = this.parent.activeCellsData.isAllDay;
        var quickCellPopup = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CELL_POPUP_CLASS"] });
        quickCellPopup.appendChild(this.getPopupHeader('Cell', temp));
        quickCellPopup.appendChild(this.getPopupContent('Cell', args, temp));
        quickCellPopup.appendChild(this.getPopupFooter('Cell', temp));
        var subjectElement = quickCellPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]);
        if (subjectElement) {
            _ej2_inputs__WEBPACK_IMPORTED_MODULE_3__["Input"].createInput({ element: subjectElement, properties: { placeholder: this.l10n.getConstant('addTitle') } });
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.eventSettings.fields.subject.default)) {
            subjectElement.value = this.parent.eventSettings.fields.subject.default;
        }
        var closeIcon = quickCellPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"]);
        if (closeIcon) {
            this.renderButton('e-flat e-round e-small', _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_ICON_CLASS"], false, closeIcon, this.popupClose);
        }
        var moreButton = quickCellPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_POPUP_EVENT_DETAILS_CLASS"]);
        if (moreButton) {
            this.renderButton('e-flat', '', false, moreButton, this.detailsClick);
        }
        var saveButton = quickCellPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_CREATE_CLASS"]);
        if (saveButton) {
            this.renderButton('e-flat e-primary', '', this.parent.activeViewOptions.readonly, saveButton, this.saveClick);
        }
        this.quickPopup.content = quickCellPopup;
        this.quickPopup.dataBind();
        this.applyFormValidation();
        if (this.morePopup) {
            this.morePopup.hide();
        }
        this.quickPopup.relateTo = target;
        this.beforeQuickPopupOpen(target);
    };
    QuickPopups.prototype.isSameEventClick = function (events) {
        var isSameTarget = this.quickPopup.relateTo === Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(events.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"]);
        if (isSameTarget && this.quickPopup.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) {
            var editIcon = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"]);
            if (editIcon) {
                editIcon.focus();
            }
            if (!this.parent.isAdaptive) {
                var editButton = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_EVENT_CLASS"]);
                if (editButton) {
                    editButton.focus();
                }
            }
            return true;
        }
        return false;
    };
    QuickPopups.prototype.isQuickTemplate = function (type) {
        return this.parent.quickInfoTemplates.templateType === 'Both' || this.parent.quickInfoTemplates.templateType === type;
    };
    QuickPopups.prototype.eventClick = function (events) {
        if (this.parent.eventTooltip) {
            this.parent.eventTooltip.close();
        }
        if (!this.parent.showQuickInfo) {
            return;
        }
        if (this.parent.isAdaptive && this.isMultipleEventSelect) {
            this.updateTapHoldEventPopup(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(events.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"]));
        }
        else {
            var isSameTarget = this.isSameEventClick(events);
            if (isSameTarget) {
                return;
            }
            this.resetQuickPopupTemplates();
            var eventData = events.event;
            var quickEventPopup = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_POPUP_CLASS"] });
            quickEventPopup.appendChild(this.getPopupHeader('Event', eventData));
            quickEventPopup.appendChild(this.getPopupContent('Event', events, eventData));
            quickEventPopup.appendChild(this.getPopupFooter('Event', eventData));
            var readonly = this.parent.activeViewOptions.readonly || eventData[this.parent.eventFields.isReadonly];
            var editAction = !this.parent.eventSettings.allowEditing || readonly;
            var deleteAction = !this.parent.eventSettings.allowDeleting || readonly;
            var editIcon = quickEventPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"]);
            var buttonClass = 'e-flat e-round e-small';
            if (editIcon) {
                this.renderButton(buttonClass, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_ICON_CLASS"], editAction, editIcon, this.editClick);
            }
            var deleteIcon = quickEventPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_CLASS"]);
            if (deleteIcon) {
                this.renderButton(buttonClass, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_ICON_CLASS"], deleteAction, deleteIcon, this.deleteClick);
            }
            var closeIcon = quickEventPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"]);
            if (closeIcon) {
                this.renderButton(buttonClass, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_ICON_CLASS"], false, closeIcon, this.popupClose);
            }
            var editButton = quickEventPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_EVENT_CLASS"]);
            if (editButton) {
                this.renderButton('e-flat e-primary', '', editAction, editButton, this.editClick);
            }
            var deleteButton = quickEventPopup.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_EVENT_CLASS"]);
            if (deleteButton) {
                this.renderButton('e-flat', '', deleteAction, deleteButton, this.deleteClick);
            }
            this.quickPopup.content = quickEventPopup;
            this.quickPopup.dataBind();
            if (this.morePopup && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(events.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_WRAPPER_CLASS"])) {
                this.morePopup.hide();
            }
            this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(events.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"]);
            this.beforeQuickPopupOpen(events.element);
        }
    };
    QuickPopups.prototype.getPopupHeader = function (headerType, headerData) {
        var headerTemplate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_HEADER_CLASS"] });
        if (this.isQuickTemplate(headerType) && this.parent.quickInfoTemplates.header) {
            var headerArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, headerData, !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? { elementType: headerType.toLowerCase() } :
                {
                    elementType: headerType.toLowerCase(),
                    startTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](headerData[this.parent.eventFields.startTime]),
                    endTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](headerData[this.parent.eventFields.endTime])
                }, true);
            var templateId = this.parent.element.id;
            var headerTemp = [].slice.call(this.parent.getQuickInfoTemplatesHeader()(headerArgs, this.parent, 'header', templateId + '_headerTemplate', false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(headerTemp), headerTemplate);
        }
        else {
            var header = void 0;
            switch (headerType) {
                case 'Cell':
                    header = "<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_HEADER_ICON_WRAPPER"] + "\"><button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"] + "\" title=" +
                        ("\"" + this.l10n.getConstant('close') + "\"></button></div>");
                    break;
                case 'Event':
                    var args = this.getFormattedString(headerData);
                    header = "<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_HEADER_ICON_WRAPPER"] + "\">" +
                        ("<button class=\"" + (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"]) + "\" title=\"" + this.l10n.getConstant('edit') + "\"></button>") +
                        ("<button class=\"" + (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"]) + "\" title=\"" + this.l10n.getConstant('delete') + "\"></button>") +
                        ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CLOSE_CLASS"] + "\" title=\"" + this.l10n.getConstant('close') + "\"></button></div>") +
                        ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_WRAP"] + "\"><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\" ") +
                        ("title=\"" + args.eventSubject + "\">" + args.eventSubject + "</div></div >");
                    break;
            }
            var templateWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { innerHTML: header });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(templateWrapper.childNodes), headerTemplate);
        }
        return headerTemplate;
    };
    QuickPopups.prototype.getPopupContent = function (type, args, data) {
        var contentTemplate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_CONTENT_CLASS"] });
        if (this.isQuickTemplate(type) && this.parent.quickInfoTemplates.content) {
            var contentArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, data, !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? { elementType: type.toLowerCase() } :
                {
                    elementType: type.toLowerCase(),
                    startTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](data[this.parent.eventFields.startTime]),
                    endTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](data[this.parent.eventFields.endTime])
                }, true);
            var templateId = this.parent.element.id;
            var contentTemp = [].slice.call(this.parent.getQuickInfoTemplatesContent()(contentArgs, this.parent, 'content', templateId + '_contentTemplate', false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(contentTemp), contentTemplate);
        }
        else {
            var content = void 0;
            var resourceText = this.getResourceText(args, type.toLowerCase());
            switch (type) {
                case 'Cell':
                    var cellDetails = this.getFormattedString(data);
                    content = "<table class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_TABLE_CLASS"] + "\"><tbody><tr><td><form class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["FORM_CLASS"] + "\" onsubmit=" +
                        ("\"return false;\"><input class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"] + " " + EVENT_FIELD + "\" type=\"text\" name=") +
                        ("\"" + this.parent.eventFields.subject + "\" /></form></td></tr><tr><td><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_CLASS"] + "\">") +
                        ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_ICON_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + "\"></div><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_DETAILS_CLASS"] + " ") +
                        (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\">" + cellDetails.details + "</div></div>") +
                        ((this.parent.activeViewOptions.group.resources.length > 0 ? "<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_CLASS"] + "\">" +
                            ("<div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_ICON_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + " \"></div><div class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_DETAILS_CLASS"] + " ") +
                            (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\">" + resourceText + "</div></div>") : '') + "</td></tr></tbody></table>");
                    break;
                case 'Event':
                    var args_1 = this.getFormattedString(data);
                    content = '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_CLASS"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_ICON_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] +
                        '"></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_WRAPPER_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '"><div class="' +
                        _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_TIME_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' + args_1.details + '</div>';
                    if (data[this.parent.eventFields.recurrenceRule]) {
                        content += '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RECURRENCE_SUMMARY_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' +
                            this.getRecurrenceSummary(data) + '</div>';
                    }
                    content += '</div></div>';
                    if (data[this.parent.eventFields.location]) {
                        content += '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["LOCATION_CLASS"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["LOCATION_ICON_CLASS"] + ' ' +
                            _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + '"></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["LOCATION_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' +
                            data[this.parent.eventFields.location] + '</div></div>';
                    }
                    if (data[this.parent.eventFields.startTimezone] || data[this.parent.eventFields.endTimezone]) {
                        content += '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_ZONE_CLASS"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_ZONE_ICON_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] +
                            '"></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_ZONE_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' +
                            this.getTimezone(data) + '</div></div>';
                    }
                    if (data[this.parent.eventFields.description]) {
                        content += '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DESCRIPTION_CLASS"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DESCRIPTION_ICON_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] +
                            '"></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DESCRIPTION_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' +
                            data[this.parent.eventFields.description] + '</div></div>';
                    }
                    if (this.parent.resourceCollection.length > 0) {
                        content += '<div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_CLASS"] + '"><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_ICON_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] +
                            '"></div><div class="' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + '">' +
                            resourceText + '</div></div>';
                    }
                    break;
            }
            var templateWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { innerHTML: content });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(templateWrapper.childNodes), contentTemplate);
        }
        return contentTemplate;
    };
    QuickPopups.prototype.getPopupFooter = function (footerType, footerData) {
        var footerTemplate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_FOOTER_CLASS"] });
        if (this.isQuickTemplate(footerType) && this.parent.quickInfoTemplates.footer) {
            var footerArgs = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, footerData, !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? { elementType: footerType.toLowerCase() } :
                {
                    elementType: footerType.toLowerCase(),
                    startTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](footerData[this.parent.eventFields.startTime]),
                    endTimeValue: _base_util__WEBPACK_IMPORTED_MODULE_7__["addLocalOffset"](footerData[this.parent.eventFields.endTime])
                }, true);
            var templateId = this.parent.element.id;
            var footerTemp = [].slice.call(this.parent.getQuickInfoTemplatesFooter()(footerArgs, this.parent, 'footer', templateId + '_footerTemplate', false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(footerTemp), footerTemplate);
        }
        else {
            var footer = void 0;
            switch (footerType) {
                case 'Cell':
                    footer = "<button class=\"" + (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_POPUP_EVENT_DETAILS_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"]) + "\" title=" +
                        ("\"" + this.l10n.getConstant('moreDetails') + "\">" + this.l10n.getConstant('moreDetails') + "</button>") +
                        ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_CREATE_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\" title=\"" + this.l10n.getConstant('save') + "\">") +
                        (this.l10n.getConstant('save') + "</button>");
                    break;
                case 'Event':
                    footer = "" + (this.parent.isAdaptive ? '' : "<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_EVENT_CLASS"] + " " +
                        (_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\" title=\"" + this.l10n.getConstant('edit') + "\">" + this.l10n.getConstant('edit') + "</button>") +
                        ("<button class=\"" + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DELETE_EVENT_CLASS"] + " " + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"] + "\" title=\"" + this.l10n.getConstant('delete') + "\">") +
                        (this.l10n.getConstant('delete') + "</button>"));
                    break;
            }
            var templateWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { innerHTML: footer });
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(templateWrapper.childNodes), footerTemplate);
        }
        return footerTemplate;
    };
    QuickPopups.prototype.getResourceText = function (args, type) {
        if (this.parent.resourceCollection.length === 0) {
            return null;
        }
        var resourceValue = '';
        if (this.parent.activeViewOptions.group.resources.length === 0) {
            var resourceCollection_1 = this.parent.resourceBase.resourceCollection.slice(-1)[0];
            var resourceData = resourceCollection_1.dataSource;
            var resourceIndex = 0;
            if (type === 'event') {
                var eventData = args.event;
                var _loop_2 = function (data) {
                    var resourceId = eventData[resourceCollection_1.field];
                    if (resourceId instanceof Array) {
                        if (resourceId.indexOf(data[resourceCollection_1.idField]) > -1) {
                            var id_1 = resourceId[resourceId.indexOf(data[resourceCollection_1.idField])];
                            var resource = resourceData.filter(function (e) {
                                return e[resourceCollection_1.idField] === id_1;
                            })[0];
                            resourceValue += (resourceValue === '') ? resource[resourceCollection_1.textField] :
                                ', ' + resource[resourceCollection_1.textField];
                        }
                    }
                    else if (data[resourceCollection_1.idField] === resourceId) {
                        resourceValue = data[resourceCollection_1.textField].toString();
                    }
                };
                for (var _i = 0, resourceData_1 = resourceData; _i < resourceData_1.length; _i++) {
                    var data = resourceData_1[_i];
                    _loop_2(data);
                }
            }
            else {
                resourceValue = resourceData[0][resourceCollection_1.textField].toString();
            }
        }
        else {
            if (type === 'event') {
                var eventData = args.event;
                var resourceData = void 0;
                var lastResource_1;
                for (var i = this.parent.resourceBase.resourceCollection.length - 1; i >= 0; i--) {
                    resourceData = eventData[this.parent.resourceBase.resourceCollection[i].field];
                    if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceData)) {
                        lastResource_1 = this.parent.resourceBase.resourceCollection[i];
                        break;
                    }
                }
                if (!Array.isArray(resourceData)) {
                    resourceData = [resourceData];
                }
                var resNames_1 = [];
                var lastResourceData_1 = lastResource_1.dataSource;
                resourceData.map(function (value) {
                    var text;
                    var i = _base_util__WEBPACK_IMPORTED_MODULE_7__["findIndexInData"](lastResourceData_1, lastResource_1.idField, value);
                    if (i > -1) {
                        text = lastResourceData_1[i][lastResource_1.textField];
                    }
                    if (text) {
                        resNames_1.push(text);
                    }
                });
                resourceValue = resNames_1.join(', ');
            }
            else {
                var argsData = args;
                var groupIndex = !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(argsData.groupIndex) ? argsData.groupIndex : 0;
                var resourceDetails = this.parent.resourceBase.lastResourceLevel[groupIndex];
                resourceValue = resourceDetails.resourceData[resourceDetails.resource.textField];
            }
        }
        return resourceValue;
    };
    QuickPopups.prototype.getFormattedString = function (eventData) {
        var fields = this.parent.eventFields;
        var eventSubject = (eventData[fields.subject] || this.l10n.getConstant('noTitle'));
        var startDate = eventData[fields.startTime];
        var endDate = eventData[fields.endTime];
        var format = 'MMMM d, y';
        var startDateDetails = this.getDateFormat(startDate, 'long', format);
        var endDateDetails = (eventData[fields.isAllDay] && endDate.getHours() === 0 && endDate.getMinutes() === 0) ?
            this.getDateFormat(_base_util__WEBPACK_IMPORTED_MODULE_7__["addDays"](new Date(endDate.getTime()), -1), 'long', format) :
            this.getDateFormat(endDate, 'long', format);
        var startTimeDetail = this.parent.getTimeString(startDate);
        var endTimeDetail = this.parent.getTimeString(endDate);
        var details = '';
        var spanLength = endDate.getDate() !== startDate.getDate() &&
            (endDate.getTime() - startDate.getTime()) / (60 * 60 * 1000) < 24 ? 1 : 0;
        if (eventData[fields.isAllDay]) {
            details = startDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';
            if (((endDate.getTime() - startDate.getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_7__["MS_PER_DAY"]) > 1) {
                details += '&nbsp;-&nbsp;' + endDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';
            }
        }
        else if ((((endDate.getTime() - startDate.getTime()) / _base_util__WEBPACK_IMPORTED_MODULE_7__["MS_PER_DAY"]) >= 1) || spanLength > 0) {
            details = startDateDetails + ' (' + startTimeDetail + ')' + '&nbsp;-&nbsp;' + endDateDetails + ' (' + endTimeDetail + ')';
        }
        else {
            details = startDateDetails + ' (' + (startTimeDetail + '&nbsp;-&nbsp;' + endTimeDetail) + ')';
        }
        return { eventSubject: eventSubject, details: details };
    };
    QuickPopups.prototype.moreEventClick = function (data, endDate, groupIndex) {
        var _this = this;
        this.quickPopupHide(true);
        var moreEventContentEle = this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CONTENT_CLASS"]);
        if (moreEventContentEle) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(moreEventContentEle);
        }
        var selectedDate = ((data.date).getTime()).toString();
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(data.element, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_INDICATOR_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]);
        var day = this.parent.globalize.formatDate(data.date, { format: 'E', calendar: this.parent.getCalendarMode() });
        this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DAY_CLASS"]).innerHTML = _base_util__WEBPACK_IMPORTED_MODULE_7__["capitalizeFirstWord"](day, 'single');
        var dateElement = this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DATE_CLASS"]);
        dateElement.innerHTML = this.getDateFormat(data.date, 'd', 'd');
        dateElement.setAttribute('data-date', selectedDate);
        dateElement.setAttribute('data-end-date', endDate.getTime().toString());
        var groupOrder;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
            dateElement.setAttribute('data-group-index', groupIndex);
            groupOrder = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)].groupOrder;
        }
        var moreEventElements = this.createMoreEventList(data.event, groupOrder, groupIndex);
        this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"]).appendChild(moreEventElements);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_DATE_HEADER_CLASS"]).childNodes, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENTDATE_CLASS"]);
        if (_base_util__WEBPACK_IMPORTED_MODULE_7__["resetTime"](data.date).getTime() === _base_util__WEBPACK_IMPORTED_MODULE_7__["resetTime"](this.parent.getCurrentTime()).getTime()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_DATE_HEADER_CLASS"]).childNodes, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENTDATE_CLASS"]);
        }
        if (!this.parent.isAdaptive) {
            if (this.parent.currentView.indexOf('Timeline') !== -1) {
                var gIndex = target.getAttribute('data-group-index');
                var startDate = new Date(parseInt(target.getAttribute('data-start-date'), 10));
                startDate.setHours(startDate.getHours(), startDate.getMinutes(), 0);
                var tdDate = this.parent.getMsFromDate(startDate).toString();
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(gIndex)) {
                    this.morePopup.relateTo = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] +
                        ' tbody tr td[data-date="' + tdDate + '"]');
                }
                else {
                    this.morePopup.relateTo = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] +
                        ' tbody tr td[data-group-index="' + gIndex + '"][data-date="' + tdDate + '"]');
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.morePopup.relateTo)) {
                        var workCells = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] +
                            ' tbody tr td[data-group-index="' + gIndex + '"]'));
                        for (var i = 0; i < workCells.length; i++) {
                            var date = workCells[i].getAttribute('data-date');
                            if (date < tdDate) {
                                this.morePopup.relateTo = workCells[i];
                            }
                        }
                    }
                }
            }
            else {
                this.morePopup.relateTo = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]);
            }
        }
        this.parent.renderTemplates();
        var eventProp = { type: 'EventContainer', cancel: false, element: this.morePopup.element };
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            eventProp.data = data;
        }
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["popupOpen"], eventProp, function (popupArgs) {
            if (!popupArgs.cancel) {
                _this.morePopup.show();
            }
        });
    };
    QuickPopups.prototype.saveClick = function () {
        this.isCrudAction = true;
        this.quickPopupHide();
    };
    QuickPopups.prototype.detailsClick = function () {
        var subjectEle = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]);
        if (subjectEle && subjectEle.value !== '') {
            var args = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(this.parent.activeCellsData, { subject: subjectEle.value });
        }
        this.isCrudAction = false;
        this.fieldValidator.destroyToolTip();
        this.quickPopupHide();
        this.parent.eventWindow.openEditor(this.parent.activeCellsData, 'Add');
    };
    QuickPopups.prototype.editClick = function () {
        this.quickPopupHide(true);
        var data = this.parent.activeEventData.event;
        this.parent.currentAction = 'EditSeries';
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[this.parent.eventFields.recurrenceRule])) {
            this.parent.currentAction = 'EditOccurrence';
            this.openRecurrenceAlert();
        }
        else {
            this.parent.eventWindow.openEditor(data, this.parent.currentAction);
        }
    };
    QuickPopups.prototype.deleteClick = function () {
        this.quickPopupHide(true);
        this.parent.currentAction = 'Delete';
        if (this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]) {
            this.openRecurrenceAlert();
        }
        else {
            this.openDeleteAlert();
        }
    };
    QuickPopups.prototype.updateMoreEventContent = function () {
        if (this.morePopup.element.classList.contains('e-popup-close')) {
            return;
        }
        var moreEventContentEle = this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_CONTENT_CLASS"]);
        if (moreEventContentEle) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(moreEventContentEle);
        }
        var dateElement = this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DATE_CLASS"]);
        var startDate = new Date(parseInt(dateElement.getAttribute('data-date'), 10));
        var endDate = new Date(parseInt(dateElement.getAttribute('data-end-date'), 10));
        var groupIndex = dateElement.getAttribute('data-group-index');
        var data;
        var groupOrder;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(groupIndex)) {
            data = this.parent.resourceBase.lastResourceLevel[parseInt(groupIndex, 10)];
            groupOrder = data.groupOrder;
        }
        var filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate, this.parent.eventsProcessed, data);
        var moreElement = this.createMoreEventList(filteredEvents, groupOrder, groupIndex);
        this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_POPUP_CLASS"]).appendChild(moreElement);
    };
    QuickPopups.prototype.closeClick = function () {
        this.quickPopupHide();
        this.morePopup.hide();
    };
    QuickPopups.prototype.dialogButtonClick = function (event) {
        this.quickDialog.hide();
        var target = event.target;
        var cancelBtn = this.quickDialog.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
        var eventData = this.parent.activeEventData.event;
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_OCCURRENCE_CLASS"])) {
            this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteOccurrence' : 'EditOccurrence';
            switch (this.parent.currentAction) {
                case 'EditOccurrence':
                    this.parent.eventWindow.openEditor(eventData, this.parent.currentAction);
                    break;
                case 'DeleteOccurrence':
                    this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);
                    break;
            }
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_FOLLOWING_EVENTS_CLASS"])) {
            this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteFollowingEvents' : 'EditFollowingEvents';
            switch (this.parent.currentAction) {
                case 'EditFollowingEvents':
                    this.parent.eventWindow.openEditor(eventData, this.parent.currentAction);
                    break;
                case 'DeleteFollowingEvents':
                    this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);
                    break;
            }
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_SERIES_CLASS"])) {
            this.parent.currentAction = (this.parent.currentAction === 'Delete') ? 'DeleteSeries' : 'EditSeries';
            switch (this.parent.currentAction) {
                case 'EditSeries':
                    this.parent.eventWindow.openEditor(this.parent.eventBase.getParentEvent(eventData, true), this.parent.currentAction);
                    break;
                case 'DeleteSeries':
                    this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);
                    break;
            }
        }
        else if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_DELETE_CLASS"])) {
            this.parent.crudModule.deleteEvent(eventData, this.parent.currentAction);
        }
        else if (!cancelBtn.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"]) && (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_OK"]) ||
            (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]) && !cancelBtn.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_CANCEL_CLASS"])))) {
            this.parent.uiStateValues.isIgnoreOccurrence = target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["QUICK_DIALOG_ALERT_CANCEL"]);
            this.parent.eventWindow.eventSave(this.l10n.getConstant('ok'));
        }
    };
    QuickPopups.prototype.updateTapHoldEventPopup = function (target) {
        var selectedElements = this.parent.eventBase.getSelectedEventElements(target);
        this.parent.activeEventData = this.parent.eventBase.getSelectedEvents();
        if (selectedElements.length > 0) {
            var eventObj = this.parent.eventBase.getEventByGuid(selectedElements[0].getAttribute('data-guid'));
            var titleContent = (selectedElements.length === 1) ?
                (eventObj[this.parent.eventFields.subject] || this.l10n.getConstant('noTitle')) :
                '(' + selectedElements.length + ')' + '&nbsp;' + this.l10n.getConstant('selectedItems');
            this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]).innerHTML = titleContent;
            if (selectedElements.length > 1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_ICON_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]);
            }
            else {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_ICON_CLASS"])], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]);
            }
        }
        else {
            this.parent.selectedElements = [];
            this.quickPopupHide();
        }
    };
    QuickPopups.prototype.getTimezone = function (event) {
        var zoneDetails = '';
        zoneDetails += event[this.parent.eventFields.startTimezone] || '';
        zoneDetails += zoneDetails === '' ? '' : ' - ';
        zoneDetails += event[this.parent.eventFields.endTimezone] || '';
        return zoneDetails;
    };
    QuickPopups.prototype.getRecurrenceSummary = function (event) {
        var recurrenceEditor = this.parent.eventWindow.getRecurrenceEditorInstance();
        if (recurrenceEditor) {
            var ruleSummary = recurrenceEditor.getRuleSummary(event[this.parent.eventFields.recurrenceRule]);
            return ruleSummary.charAt(0).toUpperCase() + ruleSummary.slice(1);
        }
        return '';
    };
    QuickPopups.prototype.getDateFormat = function (date, skeletonString, formatString) {
        return _base_util__WEBPACK_IMPORTED_MODULE_7__["capitalizeFirstWord"](Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() ? this.parent.globalize.formatDate(date, { format: formatString, calendar: this.parent.getCalendarMode() }) :
            this.parent.globalize.formatDate(date, { skeleton: skeletonString, calendar: this.parent.getCalendarMode() }), 'single');
    };
    QuickPopups.prototype.getDataFromTarget = function (target) {
        if (target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"])) {
            return this.parent.activeEventData.event;
        }
        // Depricated cells data in quick popups
        var eventObj = {
            startTime: this.parent.activeCellsData.startTime,
            endTime: this.parent.activeCellsData.endTime,
            isAllDay: this.parent.activeCellsData.isAllDay,
            groupIndex: this.parent.activeCellsData.groupIndex
        };
        var cellsData = this.parent.activeCellsData;
        this.parent.eventWindow.convertToEventData(cellsData, eventObj);
        return eventObj;
    };
    QuickPopups.prototype.beforeQuickDialogClose = function () {
        var _this = this;
        var args = {
            type: (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeEventData.event)) ? 'ValidationAlert' :
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]) ? 'RecurrenceAlert' : 'DeleteAlert',
            cancel: false, data: this.parent.activeEventData.event, element: this.quickDialog.element
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["popupClose"], args, function (popupCloseArgs) {
            popupCloseArgs = _this.serializingData(popupCloseArgs);
            if (!popupCloseArgs.cancel) {
                _this.parent.eventBase.focusElement();
            }
        });
    };
    QuickPopups.prototype.beforeQuickPopupOpen = function (target, success) {
        var _this = this;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isQuickInfoTemplates() && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(success)) {
            this.updateQuickPopupTemplates(target);
            return;
        }
        this.parent.renderTemplates();
        var isEventPopup = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_POPUP_CLASS"]);
        var popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
        var eventProp = {
            type: popupType, cancel: false, data: Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, this.getDataFromTarget(target), null, true),
            target: target, element: this.quickPopup.element
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["popupOpen"], eventProp, function (popupArgs) {
            if (popupArgs.cancel) {
                _this.quickPopupHide();
                _this.destroyButtons();
                if (popupArgs.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) {
                    _this.quickPopupClose();
                }
                _this.resetQuickPopupTemplates();
                _base_util__WEBPACK_IMPORTED_MODULE_7__["removeChildren"](_this.quickPopup.element);
                _this.isMultipleEventSelect = false;
            }
            else {
                var display = _this.quickPopup.element.style.display;
                _this.quickPopup.element.style.display = 'block';
                if (_this.parent.isAdaptive) {
                    _this.quickPopup.element.removeAttribute('style');
                    _this.quickPopup.element.style.display = 'block';
                    _this.quickPopup.element.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
                }
                else {
                    _this.quickPopup.offsetX = 10;
                    _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
                    _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: 'top' };
                    _this.quickPopup.dataBind();
                    _this.quickPopup.refreshPosition(null, true);
                    var collide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["isCollide"])(_this.quickPopup.element, _this.parent.element);
                    if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {
                        _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;
                        _this.quickPopup.dataBind();
                        var leftCollide = Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_1__["isCollide"])(_this.quickPopup.element, _this.parent.element);
                        if (leftCollide.indexOf('left') > -1) {
                            _this.quickPopup.position = { X: 'center', Y: 'center' };
                            _this.quickPopup.collision = { X: 'fit', Y: 'fit' };
                            _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);
                            _this.quickPopup.dataBind();
                        }
                    }
                    if (_this.parent.virtualScrollModule && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
                        var element = _this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] + ' table');
                        var translateY = _base_util__WEBPACK_IMPORTED_MODULE_7__["getTranslateY"](element);
                        _this.quickPopup.offsetY = translateY;
                        _this.quickPopup.dataBind();
                    }
                }
                if (isEventPopup) {
                    _this.applyEventColor();
                }
                _this.quickPopup.element.style.display = display;
                _this.quickPopup.dataBind();
                _this.quickPopup.show();
            }
        });
    };
    QuickPopups.prototype.isQuickInfoTemplates = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.quickInfoTemplates.header || this.parent.quickInfoTemplates.content
            || this.parent.quickInfoTemplates.footer)) {
            return true;
        }
        return false;
    };
    QuickPopups.prototype.applyEventColor = function () {
        var colorField = '';
        if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
            colorField = this.parent.enableRtl ? 'border-right-color' : 'border-left-color';
        }
        else {
            colorField = 'background-color';
        }
        // tslint:disable-next-line:no-any
        var color = this.parent.activeEventData.element.style[colorField];
        if (color === '') {
            return;
        }
        var colorEle = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_HEADER_CLASS"]);
        var footerEle = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_FOOTER_CLASS"]);
        if (footerEle && footerEle.offsetParent) {
            colorEle = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]);
            if (colorEle) {
                colorEle.style.borderLeftColor = color;
                color = "rgba(" + color.match(/\d+/g).join() + ",0.3)";
            }
        }
        if (colorEle) {
            colorEle.style.backgroundColor = color;
        }
    };
    QuickPopups.prototype.quickPopupOpen = function () {
        if (this.parent.isAdaptive) {
            this.quickPopup.element.style.top = '0px';
            return;
        }
        if (this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CELL_POPUP_CLASS"])) {
            var subjectElement = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SUBJECT_CLASS"]);
            if (subjectElement) {
                subjectElement.focus();
            }
        }
        else {
            var editElement = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_EVENT_CLASS"]);
            if (editElement) {
                editElement.focus();
            }
            var editIcon = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EDIT_CLASS"]);
            if (editIcon) {
                editIcon.focus();
            }
        }
    };
    QuickPopups.prototype.updateQuickPopupTemplates = function (target) {
        var _this = this;
        var templateReady = {
            header: this.parent.quickInfoTemplates.header ? false : true,
            content: this.parent.quickInfoTemplates.content ? false : true,
            footer: this.parent.quickInfoTemplates.footer ? false : true
        };
        if (this.parent.quickInfoTemplates.header) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.parent.element.id + '_headerTemplate', 'HeaderTemplate', this.parent.quickInfoTemplates, null, function () {
                templateReady.header = true;
                _this.quickPopupShow(templateReady, target);
            });
        }
        if (this.parent.quickInfoTemplates.content) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.parent.element.id + '_contentTemplate', 'ContentTemplate', this.parent.quickInfoTemplates, null, function () {
                templateReady.content = true;
                _this.quickPopupShow(templateReady, target);
            });
        }
        if (this.parent.quickInfoTemplates.footer) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["updateBlazorTemplate"])(this.parent.element.id + '_footerTemplate', 'FooterTemplate', this.parent.quickInfoTemplates, null, function () {
                templateReady.footer = true;
                _this.quickPopupShow(templateReady, target);
            });
        }
    };
    QuickPopups.prototype.quickPopupShow = function (templateReady, target) {
        if (templateReady.header && templateReady.content && templateReady.footer) {
            this.beforeQuickPopupOpen(target, true);
        }
    };
    QuickPopups.prototype.resetQuickPopupTemplates = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])() && this.isQuickInfoTemplates()) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.quickPopup.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.quickPopup.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_CLOSE"]);
            if (this.parent.quickInfoTemplates.header) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.parent.element.id + '_headerTemplate', 'HeaderTemplate');
            }
            if (this.parent.quickInfoTemplates.content) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.parent.element.id + '_contentTemplate', 'ContentTemplate');
            }
            if (this.parent.quickInfoTemplates.footer) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["resetBlazorTemplate"])(this.parent.element.id + '_footerTemplate', 'FooterTemplate');
            }
            this.parent.resetTemplates();
        }
    };
    QuickPopups.prototype.quickPopupClose = function () {
        this.resetQuickPopupTemplates();
        this.parent.eventBase.focusElement();
        this.quickPopup.relateTo = _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"];
        this.fieldValidator.destroyToolTip();
        if (this.quickPopup.element.querySelectorAll('.e-formvalidator').length) {
            this.fieldValidator.destroy();
        }
        this.destroyButtons();
        _base_util__WEBPACK_IMPORTED_MODULE_7__["removeChildren"](this.quickPopup.element);
    };
    QuickPopups.prototype.morePopupOpen = function () {
        if (this.parent.isAdaptive) {
            this.morePopup.element.style.top = '0px';
            this.morePopup.element.style.left = '0px';
            this.morePopup.element.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(window.innerHeight);
            return;
        }
        this.morePopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_HEADER_DATE_CLASS"]).focus();
        this.morePopup.refreshPosition();
    };
    QuickPopups.prototype.morePopupClose = function () {
        var moreWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_EVENT_WRAPPER_CLASS"]);
        if (moreWrapper) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(moreWrapper);
        }
    };
    QuickPopups.prototype.popupClose = function () {
        this.isCrudAction = false;
        this.quickPopupHide(true);
    };
    QuickPopups.prototype.quickPopupHide = function (hideAnimation) {
        var _this = this;
        if (!this.quickPopup.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) {
            return;
        }
        var isCellPopup = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CELL_POPUP_CLASS"]);
        var popupData;
        if (isCellPopup) {
            var formvalidator = this.quickPopup.element.querySelector('.e-formvalidator');
            if (this.isCrudAction && formvalidator && !formvalidator.ej2_instances[0].validate()) {
                return;
            }
            var fields = this.parent.eventFields;
            var saveObj = this.parent.eventWindow.getObjectFromFormData(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_WRAPPER_CLASS"]);
            this.parent.eventWindow.setDefaultValueToObject(saveObj);
            saveObj[fields.id] = this.parent.eventBase.getEventMaxID();
            saveObj[fields.startTime] = this.parent.activeCellsData.startTime;
            saveObj[fields.endTime] = this.parent.activeCellsData.endTime;
            saveObj[fields.isAllDay] = this.parent.activeCellsData.isAllDay;
            if (this.parent.resourceBase) {
                this.parent.resourceBase.setResourceValues(saveObj);
            }
            popupData = saveObj;
        }
        else {
            popupData = this.parent.activeEventData.event;
        }
        var isEventPopup = this.quickPopup.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["EVENT_POPUP_CLASS"]);
        var args = {
            type: this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo',
            cancel: false, data: popupData, element: this.quickPopup.element,
            target: (isCellPopup ? this.parent.activeCellsData.element : this.parent.activeEventData.element)
        };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["popupClose"], args, function (popupCloseArgs) {
            popupCloseArgs = _this.serializingData(popupCloseArgs);
            if (!popupCloseArgs.cancel) {
                if (_this.quickPopup.element.classList.contains('e-popup-open')) {
                    if (isCellPopup && _this.isCrudAction) {
                        _this.parent.currentAction = 'Add';
                        _this.parent.crudModule.addEvent(popupCloseArgs.data);
                    }
                    if (hideAnimation) {
                        var animation = _this.quickPopup.hideAnimation;
                        _this.quickPopup.hideAnimation = null;
                        _this.quickPopup.hide();
                        _this.quickPopup.hideAnimation = animation;
                    }
                    else {
                        _this.quickPopup.hide();
                    }
                    _this.isMultipleEventSelect = false;
                    _this.isCrudAction = false;
                }
            }
        });
    };
    QuickPopups.prototype.serializingData = function (popupCloseArgs) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isBlazor"])()) {
            var eventFields = this.parent.eventFields;
            if (popupCloseArgs.data) {
                var eventObj = popupCloseArgs.data;
                eventObj[eventFields.startTime] = this.parent.getDateTime(eventObj[eventFields.startTime]);
                eventObj[eventFields.endTime] = this.parent.getDateTime(eventObj[eventFields.endTime]);
            }
            if (popupCloseArgs.element) {
                popupCloseArgs.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(popupCloseArgs.element);
            }
            if (popupCloseArgs.target) {
                popupCloseArgs.target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getElement"])(popupCloseArgs.target);
            }
        }
        return popupCloseArgs;
    };
    QuickPopups.prototype.navigationClick = function (e) {
        var navigateEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["NAVIGATE_CLASS"]);
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(navigateEle)) {
            var date = this.parent.getDateFromElement(e.currentTarget);
            if (this.parent.isServerRenderer()) {
                date = new Date(+date - (date.getTimezoneOffset() * 60000));
            }
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date)) {
                this.closeClick();
                this.parent.setScheduleProperties({ selectedDate: date });
                this.parent.changeView(this.parent.getNavigateView(), e);
            }
        }
    };
    QuickPopups.prototype.documentClick = function (e) {
        var target = e.event.target;
        var classNames = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_WRAPPER_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"] +
            ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"] + ',.e-popup';
        var popupWrap = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_WRAPPER_CLASS"]);
        if (popupWrap && popupWrap.childElementCount > 0 && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, classNames)) {
            this.quickPopupHide();
        }
        var tar = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["INLINE_SUBJECT_CLASS"]);
        if (tar && tar !== target && this.parent.allowInline) {
            this.parent.inlineModule.documentClick();
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"])) {
            this.parent.removeNewEventElement();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, classNames)) {
            this.quickPopupHide();
            this.parent.removeNewEventElement();
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_POPUP_WRAPPER_CLASS"]) && (target.classList &&
            !target.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["MORE_INDICATOR_CLASS"]))
            && (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"])) {
            this.morePopup.hide();
        }
    };
    QuickPopups.prototype.onClosePopup = function () {
        this.quickPopupHide();
        this.parent.eventBase.focusElement();
    };
    QuickPopups.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["cellClick"], this.cellClick, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventClick"], this.eventClick, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["documentClick"], this.documentClick, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["dataReady"], this.updateMoreEventContent, this);
    };
    QuickPopups.prototype.removeEventListner = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["cellClick"], this.cellClick);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventClick"], this.eventClick);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["documentClick"], this.documentClick);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["dataReady"], this.updateMoreEventContent);
    };
    QuickPopups.prototype.destroyButtons = function () {
        var buttonCollections = [].slice.call(this.quickPopup.element.querySelectorAll('.e-control.e-btn'));
        for (var _i = 0, buttonCollections_1 = buttonCollections; _i < buttonCollections_1.length; _i++) {
            var button = buttonCollections_1[_i];
            var instance = button.ej2_instances[0];
            if (instance) {
                instance.destroy();
            }
        }
    };
    QuickPopups.prototype.refreshQuickDialog = function () {
        if (this.quickDialog.element) {
            this.quickDialog.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.quickDialog.element);
            this.quickDialog.element = null;
        }
        this.renderQuickDialog();
    };
    QuickPopups.prototype.refreshQuickPopup = function () {
        if (this.quickPopup.element) {
            this.quickPopup.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.quickPopup.element);
            this.quickPopup.element = null;
        }
        this.renderQuickPopup();
    };
    QuickPopups.prototype.refreshMorePopup = function () {
        if (this.morePopup.element) {
            this.morePopup.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.morePopup.element);
            this.morePopup.element = null;
        }
        this.renderMorePopup();
    };
    QuickPopups.prototype.destroy = function () {
        if (this.quickPopup.element.querySelectorAll('.e-formvalidator').length) {
            this.fieldValidator.destroy();
        }
        this.removeEventListner();
        this.destroyButtons();
        this.quickPopup.destroy();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.quickPopup.element);
        this.morePopup.destroy();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.morePopup.element);
        if (this.quickDialog.element) {
            this.quickDialog.destroy();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.quickDialog.element);
            this.quickDialog.element = null;
        }
    };
    return QuickPopups;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/agenda.js":
/*!********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/agenda.js ***!
  \********************************************************************************/
/*! exports provided: Agenda */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Agenda", function() { return Agenda; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _event_renderer_agenda_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../event-renderer/agenda-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/agenda-base.js");
/* harmony import */ var _view_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();







/**
 * agenda view
 */
var Agenda = /** @__PURE__ @class */ (function (_super) {
    __extends(Agenda, _super);
    /**
     * Constructor for agenda view
     */
    function Agenda(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-agenda-view';
        _this.isInverseTableSelect = false;
        _this.agendaDates = {};
        _this.virtualScrollTop = 1;
        _this.agendaBase = new _event_renderer_agenda_base__WEBPACK_IMPORTED_MODULE_1__["AgendaBase"](parent);
        return _this;
    }
    /**
     * Get module name.
     */
    Agenda.prototype.getModuleName = function () {
        return 'agenda';
    };
    Agenda.prototype.renderLayout = function () {
        this.agendaDates = {};
        this.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_WRAP_CLASS"] });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], this.viewClass);
        this.element.appendChild(this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["OUTER_TABLE_CLASS"]));
        this.element.querySelector('table').setAttribute('role', 'presentation');
        this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"]).appendChild(this.element);
        var eTr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        this.element.querySelector('tbody').appendChild(eTr);
        var workTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        eTr.appendChild(workTd);
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] });
        workTd.appendChild(wrap);
        var tbl = this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]);
        wrap.appendChild(tbl);
        var tBody = tbl.querySelector('tbody');
        var agendaDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](this.parent.selectedDate);
        this.agendaBase.renderEmptyContent(tBody, agendaDate);
        this.wireEvents();
        if (this.parent.resourceBase) {
            this.parent.resourceBase.generateResourceLevels([{ renderDates: this.parent.activeView.renderDates }]);
        }
        if (this.parent.uiStateValues.isGroupAdaptive && !this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TOOLBAR_CONTAINER"])) {
            this.renderResourceMobileLayout();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["contentReady"], {});
    };
    Agenda.prototype.eventLoad = function (args) {
        this.dataSource = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], this.parent.eventsData, null, true);
        for (var _i = 0, _a = this.parent.eventsData; _i < _a.length; _i++) {
            var event_1 = _a[_i];
            delete event_1.generatedDates;
        }
        var eventCollection = args.processedData;
        if (this.parent.uiStateValues.isGroupAdaptive) {
            var resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
            this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
            eventCollection = this.parent.eventBase.filterEventsByResource(resource, eventCollection);
        }
        this.parent.eventsProcessed = this.agendaBase.processAgendaEvents(eventCollection);
        var agendaDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](this.parent.selectedDate);
        var tBody = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"] + ' tbody');
        _base_util__WEBPACK_IMPORTED_MODULE_3__["removeChildren"](tBody);
        this.renderInitialContent(tBody, agendaDate);
        this.agendaBase.wireEventActions();
        var contentArea = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(tBody, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        contentArea.scrollTop = 1;
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["eventsLoaded"], {});
        if (!this.parent.activeViewOptions.allowVirtualScrolling) {
            this.retainScrollPosition();
        }
    };
    Agenda.prototype.refreshEvent = function (refreshDate) {
        var processedData = [];
        for (var _i = 0, _a = this.dataSource; _i < _a.length; _i++) {
            var eventData = _a[_i];
            var fields = this.parent.eventFields;
            var data = eventData;
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[fields.recurrenceID]) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data[fields.recurrenceRule]) &&
                !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.generatedDates) && refreshDate >= data.generatedDates.end) {
                processedData = processedData.concat(this.parent.eventBase.generateOccurrence(data, refreshDate));
            }
        }
        this.parent.eventsProcessed = this.parent.eventsProcessed.concat(this.agendaBase.processAgendaEvents(processedData));
    };
    Agenda.prototype.renderInitialContent = function (tBody, agendaDate) {
        var emptyTBody = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tbody');
        var firstDate = new Date(agendaDate.getTime());
        var lastDate = (this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) ?
            this.getEndDateFromStartDate(firstDate) : _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](firstDate, this.parent.agendaDaysCount);
        this.renderContent(emptyTBody, firstDate, lastDate);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(emptyTBody.childNodes), tBody);
        // Initial rendering, to load previous date events upto scroll bar enable
        if (this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays && this.parent.eventsData.length > 0) {
            var contentArea = this.getContentAreaElement();
            var contentChild = contentArea.querySelector('.e-content-table');
            while (contentArea.offsetWidth <= contentArea.clientWidth) {
                if (this.parent.isAdaptive && contentChild.offsetHeight >= contentArea.clientHeight) {
                    break;
                }
                var emptyTBody_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tbody');
                lastDate = firstDate;
                firstDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](lastDate, -this.parent.agendaDaysCount);
                this.renderContent(emptyTBody_1, firstDate, lastDate);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([].slice.call(emptyTBody_1.childNodes), tBody);
                if (firstDate <= this.parent.minDate) {
                    break;
                }
            }
        }
        if (tBody.childNodes.length <= 0) {
            this.agendaBase.renderEmptyContent(tBody, agendaDate);
        }
    };
    Agenda.prototype.renderContent = function (tBody, agendaDate, lastDate) {
        var fieldMapping = this.parent.eventFields;
        var firstDate = new Date(agendaDate.getTime());
        var isObject = this.appointmentFiltering(firstDate, lastDate);
        if (isObject.length > 0 && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) {
            var appoint = isObject;
            agendaDate = appoint[0][fieldMapping.startTime];
            agendaDate = new Date(new Date(agendaDate.getTime()).setHours(0, 0, 0, 0));
            this.updateHeaderText(appoint[0][fieldMapping.startTime]);
        }
        var endDate;
        if (!this.parent.hideEmptyAgendaDays || (this.parent.agendaDaysCount > 0 && isObject.length > 0)) {
            if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                var date = agendaDate;
                if (!this.parent.activeViewOptions.group.byDate) {
                    this.parent.activeViewOptions.allowVirtualScrolling = false;
                    date = firstDate;
                    if (this.parent.headerModule) {
                        this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());
                        this.parent.headerModule.updateHeaderItems('remove');
                    }
                }
                this.agendaBase.calculateResourceTableElement(tBody, this.parent.agendaDaysCount, date);
            }
            else {
                for (var day = 0; day < this.parent.agendaDaysCount; day++) {
                    var filterData = [];
                    filterData = this.appointmentFiltering(agendaDate);
                    var nTr = this.agendaBase.createTableRowElement(agendaDate, 'data');
                    if (this.element.querySelector('tr[aria-rowindex="' + parseInt(nTr.getAttribute('aria-rowindex'), 10)
                        + '"]')) {
                        continue;
                    }
                    // if (this.isMonthFirstDate(agendaDate)) {
                    //     tBody.appendChild(this.renderMonthHeader(this.createTableRowElement(agendaDate, 'monthHeader')));
                    // }
                    var dTd = nTr.children[0];
                    var aTd = nTr.children[1];
                    if (filterData.length > 0 || (!this.parent.hideEmptyAgendaDays && filterData.length === 0)) {
                        var elementType = (!this.parent.hideEmptyAgendaDays && filterData.length === 0) ? 'noEvents' : 'data';
                        dTd.appendChild(this.agendaBase.createDateHeaderElement(agendaDate));
                        nTr.appendChild(dTd);
                        var cTd = this.agendaBase.createAgendaContentElement(elementType, filterData, aTd);
                        nTr.appendChild(cTd);
                        if (cTd.querySelectorAll('li').length > 0) {
                            tBody.appendChild(nTr);
                        }
                    }
                    else if (this.parent.activeViewOptions.allowVirtualScrolling) {
                        day--;
                    }
                    if (this.isCurrentDate(new Date(agendaDate.getTime()))) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(dTd.childNodes, _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_CURRENT_DAY_CLASS"]);
                    }
                    agendaDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](agendaDate, 1);
                    if (agendaDate.getTime() > lastDate.getTime()) {
                        break;
                    }
                }
            }
            endDate = new Date(agendaDate.getTime() - _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]);
        }
        this.agendaDates = { start: firstDate, end: endDate };
    };
    // private renderMonthHeader(mTr: Element): Element {
    //     mTr.removeAttribute('aria-rowindex');
    //     for (let td of [].slice.call(mTr.childNodes)) {
    //         td.removeAttribute('aria-colindex');
    //     }
    //     let headerDate: Date = new Date(parseInt(mTr.children[0].getAttribute('data-date'), 10));
    //     let div: Element = createElement('div', {
    //         className: cls.DATE_HEADER_CLASS,
    //         innerHTML: headerDate.toLocaleString(this.parent.locale, { month: 'long' }) + '&nbsp' + headerDate.getFullYear()
    //     });
    //     mTr.lastElementChild.appendChild(div);
    //     return mTr;
    // }
    Agenda.prototype.agendaScrolling = function (event) {
        this.parent.quickPopup.quickPopupHide();
        if (this.parent.activeViewOptions.allowVirtualScrolling) {
            this.virtualScrolling(event);
        }
        if (!this.parent.activeViewOptions.allowVirtualScrolling) {
            this.setPersistence();
        }
    };
    Agenda.prototype.virtualScrolling = function (event) {
        var target = event.target;
        var scrollTop = target.scrollTop;
        var scrollHeight = target.scrollHeight;
        var offsetHeight = target.clientHeight;
        var totalHeight = scrollTop + offsetHeight;
        var direction = (this.virtualScrollTop < scrollTop) ? 'next' : 'previous';
        var tBody = target.querySelector('tbody');
        var emptyTBody = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tbody');
        var topElement = this.getElementFromScrollerPosition(event, direction);
        var scrollDate = this.parent.getDateFromElement(topElement);
        var filterDate;
        var filterData;
        if (scrollTop === 0) {
            filterDate = this.getPreviousNextDate(_base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](scrollDate, -1), direction);
            filterData = this.appointmentFiltering(filterDate.start, filterDate.end);
            if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
                this.renderContent(emptyTBody, filterDate.start, filterDate.end);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([].slice.call(emptyTBody.childNodes), tBody);
                this.agendaBase.wireEventActions();
                for (var s = 0, element = tBody.children; s < element.length; s++) {
                    if (element[s].getAttribute('aria-rowindex') === topElement.getAttribute('aria-colindex')) {
                        var scrollToValue = element[s].offsetTop -
                            this.element.querySelector('.e-agenda-item').offsetHeight;
                        target.scrollTop = scrollToValue;
                        break;
                    }
                }
                this.updateHeaderText(scrollDate);
            }
        }
        else if (totalHeight === scrollHeight) {
            filterDate = this.getPreviousNextDate(_base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](scrollDate, 1), direction);
            filterData = this.appointmentFiltering(filterDate.start, filterDate.end);
            if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
                this.renderContent(emptyTBody, filterDate.start, filterDate.end);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])([].slice.call(emptyTBody.childNodes), tBody);
                this.agendaBase.wireEventActions();
                this.updateHeaderText(scrollDate);
            }
        }
        else {
            this.updateHeaderText(scrollDate);
        }
        this.virtualScrollTop = scrollTop;
        var selectedElements = this.parent.eventBase.getSelectedAppointments();
        if (selectedElements.length > 0) {
            selectedElements[selectedElements.length - 1].focus();
        }
    };
    Agenda.prototype.getElementFromScrollerPosition = function (event, direction) {
        var filterElement;
        var target = event.target;
        var scrollTop = target.scrollTop;
        var scrollHeight = target.scrollHeight;
        var offsetHeight = target.clientHeight;
        var totalHeight = scrollTop + offsetHeight;
        var liCollection = [].slice.call(target.querySelectorAll('.e-agenda-item'));
        var li;
        var liDetails;
        if (liCollection.length > 0) {
            if (scrollTop === 0) {
                li = liCollection[0];
                filterElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(li, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_CELLS_CLASS"]);
            }
            else if (totalHeight === scrollHeight) {
                li = liCollection[liCollection.length - 1];
                filterElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(li, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_CELLS_CLASS"]);
            }
            else {
                for (var a = 0, length_1 = liCollection.length; a < length_1; a++) {
                    li = liCollection[a];
                    liDetails = li.getBoundingClientRect();
                    if (liDetails.top >= 0) {
                        filterElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(li, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_CELLS_CLASS"]);
                        break;
                    }
                }
            }
        }
        return filterElement;
    };
    Agenda.prototype.updateHeaderText = function (date) {
        if (this.parent.showHeaderBar) {
            this.parent.headerModule.updateDateRange(this.getDateRangeText(date));
        }
    };
    Agenda.prototype.getPreviousNextDate = function (date, type) {
        var currentDate = new Date(date.getTime());
        var firstDate = this.getStartDateFromEndDate(date);
        var lastDate = this.getEndDateFromStartDate(date);
        var daysCount = 0;
        do {
            var filterData = this.appointmentFiltering(currentDate);
            if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
                daysCount++;
            }
            currentDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](currentDate, (type === 'next') ? 1 : -1);
            if (currentDate < firstDate || currentDate > lastDate) {
                break;
            }
        } while (daysCount !== this.parent.agendaDaysCount);
        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](currentDate, (type === 'next') ? -1 : 1);
        return (type === 'next') ? { start: date, end: _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](endDate, 1) } : { start: endDate, end: _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](date, 1) };
    };
    Agenda.prototype.appointmentFiltering = function (startDate, endDate) {
        var dateStart;
        var dateEnd;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startDate) && Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endDate)) {
            dateStart = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(startDate.getTime()));
            dateEnd = _base_util__WEBPACK_IMPORTED_MODULE_3__["setTime"](new Date(dateStart.getTime()), _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]);
        }
        else {
            dateStart = new Date(startDate.getTime());
            dateEnd = new Date(endDate.getTime());
        }
        var filterData = this.parent.eventBase.filterEvents(dateStart, dateEnd);
        if (filterData.length === 0) {
            this.refreshEvent(startDate);
            filterData = this.parent.eventBase.filterEvents(dateStart, dateEnd);
        }
        return filterData;
    };
    Agenda.prototype.getStartDateFromEndDate = function (endDate) {
        var filterDate;
        var fieldMapping = this.parent.eventFields;
        if (this.parent.eventsProcessed.length > 0) {
            var firstDate = Math.min.apply(Math, this.parent.eventsProcessed.map(function (a) {
                var date = a[fieldMapping.startTime];
                return date.getTime();
            }));
            filterDate = this.parent.hideEmptyAgendaDays ? new Date(firstDate) : this.parent.minDate;
        }
        else {
            filterDate = this.parent.hideEmptyAgendaDays ? _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](endDate, -1) : this.parent.minDate;
        }
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](filterDate);
    };
    Agenda.prototype.getEndDateFromStartDate = function (startDate) {
        var filterDate;
        var fieldMapping = this.parent.eventFields;
        if (this.parent.eventsProcessed.length > 0) {
            var lastDate = Math.max.apply(Math, this.parent.eventsProcessed.map(function (a) {
                var date = a[fieldMapping.endTime];
                return date.getTime();
            }));
            filterDate = this.parent.hideEmptyAgendaDays ? new Date(lastDate) : this.parent.maxDate;
        }
        else {
            filterDate = this.parent.hideEmptyAgendaDays ? _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](startDate, 1) : this.parent.maxDate;
        }
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](_base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](filterDate, 1));
    };
    Agenda.prototype.getNextPreviousDate = function (type) {
        var noOfDays = (type === 'next') ? 1 : -1;
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](this.parent.selectedDate, noOfDays);
    };
    Agenda.prototype.startDate = function () {
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](this.parent.selectedDate);
    };
    Agenda.prototype.endDate = function () {
        if (this.parent.activeViewOptions.allowVirtualScrolling) {
            return this.getEndDateFromStartDate(this.startDate());
        }
        else {
            return _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](this.startDate(), this.parent.agendaDaysCount);
        }
    };
    Agenda.prototype.getDateRangeText = function (date) {
        var formatDate = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
        if (this.parent.activeViewOptions.allowVirtualScrolling || this.parent.isAdaptive) {
            var currentDate = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date) ? this.parent.selectedDate : date;
            return _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](this.parent.globalize.formatDate(currentDate, { format: formatDate, calendar: this.parent.getCalendarMode() }), 'multiple');
        }
        else {
            var startDate = this.parent.selectedDate;
            var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](startDate, this.parent.agendaDaysCount - 1);
            return this.formatDateRange(startDate, endDate);
        }
    };
    Agenda.prototype.dayNavigationClick = function (e) {
        var date = this.parent.getDateFromElement(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.currentTarget, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_CELLS_CLASS"]));
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date) && !this.parent.isAdaptive && this.parent.isMinMaxDate(date)) {
            this.parent.setScheduleProperties({ selectedDate: date });
            this.parent.changeView('Day', e);
        }
    };
    // private isMonthFirstDate(date: Date): boolean {
    //     return date.getDate() === 1;
    // }
    Agenda.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]), _base_constant__WEBPACK_IMPORTED_MODULE_4__["scroll"], this.agendaScrolling, this);
    };
    Agenda.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]), _base_constant__WEBPACK_IMPORTED_MODULE_4__["scroll"], this.agendaScrolling);
        var dateHeaderElement = [].slice.call(this.element.querySelectorAll('.e-m-date'));
        for (var _i = 0, dateHeaderElement_1 = dateHeaderElement; _i < dateHeaderElement_1.length; _i++) {
            var element = dateHeaderElement_1[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(element, 'click', this.dayNavigationClick);
        }
    };
    Agenda.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onAgendaScrollUiUpdate, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.eventLoad, this);
    };
    Agenda.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onAgendaScrollUiUpdate);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.eventLoad);
    };
    Agenda.prototype.onAgendaScrollUiUpdate = function () {
        var headerHeight = this.getHeaderBarHeight();
        if (this.parent.headerModule) {
            if (this.parent.activeViewOptions.allowVirtualScrolling) {
                this.parent.headerModule.updateHeaderItems('add');
            }
            else {
                this.parent.headerModule.updateHeaderItems('remove');
            }
        }
        var contentArea = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        contentArea.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(this.parent.element.offsetHeight - headerHeight);
    };
    /**
     * To destroy the agenda.
     * @return {void}
     * @private
     */
    Agenda.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        if (this.element) {
            this.unWireEvents();
            if (this.parent.resourceBase) {
                this.parent.resourceBase.destroy();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.element = null;
            if (this.parent.headerModule && this.parent.activeViewOptions.allowVirtualScrolling) {
                this.parent.headerModule.updateHeaderItems('remove');
            }
        }
    };
    return Agenda;
}(_view_base__WEBPACK_IMPORTED_MODULE_2__["ViewBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/day.js":
/*!*****************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/day.js ***!
  \*****************************************************************************/
/*! exports provided: Day */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Day", function() { return Day; });
/* harmony import */ var _vertical_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();

/**
 * day view
 */
var Day = /** @__PURE__ @class */ (function (_super) {
    __extends(Day, _super);
    /**
     * Constructor for day view
     */
    function Day(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-day-view';
        return _this;
    }
    /**
     * Get module name.
     */
    Day.prototype.getModuleName = function () {
        return 'day';
    };
    return Day;
}(_vertical_view__WEBPACK_IMPORTED_MODULE_0__["VerticalView"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/header-renderer.js":
/*!*****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/header-renderer.js ***!
  \*****************************************************************************************/
/*! exports provided: HeaderRenderer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRenderer", function() { return HeaderRenderer; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_navigations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../ej2-navigations */ "./ej2-resources/18.4.46/scripts/ej2-navigations/index.js");
/* harmony import */ var _ej2_calendars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../ej2-calendars */ "./ej2-resources/18.4.46/scripts/ej2-calendars/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");







/**
 * Header module
 */
var HeaderRenderer = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for render module
     */
    function HeaderRenderer(parent) {
        this.parent = parent;
        this.l10n = this.parent.localeObj;
        this.renderHeader();
        this.addEventListener();
    }
    HeaderRenderer.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["documentClick"], this.closeHeaderPopup, this);
    };
    HeaderRenderer.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["documentClick"], this.closeHeaderPopup);
    };
    HeaderRenderer.prototype.closeHeaderPopup = function (e) {
        var closestEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.event.target, '.e-date-range,.e-header-popup,.e-selected');
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(closestEle)) {
            return;
        }
        this.hideHeaderPopup();
    };
    /** @hidden */
    HeaderRenderer.prototype.hideHeaderPopup = function () {
        if (this.headerPopup) {
            this.headerPopup.hide();
        }
    };
    HeaderRenderer.prototype.renderHeader = function () {
        this.element = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TOOLBAR_CONTAINER"] });
        var toolbarEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_TOOLBAR"] });
        this.element.appendChild(toolbarEle);
        this.parent.element.insertBefore(this.element, this.parent.element.firstElementChild);
        this.renderToolbar();
    };
    HeaderRenderer.prototype.renderToolbar = function () {
        var items = this.getItems();
        var args = { requestType: 'toolbarItemRendering', items: items };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["actionBegin"], args);
        this.toolbarObj = new _ej2_navigations__WEBPACK_IMPORTED_MODULE_1__["Toolbar"]({
            items: args.items,
            overflowMode: 'Popup',
            clicked: this.toolbarClickHandler.bind(this),
            enableRtl: this.parent.enableRtl,
            locale: this.parent.locale
        });
        this.toolbarObj.isStringTemplate = true;
        this.toolbarObj.appendTo(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_TOOLBAR"]));
        var prevNavEle = this.toolbarObj.element.querySelector('.e-prev');
        if (prevNavEle) {
            prevNavEle.firstElementChild.setAttribute('title', this.l10n.getConstant('previous'));
        }
        var nextNavEle = this.toolbarObj.element.querySelector('.e-next');
        if (nextNavEle) {
            nextNavEle.firstElementChild.setAttribute('title', this.l10n.getConstant('next'));
        }
        this.updateActiveView();
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["actionComplete"], {
            requestType: 'toolBarItemRendered', items: this.toolbarObj.items
        });
    };
    HeaderRenderer.prototype.updateItems = function () {
        if (this.toolbarObj) {
            var items = this.getItems();
            var args = { requestType: 'toolbarItemRendering', items: items };
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["actionBegin"], args);
            this.toolbarObj.items = args.items;
            this.toolbarObj.dataBind();
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["actionComplete"], {
                requestType: 'toolBarItemRendered',
                items: this.toolbarObj.items
            });
        }
    };
    HeaderRenderer.prototype.getPopUpRelativeElement = function () {
        if (this.parent.isAdaptive) {
            return this.toolbarObj.element;
        }
        return this.element.querySelector('.e-date-range');
    };
    HeaderRenderer.prototype.setDayOfWeek = function (index) {
        if (this.headerCalendar) {
            this.headerCalendar.firstDayOfWeek = index;
            this.headerCalendar.dataBind();
        }
    };
    HeaderRenderer.prototype.setCalendarDate = function (date) {
        if (this.headerCalendar) {
            this.headerCalendar.value = date;
            this.headerCalendar.dataBind();
        }
    };
    HeaderRenderer.prototype.setCalendarMinMaxDate = function () {
        if (this.headerCalendar) {
            this.headerCalendar.min = this.parent.minDate;
            this.headerCalendar.max = this.parent.maxDate;
            this.headerCalendar.dataBind();
        }
    };
    HeaderRenderer.prototype.getCalendarView = function () {
        if (['Month', 'MonthAgenda', 'TimelineMonth'].indexOf(this.parent.currentView) > -1) {
            return 'Year';
        }
        else if (['Year', 'TimelineYear'].indexOf(this.parent.currentView) > -1) {
            return 'Decade';
        }
        else {
            return 'Month';
        }
    };
    HeaderRenderer.prototype.setCalendarView = function () {
        if (this.headerCalendar) {
            var calendarView = this.getCalendarView();
            this.headerCalendar.depth = calendarView;
            this.headerCalendar.start = calendarView;
            this.headerCalendar.refresh();
        }
    };
    HeaderRenderer.prototype.updateActiveView = function () {
        var selEle = [].slice.call(this.toolbarObj.element.querySelectorAll('.e-views'));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(selEle, ['e-active-view']);
        if (selEle.length > 0 && selEle[this.parent.viewIndex]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([selEle[this.parent.viewIndex]], ['e-active-view']);
        }
    };
    HeaderRenderer.prototype.updateDateRange = function (text) {
        var selEle = this.toolbarObj.element.querySelector('.e-date-range');
        if (selEle) {
            selEle.setAttribute('aria-label', text);
            selEle.querySelector('.e-tbar-btn-text').innerHTML = text;
            this.toolbarObj.refreshOverflow();
        }
    };
    HeaderRenderer.prototype.getDateRangeText = function () {
        return _base_util__WEBPACK_IMPORTED_MODULE_5__["capitalizeFirstWord"](this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM y', calendar: this.parent.getCalendarMode() }), 'single');
    };
    HeaderRenderer.prototype.getItems = function () {
        var items = [];
        var showInPopup = this.parent.isAdaptive;
        items.push({
            align: 'Left', prefixIcon: 'e-icon-prev', tooltipText: 'Previous', overflow: 'Show',
            cssClass: 'e-prev', htmlAttributes: { 'aria-label': 'previous period', 'role': 'navigation' }
        });
        items.push({
            align: 'Left', prefixIcon: 'e-icon-next', tooltipText: 'Next', overflow: 'Show',
            cssClass: 'e-next', htmlAttributes: { 'aria-label': 'next period', 'role': 'navigation' }
        });
        items.push({
            align: 'Left', text: this.getDateRangeText(), suffixIcon: 'e-icon-down-arrow', cssClass: 'e-date-range',
            overflow: 'Show',
            htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title', 'role': 'navigation' }
        });
        if (this.parent.isAdaptive) {
            items.push({
                align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-add', text: this.l10n.getConstant('newEvent'),
                cssClass: 'e-add', overflow: 'Show'
            });
            items.push({
                align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-today', text: this.l10n.getConstant('today'),
                cssClass: 'e-today', overflow: 'Show'
            });
        }
        else {
            items.push({
                align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-day', text: this.l10n.getConstant('today'),
                cssClass: 'e-today', overflow: 'Show'
            });
            if (this.parent.views.length > 1) {
                items.push({
                    align: 'Right', type: 'Separator', cssClass: 'e-schedule-seperator'
                });
            }
        }
        if (this.parent.views.length > 1) {
            for (var _i = 0, _a = this.parent.views; _i < _a.length; _i++) {
                var item = _a[_i];
                typeof (item) === 'string' ? items.push(this.getItemObject(item)) :
                    items.push(this.getItemObject(item));
            }
        }
        return items;
    };
    HeaderRenderer.prototype.getItemObject = function (item) {
        var viewName;
        var displayName;
        if (typeof (item) === 'string') {
            viewName = item.toLowerCase();
            displayName = null;
        }
        else {
            viewName = item.option.toLowerCase();
            displayName = item.displayName;
        }
        var view;
        var showInPopup = this.parent.isAdaptive;
        switch (viewName) {
            case 'day':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-day',
                    text: displayName || this.l10n.getConstant('day'), cssClass: 'e-views e-day'
                };
                break;
            case 'week':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-week',
                    text: displayName || this.l10n.getConstant('week'), cssClass: 'e-views e-week'
                };
                break;
            case 'workweek':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-workweek',
                    text: displayName || this.l10n.getConstant('workWeek'), cssClass: 'e-views e-work-week'
                };
                break;
            case 'month':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-month',
                    text: displayName || this.l10n.getConstant('month'), cssClass: 'e-views e-month'
                };
                break;
            case 'year':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-year',
                    text: displayName || this.l10n.getConstant('year'), cssClass: 'e-views e-year'
                };
                break;
            case 'agenda':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-agenda',
                    text: displayName || this.l10n.getConstant('agenda'), cssClass: 'e-views e-agenda'
                };
                break;
            case 'monthagenda':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-month-agenda',
                    text: displayName || this.l10n.getConstant('monthAgenda'), cssClass: 'e-views e-month-agenda'
                };
                break;
            case 'timelineday':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-timeline-day',
                    text: displayName || this.l10n.getConstant('timelineDay'), cssClass: 'e-views e-timeline-day'
                };
                break;
            case 'timelineweek':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-timeline-week',
                    text: displayName || this.l10n.getConstant('timelineWeek'), cssClass: 'e-views e-timeline-week'
                };
                break;
            case 'timelineworkweek':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-timeline-workweek',
                    text: displayName || this.l10n.getConstant('timelineWorkWeek'), cssClass: 'e-views e-timeline-work-week'
                };
                break;
            case 'timelinemonth':
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-timeline-month',
                    text: displayName || this.l10n.getConstant('timelineMonth'), cssClass: 'e-views e-timeline-month'
                };
                break;
            case 'timelineyear':
                var orientationClass = (item.orientation === 'Vertical') ? 'vertical' : 'horizontal';
                view = {
                    align: 'Right', showAlwaysInPopup: showInPopup, prefixIcon: 'e-icon-timeline-year-' + orientationClass,
                    text: displayName || this.l10n.getConstant('timelineYear'), cssClass: 'e-views e-timeline-year'
                };
                break;
        }
        return view;
    };
    HeaderRenderer.prototype.renderHeaderPopup = function () {
        var headerPopupEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_POPUP_CLASS"] });
        var headerCalendarEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CALENDAR_CLASS"] });
        headerPopupEle.appendChild(headerCalendarEle);
        this.element.appendChild(headerPopupEle);
        this.headerPopup = new _ej2_popups__WEBPACK_IMPORTED_MODULE_3__["Popup"](headerPopupEle, {
            actionOnScroll: 'hide',
            targetType: 'relative',
            relateTo: this.getPopUpRelativeElement(),
            position: { X: 'left', Y: 'bottom' },
            enableRtl: this.parent.enableRtl
        });
        this.headerPopup.isStringTemplate = true;
        var calendarView = this.getCalendarView();
        this.headerCalendar = new _ej2_calendars__WEBPACK_IMPORTED_MODULE_2__["Calendar"]({
            value: this.parent.selectedDate,
            min: this.parent.minDate,
            max: this.parent.maxDate,
            firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
            enableRtl: this.parent.enableRtl,
            locale: this.parent.locale,
            depth: calendarView,
            start: calendarView,
            calendarMode: this.parent.calendarMode,
            change: this.calendarChange.bind(this)
        });
        this.headerCalendar.isStringTemplate = true;
        this.setCalendarTimezone();
        this.headerCalendar.appendTo(headerCalendarEle);
        this.headerPopup.hide();
    };
    HeaderRenderer.prototype.calendarChange = function (args) {
        if (args.value.getTime() !== this.parent.selectedDate.getTime()) {
            var calendarDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["resetTime"](new Date(args.value));
            this.parent.changeDate(calendarDate);
        }
        this.headerPopup.hide();
    };
    HeaderRenderer.prototype.setCalendarTimezone = function () {
        if (this.headerCalendar) {
            // tslint:disable-next-line:no-any
            this.headerCalendar.timezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
        }
    };
    HeaderRenderer.prototype.calculateViewIndex = function (args) {
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(args.originalEvent.target, '.e-views');
        var views = [].slice.call(this.element.querySelectorAll('.e-views'));
        return views.indexOf(target);
    };
    HeaderRenderer.prototype.toolbarClickHandler = function (args) {
        if (!args.item) {
            return;
        }
        var strClass = args.item.cssClass.replace('e-views ', '');
        switch (strClass) {
            case 'e-date-range':
                if (!this.headerPopup) {
                    this.renderHeaderPopup();
                }
                if (this.headerPopup.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["POPUP_OPEN"])) {
                    this.headerPopup.hide();
                }
                else {
                    this.headerPopup.show();
                }
                break;
            case 'e-day':
                this.parent.changeView('Day', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-week':
                this.parent.changeView('Week', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-work-week':
                this.parent.changeView('WorkWeek', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-month':
                this.parent.changeView('Month', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-year':
                this.parent.changeView('Year', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-agenda':
                this.parent.changeView('Agenda', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-month-agenda':
                this.parent.changeView('MonthAgenda', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-timeline-day':
                this.parent.changeView('TimelineDay', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-timeline-week':
                this.parent.changeView('TimelineWeek', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-timeline-work-week':
                this.parent.changeView('TimelineWorkWeek', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-timeline-month':
                this.parent.changeView('TimelineMonth', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-timeline-year':
                this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
                break;
            case 'e-today':
                if (!this.parent.isSelectedDate(_base_util__WEBPACK_IMPORTED_MODULE_5__["resetTime"](this.parent.getCurrentTime()))) {
                    this.parent.changeDate(_base_util__WEBPACK_IMPORTED_MODULE_5__["resetTime"](this.parent.getCurrentTime()), args.originalEvent);
                }
                break;
            case 'e-prev':
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), args.originalEvent);
                break;
            case 'e-next':
                this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), args.originalEvent);
                break;
            case 'e-add':
                var data = void 0;
                var isSameTime = this.parent.activeCellsData.startTime.getTime() === this.parent.activeCellsData.endTime.getTime();
                if (this.parent.activeCellsData && !isSameTime) {
                    data = this.parent.activeCellsData;
                }
                else {
                    var interval = this.parent.activeViewOptions.timeScale.interval;
                    var slotCount = this.parent.activeViewOptions.timeScale.slotCount;
                    var msInterval = (interval * _base_util__WEBPACK_IMPORTED_MODULE_5__["MS_PER_MINUTE"]) / slotCount;
                    var startTime = new Date(this.parent.selectedDate.getTime());
                    var currentTime = this.parent.getCurrentTime();
                    startTime.
                        setHours(currentTime.getHours(), (Math.round(startTime.getMinutes() / msInterval) * msInterval), 0);
                    var endTime = new Date(new Date(startTime.getTime()).setMilliseconds(startTime.getMilliseconds() + msInterval));
                    data = { startTime: startTime, endTime: endTime, isAllDay: false };
                }
                this.parent.eventWindow.openEditor(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])(data, { cancel: false, event: args.originalEvent }), 'Add');
                break;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.toolbarObj)) {
            return;
        }
        var toolbarPopUp = this.toolbarObj.element.querySelector('.e-toolbar-pop');
        if (toolbarPopUp && args.item.type !== 'Input') {
            toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
        }
    };
    HeaderRenderer.prototype.getHeaderElement = function () {
        return this.toolbarObj.element;
    };
    HeaderRenderer.prototype.updateHeaderItems = function (classType) {
        var prevNavEle = this.toolbarObj.element.querySelector('.e-prev');
        var nextNavEle = this.toolbarObj.element.querySelector('.e-next');
        var dateRangeEle = this.toolbarObj.element.querySelector('.e-date-range');
        if (prevNavEle) {
            (classType === 'add') ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([prevNavEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([prevNavEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]);
        }
        if (nextNavEle) {
            (classType === 'add') ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([nextNavEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([nextNavEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDDEN_CLASS"]);
        }
        if (dateRangeEle) {
            (classType === 'add') ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([dateRangeEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"]) : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([dateRangeEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TEXT_ELLIPSIS"]);
        }
    };
    HeaderRenderer.prototype.previousNextIconHandler = function () {
        var dates = (this.parent.currentView === 'Agenda' ?
            [this.parent.getCurrentViewDates()[0]] : this.parent.getCurrentViewDates());
        var prevNavEle = this.toolbarObj.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["PREVIOUS_DATE_CLASS"]);
        var nextNavEle = this.toolbarObj.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["NEXT_DATE_CLASS"]);
        var firstDate = new Date(dates[0].getTime());
        var lastDate = new Date(dates[dates.length - 1].getTime());
        if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {
            firstDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["getWeekFirstDate"](_base_util__WEBPACK_IMPORTED_MODULE_5__["resetTime"](this.parent.selectedDate), this.parent.firstDayOfWeek);
            lastDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["addDays"](firstDate, 7 * this.parent.activeViewOptions.interval);
        }
        if (this.parent.currentView === 'Month') {
            firstDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["firstDateOfMonth"](this.parent.selectedDate);
            var lastMonthFirstDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["addMonths"](firstDate, this.parent.activeViewOptions.interval - 1);
            lastDate = _base_util__WEBPACK_IMPORTED_MODULE_5__["lastDateOfMonth"](lastMonthFirstDate);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(prevNavEle)) {
            this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(nextNavEle)) {
            this.toolbarObj.enableItems(nextNavEle, lastDate < this.parent.maxDate);
        }
        this.setCalendarMinMaxDate();
    };
    /**
     * Get module name.
     */
    HeaderRenderer.prototype.getModuleName = function () {
        return 'headerbar';
    };
    /**
     * To destroy the headerbar.
     * @return {void}
     * @private
     */
    HeaderRenderer.prototype.destroy = function () {
        if (this.headerPopup && !this.headerPopup.isDestroyed) {
            this.headerPopup.destroy();
            this.headerPopup = null;
        }
        if (this.headerCalendar && !this.headerCalendar.isDestroyed) {
            this.headerCalendar.destroy();
            this.headerCalendar = null;
        }
        if (this.toolbarObj && !this.toolbarObj.isDestroyed) {
            this.toolbarObj.destroy();
            this.removeEventListener();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.toolbarObj = null;
        }
    };
    return HeaderRenderer;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month-agenda.js":
/*!**************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month-agenda.js ***!
  \**************************************************************************************/
/*! exports provided: MonthAgenda */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonthAgenda", function() { return MonthAgenda; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _event_renderer_agenda_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../event-renderer/agenda-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/agenda-base.js");
/* harmony import */ var _month__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






/**
 * month agenda view
 */
var MonthAgenda = /** @__PURE__ @class */ (function (_super) {
    __extends(MonthAgenda, _super);
    /**
     * Constructor
     */
    function MonthAgenda(parent) {
        var _this = _super.call(this, parent) || this;
        _this.dayNameFormat = 'narrow';
        _this.viewClass = 'e-month-agenda-view';
        _this.agendaDates = {};
        _this.agendaBase = new _event_renderer_agenda_base__WEBPACK_IMPORTED_MODULE_1__["AgendaBase"](parent);
        _this.monthAgendaDate = new Date('' + parent.selectedDate);
        return _this;
    }
    MonthAgenda.prototype.renderAppointmentContainer = function () {
        if (this.parent.isServerRenderer()) {
            this.setEventWrapperHeight();
            return;
        }
        var contentArea = this.getContentAreaElement();
        var wrapperContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WRAPPER_CONTAINER_CLASS"] });
        contentArea.appendChild(wrapperContainer);
        var appWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_WRAP_CLASS"] });
        wrapperContainer.appendChild(appWrap);
        this.appendAppContainer(appWrap);
        this.setEventWrapperHeight();
    };
    MonthAgenda.prototype.getDayNameFormat = function () {
        if (this.parent.isAdaptive) {
            return 'narrow';
        }
        return 'abbreviated';
    };
    MonthAgenda.prototype.setEventWrapperHeight = function () {
        var headerHeight = (this.parent.headerModule ? this.parent.headerModule.getHeaderElement().offsetHeight : 0) + 2;
        var resourceWrapper = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_HEADER_TOOLBAR"]);
        if (resourceWrapper) {
            headerHeight += resourceWrapper.offsetHeight;
        }
        var contentArea = this.getContentAreaElement().firstElementChild;
        var dateHeader = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_WRAP_CLASS"]);
        var availableHeight = this.parent.element.offsetHeight - headerHeight - dateHeader.offsetHeight - contentArea.offsetHeight;
        var wrapperContainer = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WRAPPER_CONTAINER_CLASS"]);
        var eventWrapper = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_WRAP_CLASS"]);
        wrapperContainer.style.height = eventWrapper.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(availableHeight);
    };
    MonthAgenda.prototype.onDataReady = function (args) {
        this.setEventWrapperHeight();
        this.clearElements();
        var eventCollection = args.processedData;
        if (this.parent.uiStateValues.isGroupAdaptive) {
            var resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
            eventCollection = this.parent.eventBase.filterEventsByResource(resource, eventCollection);
        }
        this.parent.eventsProcessed = this.agendaBase.processAgendaEvents(eventCollection);
        var count = 0;
        for (var _i = 0, _a = this.renderDates; _i < _a.length; _i++) {
            var date = _a[_i];
            var filterData = this.appointmentFiltering(date);
            var workCell = this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"])[count];
            if (filterData.length > 0) {
                if (!workCell.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_INDICATOR_CLASS"])) {
                    workCell.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_INDICATOR_CLASS"] }));
                }
                if (date.getTime() === _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(this.monthAgendaDate.getTime())).getTime()) {
                    this.onEventRender(filterData, date);
                }
            }
            count++;
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["eventsLoaded"], {});
    };
    MonthAgenda.prototype.onCellClick = function (event) {
        this.parent.quickPopup.quickPopupHide();
        var filterData = this.appointmentFiltering(event.startTime);
        this.onEventRender(filterData, event.startTime);
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["eventsLoaded"], {});
        this.monthAgendaDate = new Date('' + event.startTime);
    };
    MonthAgenda.prototype.onEventRender = function (events, date) {
        var appWrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_WRAP_CLASS"]);
        _base_util__WEBPACK_IMPORTED_MODULE_3__["removeChildren"](appWrap);
        if (this.parent.activeViewOptions.group.resources.length === 0 || this.parent.uiStateValues.isGroupAdaptive) {
            if (events.length > 0) {
                var appContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_CONTAINER_CLASS"] });
                appWrap.appendChild(this.agendaBase.
                    createAgendaContentElement('data', events, appContainer));
            }
            else {
                this.appendAppContainer(appWrap);
            }
        }
        else {
            if (events.length > 0) {
                var table = this.createTableLayout();
                var tBody = table.querySelector('tbody');
                this.agendaBase.calculateResourceTableElement(tBody, 1, date);
                table.appendChild(tBody);
                appWrap.appendChild(table);
            }
            else {
                this.appendAppContainer(appWrap);
            }
        }
        this.agendaBase.wireEventActions();
    };
    MonthAgenda.prototype.appointmentFiltering = function (date) {
        var dateStart = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(date.getTime()));
        var dateEnd = _base_util__WEBPACK_IMPORTED_MODULE_3__["setTime"](new Date(dateStart.getTime()), _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]);
        return this.parent.eventBase.filterEvents(dateStart, dateEnd);
    };
    MonthAgenda.prototype.clearElements = function () {
        var appointmentIndicators = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_INDICATOR_CLASS"]));
        for (var _i = 0, appointmentIndicators_1 = appointmentIndicators; _i < appointmentIndicators_1.length; _i++) {
            var appointmentIndicator = appointmentIndicators_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(appointmentIndicator);
        }
        this.appendAppContainer(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_WRAP_CLASS"]));
    };
    MonthAgenda.prototype.appendAppContainer = function (appWrap) {
        var app = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["APPOINTMENT_CONTAINER_CLASS"] });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([app], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["AGENDA_NO_EVENT_CLASS"]);
        app.innerHTML = this.parent.localeObj.getConstant('noEvents');
        _base_util__WEBPACK_IMPORTED_MODULE_3__["removeChildren"](appWrap);
        appWrap.appendChild(app);
    };
    MonthAgenda.prototype.getNextPreviousDate = function (type) {
        var selectedDate = this.parent.selectedDate;
        var interval = (type === 'next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
        var navigateDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](this.parent.selectedDate, interval);
        var month = (type === 'next') ? 2 : 0;
        var lastDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + month, 0).getDate();
        var date = (lastDate >= this.monthAgendaDate.getDate()) ? this.monthAgendaDate.getDate() : lastDate;
        this.monthAgendaDate = new Date(navigateDate.getFullYear(), navigateDate.getMonth(), date);
        return this.monthAgendaDate;
    };
    /**
     * Get module name.
     */
    MonthAgenda.prototype.getModuleName = function () {
        return 'monthAgenda';
    };
    return MonthAgenda;
}(_month__WEBPACK_IMPORTED_MODULE_2__["Month"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month.js":
/*!*******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month.js ***!
  \*******************************************************************************/
/*! exports provided: Month */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Month", function() { return Month; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _view_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();







/**
 * month view
 */
var Month = /** @__PURE__ @class */ (function (_super) {
    __extends(Month, _super);
    /**
     * Constructor for month view
     */
    function Month(parent) {
        var _this = _super.call(this, parent) || this;
        _this.dayNameFormat = 'wide';
        _this.viewClass = 'e-month-view';
        _this.isInverseTableSelect = false;
        _this.monthDates = {};
        return _this;
    }
    Month.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onScrollUIUpdate, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.onDataReady, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["cellClick"], this.onCellClick, this);
    };
    Month.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onScrollUIUpdate);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.onDataReady);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["cellClick"], this.onCellClick);
    };
    Month.prototype.onDataReady = function (args) {
        var monthEvent = new _event_renderer_month__WEBPACK_IMPORTED_MODULE_2__["MonthEvent"](this.parent);
        monthEvent.renderAppointments();
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["eventsLoaded"], {});
    };
    Month.prototype.onCellClick = function (event) {
        // Here cell click
    };
    Month.prototype.onContentScroll = function (e) {
        this.parent.removeNewEventElement();
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["virtualScroll"], e);
        this.scrollTopPanel(e.target);
        this.scrollLeftPanel(e.target);
        this.setPersistence();
    };
    Month.prototype.scrollLeftPanel = function (target) {
        var leftPanel = this.getLeftPanelElement();
        if (leftPanel) {
            leftPanel.scrollTop = target.scrollTop;
        }
    };
    Month.prototype.getLeftPanelElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WEEK_NUMBER_WRAPPER_CLASS"]);
    };
    Month.prototype.onScrollUIUpdate = function (args) {
        var headerHeight = this.getHeaderBarHeight();
        var header = this.getDatesHeaderElement();
        var content = this.getContentAreaElement();
        var height = this.parent.element.offsetHeight - headerHeight - header.offsetHeight;
        var leftPanel = this.getLeftPanelElement();
        this.setContentHeight(content, leftPanel, height);
        var scrollBarWidth = _base_util__WEBPACK_IMPORTED_MODULE_3__["getScrollBarWidth"]();
        // tslint:disable:no-any
        header.firstElementChild.style[args.cssProperties.rtlBorder] = '';
        header.style[args.cssProperties.rtlPadding] = '';
        if (content.offsetWidth - content.clientWidth > 0) {
            header.firstElementChild.style[args.cssProperties.border] = scrollBarWidth > 0 ? '1px' : '0px';
            header.style[args.cssProperties.padding] = scrollBarWidth > 0 ? scrollBarWidth - 1 + 'px' : '0px';
        }
        else {
            header.firstElementChild.style[args.cssProperties.border] = '';
            header.style[args.cssProperties.padding] = '';
        }
        // tslint:enable:no-any
        this.setColWidth(content);
        if (args.scrollPosition) {
            if (leftPanel) {
                leftPanel.scrollTop = args.scrollPosition.top;
            }
            content.scrollTop = args.scrollPosition.top;
            content.scrollLeft = args.scrollPosition.left;
        }
        else {
            var headerCell = document.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"] + '[data-date="'
                + this.parent.getMsFromDate(this.parent.selectedDate) + '"]');
            content.scrollLeft = headerCell !== null ? headerCell.offsetLeft : 0;
        }
        this.retainScrollPosition();
    };
    Month.prototype.setContentHeight = function (content, leftPanelElement, height) {
        content.style.height = 'auto';
        if (this.parent.currentView === 'Month') {
            content.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height);
        }
        if (leftPanelElement) {
            if (this.parent.currentView === 'MonthAgenda') {
                height = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]).offsetHeight;
            }
            leftPanelElement.style.height = 'auto';
            leftPanelElement.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height - this.getScrollXIndent(content));
        }
    };
    Month.prototype.generateColumnLevels = function () {
        var colLevels = [];
        var level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            colLevels = this.parent.resourceBase.generateResourceLevels(level);
            if (this.parent.currentView === 'MonthAgenda') {
                colLevels = [level];
            }
            if (this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.lastResourceLevel.length > 0) {
                var resourceLevel = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
                colLevels = [this.getDateSlots(resourceLevel.renderDates, resourceLevel.workDays)];
            }
        }
        else {
            colLevels.push(level);
        }
        this.colLevels = colLevels;
        return colLevels;
    };
    Month.prototype.getDateSlots = function (renderDates, workDays) {
        var count = this.parent.activeViewOptions.showWeekend ? _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"] : workDays.length;
        var dateSlots = [];
        for (var col = 0; col < count; col++) {
            var classList = [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"]];
            var currentDateIndex = renderDates.slice(0, count).map(function (date) { return date.getDay(); });
            if (this.isCurrentMonth(this.parent.selectedDate) && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
                classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_DAY_CLASS"]);
            }
            dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList, colSpan: 1, workDays: workDays });
        }
        return dateSlots;
    };
    Month.prototype.getDayNameFormat = function () {
        if (this.parent.isAdaptive || this.parent.activeViewOptions.group.resources.length > 0) {
            return 'abbreviated';
        }
        return 'wide';
    };
    Month.prototype.serverRenderLayout = function () {
        var curElem = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_DAY_CLASS"]));
        if (curElem.length > 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(curElem, _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_DAY_CLASS"]);
        }
        var curDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffset"](new Date(new Date().setHours(0, 0, 0, 0)));
        var queryString = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"] + '[data-date="' + curDate.getTime().toString() + '"]';
        if (this.parent.currentView === 'Month' || this.parent.currentView === 'MonthAgenda') {
            curElem = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENTDATE_CLASS"]));
            if (curElem.length > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(curElem, _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENTDATE_CLASS"]);
            }
            var curEle = [].slice.call(this.parent.element.querySelectorAll(queryString));
            for (var _i = 0, curEle_1 = curEle; _i < curEle_1.length; _i++) {
                var ele = curEle_1[_i];
                var index = ele.cellIndex;
                var curHeader = [].slice.call(this.parent.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"]))[index];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENTDATE_CLASS"]);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([curHeader], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_DAY_CLASS"]);
            }
        }
        if (this.parent.currentView === 'TimelineMonth') {
            var curEle = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"] + '[data-date="' + curDate.getTime().toString() + '"]');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(curEle)) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([curEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_DAY_CLASS"]);
            }
        }
        this.setPanel(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_WRAP_CLASS"]));
        var target = (this.parent.currentView === 'MonthAgenda') ? this.parent.activeView.getPanel() : this.parent.element;
        var headerCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_WRAP_CLASS"] + ' td.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"]));
        for (var _a = 0, headerCells_1 = headerCells; _a < headerCells_1.length; _a++) {
            var cell = headerCells_1[_a];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(cell);
            this.wireCellEvents(cell);
        }
        var contentBody = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"] + ' tbody');
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(contentBody);
        this.wireCellEvents(contentBody);
        if (this.parent.virtualScrollModule) {
            this.parent.virtualScrollModule.setTranslateValue();
        }
        var wrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(wrap);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, 'scroll', this.onContentScroll, this);
        this.wireExpandCollapseIconEvents();
        this.renderAppointmentContainer();
        if (this.parent.uiStateValues.isGroupAdaptive && !target.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TOOLBAR_CONTAINER"])) {
            this.renderResourceMobileLayout();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["contentReady"], {});
    };
    Month.prototype.renderLayout = function (type) {
        this.dayNameFormat = this.getDayNameFormat();
        if (this.parent.isServerRenderer()) {
            this.colLevels = this.generateColumnLevels();
            if (this.parent.activeView.isTimelineView() && this.parent.resourceBase &&
                this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                this.parent.resourceBase.setRenderedResources();
            }
            return;
        }
        this.setPanel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_WRAP_CLASS"] }));
        var clsList = [this.viewClass];
        clsList.push(type);
        if (this.parent.activeViewOptions.group.byDate) {
            clsList.push('e-by-date');
        }
        if (this.parent.activeViewOptions.allowVirtualScrolling) {
            clsList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["VIRTUAL_SCROLL_CLASS"]);
        }
        if (this.parent.eventSettings.ignoreWhitespace) {
            clsList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["IGNORE_WHITESPACE"]);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], clsList);
        this.renderPanel(type);
        this.element.appendChild(this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["OUTER_TABLE_CLASS"]));
        this.element.querySelector('table').setAttribute('role', 'presentation');
        this.colLevels = this.generateColumnLevels();
        this.renderHeader();
        this.renderContent();
        var target = (this.parent.currentView === 'MonthAgenda') ? this.parent.activeView.getPanel() : this.parent.element;
        if (this.parent.uiStateValues.isGroupAdaptive && !target.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_TOOLBAR_CONTAINER"])) {
            this.renderResourceMobileLayout();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["contentReady"], {});
    };
    Month.prototype.wireCellEvents = function (element) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
        if (!this.parent.isAdaptive) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
        }
    };
    Month.prototype.renderHeader = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        this.renderLeftIndent(tr);
        var dateTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        dateTd.appendChild(this.renderDatesHeader());
        tr.appendChild(dateTd);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([tr], this.element.querySelector('tbody'));
    };
    Month.prototype.renderLeftIndent = function (tr) {
        if (this.parent.activeViewOptions.showWeekNumber) {
            tr.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: 'e-left-indent' }));
        }
    };
    Month.prototype.renderContent = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        if (this.parent.activeViewOptions.showWeekNumber) {
            tr.appendChild(this.renderWeekNumberContent());
        }
        var workTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] });
        var contentArea = this.renderContentArea();
        if (this.parent.currentView === 'Month') {
            wrap.appendChild(contentArea);
        }
        else {
            var monthAgendaWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_CONTAINER_CLASS"] });
            monthAgendaWrapper.appendChild(contentArea);
            wrap.appendChild(monthAgendaWrapper);
        }
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, 'scroll', this.onContentScroll, this);
        workTd.appendChild(wrap);
        tr.appendChild(workTd);
        this.element.querySelector('tbody').appendChild(tr);
        this.renderAppointmentContainer();
    };
    Month.prototype.renderWeekNumberContent = function () {
        var dateCol = this.renderDates.map(function (date) { return new Date(+date); });
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        var contentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WEEK_NUMBER_WRAPPER_CLASS"] });
        td.appendChild(contentWrapper);
        var contentWrapTable = this.createTableLayout();
        contentWrapper.appendChild(contentWrapTable);
        var noOfDays = this.parent.activeViewOptions.showWeekend ? _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"] :
            this.parent.activeViewOptions.workDays.length;
        for (var i = 0, length_1 = (this.renderDates.length / noOfDays); i < length_1; i++) {
            var dates = dateCol.splice(0, noOfDays);
            var weekNumber = _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getWeekNumberContent(this.parent, dates).toString();
            contentWrapTable.querySelector('tbody').appendChild(this.createWeekNumberElement(weekNumber));
        }
        return td;
    };
    Month.prototype.renderAppointmentContainer = function () {
        //Here needs to render mobile view appointment details on selected date
    };
    Month.prototype.renderDatesHeader = function () {
        var container = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_CONTAINER_CLASS"] });
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_WRAP_CLASS"] });
        container.appendChild(wrap);
        var table = this.createTableLayout();
        this.createColGroup(table, this.colLevels[this.colLevels.length - 1]);
        var trEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        for (var i = 0; i < this.colLevels.length; i++) {
            var level = this.colLevels[i];
            var ntr = trEle.cloneNode();
            for (var j = 0; j < level.length; j++) {
                var td = level[j];
                ntr.appendChild(this.createHeaderCell(td));
            }
            table.querySelector('tbody').appendChild(ntr);
        }
        wrap.appendChild(table);
        return container;
    };
    Month.prototype.createHeaderCell = function (td) {
        var tdEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        this.addAttributes(td, tdEle);
        if (td.type === 'monthDay') {
            var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', { innerHTML: _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](this.parent.getDayNames(this.dayNameFormat)[td.date.getDay()], 'single') });
            tdEle.appendChild(ele);
        }
        if (td.type === 'resourceHeader') {
            this.setResourceHeaderContent(tdEle, td);
        }
        if (td.type === 'dateHeader') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_CLASS"]);
            tdEle.setAttribute('data-date', td.date.getTime().toString());
            if (this.parent.activeViewOptions.dateHeaderTemplate) {
                var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffset"](td.date);
                var cellArgs = { date: dateValue, type: td.type };
                var elementId = this.parent.element.id + '_';
                var viewName = this.parent.activeViewOptions.dateHeaderTemplateName;
                var templateId = elementId + viewName + 'dateHeaderTemplate';
                var dateTemplate = [].slice.call(this.parent.getDateHeaderTemplate()(cellArgs, this.parent, 'dateHeaderTemplate', templateId, false));
                if (dateTemplate && dateTemplate.length) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(dateTemplate, tdEle);
                }
            }
            else {
                var ele = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["NAVIGATE_CLASS"] });
                var skeleton = 'full';
                var title = this.parent.globalize.formatDate(td.date, { skeleton: skeleton, calendar: this.parent.getCalendarMode() });
                ele.setAttribute('title', _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](title, 'multiple'));
                var innerText = (this.parent.calendarUtil.isMonthStart(td.date) && !this.isCurrentDate(td.date) && !this.parent.isAdaptive) ?
                    this.parent.globalize.formatDate(td.date, { format: 'MMM d', calendar: this.parent.getCalendarMode() }) :
                    this.parent.globalize.formatDate(td.date, { skeleton: 'd', calendar: this.parent.getCalendarMode() });
                ele.innerHTML = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](innerText, 'single');
                tdEle.appendChild(ele);
            }
            this.wireCellEvents(tdEle);
        }
        var args = { elementType: td.type, element: tdEle, date: td.date, groupIndex: td.groupIndex };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], args);
        return tdEle;
    };
    Month.prototype.getContentSlots = function () {
        if (!(this.colLevels[this.colLevels.length - 1] && this.colLevels[this.colLevels.length - 1][0])) {
            return [];
        }
        var slotDatas = [];
        var prepareSlots = function (rowIndex, renderDate, resData, classList) {
            var data = {
                date: new Date(+renderDate), groupIndex: resData.groupIndex, workDays: resData.workDays,
                type: 'monthCells', className: classList || [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"]]
            };
            if (!slotDatas[rowIndex]) {
                slotDatas[rowIndex] = [];
            }
            slotDatas[rowIndex].push(data);
        };
        var includeResource = this.parent.currentView !== 'MonthAgenda' &&
            this.parent.activeViewOptions.group.resources.length > 0;
        if (includeResource && !this.parent.uiStateValues.isGroupAdaptive && !this.parent.activeViewOptions.group.byDate) {
            for (var _i = 0, _a = this.colLevels[this.colLevels.length - 2]; _i < _a.length; _i++) {
                var res = _a[_i];
                var dates = res.renderDates.map(function (date) { return new Date(+date); });
                var count = this.parent.activeViewOptions.showWeekend ? _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"] : res.workDays.length;
                for (var i = 0; i < (res.renderDates.length / count); i++) {
                    var colDates = dates.splice(0, count);
                    for (var _b = 0, colDates_1 = colDates; _b < colDates_1.length; _b++) {
                        var colDate = colDates_1[_b];
                        prepareSlots(i, colDate, res);
                    }
                }
            }
        }
        else {
            var dates = this.renderDates.map(function (date) { return new Date(+date); });
            var count = this.parent.activeViewOptions.showWeekend ? _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"] :
                this.parent.activeViewOptions.workDays.length;
            for (var i = 0; i < (this.renderDates.length / count); i++) {
                var colDates = dates.splice(0, count);
                for (var _c = 0, colDates_2 = colDates; _c < colDates_2.length; _c++) {
                    var colDate = colDates_2[_c];
                    if (includeResource) {
                        var lastRow = this.colLevels[(this.colLevels.length - 1)];
                        var resourcesTd = lastRow.slice(0, lastRow.length / count);
                        for (var resIndex = 0; resIndex < resourcesTd.length; resIndex++) {
                            var clsList = void 0;
                            if (resIndex !== 0) {
                                clsList = [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DISABLE_DATE"]];
                            }
                            prepareSlots(i, colDate, resourcesTd[resIndex], clsList);
                        }
                    }
                    else {
                        prepareSlots(i, colDate, this.colLevels[this.colLevels.length - 1][0]);
                    }
                }
            }
        }
        return slotDatas;
    };
    Month.prototype.updateClassList = function (data) {
        if (this.isOtherMonth(data.date)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["OTHERMONTH_CLASS"]);
        }
        if (!this.parent.isMinMaxDate(data.date)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DISABLE_DATES"]);
        }
        if (this.parent.currentView === 'MonthAgenda' && this.parent.isSelectedDate(data.date)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["SELECTED_CELL_CLASS"]);
        }
    };
    Month.prototype.isOtherMonth = function (date) {
        return date.getTime() < this.monthDates.start.getTime() || date.getTime() > this.monthDates.end.getTime();
    };
    Month.prototype.renderContentArea = function () {
        var tbl = this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]);
        this.addAutoHeightClass(tbl);
        if (this.parent.currentView === 'TimelineMonth') {
            this.createColGroup(tbl, this.colLevels[this.colLevels.length - 1]);
        }
        var monthDate = new Date(this.parent.selectedDate.getTime());
        this.monthDates = {
            start: this.parent.calendarUtil.firstDateOfMonth(monthDate),
            end: this.parent.calendarUtil.lastDateOfMonth(_base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](monthDate, this.parent.activeViewOptions.interval - 1))
        };
        var tBody = tbl.querySelector('tbody');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getContentRows(), tBody);
        this.wireCellEvents(tBody);
        return tbl;
    };
    Month.prototype.getContentRows = function () {
        var trows = [];
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { role: 'row' } });
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
        var slotDatas = this.getContentSlots();
        for (var row = 0; row < slotDatas.length; row++) {
            var ntr = tr.cloneNode();
            for (var col = 0; col < slotDatas[row].length; col++) {
                var ntd = this.createContentTd(slotDatas[row][col], td);
                ntr.appendChild(ntd);
            }
            trows.push(ntr);
        }
        return trows;
    };
    Month.prototype.createContentTd = function (data, td) {
        var ntd = td.cloneNode();
        if (data.colSpan) {
            ntd.setAttribute('colspan', data.colSpan.toString());
        }
        this.updateClassList(data);
        var type = data.type;
        if (data.className.indexOf(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_PARENT_CLASS"]) !== -1) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_GROUP_CELLS_CLASS"]);
            type = 'resourceGroupCells';
        }
        if (this.parent.workHours.highlight && this.isWorkDay(data.date, data.workDays)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORKDAY_CLASS"]);
        }
        if (this.isCurrentDate(data.date)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENTDATE_CLASS"]);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], data.className);
        ntd.setAttribute('data-date', data.date.getTime().toString());
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(data.groupIndex) || this.parent.uiStateValues.isGroupAdaptive) {
            var groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex :
                data.groupIndex;
            ntd.setAttribute('data-group-index', '' + groupIndex);
        }
        this.renderDateHeaderElement(data, ntd);
        if (this.parent.activeViewOptions.cellTemplate) {
            var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffset"](data.date);
            var args_1 = { date: dateValue, type: type, groupIndex: data.groupIndex };
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.cellTemplateName;
            var templateId = scheduleId + viewName + 'cellTemplate';
            var cellTemplate = [].slice.call(this.parent.getCellTemplate()(args_1, this.parent, 'cellTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(cellTemplate, ntd);
        }
        var args = { elementType: type, element: ntd, date: data.date, groupIndex: data.groupIndex };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], args);
        return ntd;
    };
    Month.prototype.renderDateHeaderElement = function (data, ntd) {
        if (this.parent.currentView === 'TimelineMonth') {
            return;
        }
        var dateHeader = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_CLASS"] });
        if (this.parent.activeViewOptions.cellHeaderTemplate) {
            var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_3__["addLocalOffset"](data.date);
            var args = { date: dateValue, type: data.type, groupIndex: data.groupIndex };
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.cellHeaderTemplateName;
            var templateId = scheduleId + viewName + 'cellHeaderTemplate';
            var cellheaderTemplate = [].slice.call(this.parent.getCellHeaderTemplate()(args, this.parent, 'cellHeaderTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(cellheaderTemplate, dateHeader);
        }
        else {
            var innerText = (this.parent.calendarUtil.isMonthStart(data.date) && !this.isCurrentDate(data.date) && !this.parent.isAdaptive) ?
                this.parent.globalize.formatDate(data.date, { format: 'MMM d', calendar: this.parent.getCalendarMode() }) :
                this.parent.globalize.formatDate(data.date, { skeleton: 'd', calendar: this.parent.getCalendarMode() });
            dateHeader.innerHTML = _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](innerText, 'single');
        }
        ntd.appendChild(dateHeader);
        if (this.getModuleName() === 'month') {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([dateHeader], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["NAVIGATE_CLASS"]);
            var skeleton = 'full';
            var annocementText = this.parent.globalize.formatDate(data.date, { skeleton: skeleton, calendar: this.parent.getCalendarMode() });
            dateHeader.setAttribute('aria-label', annocementText);
        }
    };
    Month.prototype.getMonthStart = function (currentDate) {
        var monthStart = _base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekFirstDate"](this.parent.calendarUtil.firstDateOfMonth(currentDate), this.parent.activeViewOptions.firstDayOfWeek);
        var start = new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
        return start;
    };
    Month.prototype.getMonthEnd = function (currentDate) {
        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](currentDate, this.parent.activeViewOptions.interval - 1);
        var lastWeekOfMonth = _base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekFirstDate"](this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
        var monthEnd = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](lastWeekOfMonth, _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"] - 1);
        return monthEnd;
    };
    Month.prototype.getRenderDates = function (workDays) {
        var renderDates = [];
        var currentDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](this.parent.selectedDate);
        var start = this.getMonthStart(currentDate);
        var monthEnd = this.getMonthEnd(currentDate);
        do {
            if (this.parent.activeViewOptions.showWeekend) {
                renderDates.push(start);
            }
            else {
                if (this.isWorkDay(start, workDays)) {
                    renderDates.push(start);
                }
            }
            start = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](start, 1);
            if (start.getHours() > 0) {
                start = _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](start);
            }
        } while (start.getTime() <= monthEnd.getTime());
        if (!workDays) {
            this.renderDates = renderDates;
        }
        if (this.parent.headerModule) {
            this.parent.headerModule.previousNextIconHandler();
        }
        return renderDates;
    };
    Month.prototype.getNextPreviousDate = function (type) {
        if (type === 'next') {
            return _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](this.parent.selectedDate, this.parent.activeViewOptions.interval);
        }
        else {
            return _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](this.parent.selectedDate, -(this.parent.activeViewOptions.interval));
        }
    };
    Month.prototype.getEndDateFromStartDate = function (start) {
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(start.getTime()), 1);
    };
    Month.prototype.getDateRangeText = function () {
        if (this.parent.isAdaptive || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeViewOptions.dateFormat)) {
            if (this.parent.activeViewOptions.interval > 1) {
                var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addMonths"](_base_util__WEBPACK_IMPORTED_MODULE_3__["lastDateOfMonth"](this.parent.selectedDate), this.parent.activeViewOptions.interval - 1);
                if (this.parent.selectedDate.getFullYear() === endDate.getFullYear()) {
                    var monthNames = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
                        (this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
                        endDate.getFullYear();
                    return _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](monthNames, 'single');
                }
                var text = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
                    this.parent.selectedDate.getFullYear() + ' - ' + (this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
                    endDate.getFullYear();
                return _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](text, 'single');
            }
            var format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
            return _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](this.parent.globalize.formatDate(this.parent.selectedDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
        }
        return this.formatDateRange(this.parent.selectedDate);
    };
    Month.prototype.getLabelText = function (view) {
        return this.parent.localeObj.getConstant(view) + ' of ' + _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM y', calendar: this.parent.getCalendarMode() }), 'single');
    };
    Month.prototype.createWeekNumberElement = function (text) {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WEEK_NUMBER_CLASS"],
            attrs: { 'title': (text ? this.parent.localeObj.getConstant('week') + ' ' + text : '') },
            innerHTML: (text || '')
        });
        tr.appendChild(td);
        var args = { elementType: 'weekNumberCell', element: td };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], args);
        return tr;
    };
    Month.prototype.unwireEvents = function () {
        // No scroller events for month view
    };
    /**
     * Get module name.
     */
    Month.prototype.getModuleName = function () {
        return 'month';
    };
    /**
     * To destroy the month.
     * @return {void}
     * @private
     */
    Month.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        if (this.element) {
            this.unwireEvents();
            if (this.parent.resourceBase) {
                this.parent.resourceBase.destroy();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.element = null;
            if (this.parent.scheduleTouchModule) {
                this.parent.scheduleTouchModule.resetValues();
            }
        }
    };
    return Month;
}(_view_base__WEBPACK_IMPORTED_MODULE_1__["ViewBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/renderer.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/renderer.js ***!
  \**********************************************************************************/
/*! exports provided: Render */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Render", function() { return Render; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _actions_virtual_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../actions/virtual-scroll */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/actions/virtual-scroll.js");
/* harmony import */ var _popups_event_tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../popups/event-tooltip */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/popups/event-tooltip.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");





/**
 * Schedule DOM rendering
 */
var Render = /** @__PURE__ @class */ (function () {
    /**
     * Constructor for render
     */
    function Render(parent) {
        this.parent = parent;
    }
    Render.prototype.render = function (viewName, isDataRefresh) {
        if (isDataRefresh === void 0) { isDataRefresh = true; }
        this.initializeLayout(viewName);
        if (this.parent.activeView && isDataRefresh && !this.parent.isServerRenderer()) {
            this.refreshDataManager();
        }
    };
    Render.prototype.initializeLayout = function (viewName) {
        if (this.parent.activeView) {
            this.parent.activeView.removeEventListener();
            this.parent.activeView.destroy();
        }
        switch (viewName) {
            case 'Day':
                this.parent.activeView = this.parent.dayModule;
                break;
            case 'Week':
                this.parent.activeView = this.parent.weekModule;
                break;
            case 'WorkWeek':
                this.parent.activeView = this.parent.workWeekModule;
                break;
            case 'Month':
                this.parent.activeView = this.parent.monthModule;
                break;
            case 'Year':
                this.parent.activeView = this.parent.yearModule;
                break;
            case 'Agenda':
                this.parent.activeView = this.parent.agendaModule;
                break;
            case 'MonthAgenda':
                this.parent.activeView = this.parent.monthAgendaModule;
                break;
            case 'TimelineDay':
                this.parent.activeView = this.parent.timelineViewsModule;
                this.parent.activeView.viewClass = 'e-timeline-day-view';
                break;
            case 'TimelineWorkWeek':
                this.parent.activeView = this.parent.timelineViewsModule;
                this.parent.activeView.viewClass = 'e-timeline-work-week-view';
                break;
            case 'TimelineWeek':
                this.parent.activeView = this.parent.timelineViewsModule;
                this.parent.activeView.viewClass = 'e-timeline-week-view';
                break;
            case 'TimelineMonth':
                this.parent.activeView = this.parent.timelineMonthModule;
                break;
            case 'TimelineYear':
                this.parent.activeView = this.parent.timelineYearModule;
                break;
        }
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeView)) {
            var firstView = this.parent.viewCollections[0].option;
            if (firstView) {
                this.parent.setScheduleProperties({ currentView: firstView });
                if (this.parent.headerModule) {
                    this.parent.headerModule.updateActiveView();
                    this.parent.headerModule.setCalendarView();
                }
                return this.initializeLayout(firstView);
            }
            throw Error('Inject required modules');
        }
        this.parent.activeView.viewIndex = this.parent.viewIndex;
        this.updateLabelText(viewName);
        this.parent.activeView.addEventListener();
        this.parent.activeView.getRenderDates();
        this.parent.uiStateValues.isGroupAdaptive = this.parent.isAdaptive && this.parent.activeViewOptions.group.resources.length > 0 &&
            this.parent.activeViewOptions.group.enableCompactView;
        if (this.parent.virtualScrollModule) {
            this.parent.virtualScrollModule.destroy();
            this.parent.virtualScrollModule = null;
        }
        if (this.parent.currentView.indexOf('Timeline') !== -1 && this.parent.currentView.indexOf('Year') === -1
            && this.parent.activeViewOptions.allowVirtualScrolling
            && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            this.parent.virtualScrollModule = new _actions_virtual_scroll__WEBPACK_IMPORTED_MODULE_1__["VirtualScroll"](this.parent);
            this.parent.uiStateValues.top = 0;
        }
        this.updateHeader();
        this.parent.activeView.renderLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["CURRENT_PANEL_CLASS"]);
        this.parent.renderTemplates();
        if (this.parent.eventTooltip) {
            this.parent.eventTooltip.destroy();
            this.parent.eventTooltip = null;
        }
        if (this.parent.eventSettings.enableTooltip || (this.parent.activeViewOptions.group.resources.length > 0
            && this.parent.activeViewOptions.group.headerTooltipTemplate)) {
            this.parent.eventTooltip = new _popups_event_tooltip__WEBPACK_IMPORTED_MODULE_2__["EventTooltip"](this.parent);
        }
    };
    Render.prototype.updateHeader = function () {
        if (this.parent.headerModule) {
            this.parent.headerModule.setDayOfWeek(this.parent.activeViewOptions.firstDayOfWeek);
            if (this.parent.activeViewOptions.readonly) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.parent.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["READ_ONLY"]);
            }
            else if (this.parent.element.classList.contains(_base_css_constant__WEBPACK_IMPORTED_MODULE_4__["READ_ONLY"])) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.parent.element], _base_css_constant__WEBPACK_IMPORTED_MODULE_4__["READ_ONLY"]);
            }
            this.parent.headerModule.updateDateRange(this.parent.activeView.getDateRangeText());
            this.parent.headerModule.updateHeaderItems('remove');
        }
    };
    Render.prototype.updateLabelText = function (view) {
        var content = this.parent.activeView.getLabelText(view);
        this.parent.element.setAttribute('role', 'main');
        this.parent.element.setAttribute('aria-label', content);
    };
    Render.prototype.refreshDataManager = function () {
        var _this = this;
        var start = this.parent.activeView.startDate();
        var end = this.parent.activeView.endDate();
        var dataManager = this.parent.dataModule.getData(this.parent.dataModule.generateQuery(start, end));
        dataManager.then(function (e) { return _this.dataManagerSuccess(e); }).catch(function (e) { return _this.dataManagerFailure(e); });
    };
    Render.prototype.dataManagerSuccess = function (e) {
        var _this = this;
        if (this.parent.isDestroyed) {
            return;
        }
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["dataBinding"], e, function (args) {
            var resultData = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], args.result, null, true);
            _this.parent.eventsData = resultData.filter(function (data) { return !data[_this.parent.eventFields.isBlock]; });
            _this.parent.blockData = resultData.filter(function (data) { return data[_this.parent.eventFields.isBlock]; });
            var processed = _this.parent.eventBase.processData(resultData);
            _this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_3__["dataReady"], { processedData: processed });
            if (_this.parent.dragAndDropModule && _this.parent.dragAndDropModule.actionObj.action === 'drag') {
                _this.parent.dragAndDropModule.navigationWrapper();
            }
            _this.parent.renderCompleted();
            _this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["dataBound"], null, function () { return _this.parent.hideSpinner(); });
        });
    };
    Render.prototype.dataManagerFailure = function (e) {
        var _this = this;
        if (this.parent.isDestroyed) {
            return;
        }
        // tslint:disable:no-any
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_3__["actionFailure"], { error: e }, function () { return _this.parent.hideSpinner(); });
        // tslint:disable:no-any
    };
    return Render;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-header-row.js":
/*!*********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-header-row.js ***!
  \*********************************************************************************************/
/*! exports provided: TimelineHeaderRow */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineHeaderRow", function() { return TimelineHeaderRow; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _view_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");



/**
 * timeline header
 */
var TimelineHeaderRow = /** @__PURE__ @class */ (function () {
    function TimelineHeaderRow(parent, renderDates) {
        this.parent = parent;
        this.renderDates = renderDates;
    }
    TimelineHeaderRow.prototype.groupByYear = function (dates) {
        var result = {};
        for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
            var d = dates_1[_i];
            var key = d.getFullYear();
            result[key] = result[key] || [];
            result[key].push(d);
        }
        return result;
    };
    TimelineHeaderRow.prototype.groupByMonth = function (dates) {
        var result = {};
        for (var _i = 0, dates_2 = dates; _i < dates_2.length; _i++) {
            var d = dates_2[_i];
            var key = (d.getFullYear() - 1970) * 12 + d.getMonth();
            result[key] = result[key] || [];
            result[key].push(d);
        }
        return result;
    };
    TimelineHeaderRow.prototype.groupByWeek = function (dates) {
        var result = {};
        for (var _i = 0, dates_3 = dates; _i < dates_3.length; _i++) {
            var d = dates_3[_i];
            var jsDate = +new Date(1970, 0, 1);
            var tzOffsetDiff = d.getTimezoneOffset() - new Date(1970, 0, 1).getTimezoneOffset();
            var key = Math.ceil(((((+d - jsDate) - (tzOffsetDiff * 60 * 1000)) / _base_util__WEBPACK_IMPORTED_MODULE_2__["MS_PER_DAY"]) + new Date(jsDate).getDay() + 1) / 7);
            if (this.parent.firstDayOfWeek && this.parent.firstDayOfWeek > new Date(+d).getDay()) {
                key = key - 1;
            }
            result[key] = result[key] || [];
            result[key].push(d);
        }
        return result;
    };
    TimelineHeaderRow.prototype.generateSlots = function (data, colspan, row, cls, type) {
        var _this = this;
        var dateParser = function (date, format) {
            return _this.parent.globalize.formatDate(date, { format: format, calendar: _this.parent.getCalendarMode() });
        };
        var tdDatas = [];
        var keys = Object.keys(data);
        for (var i = 0; i < keys.length; i++) {
            var dates = data[keys[i]];
            var htmlCol = void 0;
            if (row.template) {
                var args = { date: dates[0], type: type };
                var templateId = this.parent.element.id + '_headerRowTemplate';
                htmlCol = [].slice.call(this.parent.templateParser(row.template)(args, this.parent, 'template', templateId, false));
            }
            else {
                var viewTemplate = void 0;
                switch (row.option) {
                    case 'Year':
                        viewTemplate = "<span class=\"e-header-year\">" + dateParser(dates[0], 'y') + "</span>";
                        break;
                    case 'Month':
                        viewTemplate = "<span class=\"e-header-month\">" + Object(_base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"])(dateParser(dates[0], 'MMMM'), 'single') + "</span>";
                        break;
                    case 'Week':
                        var weekNumberDate = _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getWeekNumberContent(this.parent, dates);
                        viewTemplate = "<span class=\"e-header-week\">" + weekNumberDate + "</span>";
                }
                var headerWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { innerHTML: viewTemplate });
                htmlCol = [].slice.call(headerWrapper.childNodes);
            }
            tdDatas.push({ date: dates[0], type: type, className: [cls], colSpan: dates.length * colspan, template: htmlCol });
        }
        return tdDatas;
    };
    TimelineHeaderRow.prototype.generateColumnLevels = function (dateSlots, hourSlots) {
        var levels = [];
        var rows = this.parent.activeViewOptions.headerRows;
        var lastLevelColspan = 1;
        if (rows[rows.length - 1].option === 'Hour' && hourSlots.length > 0) {
            lastLevelColspan = hourSlots.length / dateSlots.length;
        }
        var tdDatas = [];
        for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
            var row = rows_1[_i];
            switch (row.option) {
                case 'Year':
                    var byYear = this.groupByYear(this.renderDates);
                    tdDatas = this.generateSlots(byYear, lastLevelColspan, row, 'e-header-year-cell', 'yearHeader');
                    levels.push(tdDatas);
                    break;
                case 'Month':
                    var byMonth = this.groupByMonth(this.renderDates);
                    tdDatas = this.generateSlots(byMonth, lastLevelColspan, row, 'e-header-month-cell', 'monthHeader');
                    levels.push(tdDatas);
                    break;
                case 'Week':
                    var byWeek = this.groupByWeek(this.renderDates);
                    tdDatas = this.generateSlots(byWeek, lastLevelColspan, row, 'e-header-week-cell', 'weekHeader');
                    levels.push(tdDatas);
                    break;
                case 'Date':
                    tdDatas = dateSlots;
                    tdDatas = tdDatas.map(function (value) {
                        value.colSpan = lastLevelColspan;
                        return value;
                    });
                    levels.push(tdDatas);
                    break;
                case 'Hour':
                    if (hourSlots.length > 0) {
                        levels.push(hourSlots);
                    }
                    break;
            }
        }
        return levels;
    };
    return TimelineHeaderRow;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-month.js":
/*!****************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-month.js ***!
  \****************************************************************************************/
/*! exports provided: TimelineMonth */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineMonth", function() { return TimelineMonth; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _month__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/month.js");
/* harmony import */ var _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js");
/* harmony import */ var _timeline_header_row__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./timeline-header-row */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-header-row.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();







/**
 * timeline month view
 */
var TimelineMonth = /** @__PURE__ @class */ (function (_super) {
    __extends(TimelineMonth, _super);
    /**
     * Constructor for timeline month view
     */
    function TimelineMonth(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-timeline-month-view';
        _this.isInverseTableSelect = true;
        return _this;
    }
    /**
     * Get module name.
     */
    TimelineMonth.prototype.getModuleName = function () {
        return 'timelineMonth';
    };
    TimelineMonth.prototype.onDataReady = function (args) {
        var appointment = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_2__["TimelineEvent"](this.parent, 'day');
        appointment.renderAppointments();
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventsLoaded"], {});
    };
    TimelineMonth.prototype.getLeftPanelElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_COLUMN_WRAP_CLASS"]);
    };
    TimelineMonth.prototype.scrollTopPanel = function (target) {
        _super.prototype.scrollTopPanel.call(this, target);
        this.scrollHeaderLabels(target);
    };
    TimelineMonth.prototype.setContentHeight = function (content, leftPanelElement, height) {
        if (leftPanelElement) {
            leftPanelElement.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height - this.getScrollXIndent(content));
        }
        content.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height);
    };
    TimelineMonth.prototype.getDateSlots = function (renderDates, workDays) {
        var dateSlots = [];
        for (var _i = 0, renderDates_1 = renderDates; _i < renderDates_1.length; _i++) {
            var col = renderDates_1[_i];
            var classList = [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]];
            if (this.isCurrentDate(col)) {
                classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_DAY_CLASS"]);
            }
            dateSlots.push({ date: col, type: 'dateHeader', className: classList, colSpan: 1, workDays: workDays });
        }
        return dateSlots;
    };
    TimelineMonth.prototype.renderLeftIndent = function (tr) {
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            this.parent.resourceBase.renderResourceHeaderIndent(tr);
        }
    };
    TimelineMonth.prototype.renderContent = function () {
        var contentTr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            var resTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
            resTd.appendChild(this.parent.resourceBase.createResourceColumn());
            contentTr.appendChild(resTd);
        }
        var contentTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        this.element.querySelector('tbody').appendChild(contentTr);
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] });
        wrap.appendChild(this.renderContentArea());
        wrap.appendChild(this.createEventTable(this.getRowCount()));
        this.collapseRows(wrap);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, 'scroll', this.onContentScroll, this);
        contentTd.appendChild(wrap);
        if (this.parent.virtualScrollModule) {
            this.parent.virtualScrollModule.renderVirtualTrack(wrap);
        }
        contentTr.appendChild(contentTd);
    };
    TimelineMonth.prototype.getRowCount = function () {
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            return this.parent.resourceBase.renderedResources.length;
        }
        return 1;
    };
    TimelineMonth.prototype.getContentSlots = function () {
        var slotDatas = [];
        for (var row = 0; row < this.getRowCount(); row++) {
            for (var _i = 0, _a = this.colLevels[this.colLevels.length - 1]; _i < _a.length; _i++) {
                var data = _a[_i];
                data.className = [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]];
                if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                    var resLevel = this.parent.resourceBase.renderedResources[row];
                    data.workDays = resLevel.resourceData[resLevel.resource.workDaysField] || this.parent.workDays;
                    data.className = data.className.concat(resLevel.className);
                    data.groupIndex = resLevel.groupIndex;
                    data.groupOrder = resLevel.groupOrder;
                }
                var slotData = {
                    date: new Date(+data.date), colSpan: data.colSpan, groupIndex: data.groupIndex, workDays: data.workDays,
                    type: 'monthCells', className: data.className
                };
                if (!slotDatas[row]) {
                    slotDatas[row] = [];
                }
                slotDatas[row].push(slotData);
            }
        }
        return slotDatas;
    };
    TimelineMonth.prototype.updateClassList = function (data) {
        if (!this.parent.isMinMaxDate(data.date)) {
            data.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_DATES"]);
        }
    };
    TimelineMonth.prototype.unwireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.getContentAreaElement(), 'scroll', this.onContentScroll);
    };
    TimelineMonth.prototype.getMonthStart = function (currentDate) {
        var monthStart = this.parent.calendarUtil.firstDateOfMonth(_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](currentDate));
        return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
    };
    TimelineMonth.prototype.getMonthEnd = function (currentDate) {
        var monthStart = this.parent.calendarUtil.firstDateOfMonth(_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](currentDate));
        return this.parent.calendarUtil.lastDateOfMonth(_base_util__WEBPACK_IMPORTED_MODULE_4__["addMonths"](new Date(+monthStart), this.parent.activeViewOptions.interval - 1));
    };
    TimelineMonth.prototype.generateColumnLevels = function () {
        var colLevels = [];
        var level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
        colLevels.push(level);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.parent.resourceBase.generateResourceLevels(level, !this.parent.uiStateValues.isGroupAdaptive);
        }
        var hourSlots = [];
        if (this.parent.activeViewOptions.headerRows.length > 0) {
            var renderGn = new _timeline_header_row__WEBPACK_IMPORTED_MODULE_3__["TimelineHeaderRow"](this.parent, this.renderDates);
            colLevels = renderGn.generateColumnLevels(level, hourSlots);
        }
        this.colLevels = colLevels;
        return colLevels;
    };
    return TimelineMonth;
}(_month__WEBPACK_IMPORTED_MODULE_1__["Month"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-view.js":
/*!***************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-view.js ***!
  \***************************************************************************************/
/*! exports provided: TimelineViews */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineViews", function() { return TimelineViews; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _vertical_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js");
/* harmony import */ var _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/timeline-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/timeline-view.js");
/* harmony import */ var _timeline_header_row__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./timeline-header-row */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-header-row.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();







/**
 * timeline view
 */
var TimelineViews = /** @__PURE__ @class */ (function (_super) {
    __extends(TimelineViews, _super);
    function TimelineViews(parent) {
        var _this = _super.call(this, parent) || this;
        _this.baseCssClass = 'e-timeline-view';
        return _this;
    }
    TimelineViews.prototype.getLeftPanelElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"]);
    };
    TimelineViews.prototype.scrollTopPanel = function (target) {
        _super.prototype.scrollTopPanel.call(this, target);
        this.scrollHeaderLabels(target);
    };
    TimelineViews.prototype.scrollToWorkHour = function () {
        var start = this.parent.getStartEndTime(this.parent.workHours.start);
        var currDateTime = this.isWorkDay(this.parent.selectedDate) && this.parent.workHours.highlight &&
            !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(start) ? new Date(+this.parent.selectedDate).setHours(start.getHours(), start.getMinutes(), 0, 0)
            : new Date(+this.parent.selectedDate).setHours(0, 0, 0, 0);
        var queryString = '[data-date="' + this.parent.getMsFromDate(new Date(currDateTime)) + '"]';
        var firstWorkHourCell = this.element.querySelector(queryString);
        if (firstWorkHourCell) {
            this.getScrollableElement().scrollLeft = firstWorkHourCell.offsetLeft;
        }
    };
    TimelineViews.prototype.scrollToHour = function (hour, scrollDate) {
        var date;
        var index;
        if (scrollDate) {
            index = this.parent.getIndexOfDate(this.renderDates, _base_util__WEBPACK_IMPORTED_MODULE_6__["resetTime"](scrollDate));
            if (index >= 0) {
                var timeString = hour.split(':');
                if (timeString.length === 2) {
                    date = new Date(scrollDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0));
                }
            }
        }
        date = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollDate) ? this.parent.getStartEndTime(hour) : date;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date)) {
            return;
        }
        this.getScrollableElement().scrollLeft =
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollDate) ? this.getLeftFromDateTime(null, date) : this.getLeftFromDateTime([index], date);
    };
    TimelineViews.prototype.generateColumnLevels = function () {
        var levels = [];
        var dateSlots = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
        levels.push(dateSlots);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.parent.resourceBase.generateResourceLevels(dateSlots, !this.parent.uiStateValues.isGroupAdaptive);
        }
        var hourSlots = [];
        if (this.parent.activeViewOptions.timeScale.enable) {
            hourSlots = this.generateTimeSlots(levels[levels.length - 1]);
            levels.push(hourSlots);
        }
        if (this.parent.activeViewOptions.headerRows.length > 0) {
            var renderGn = new _timeline_header_row__WEBPACK_IMPORTED_MODULE_3__["TimelineHeaderRow"](this.parent, this.renderDates);
            levels = renderGn.generateColumnLevels(dateSlots, hourSlots);
        }
        return levels;
    };
    TimelineViews.prototype.generateTimeSlots = function (dateSlots) {
        var _this = this;
        var handler = function (r) {
            r.type = r.first ? 'majorSlot' : 'minorSlot';
            r.className = r.first ? [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TIME_SLOT_CLASS"]] : [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TIME_SLOT_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TIME_CELLS_CLASS"]];
            r.workDays = _this.parent.activeViewOptions.workDays;
            return r;
        };
        var timeSlotData = this.getTimeSlotRows(handler);
        var slots = [];
        for (var _i = 0, dateSlots_1 = dateSlots; _i < dateSlots_1.length; _i++) {
            var data = dateSlots_1[_i];
            data.colSpan = timeSlotData.length;
            var tempTimeSlots = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])([], timeSlotData, null, true);
            for (var _a = 0, tempTimeSlots_1 = tempTimeSlots; _a < tempTimeSlots_1.length; _a++) {
                var slot = tempTimeSlots_1[_a];
                var cellDate = _base_util__WEBPACK_IMPORTED_MODULE_6__["resetTime"](new Date('' + data.date));
                slot.date = _base_util__WEBPACK_IMPORTED_MODULE_6__["setTime"](cellDate, _base_util__WEBPACK_IMPORTED_MODULE_6__["getDateInMs"](slot.date));
                slots.push(slot);
            }
        }
        return slots;
    };
    TimelineViews.prototype.changeCurrentTimePosition = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.removeCurrentTimeIndicatorElements();
        var currentDateIndex = this.getCurrentTimeIndicatorIndex();
        var left = this.getLeftFromDateTime(currentDateIndex, this.parent.getCurrentTime());
        var height = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]).offsetHeight;
        var headerWrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_WRAP_CLASS"]);
        var contentWrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        contentWrap.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_TIMELINE_CLASS"],
            styles: (this.parent.enableRtl ? 'right' : 'left') + ':' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(left) + '; height:' + Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height)
        }));
        if (this.parent.virtualScrollModule) {
            var timeIndicator = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_TIMELINE_CLASS"]);
            var element = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] + ' table');
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(timeIndicator, {
                transform: element.style.transform
            });
        }
        var currentTimeEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CURRENT_TIME_CLASS"]
        });
        headerWrap.appendChild(currentTimeEle);
        currentTimeEle.style[this.parent.enableRtl ? 'right' : 'left'] = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(left - (currentTimeEle.offsetWidth / 2));
    };
    TimelineViews.prototype.getLeftFromDateTime = function (currentDateIndex, date) {
        var startHour = this.getStartHour();
        var endHour = this.getEndHour();
        var diffInDates = 0;
        var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(currentDateIndex)) {
            var end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
            if (currentDateIndex[0] !== 0) {
                diffInDates = (currentDateIndex[0]) * ((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes());
            }
            diffInMinutes = diffInDates + diffInMinutes;
        }
        return (diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
            this.parent.activeViewOptions.timeScale.interval;
    };
    TimelineViews.prototype.getWorkCellWidth = function () {
        return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;
    };
    TimelineViews.prototype.renderHeader = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            this.parent.resourceBase.renderResourceHeaderIndent(tr);
        }
        var dateTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        dateTd.appendChild(this.renderDatesHeader());
        tr.appendChild(dateTd);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([tr], this.element.querySelector('tbody'));
    };
    TimelineViews.prototype.createAllDayRow = function (table, tdData) {
        // For current time indicator wrapper
    };
    TimelineViews.prototype.getCurrentTimeIndicatorIndex = function () {
        var currentDateIndex = [];
        var index = this.parent.getIndexOfDate(this.renderDates, _base_util__WEBPACK_IMPORTED_MODULE_6__["resetTime"](this.parent.getCurrentTime()));
        if (index >= 0) {
            currentDateIndex.push(index);
        }
        return currentDateIndex;
    };
    TimelineViews.prototype.renderContent = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            var resTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
            resTd.appendChild(this.parent.resourceBase.createResourceColumn());
            tr.appendChild(resTd);
        }
        var workTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        var wrap = this.renderContentArea();
        wrap.appendChild(this.createEventTable(this.getRowCount()));
        this.collapseRows(wrap);
        workTd.appendChild(wrap);
        tr.appendChild(workTd);
        if (this.parent.virtualScrollModule) {
            this.parent.virtualScrollModule.renderVirtualTrack(wrap);
        }
        this.element.querySelector('tbody').appendChild(tr);
    };
    TimelineViews.prototype.getRowCount = function () {
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            return this.parent.resourceBase.renderedResources.length;
        }
        return 1;
    };
    TimelineViews.prototype.getResourceTdData = function (i, tdData) {
        var resLevel = this.parent.resourceBase.renderedResources[i];
        var resSHr = resLevel.resourceData[resLevel.resource.startHourField] || this.parent.workHours.start;
        var resEHr = resLevel.resourceData[resLevel.resource.endHourField] || this.parent.workHours.end;
        tdData.startHour = this.parent.getStartEndTime(resSHr);
        tdData.endHour = this.parent.getStartEndTime(resEHr);
        tdData.workDays = resLevel.resourceData[resLevel.resource.workDaysField] || this.parent.workDays;
        tdData.className = resLevel.className;
        tdData.groupIndex = resLevel.groupIndex;
        tdData.groupOrder = resLevel.groupOrder;
        return tdData;
    };
    TimelineViews.prototype.renderContentTable = function (table) {
        var tBody = table.querySelector('tbody');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getContentRows(), tBody);
    };
    TimelineViews.prototype.getContentRows = function () {
        var rows = [];
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { role: 'row' } });
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
        var trCount = this.getRowCount();
        for (var i = 0; i < trCount; i++) {
            var ntr = tr.cloneNode();
            for (var _i = 0, _a = this.colLevels[this.colLevels.length - 1]; _i < _a.length; _i++) {
                var tdData = _a[_i];
                if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                    tdData = this.getResourceTdData(i, tdData);
                }
                var ntd = this.createContentTd(tdData, tdData, td);
                ntr.appendChild(ntd);
            }
            rows.push(ntr);
        }
        return rows;
    };
    TimelineViews.prototype.getContentTdClass = function (r) {
        return (r.first || !this.parent.activeViewOptions.timeScale.enable) ? [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"]] :
            [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["ALTERNATE_CELLS_CLASS"]];
    };
    TimelineViews.prototype.renderEvents = function () {
        if (this.parent.activeViewOptions.timeScale.enable) {
            var appointment = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_2__["TimelineEvent"](this.parent, 'hour');
            appointment.renderAppointments();
        }
        else {
            var appointment = new _event_renderer_timeline_view__WEBPACK_IMPORTED_MODULE_2__["TimelineEvent"](this.parent, 'day');
            appointment.renderAppointments();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["eventsLoaded"], {});
    };
    TimelineViews.prototype.getModuleName = function () {
        return 'timelineViews';
    };
    return TimelineViews;
}(_vertical_view__WEBPACK_IMPORTED_MODULE_1__["VerticalView"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-year.js":
/*!***************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/timeline-year.js ***!
  \***************************************************************************************/
/*! exports provided: TimelineYear */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineYear", function() { return TimelineYear; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _year__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./year */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/year.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();





/**
 * timeline year view
 */
var TimelineYear = /** @__PURE__ @class */ (function (_super) {
    __extends(TimelineYear, _super);
    /**
     * Constructor for timeline year view
     */
    function TimelineYear(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-timeline-year-view';
        _this.isInverseTableSelect = true;
        return _this;
    }
    /**
     * Get module name.
     */
    TimelineYear.prototype.getModuleName = function () {
        return 'timelineYear';
    };
    TimelineYear.prototype.renderHeader = function (headerWrapper) {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        headerWrapper.appendChild(tr);
        if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 &&
            !this.parent.uiStateValues.isGroupAdaptive) {
            this.parent.resourceBase.renderResourceHeaderIndent(tr);
        }
        else {
            var leftHeaderCells = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["LEFT_INDENT_CLASS"] });
            tr.appendChild(leftHeaderCells);
            leftHeaderCells.appendChild(this.renderResourceHeader(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["LEFT_INDENT_WRAP_CLASS"]));
        }
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        tr.appendChild(td);
        var container = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_CONTAINER_CLASS"] });
        td.appendChild(container);
        if (this.parent.activeViewOptions.orientation === 'Horizontal' && this.parent.activeViewOptions.group.resources.length > 0 &&
            !this.parent.uiStateValues.isGroupAdaptive) {
            container.appendChild(this.renderResourceHeader(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_WRAP_CLASS"]));
            this.columnCount = this.colLevels.slice(-1)[0].length;
        }
        else {
            var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_WRAP_CLASS"] });
            container.appendChild(wrapper);
            var table = this.createTableLayout();
            wrapper.appendChild(table);
            table.appendChild(this.createTableColGroup(this.columnCount));
            var innerTr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
            table.querySelector('tbody').appendChild(innerTr);
            for (var column = 0; column < this.columnCount; column++) {
                var innerTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["HEADER_CELLS_CLASS"] });
                if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                    innerTd.innerHTML = "<span>" + this.parent.getDayNames('abbreviated')[column % 7] + "</span>";
                }
                else {
                    var date = new Date(this.parent.selectedDate.getFullYear(), column, 1);
                    innerTd.innerHTML = "<span>" + this.getMonthName(date) + "</span>";
                    innerTd.setAttribute('data-date', date.getTime().toString());
                }
                innerTr.appendChild(innerTd);
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["renderCell"], { elementType: 'headerCells', element: innerTd });
            }
        }
    };
    TimelineYear.prototype.renderResourceHeader = function (className) {
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: className });
        var tbl = this.createTableLayout();
        wrap.appendChild(tbl);
        var trEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            this.colLevels = this.generateColumnLevels();
        }
        else {
            var colData = [{ className: [_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["HEADER_CELLS_CLASS"]], type: 'headerCell' }];
            this.colLevels = [colData];
        }
        for (var _i = 0, _a = this.colLevels; _i < _a.length; _i++) {
            var col = _a[_i];
            var ntr = trEle.cloneNode();
            var count = className === _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_WRAP_CLASS"] ? col : [col[0]];
            for (var _b = 0, count_1 = count; _b < count_1.length; _b++) {
                var c = count_1[_b];
                var tdEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
                if (c.className) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], c.className);
                }
                if (className === _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_WRAP_CLASS"]) {
                    if (c.template) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(c.template, tdEle);
                    }
                    if (c.colSpan) {
                        tdEle.setAttribute('colspan', c.colSpan.toString());
                    }
                    this.setResourceHeaderContent(tdEle, c);
                }
                var args = { elementType: c.type, element: tdEle, date: c.date, groupIndex: c.groupIndex };
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["renderCell"], args);
                ntr.appendChild(tdEle);
            }
            tbl.querySelector('tbody').appendChild(ntr);
        }
        if (className === _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_WRAP_CLASS"]) {
            tbl.appendChild(this.createTableColGroup(this.colLevels.slice(-1)[0].length));
        }
        return wrap;
    };
    TimelineYear.prototype.renderContent = function (contentWrapper) {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        contentWrapper.appendChild(tr);
        var firstTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        var lastTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        var tdCollection = [];
        var monthTBody;
        if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 &&
            !this.parent.uiStateValues.isGroupAdaptive) {
            tdCollection.push(firstTd);
            firstTd.appendChild(this.parent.resourceBase.createResourceColumn());
            this.rowCount = this.parent.resourceBase.lastResourceLevel.length;
        }
        else {
            tdCollection.push(firstTd);
            var monthWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MONTH_HEADER_WRAPPER"] });
            firstTd.appendChild(monthWrapper);
            monthWrapper.appendChild(this.createTableLayout());
            monthTBody = monthWrapper.querySelector('tbody');
        }
        tdCollection.push(lastTd);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tdCollection, tr);
        var content = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CONTENT_WRAP_CLASS"] });
        lastTd.appendChild(content);
        var contentTable = this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CONTENT_TABLE_CLASS"]);
        content.appendChild(contentTable);
        var eventWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["EVENT_TABLE_CLASS"] });
        content.appendChild(eventWrapper);
        var contentTBody = contentTable.querySelector('tbody');
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            if (this.parent.rowAutoHeight) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([contentTable], _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["AUTO_HEIGHT"]);
            }
            var colCount = this.parent.activeViewOptions.orientation === 'Horizontal' ? this.colLevels.slice(-1)[0].length : 12;
            contentTable.appendChild(this.createTableColGroup(colCount));
            this.renderResourceContent(eventWrapper, monthTBody, contentTBody);
        }
        else {
            contentTable.appendChild(this.createTableColGroup(this.columnCount));
            this.renderDefaultContent(eventWrapper, monthTBody, contentTBody);
        }
    };
    TimelineYear.prototype.renderDefaultContent = function (wrapper, monthBody, contentBody) {
        for (var month = 0; month < this.rowCount; month++) {
            wrapper.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CONTAINER_CLASS"] }));
            var monthDate = new Date(this.parent.selectedDate.getFullYear(), month, 1);
            var monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
            var monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
            var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { 'role': 'row' } });
            var monthTr = tr.cloneNode();
            monthBody.appendChild(monthTr);
            var contentTr = tr.cloneNode();
            contentBody.appendChild(contentTr);
            var monthTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MONTH_HEADER_CLASS"], attrs: { 'role': 'gridcell' } });
            if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                monthTd.setAttribute('data-date', monthDate.getTime().toString());
                monthTd.innerHTML = "<span>" + this.getMonthName(monthDate) + "</span>";
            }
            else {
                monthTd.innerHTML = "<span>" + this.parent.getDayNames('abbreviated')[month % 7] + "</span>";
            }
            monthTr.appendChild(monthTd);
            this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["renderCell"], { elementType: 'leftHeaderCells', element: monthTd });
            var date = new Date(monthStart.getTime());
            for (var column = 0; column < this.columnCount; column++) {
                var isDateAvail = void 0;
                if (this.parent.activeViewOptions.orientation === 'Vertical') {
                    monthDate = new Date(this.parent.selectedDate.getFullYear(), column, 1);
                    monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
                    monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
                    var dayDate = (month - monthStart.getDay()) + 1;
                    date = new Date(this.parent.selectedDate.getFullYear(), column, dayDate);
                    isDateAvail = dayDate > 0 && date.getTime() < monthEnd.getTime();
                }
                else {
                    isDateAvail = column >= monthStart.getDay() && date.getTime() < monthEnd.getTime();
                }
                var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"],
                    attrs: { 'role': 'gridcell', 'aria-selected': 'false' }
                });
                contentTr.appendChild(td);
                var dateHeader = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["DATE_HEADER_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["NAVIGATE_CLASS"],
                    innerHTML: (isDateAvail) ? date.getDate().toString() : ''
                });
                var skeleton = 'full';
                var annocementText = this.parent.globalize.formatDate(date, {
                    skeleton: skeleton,
                    calendar: this.parent.getCalendarMode()
                });
                dateHeader.setAttribute('aria-label', annocementText);
                if (isDateAvail) {
                    var tds = [td];
                    var classList = [];
                    if (this.parent.activeViewOptions.workDays.indexOf(date.getDay()) > -1) {
                        classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORKDAY_CLASS"]);
                    }
                    if (this.isCurrentDate(date)) {
                        classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CURRENT_DAY_CLASS"]);
                        if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                            tds.push(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["HEADER_CELLS_CLASS"] + (":nth-child(" + (column + 1) + ")")));
                        }
                        else {
                            tds.push(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MONTH_HEADER_CLASS"]).item(month));
                        }
                    }
                    if (classList.length > 0) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])(tds, classList);
                    }
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([td], _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["OTHERMONTH_CLASS"]);
                }
                td.appendChild(dateHeader);
                if (isDateAvail) {
                    td.setAttribute('data-date', date.getTime().toString());
                    this.wireEvents(td, 'cell');
                }
                this.renderCellTemplate({ date: date, type: 'workCells' }, td);
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["renderCell"], { elementType: 'workCells', element: td, date: date });
                if (isDateAvail) {
                    if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                        date = _base_util__WEBPACK_IMPORTED_MODULE_4__["addDays"](new Date(date.getTime()), 1);
                    }
                }
            }
        }
    };
    TimelineYear.prototype.renderResourceContent = function (wrapper, monthBody, contentBody) {
        for (var row = 0; row < this.rowCount; row++) {
            wrapper.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["APPOINTMENT_CONTAINER_CLASS"] }));
            var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { 'role': 'row' } });
            contentBody.appendChild(tr);
            var resData = void 0;
            if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
                resData = this.parent.resourceBase.lastResourceLevel[row];
            }
            var monthDate = new Date(this.parent.selectedDate.getFullYear(), row, 1);
            var date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
            if (this.parent.activeViewOptions.orientation === 'Horizontal') {
                var monthTr = tr.cloneNode();
                monthBody.appendChild(monthTr);
                var monthTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["MONTH_HEADER_CLASS"],
                    innerHTML: "<span>" + this.getMonthName(monthDate) + "</span>",
                    attrs: { 'role': 'gridcell', 'data-date': date.getTime().toString() }
                });
                monthTr.appendChild(monthTd);
            }
            for (var month = 0; month < this.columnCount; month++) {
                var classList = [];
                var groupIndex = row;
                if (this.parent.activeViewOptions.orientation === 'Vertical') {
                    classList = classList.concat(resData.className);
                    if (classList.indexOf(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_PARENT_CLASS"]) > -1) {
                        classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["RESOURCE_GROUP_CELLS_CLASS"]);
                    }
                    else {
                        classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORKDAY_CLASS"]);
                    }
                    monthDate = new Date(this.parent.selectedDate.getFullYear(), month, 1);
                    date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
                }
                else {
                    groupIndex = this.colLevels.slice(-1)[0][month].groupIndex;
                    classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORKDAY_CLASS"]);
                }
                var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["WORK_CELLS_CLASS"],
                    attrs: {
                        'role': 'gridcell', 'aria-selected': 'false',
                        'data-date': date.getTime().toString()
                    }
                });
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([td], classList);
                td.setAttribute('data-group-index', groupIndex.toString());
                this.renderCellTemplate({ date: date, type: 'workCells', groupIndex: groupIndex }, td);
                this.wireEvents(td, 'cell');
                tr.appendChild(td);
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_2__["renderCell"], { elementType: 'workCells', element: td, date: date });
            }
        }
        if (this.parent.activeViewOptions.orientation === 'Vertical') {
            this.collapseRows(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["CONTENT_WRAP_CLASS"]));
        }
    };
    TimelineYear.prototype.renderCellTemplate = function (data, td) {
        if (!this.parent.activeViewOptions.cellTemplate) {
            return;
        }
        var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_4__["addLocalOffset"](data.date);
        var args = { date: dateValue, type: data.type };
        if (data.groupIndex) {
            args.groupIndex = data.groupIndex;
        }
        var scheduleId = this.parent.element.id + '_';
        var viewName = this.parent.activeViewOptions.cellTemplateName;
        var templateId = scheduleId + viewName + 'cellTemplate';
        var cellTemplate = [].slice.call(this.parent.getCellTemplate()(args, this.parent, 'cellTemplate', templateId, false));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(cellTemplate, td);
    };
    TimelineYear.prototype.scrollToDate = function (scrollDate) {
        if (this.parent.activeViewOptions.group.resources.length === 0) {
            var date = +new Date(_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](scrollDate));
            var element = this.element.querySelector('[data-date="' + date + '"]');
            if (element) {
                this.getScrollableElement().scrollLeft = element.offsetLeft;
                this.getScrollableElement().scrollTop = element.offsetTop;
            }
        }
    };
    TimelineYear.prototype.getScrollableElement = function () {
        if (this.parent.isAdaptive && !this.isTimelineView() && !this.parent.isServerRenderer()) {
            return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_3__["SCROLL_CONTAINER_CLASS"]);
        }
        else {
            return this.getContentAreaElement();
        }
    };
    return TimelineYear;
}(_year__WEBPACK_IMPORTED_MODULE_1__["Year"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js":
/*!***************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js ***!
  \***************************************************************************************/
/*! exports provided: VerticalView */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalView", function() { return VerticalView; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _view_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/vertical-view.js");
/* harmony import */ var _event_renderer_month__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../event-renderer/month */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/month.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();








/**
 * vertical view
 */
var VerticalView = /** @__PURE__ @class */ (function (_super) {
    __extends(VerticalView, _super);
    /**
     * Constructor for vertical view
     */
    function VerticalView(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-day-view';
        _this.isInverseTableSelect = true;
        _this.baseCssClass = 'e-vertical-view';
        return _this;
    }
    VerticalView.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["scrollUiUpdate"], this.scrollUiUpdate, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_5__["dataReady"], this.renderEvents, this);
    };
    VerticalView.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["scrollUiUpdate"], this.scrollUiUpdate);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_5__["dataReady"], this.renderEvents);
    };
    VerticalView.prototype.renderEvents = function () {
        if (this.parent.activeViewOptions.timeScale.enable) {
            var appointment = new _event_renderer_vertical_view__WEBPACK_IMPORTED_MODULE_2__["VerticalEvent"](this.parent);
            appointment.renderAppointments();
        }
        else {
            var appointment = new _event_renderer_month__WEBPACK_IMPORTED_MODULE_3__["MonthEvent"](this.parent);
            appointment.renderAppointments();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["eventsLoaded"], {});
    };
    VerticalView.prototype.onContentScroll = function (e) {
        this.parent.removeNewEventElement();
        var target = e.target;
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["virtualScroll"], e);
        this.scrollLeftPanel(target);
        this.scrollTopPanel(target);
        if (!this.parent.isAdaptive) {
            this.parent.uiStateValues.top = target.scrollTop;
        }
        this.parent.uiStateValues.left = target.scrollLeft;
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.quickPopup)) {
            this.parent.quickPopup.quickPopupHide();
        }
        this.setPersistence();
    };
    VerticalView.prototype.onApaptiveMove = function (e) {
        if (this.parent.uiStateValues.action) {
            e.preventDefault();
        }
    };
    VerticalView.prototype.onApaptiveScroll = function (e) {
        this.parent.removeNewEventElement();
        this.parent.uiStateValues.top = e.target.scrollTop;
    };
    VerticalView.prototype.scrollLeftPanel = function (target) {
        var leftPanel = this.getLeftPanelElement();
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(leftPanel)) {
            leftPanel.scrollTop = target.scrollTop;
        }
    };
    VerticalView.prototype.scrollUiUpdate = function (args) {
        var headerBarHeight = this.getHeaderBarHeight();
        var timecells = this.getLeftPanelElement();
        var content = this.getScrollableElement();
        var header = this.getDatesHeaderElement();
        var scrollerHeight = this.parent.element.offsetHeight - headerBarHeight - header.offsetHeight;
        this.setColWidth(content);
        this.setContentHeight(content, timecells, scrollerHeight);
        var scrollBarWidth = _base_util__WEBPACK_IMPORTED_MODULE_4__["getScrollBarWidth"]();
        // tslint:disable:no-any
        header.firstElementChild.style[args.cssProperties.rtlBorder] = '';
        header.style[args.cssProperties.rtlPadding] = '';
        if (content.offsetWidth - content.clientWidth > 0) {
            header.firstElementChild.style[args.cssProperties.border] = scrollBarWidth > 0 ? '1px' : '0px';
            header.style[args.cssProperties.padding] = scrollBarWidth > 0 ? scrollBarWidth - 1 + 'px' : '0px';
        }
        else {
            header.firstElementChild.style[args.cssProperties.border] = '';
            header.style[args.cssProperties.padding] = '';
        }
        // tslint:enable:no-any
        if (!args.isPreventScrollUpdate) {
            if (this.parent.uiStateValues.isInitial) {
                this.scrollToWorkHour();
                this.parent.uiStateValues.isInitial = false;
            }
            else {
                if (timecells) {
                    timecells.scrollTop = this.parent.uiStateValues.top;
                }
                content.scrollTop = this.parent.uiStateValues.top;
                content.scrollLeft = this.parent.uiStateValues.left;
            }
        }
        if (this.parent.activeViewOptions.timeScale.enable) {
            this.highlightCurrentTime();
        }
        this.retainScrollPosition();
    };
    VerticalView.prototype.setContentHeight = function (element, leftPanelElement, height) {
        if (this.parent.isAdaptive && !this.isTimelineView() && !this.parent.isServerRenderer()) {
            element.style.height = (this.parent.height === 'auto') ? 'auto' : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height);
        }
        else {
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(leftPanelElement)) {
                leftPanelElement.style.height = (this.parent.height === 'auto') ? 'auto'
                    : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height - this.getScrollXIndent(element));
            }
            element.style.height = (this.parent.height === 'auto') ? 'auto' : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height);
        }
    };
    VerticalView.prototype.scrollToWorkHour = function () {
        if (this.parent.workHours.highlight) {
            var firstWorkHourCell = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_HOURS_CLASS"]);
            if (firstWorkHourCell) {
                this.getScrollableElement().scrollTop = firstWorkHourCell.offsetTop;
                this.parent.uiStateValues.top = firstWorkHourCell.offsetTop;
                this.parent.uiStateValues.left = 0;
            }
        }
    };
    VerticalView.prototype.scrollToHour = function (hour, scrollDate) {
        var date = this.parent.getStartEndTime(hour);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(date) || !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollDate)) {
            return;
        }
        this.getScrollableElement().scrollTop = this.getTopFromDateTime(date);
    };
    VerticalView.prototype.generateColumnLevels = function () {
        var level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
        var columnLevels = [];
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            columnLevels = this.parent.resourceBase.generateResourceLevels(level);
            if (this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.lastResourceLevel.length > 0) {
                var resourceLevel = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
                var resStartHour = resourceLevel.resourceData[resourceLevel.resource.startHourField];
                var resEndHour = resourceLevel.resourceData[resourceLevel.resource.endHourField];
                var dateSlots = this.getDateSlots(resourceLevel.renderDates, resourceLevel.workDays, resStartHour, resEndHour);
                columnLevels = [dateSlots];
            }
        }
        else {
            columnLevels.push(level);
        }
        this.colLevels = columnLevels;
        return columnLevels;
    };
    VerticalView.prototype.getDateSlots = function (renderDates, workDays, workStartHour, workEndHour) {
        if (workStartHour === void 0) { workStartHour = this.parent.workHours.start; }
        if (workEndHour === void 0) { workEndHour = this.parent.workHours.end; }
        var dateCol = [];
        var start = this.parent.getStartEndTime(workStartHour);
        var end = this.parent.getStartEndTime(workEndHour);
        for (var _i = 0, renderDates_1 = renderDates; _i < renderDates_1.length; _i++) {
            var col = renderDates_1[_i];
            var classList = [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]];
            if (this.isCurrentDate(col)) {
                classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_DAY_CLASS"]);
            }
            dateCol.push({
                date: col, type: 'dateHeader', className: classList, colSpan: 1,
                workDays: workDays, startHour: new Date(+start), endHour: new Date(+end)
            });
        }
        return dateCol;
    };
    VerticalView.prototype.isWorkHourRange = function (date) {
        return (this.getStartHour().getTime() <= date.getTime()) && (this.getEndHour().getTime() >= date.getTime());
    };
    VerticalView.prototype.highlightCurrentTime = function () {
        var _this = this;
        if (this.parent.activeViewOptions.headerRows.length > 0 &&
            this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
            return;
        }
        if (this.parent.isServerRenderer()) {
            var curEle = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_DAY_CLASS"]));
            if (curEle.length > 0) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(curEle, _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_DAY_CLASS"]);
            }
            var curDate = _base_util__WEBPACK_IMPORTED_MODULE_4__["addLocalOffset"](new Date(new Date().setHours(0, 0, 0, 0)));
            var queryString = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_CLASS"] + '[data-date="' + curDate.getTime().toString() + '"]';
            curEle = [].slice.call(this.element.querySelectorAll(queryString));
            for (var _i = 0, curEle_1 = curEle; _i < curEle_1.length; _i++) {
                var ele = curEle_1[_i];
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ele], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_DAY_CLASS"]);
            }
        }
        if (this.parent.showTimeIndicator && this.isWorkHourRange(this.parent.getCurrentTime())) {
            var currentDateIndex = this.getCurrentTimeIndicatorIndex();
            if (currentDateIndex.length > 0) {
                var workCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]));
                if (workCells.length > 0) {
                    this.changeCurrentTimePosition();
                }
                if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.currentTimeIndicatorTimer)) {
                    this.currentTimeIndicatorTimer = window.setInterval(function () { _this.changeCurrentTimePosition(); }, _base_util__WEBPACK_IMPORTED_MODULE_4__["MS_PER_MINUTE"]);
                }
            }
            else {
                this.clearCurrentTimeIndicatorTimer();
            }
        }
        else {
            this.clearCurrentTimeIndicatorTimer();
        }
    };
    VerticalView.prototype.getCurrentTimeIndicatorIndex = function () {
        var currentDateIndex = [];
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.resourceBase) && (this.parent.activeViewOptions.group.resources.length > 0) &&
            !this.parent.uiStateValues.isGroupAdaptive) {
            var count = 0;
            for (var _i = 0, _a = this.parent.resourceBase.lastResourceLevel; _i < _a.length; _i++) {
                var resource = _a[_i];
                var index = this.parent.getIndexOfDate(resource.renderDates, _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](this.parent.getCurrentTime()));
                if (index >= 0) {
                    var resIndex = this.parent.activeViewOptions.group.byDate ?
                        (this.parent.resourceBase.lastResourceLevel.length * index) + count : count + index;
                    currentDateIndex.push(resIndex);
                }
                count += this.parent.activeViewOptions.group.byDate ? 1 : resource.renderDates.length;
            }
        }
        else {
            var renderDates = (this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.lastResourceLevel.length > 0) ?
                this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].renderDates : this.renderDates;
            var index = this.parent.getIndexOfDate(renderDates, _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](this.parent.getCurrentTime()));
            if (index >= 0) {
                currentDateIndex.push(index);
            }
        }
        return currentDateIndex;
    };
    VerticalView.prototype.clearCurrentTimeIndicatorTimer = function () {
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.currentTimeIndicatorTimer)) {
            window.clearInterval(this.currentTimeIndicatorTimer);
            this.currentTimeIndicatorTimer = null;
            this.removeCurrentTimeIndicatorElements();
        }
    };
    VerticalView.prototype.removeCurrentTimeIndicatorElements = function () {
        var queryString = '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["PREVIOUS_TIMELINE_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_TIMELINE_CLASS"] + ',.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_TIME_CLASS"];
        var timeIndicator = [].slice.call(this.element.querySelectorAll(queryString));
        for (var _i = 0, timeIndicator_1 = timeIndicator; _i < timeIndicator_1.length; _i++) {
            var indicator = timeIndicator_1[_i];
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(indicator);
        }
    };
    VerticalView.prototype.changeCurrentTimePosition = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.removeCurrentTimeIndicatorElements();
        var currentDateIndex = this.getCurrentTimeIndicatorIndex();
        var firstRow = this.parent.getContentTable().rows[0];
        var top = this.getTopFromDateTime(this.parent.getCurrentTime());
        var topInPx = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(top);
        var rowIndex = Math.floor(top / firstRow.cells[0].offsetHeight);
        var timeCellsWrap = this.getLeftPanelElement();
        var timeTrs = [].slice.call(timeCellsWrap.querySelectorAll('tr'));
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(rowIndex) || isNaN(rowIndex) || rowIndex === timeTrs.length) {
            return;
        }
        var curTimeWrap = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIMELINE_WRAPPER_CLASS"]));
        for (var i = 0, length_1 = currentDateIndex[0]; i < length_1; i++) {
            curTimeWrap[i].appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["PREVIOUS_TIMELINE_CLASS"], styles: 'top:' + topInPx }));
        }
        for (var _i = 0, currentDateIndex_1 = currentDateIndex; _i < currentDateIndex_1.length; _i++) {
            var day = currentDateIndex_1[_i];
            curTimeWrap[day].appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_TIMELINE_CLASS"], styles: 'top:' + topInPx }));
        }
        var currentTimeEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CURRENT_TIME_CLASS"],
            styles: 'top:' + topInPx
        });
        if (rowIndex <= timeTrs.length) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(timeCellsWrap.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDE_CHILDS_CLASS"]), _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDE_CHILDS_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([timeTrs[rowIndex].lastElementChild], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HIDE_CHILDS_CLASS"]);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([currentTimeEle], timeCellsWrap);
            currentTimeEle.style.top = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(currentTimeEle.offsetTop - (currentTimeEle.offsetHeight / 2));
        }
    };
    VerticalView.prototype.getTopFromDateTime = function (date) {
        var startHour = this.getStartHour();
        var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
        return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) /
            this.parent.activeViewOptions.timeScale.interval;
    };
    VerticalView.prototype.getWorkCellHeight = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]).offsetHeight;
    };
    VerticalView.prototype.getTdContent = function (date, type, groupIndex) {
        var cntEle;
        var wrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div');
        var templateName = '';
        var templateId = this.parent.element.id + '_';
        var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_4__["addLocalOffset"](date);
        switch (type) {
            case 'dateHeader':
                if (this.parent.activeViewOptions.dateHeaderTemplate) {
                    templateName = 'dateHeaderTemplate';
                    var args = { date: dateValue, type: type };
                    var viewName = this.parent.activeViewOptions.dateHeaderTemplateName;
                    cntEle = [].slice.call(this.parent.getDateHeaderTemplate()(args, this.parent, templateName, templateId + viewName + templateName, false));
                }
                else {
                    wrapper.innerHTML = this.parent.activeView.isTimelineView() ?
                        "<span class=\"e-header-date e-navigate\">" + _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getTimelineDate(this.parent, date) + "</span>" :
                        "<div class=\"e-header-day\">" + _base_util__WEBPACK_IMPORTED_MODULE_4__["capitalizeFirstWord"](_view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getDayName(this.parent, date), 'single') + "</div>" +
                            ("<div class=\"e-header-date e-navigate\" role=\"link\">" + _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getDate(this.parent, date) + "</div>");
                    cntEle = [].slice.call(wrapper.childNodes);
                }
                break;
            case 'majorSlot':
                if (this.parent.activeViewOptions.timeScale.majorSlotTemplate) {
                    templateName = 'majorSlotTemplate';
                    var args = { date: dateValue, type: type };
                    cntEle = [].slice.call(this.parent.getMajorSlotTemplate()(args, this.parent, templateName, templateId + templateName, false));
                }
                else {
                    wrapper.innerHTML = "<span>" + _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getTime(this.parent, date) + "</span>";
                    cntEle = [].slice.call(wrapper.childNodes);
                }
                break;
            case 'minorSlot':
                if (this.parent.activeViewOptions.timeScale.minorSlotTemplate) {
                    templateName = 'minorSlotTemplate';
                    var args = { date: dateValue, type: type };
                    cntEle = [].slice.call(this.parent.getMinorSlotTemplate()(args, this.parent, templateName, templateId + templateName, false));
                }
                else {
                    wrapper.innerHTML = '&nbsp;';
                    cntEle = [].slice.call(wrapper.childNodes);
                }
                break;
            case 'alldayCells':
                if (this.parent.activeViewOptions.cellTemplate) {
                    var viewName = this.parent.activeViewOptions.cellTemplateName;
                    templateName = 'cellTemplate';
                    var args = { date: dateValue, type: type, groupIndex: groupIndex };
                    cntEle = [].slice.call(this.parent.getCellTemplate()(args, this.parent, templateName, templateId + viewName + templateName, false));
                }
                break;
        }
        return cntEle;
    };
    VerticalView.prototype.serverRenderLayout = function () {
        this.setPanel(this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TABLE_WRAP_CLASS"]));
        if (this.parent.uiStateValues.isGroupAdaptive && !this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_TOOLBAR_CONTAINER"])) {
            this.renderResourceMobileLayout();
        }
        var headerCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_WRAP_CLASS"] + ' td.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]));
        for (var _i = 0, headerCells_1 = headerCells; _i < headerCells_1.length; _i++) {
            var cell = headerCells_1[_i];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(cell);
            this.wireMouseEvents(cell);
        }
        var alldayCells = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_WRAP_CLASS"] + ' td.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"]));
        for (var _a = 0, alldayCells_1 = alldayCells; _a < alldayCells_1.length; _a++) {
            var cell = alldayCells_1[_a];
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(cell);
            this.wireCellEvents(cell);
        }
        if (this.parent.virtualScrollModule) {
            this.parent.virtualScrollModule.setTranslateValue();
        }
        var wrap = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"]);
        var contentBody = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_TABLE_CLASS"] + ' tbody');
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(contentBody);
        this.wireCellEvents(contentBody);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(wrap);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, 'scroll', this.onContentScroll, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.onApaptiveMove, this);
        this.wireExpandCollapseIconEvents();
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["contentReady"], {});
    };
    VerticalView.prototype.renderLayout = function (type) {
        if (this.parent.isServerRenderer()) {
            this.colLevels = this.generateColumnLevels();
            if (this.parent.resourceBase && this.parent.activeViewOptions.group.resources.length > 0 &&
                !this.parent.uiStateValues.isGroupAdaptive && this.parent.activeView.isTimelineView()) {
                this.parent.resourceBase.setRenderedResources();
            }
            return;
        }
        this.setPanel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TABLE_WRAP_CLASS"] }));
        var clsList = [this.baseCssClass, this.viewClass];
        clsList.push(type);
        if (this.parent.activeViewOptions.group.byDate) {
            clsList.push('e-by-date');
        }
        if (!this.parent.activeViewOptions.timeScale.enable) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIMESCALE_DISABLE"], this.viewClass]);
        }
        if (this.parent.activeViewOptions.allowVirtualScrolling) {
            clsList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["VIRTUAL_SCROLL_CLASS"]);
        }
        if (this.parent.eventSettings.ignoreWhitespace) {
            clsList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["IGNORE_WHITESPACE"]);
        }
        this.renderPanel(type);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], clsList);
        this.element.appendChild(this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["OUTER_TABLE_CLASS"]));
        this.element.querySelector('table').setAttribute('role', 'presentation');
        this.colLevels = this.generateColumnLevels();
        this.renderHeader();
        this.renderContent();
        if (this.parent.uiStateValues.isGroupAdaptive && !this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_TOOLBAR_CONTAINER"])) {
            this.renderResourceMobileLayout();
        }
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_5__["contentReady"], {});
    };
    VerticalView.prototype.renderHeader = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var dateTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        dateTd.appendChild(this.renderDatesHeader());
        if (this.parent.activeViewOptions.timeScale.enable) {
            var indentTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["LEFT_INDENT_CLASS"] });
            indentTd.appendChild(this.renderLeftIndent());
            tr.appendChild(indentTd);
        }
        tr.appendChild(dateTd);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([tr], this.element.querySelector('tbody'));
    };
    VerticalView.prototype.renderContent = function () {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var workTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        if (this.parent.isAdaptive) {
            workTd.setAttribute('colspan', (this.parent.activeViewOptions.timeScale.enable ? '2' : '1'));
            var scrollContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SCROLL_CONTAINER_CLASS"] });
            if (this.parent.activeViewOptions.timeScale.enable) {
                scrollContainer.appendChild(this.renderTimeCells());
            }
            scrollContainer.appendChild(this.renderContentArea());
            workTd.appendChild(scrollContainer);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(scrollContainer, 'scroll', this.onApaptiveScroll, this);
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(scrollContainer, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.onApaptiveMove, this);
            tr.appendChild(workTd);
        }
        else {
            workTd.appendChild(this.renderContentArea());
            if (this.parent.activeViewOptions.timeScale.enable) {
                var timesTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
                timesTd.appendChild(this.renderTimeCells());
                tr.appendChild(timesTd);
            }
            tr.appendChild(workTd);
        }
        this.element.querySelector('tbody').appendChild(tr);
    };
    VerticalView.prototype.renderLeftIndent = function () {
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["LEFT_INDENT_WRAP_CLASS"] });
        var tbl = this.createTableLayout();
        var trEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var rowCount = this.colLevels.length;
        for (var i = 0; i < rowCount; i++) {
            var ntr_1 = trEle.cloneNode();
            var data_1 = { className: [(this.colLevels[i][0] && this.colLevels[i][0].className[0])], type: 'emptyCells' };
            if (this.parent.activeViewOptions.showWeekNumber && data_1.className.indexOf(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]) !== -1) {
                data_1.className.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WEEK_NUMBER_CLASS"]);
                var weekNo = _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getWeekNumberContent(this.parent, this.renderDates);
                data_1.template = [Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', {
                        innerHTML: '' + weekNo,
                        attrs: { title: this.parent.localeObj.getConstant('week') + ' ' + weekNo }
                    })];
            }
            ntr_1.appendChild(this.createTd(data_1));
            tbl.querySelector('tbody').appendChild(ntr_1);
        }
        var ntr = trEle.cloneNode();
        var appointmentExpandCollapse = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            attrs: {
                'tabindex': '0', 'role': 'list',
                title: 'Expand-all-day-section', 'aria-disabled': 'false', 'aria-label': 'Expand section'
            },
            className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_SECTION_CLASS"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_ROW_EXPAND_CLASS"] + ' ' +
                _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ICON"] + ' ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_CLASS"],
        });
        var data = { className: [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"]], type: 'emptyCells' };
        var nth = this.createTd(data);
        nth.appendChild(appointmentExpandCollapse);
        ntr.appendChild(nth);
        tbl.querySelector('tbody').appendChild(ntr);
        wrap.appendChild(tbl);
        return wrap;
    };
    VerticalView.prototype.renderDatesHeader = function () {
        var container = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_CONTAINER_CLASS"] });
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DATE_HEADER_WRAP_CLASS"] });
        container.appendChild(wrap);
        var tbl = this.createTableLayout();
        var trEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var rowCount = this.colLevels.length;
        var lastLevel = this.colLevels[rowCount - 1];
        this.createColGroup(tbl, lastLevel);
        for (var i = 0; i < rowCount; i++) {
            var ntr = trEle.cloneNode();
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntr], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_ROW_CLASS"]);
            var level = this.colLevels[i];
            for (var j = 0; j < level.length; j++) {
                ntr.appendChild(this.createTd(level[j]));
            }
            tbl.querySelector('tbody').appendChild(ntr);
        }
        this.createAllDayRow(tbl, lastLevel);
        wrap.appendChild(tbl);
        return container;
    };
    VerticalView.prototype.createAllDayRow = function (table, tdData) {
        var ntr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntr], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_ROW_CLASS"]);
        for (var j = 0; j < tdData.length; j++) {
            var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, tdData[j]);
            td.className = [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_CELLS_CLASS"]];
            td.type = 'alldayCells';
            var ntd = this.createTd(td);
            ntd.setAttribute('data-date', td.date.getTime().toString());
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(td.groupIndex)) {
                ntd.setAttribute('data-group-index', '' + td.groupIndex);
            }
            this.wireCellEvents(ntd);
            ntr.appendChild(ntd);
        }
        table.querySelector('tbody').appendChild(ntr);
        var thead = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('thead');
        thead.appendChild(this.createEventWrapper('allDay'));
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([thead], table);
    };
    VerticalView.prototype.createTd = function (td) {
        var tdEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        this.addAttributes(td, tdEle);
        if (td.date && td.type) {
            var ele = this.getTdContent(td.date, td.type, td.groupIndex);
            if (ele && ele.length) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(ele, tdEle);
            }
        }
        if (!this.parent.isMinMaxDate(_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date('' + td.date)))) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([tdEle], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_DATES"]);
        }
        if (td.type === 'resourceHeader') {
            this.setResourceHeaderContent(tdEle, td);
        }
        if (td.type === 'dateHeader' && td.className.indexOf(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["HEADER_CELLS_CLASS"]) >= 0) {
            tdEle.setAttribute('data-date', td.date.getTime().toString());
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(td.groupIndex)) {
                tdEle.setAttribute('data-group-index', '' + td.groupIndex);
            }
            this.wireMouseEvents(tdEle);
        }
        var args = { elementType: td.type, element: tdEle, date: td.date, groupIndex: td.groupIndex };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["renderCell"], args);
        return tdEle;
    };
    VerticalView.prototype.wireCellEvents = function (element) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
        this.wireMouseEvents(element);
    };
    VerticalView.prototype.wireMouseEvents = function (element) {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
        if (!this.parent.isAdaptive) {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
        }
    };
    VerticalView.prototype.renderTimeCells = function () {
        var _this = this;
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_CELLS_WRAP_CLASS"] });
        var tbl = this.createTableLayout();
        var trEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var handler = function (r) {
            r.type = r.first ? 'majorSlot' : 'minorSlot';
            r.className = r.last ? [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_SLOT_CLASS"]] : [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_SLOT_CLASS"]];
            var ntr = trEle.cloneNode();
            var data = { date: r.date, type: r.type, className: r.className };
            ntr.appendChild(_this.createTd(data));
            tbl.querySelector('tbody').appendChild(ntr);
            return r;
        };
        this.getTimeSlotRows(handler);
        wrap.appendChild(tbl);
        return wrap;
    };
    VerticalView.prototype.renderContentArea = function () {
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_WRAP_CLASS"] });
        var tbl = this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["CONTENT_TABLE_CLASS"]);
        this.addAutoHeightClass(tbl);
        this.createColGroup(tbl, this.colLevels.slice(-1)[0]);
        this.renderContentTable(tbl);
        wrap.appendChild(tbl);
        this.wireCellEvents(tbl.querySelector('tbody'));
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, 'scroll', this.onContentScroll, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(wrap, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["Browser"].touchMoveEvent, this.onApaptiveMove, this);
        return wrap;
    };
    VerticalView.prototype.renderContentTable = function (table) {
        var _this = this;
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { role: 'row' } });
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
        var tbody = table.querySelector('tbody');
        var handler = function (r) {
            var ntr = tr.cloneNode();
            for (var _i = 0, _a = _this.colLevels[_this.colLevels.length - 1]; _i < _a.length; _i++) {
                var tdData = _a[_i];
                var ntd = _this.createContentTd(tdData, r, td);
                ntr.appendChild(ntd);
            }
            tbody.appendChild(ntr);
            return r;
        };
        this.getTimeSlotRows(handler);
        this.renderContentTableHeader(table);
    };
    VerticalView.prototype.createContentTd = function (tdData, r, td) {
        var ntd = td.cloneNode();
        if (tdData.colSpan) {
            ntd.setAttribute('colspan', tdData.colSpan.toString());
        }
        var clsName = this.getContentTdClass(r);
        if (!this.parent.isMinMaxDate(_base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date('' + tdData.date)))) {
            clsName.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DISABLE_DATES"]);
        }
        var cellDate = _base_util__WEBPACK_IMPORTED_MODULE_4__["resetTime"](new Date('' + tdData.date));
        _base_util__WEBPACK_IMPORTED_MODULE_4__["setTime"](cellDate, _base_util__WEBPACK_IMPORTED_MODULE_4__["getDateInMs"](r.date));
        var type = 'workCells';
        if (tdData.className.indexOf(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_PARENT_CLASS"]) !== -1) {
            clsName.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["RESOURCE_GROUP_CELLS_CLASS"]);
            type = 'resourceGroupCells';
        }
        if (this.parent.workHours.highlight && ((this.parent.activeViewOptions.timeScale.enable &&
            this.isWorkHour(cellDate, tdData.startHour, tdData.endHour, tdData.workDays)) ||
            (!this.parent.activeViewOptions.timeScale.enable && this.isWorkDay(cellDate, tdData.workDays)))) {
            clsName.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_HOURS_CLASS"]);
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ntd], clsName);
        if (this.parent.activeViewOptions.cellTemplate) {
            var dateValue = _base_util__WEBPACK_IMPORTED_MODULE_4__["addLocalOffset"](cellDate);
            var args_1 = { date: dateValue, type: type, groupIndex: tdData.groupIndex };
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.cellTemplateName;
            var templateId = scheduleId + viewName + 'cellTemplate';
            var tooltipTemplate = [].slice.call(this.parent.getCellTemplate()(args_1, this.parent, 'cellTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(tooltipTemplate, ntd);
        }
        ntd.setAttribute('data-date', cellDate.getTime().toString());
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(tdData.groupIndex) || this.parent.uiStateValues.isGroupAdaptive) {
            var groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex :
                tdData.groupIndex;
            ntd.setAttribute('data-group-index', '' + groupIndex);
        }
        var args = { elementType: type, element: ntd, date: cellDate, groupIndex: tdData.groupIndex };
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_5__["renderCell"], args);
        return ntd;
    };
    VerticalView.prototype.getContentTdClass = function (r) {
        return r.last ? [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"]] : [_base_css_constant__WEBPACK_IMPORTED_MODULE_6__["WORK_CELLS_CLASS"], _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALTERNATE_CELLS_CLASS"]];
    };
    VerticalView.prototype.renderContentTableHeader = function (table) {
        var thead = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('thead');
        thead.appendChild(this.createEventWrapper());
        if (this.parent.activeViewOptions.timeScale.enable) {
            thead.appendChild(this.createEventWrapper('timeIndicator'));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([thead], table);
    };
    VerticalView.prototype.createEventWrapper = function (type) {
        if (type === void 0) { type = ''; }
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var levels = this.colLevels.slice(-1)[0];
        for (var i = 0, len = levels.length; i < len; i++) {
            var col = levels[i];
            var appointmentWrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                className: (type === 'allDay') ? _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["ALLDAY_APPOINTMENT_WRAPPER_CLASS"] : (type === 'timeIndicator') ?
                    _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIMELINE_WRAPPER_CLASS"] : _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["DAY_WRAPPER_CLASS"], attrs: { 'data-date': col.date.getTime().toString() }
            });
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(col.groupIndex)) {
                appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
            }
            if (type === '') {
                var innerWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                    id: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"] + '-' + i.toString(),
                    className: _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["APPOINTMENT_WRAPPER_CLASS"]
                });
                appointmentWrap.appendChild(innerWrapper);
            }
            tr.appendChild(appointmentWrap);
        }
        return tr;
    };
    VerticalView.prototype.getScrollableElement = function () {
        if (this.parent.isAdaptive && !this.isTimelineView() && !this.parent.isServerRenderer()) {
            return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["SCROLL_CONTAINER_CLASS"]);
        }
        else {
            return this.getContentAreaElement();
        }
    };
    VerticalView.prototype.getLeftPanelElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_6__["TIME_CELLS_WRAP_CLASS"]);
    };
    VerticalView.prototype.getEndDateFromStartDate = function (start) {
        var msMajorInterval = this.parent.activeViewOptions.timeScale.interval * _base_util__WEBPACK_IMPORTED_MODULE_4__["MS_PER_MINUTE"];
        var msInterval = msMajorInterval / this.parent.activeViewOptions.timeScale.slotCount;
        var end = new Date(start.getTime());
        end.setMilliseconds(end.getMilliseconds() + msInterval);
        return end;
    };
    VerticalView.prototype.getTimeSlotRows = function (handler) {
        var rows = [];
        var startHour = this.getStartHour();
        var endHour = this.getEndHour();
        var msMajorInterval = this.parent.activeViewOptions.timeScale.interval * _base_util__WEBPACK_IMPORTED_MODULE_4__["MS_PER_MINUTE"];
        var msInterval = msMajorInterval / this.parent.activeViewOptions.timeScale.slotCount;
        var length = Math.round(_base_util__WEBPACK_IMPORTED_MODULE_4__["MS_PER_DAY"] / msInterval);
        var msStartHour = startHour.getTime();
        var msEndHour = endHour.getTime();
        if (msStartHour !== msEndHour) {
            length = (Math.abs(msEndHour - msStartHour) / msInterval) - ((new Date(msEndHour).getTimezoneOffset()
                - new Date(msStartHour).getTimezoneOffset()) / (60 / this.parent.activeViewOptions.timeScale.slotCount));
        }
        if (!this.parent.activeViewOptions.timeScale.enable) {
            length = 1;
        }
        var start = this.parent.getStartEndTime(this.parent.workHours.start);
        var end = this.parent.getStartEndTime(this.parent.workHours.end);
        for (var i = 0; i < length; i++) {
            var dt = new Date(msStartHour + (msInterval * i));
            if (_base_util__WEBPACK_IMPORTED_MODULE_4__["isDaylightSavingTime"](dt) || new Date(msStartHour).getTimezoneOffset() !== dt.getTimezoneOffset()) {
                var timeOffset = new Date(msStartHour).getTimezoneOffset() - dt.getTimezoneOffset();
                dt = new Date(dt.getTime() - (1000 * 60 * timeOffset));
            }
            var majorTickDivider = i % (msMajorInterval / msInterval);
            var row = {
                date: new Date('' + dt),
                startHour: start,
                endHour: end,
                first: (majorTickDivider === 0),
                middle: (majorTickDivider < this.parent.activeViewOptions.timeScale.slotCount - 1),
                last: (majorTickDivider === this.parent.activeViewOptions.timeScale.slotCount - 1),
                type: ''
            };
            if (handler) {
                handler(row);
            }
            rows.push(row);
        }
        return rows;
    };
    /**
     * Get module name.
     */
    VerticalView.prototype.getModuleName = function () {
        return 'verticalView';
    };
    /**
     * To destroy the vertical view.
     * @return {void}
     * @private
     */
    VerticalView.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        this.clearCurrentTimeIndicatorTimer();
        if (this.element) {
            var contentScrollableEle = this.getContentAreaElement();
            if (contentScrollableEle) {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(contentScrollableEle, 'scroll', this.onContentScroll);
            }
            if (this.parent.resourceBase) {
                this.parent.resourceBase.destroy();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.element = null;
            if (this.parent.scheduleTouchModule) {
                this.parent.scheduleTouchModule.resetValues();
            }
        }
    };
    return VerticalView;
}(_view_base__WEBPACK_IMPORTED_MODULE_1__["ViewBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js ***!
  \***********************************************************************************/
/*! exports provided: ViewHelper, ViewBase */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewHelper", function() { return ViewHelper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewBase", function() { return ViewBase; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");



/**
 * view base
 */
var ViewHelper;
(function (ViewHelper) {
    ViewHelper.getDayName = function (proxy, date) {
        return proxy.getDayNames('abbreviated')[date.getDay()];
    };
    ViewHelper.getDate = function (proxy, date) {
        return proxy.globalize.formatDate(date, { format: 'd', calendar: proxy.getCalendarMode() });
    };
    ViewHelper.getTime = function (proxy, date) {
        if (proxy.isAdaptive) {
            if (proxy.timeFormat === 'HH:mm' || proxy.timeFormat === 'HH.mm') {
                return proxy.globalize.formatDate(date, { format: 'H', calendar: proxy.getCalendarMode() });
            }
            return proxy.globalize.formatDate(date, { skeleton: 'h', calendar: proxy.getCalendarMode() });
        }
        return proxy.getTimeString(date);
    };
    ViewHelper.getTimelineDate = function (proxy, date) {
        var skeleton = 'MMMd';
        var text = proxy.globalize.formatDate(date, { skeleton: skeleton, calendar: proxy.getCalendarMode() }) + ', ' +
            proxy.getDayNames('wide')[date.getDay()];
        return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](text, 'multiple');
    };
    ViewHelper.getWeekNumberContent = function (proxy, dates) {
        var weekNumber;
        if (proxy.weekRule === 'FirstDay') {
            var weekNumberDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekLastDate"](dates.slice(-1)[0], proxy.firstDayOfWeek);
            weekNumber = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekNumber"](weekNumberDate);
        }
        else if (proxy.weekRule === 'FirstFourDayWeek') {
            var weekFirstDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"](dates.slice(-1)[0], proxy.firstDayOfWeek);
            var weekLastDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekLastDate"](dates.slice(-1)[0], proxy.firstDayOfWeek);
            var weekMidDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekMiddleDate"](weekFirstDate, weekLastDate);
            weekNumber = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekNumber"](weekMidDate);
        }
        else if (proxy.weekRule === 'FirstFullWeek') {
            var weekFirstDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"](dates.slice(-1)[0], proxy.firstDayOfWeek);
            weekNumber = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekNumber"](weekFirstDate);
        }
        return weekNumber;
    };
})(ViewHelper || (ViewHelper = {}));
var ViewBase = /** @__PURE__ @class */ (function () {
    /**
     * Constructor
     */
    function ViewBase(parent) {
        this.parent = parent;
    }
    ViewBase.prototype.isTimelineView = function () {
        return this.parent.currentView.indexOf('Timeline') !== -1;
    };
    ViewBase.prototype.getContentRows = function () {
        return [];
    };
    ViewBase.prototype.serverRenderLayout = function () {
        // Need only for layout server rendering
    };
    ViewBase.prototype.createEventTable = function (trCount) {
        var eventTable = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_TABLE_CLASS"] });
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(this.getEventRows(trCount), eventTable);
        return eventTable;
    };
    ViewBase.prototype.getEventRows = function (trCount) {
        var eventRows = [];
        var eventContainer;
        for (var row = 0; row < trCount; row++) {
            eventContainer = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["APPOINTMENT_CONTAINER_CLASS"] });
            if (this.parent.resourceBase && !this.parent.uiStateValues.isGroupAdaptive && this.parent.resourceBase.renderedResources) {
                eventContainer.setAttribute('data-group-index', this.parent.resourceBase.renderedResources[row].groupIndex.toString());
            }
            eventRows.push(eventContainer);
        }
        return eventRows;
    };
    ViewBase.prototype.collapseRows = function (wrap) {
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            this.parent.resourceBase.hideResourceRows(wrap.querySelector('tbody'));
            this.parent.resourceBase.hideResourceRows(wrap.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["EVENT_TABLE_CLASS"]));
        }
    };
    ViewBase.prototype.createTableLayout = function (className) {
        var clsName = className || '';
        var table = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('table', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["SCHEDULE_TABLE_CLASS"] + ' ' + clsName });
        var tbody = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tbody');
        table.appendChild(tbody);
        return table;
    };
    ViewBase.prototype.createColGroup = function (table, lastRow) {
        var length = lastRow.length;
        if (lastRow[0] && lastRow[0].colSpan) {
            length = lastRow.map(function (value) { return value.colSpan; }).reduce(function (prev, next) { return prev + next; });
        }
        var colGroupEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('colgroup');
        for (var i = 0; i < length; i++) {
            colGroupEle.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('col'));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([colGroupEle], table);
    };
    ViewBase.prototype.getScrollXIndent = function (content) {
        return content.offsetHeight - content.clientHeight > 0 ? _base_util__WEBPACK_IMPORTED_MODULE_2__["getScrollBarWidth"]() : 0;
    };
    ViewBase.prototype.scrollTopPanel = function (target) {
        this.getDatesHeaderElement().firstElementChild.scrollLeft = target.scrollLeft;
    };
    ViewBase.prototype.scrollHeaderLabels = function (target) {
        var headerTable = this.element.querySelector('.e-date-header-wrap table');
        var colWidth = headerTable.offsetWidth / headerTable.querySelectorAll('colgroup col').length;
        var applyLeft = function (headerCells, isRtl) {
            var currentCell;
            var tdLeft = 0;
            var colSpan = 0;
            var hiddenLeft = isRtl ? target.scrollWidth - target.offsetWidth - target.scrollLeft : target.scrollLeft;
            for (var _i = 0, headerCells_2 = headerCells; _i < headerCells_2.length; _i++) {
                var cell = headerCells_2[_i];
                colSpan += parseInt(cell.getAttribute('colSpan'), 10);
                if (colSpan > Math.floor(hiddenLeft / colWidth)) {
                    currentCell = cell;
                    break;
                }
                tdLeft += cell.offsetWidth;
            }
            currentCell.children[0].style[isRtl ? 'right' : 'left'] = (hiddenLeft - tdLeft) + 'px';
        };
        var classNames = ['.e-header-year-cell', '.e-header-month-cell', '.e-header-week-cell', '.e-header-cells'];
        for (var _i = 0, classNames_1 = classNames; _i < classNames_1.length; _i++) {
            var className = classNames_1[_i];
            var headerCells = [].slice.call(this.element.querySelectorAll(className));
            if (headerCells.length > 0) {
                for (var _a = 0, headerCells_1 = headerCells; _a < headerCells_1.length; _a++) {
                    var element = headerCells_1[_a];
                    element.children[0].style[this.parent.enableRtl ? 'right' : 'left'] = '';
                }
                applyLeft(headerCells, this.parent.enableRtl);
            }
        }
    };
    ViewBase.prototype.addAttributes = function (td, element) {
        if (td.template) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(td.template, element);
        }
        if (td.colSpan) {
            element.setAttribute('colspan', td.colSpan.toString());
        }
        if (td.className) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], td.className);
        }
    };
    ViewBase.prototype.getHeaderBarHeight = function () {
        var headerBarHeight = 2;
        if (this.parent.headerModule) {
            headerBarHeight += _base_util__WEBPACK_IMPORTED_MODULE_2__["getOuterHeight"](this.parent.headerModule.getHeaderElement());
        }
        if (this.parent.uiStateValues.isGroupAdaptive) {
            var resHeader = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESOURCE_HEADER_TOOLBAR"]);
            if (resHeader) {
                headerBarHeight += resHeader.offsetHeight;
            }
        }
        return headerBarHeight;
    };
    ViewBase.prototype.renderPanel = function (type) {
        if (type === _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["PREVIOUS_PANEL_CLASS"]) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([this.element], this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["TABLE_CONTAINER_CLASS"]));
        }
        else {
            this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["TABLE_CONTAINER_CLASS"]).appendChild(this.element);
        }
    };
    ViewBase.prototype.setPanel = function (panel) {
        this.element = panel;
    };
    ViewBase.prototype.getPanel = function () {
        return this.element;
    };
    ViewBase.prototype.getDatesHeaderElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["DATE_HEADER_CONTAINER_CLASS"]);
    };
    ViewBase.prototype.getDateSlots = function (renderDates, workDays) {
        // Here getDateSlots only need in vertical and month views
        return [];
    };
    ViewBase.prototype.generateColumnLevels = function () {
        // Here generateColumnLevels only need in vertical and month views
        return [];
    };
    ViewBase.prototype.getColumnLevels = function () {
        return this.colLevels;
    };
    ViewBase.prototype.highlightCurrentTime = function () {
        // Here showTimeIndicator functionalities
    };
    ViewBase.prototype.startDate = function () {
        return this.renderDates[0];
    };
    ViewBase.prototype.endDate = function () {
        return _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.renderDates[this.renderDates.length - 1], 1);
    };
    ViewBase.prototype.getStartHour = function () {
        var startHour = this.parent.getStartEndTime(this.parent.activeViewOptions.startHour);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startHour)) {
            startHour = new Date(2000, 0, 0, 0);
        }
        return startHour;
    };
    ViewBase.prototype.getEndHour = function () {
        var endHour = this.parent.getStartEndTime(this.parent.activeViewOptions.endHour);
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endHour)) {
            endHour = new Date(2000, 0, 0, 0);
        }
        return endHour;
    };
    ViewBase.prototype.isCurrentDate = function (date) {
        return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
    };
    ViewBase.prototype.isCurrentMonth = function (date) {
        return date.getFullYear() ===
            this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
    };
    ViewBase.prototype.isWorkDay = function (date, workDays) {
        if (workDays === void 0) { workDays = this.parent.activeViewOptions.workDays; }
        if (workDays.indexOf(date.getDay()) >= 0) {
            return true;
        }
        return false;
    };
    ViewBase.prototype.isWorkHour = function (date, startHour, endHour, workDays) {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(startHour) || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(endHour)) {
            return false;
        }
        startHour.setMilliseconds(0);
        endHour.setMilliseconds(0);
        return !(_base_util__WEBPACK_IMPORTED_MODULE_2__["getDateInMs"](date) < _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateInMs"](startHour) || _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateInMs"](date) >= _base_util__WEBPACK_IMPORTED_MODULE_2__["getDateInMs"](endHour) ||
            !this.isWorkDay(date, workDays));
    };
    ViewBase.prototype.getRenderDates = function (workDays) {
        var renderDates = [];
        // Due to same code for vertical and time line, week & work week views, if condition has used
        if (this.parent.currentView === 'Week' || this.parent.currentView === 'TimelineWeek') {
            var selectedDate = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.parent.selectedDate);
            var start = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"](selectedDate, this.parent.activeViewOptions.firstDayOfWeek);
            for (var i = 0, length_1 = _base_util__WEBPACK_IMPORTED_MODULE_2__["WEEK_LENGTH"] * this.parent.activeViewOptions.interval; i < length_1; i++) {
                if (this.parent.activeViewOptions.showWeekend) {
                    renderDates.push(start);
                }
                else {
                    if (this.isWorkDay(start, workDays)) {
                        renderDates.push(start);
                    }
                }
                start = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](start, 1);
            }
        }
        else if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {
            var start = _base_util__WEBPACK_IMPORTED_MODULE_2__["getWeekFirstDate"](_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.parent.selectedDate), this.parent.activeViewOptions.firstDayOfWeek);
            for (var i = 0, length_2 = _base_util__WEBPACK_IMPORTED_MODULE_2__["WEEK_LENGTH"] * this.parent.activeViewOptions.interval; i < length_2; i++) {
                if (this.isWorkDay(start, workDays)) {
                    renderDates.push(start);
                }
                start = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](start, 1);
            }
        }
        else {
            var dayCount = this.parent.currentView === 'Agenda' ? this.parent.agendaDaysCount :
                this.parent.activeViewOptions.interval;
            var start = _base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](this.parent.selectedDate);
            do {
                if (this.parent.activeViewOptions.showWeekend) {
                    renderDates.push(start);
                }
                else {
                    if (this.isWorkDay(start, workDays)) {
                        renderDates.push(start);
                    }
                }
                start = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](start, 1);
            } while (dayCount !== renderDates.length);
        }
        if (!workDays) {
            this.renderDates = renderDates;
        }
        if (this.parent.headerModule) {
            this.parent.headerModule.previousNextIconHandler();
        }
        return renderDates;
    };
    ViewBase.prototype.getNextPreviousDate = function (type) {
        if (this.parent.currentView === 'Day' || this.parent.currentView === 'TimelineDay') {
            if (this.parent.activeViewOptions.showWeekend) {
                var daysCount = this.parent.activeViewOptions.interval;
                return _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.parent.selectedDate, type === 'next' ? daysCount : -daysCount);
            }
            else {
                var date = void 0;
                if (type === 'next') {
                    date = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.renderDates.slice(-1)[0], 1);
                    while (!this.isWorkDay(date)) {
                        date = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](date, 1);
                    }
                }
                else {
                    date = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.renderDates[0], -1);
                    var count = 0;
                    do {
                        if (this.isWorkDay(date)) {
                            count += 1;
                        }
                        if (this.parent.activeViewOptions.interval !== count) {
                            date = _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](date, -1);
                        }
                    } while (this.parent.activeViewOptions.interval !== count);
                }
                return date;
            }
        }
        var weekLength = type === 'next' ? _base_util__WEBPACK_IMPORTED_MODULE_2__["WEEK_LENGTH"] : -_base_util__WEBPACK_IMPORTED_MODULE_2__["WEEK_LENGTH"];
        return _base_util__WEBPACK_IMPORTED_MODULE_2__["addDays"](this.parent.selectedDate, weekLength * this.parent.activeViewOptions.interval);
    };
    ViewBase.prototype.getLabelText = function (view) {
        var viewStr = view.charAt(0).toLowerCase() + view.substring(1);
        return this.parent.localeObj.getConstant(viewStr) + ' of ' + _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](this.parent.globalize.formatDate(this.parent.selectedDate, { skeleton: 'long', calendar: this.parent.getCalendarMode() }), 'single');
    };
    ViewBase.prototype.getDateRangeText = function () {
        if (this.parent.isAdaptive) {
            var formatDate = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
            return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](this.parent.globalize.formatDate(this.parent.selectedDate, { format: formatDate, calendar: this.parent.getCalendarMode() }), 'single');
        }
        return this.formatDateRange(this.renderDates[0], this.renderDates[this.renderDates.length - 1]);
    };
    ViewBase.prototype.formatDateRange = function (startDate, endDate) {
        var globalize = this.parent.globalize;
        var mode = this.parent.getCalendarMode();
        if (startDate === endDate) {
            endDate = null;
        }
        if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.activeViewOptions.dateFormat)) {
            var text = '';
            if (!endDate) {
                text = globalize.formatDate(startDate, { format: this.parent.activeViewOptions.dateFormat, calendar: mode });
                return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](text, 'multiple');
            }
            text = (globalize.formatDate(startDate, { format: this.parent.activeViewOptions.dateFormat, calendar: mode }) +
                ' - ' + globalize.formatDate(endDate, { format: this.parent.activeViewOptions.dateFormat, calendar: mode }));
            return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](text, 'multiple');
        }
        var formattedStr;
        var longDateFormat;
        if (this.parent.locale === 'en' || this.parent.locale === 'en-US') {
            longDateFormat = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('dateFormats.long', Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getDefaultDateObject"])(mode));
        }
        else {
            longDateFormat = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('main.' + '' + this.parent.locale + '.dates.calendars.' + mode + '.dateFormats.long', _ej2_base__WEBPACK_IMPORTED_MODULE_0__["cldrData"]);
        }
        if (!endDate) {
            return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](globalize.formatDate(startDate, { format: longDateFormat, calendar: mode }), 'single');
        }
        var dateFormat = longDateFormat.trim().toLocaleLowerCase();
        if (dateFormat.substr(0, 1) === 'd') {
            if (startDate.getFullYear() === endDate.getFullYear()) {
                if (startDate.getMonth() === endDate.getMonth()) {
                    formattedStr = globalize.formatDate(startDate, { format: 'dd', calendar: mode }) + ' - ' +
                        globalize.formatDate(endDate, { format: 'dd MMMM yyyy', calendar: mode });
                }
                else {
                    formattedStr = globalize.formatDate(startDate, { format: 'dd MMM', calendar: mode }) + ' - ' +
                        globalize.formatDate(endDate, { format: 'dd MMM yyyy', calendar: mode });
                }
            }
            else {
                formattedStr = globalize.formatDate(startDate, { format: 'dd MMM yyyy', calendar: mode }) + ' - ' +
                    globalize.formatDate(endDate, { format: 'dd MMM yyyy', calendar: mode });
            }
        }
        else if (dateFormat.substr(0, 1) === 'm') {
            if (startDate.getFullYear() === endDate.getFullYear()) {
                if (startDate.getMonth() === endDate.getMonth()) {
                    formattedStr = globalize.formatDate(startDate, { format: 'MMMM dd', calendar: mode }) + ' - ' +
                        globalize.formatDate(endDate, { format: 'dd, yyyy', calendar: mode });
                }
                else {
                    formattedStr = globalize.formatDate(startDate, { format: 'MMM dd', calendar: mode }) + ' - ' +
                        globalize.formatDate(endDate, { format: 'MMM dd, yyyy', calendar: mode });
                }
            }
            else {
                formattedStr = globalize.
                    formatDate(startDate, { format: 'MMM dd, yyyy', calendar: mode }) + ' - ' +
                    globalize.formatDate(endDate, { format: 'MMM dd, yyyy', calendar: mode });
            }
        }
        else {
            formattedStr = globalize.formatDate(startDate, { format: longDateFormat, calendar: mode }) + ' - ' +
                globalize.formatDate(endDate, { format: longDateFormat, calendar: mode });
        }
        return _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](formattedStr, 'multiple');
    };
    ViewBase.prototype.getMobileDateElement = function (date, className) {
        var wrap = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
            className: className,
            innerHTML: '<div class="e-m-date">' + this.parent.globalize.formatDate(date, { format: 'd', calendar: this.parent.getCalendarMode() }) + '</div>' + '<div class="e-m-day">' +
                _base_util__WEBPACK_IMPORTED_MODULE_2__["capitalizeFirstWord"](this.parent.globalize.formatDate(date, { format: 'E', calendar: this.parent.getCalendarMode() }), 'single') + '</div>'
        });
        return wrap;
    };
    ViewBase.prototype.setResourceHeaderContent = function (tdElement, tdData, className) {
        if (className === void 0) { className = _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["TEXT_ELLIPSIS"]; }
        if (this.parent.activeViewOptions.resourceHeaderTemplate) {
            var data = { resource: tdData.resource, resourceData: tdData.resourceData };
            var scheduleId = this.parent.element.id + '_';
            var viewName = this.parent.activeViewOptions.resourceHeaderTemplateName;
            var templateId = scheduleId + viewName + 'resourceHeaderTemplate';
            var quickTemplate = [].slice.call(this.parent.getResourceHeaderTemplate()(data, this.parent, 'resourceHeaderTemplate', templateId, false));
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["append"])(quickTemplate, tdElement);
        }
        else {
            tdElement.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: className, innerHTML: tdData.resourceData[tdData.resource.textField]
            }));
        }
    };
    ViewBase.prototype.renderResourceMobileLayout = function () {
        if (this.parent.resourceBase.lastResourceLevel && this.parent.resourceBase.lastResourceLevel.length <= 0) {
            return;
        }
        this.parent.resourceBase.renderResourceHeader();
        this.parent.resourceBase.renderResourceTree();
    };
    ViewBase.prototype.addAutoHeightClass = function (element) {
        if (!this.parent.uiStateValues.isGroupAdaptive && this.parent.rowAutoHeight && this.isTimelineView()
            && this.parent.activeViewOptions.group.resources.length > 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([element], _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["AUTO_HEIGHT"]);
        }
    };
    ViewBase.prototype.getColElements = function () {
        return [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_WRAP_CLASS"] + ' col, .' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["DATE_HEADER_WRAP_CLASS"] + ' col'));
    };
    ViewBase.prototype.setColWidth = function (content) {
        if (this.isTimelineView()) {
            var colElements = this.getColElements();
            var contentBody = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_TABLE_CLASS"] + ' tbody');
            var colWidth_1 = Math.ceil(contentBody.offsetWidth / (colElements.length / 2));
            colElements.forEach(function (col) { return Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(col, { 'width': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(colWidth_1) }); });
            if (content.offsetHeight !== content.clientHeight) {
                var resourceColumn = this.parent.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESOURCE_COLUMN_WRAP_CLASS"]);
                if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(resourceColumn)) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setStyleAttribute"])(resourceColumn, { 'height': Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(content.clientHeight) });
                }
            }
        }
    };
    ViewBase.prototype.resetColWidth = function () {
        var colElements = this.getColElements();
        for (var _i = 0, colElements_1 = colElements; _i < colElements_1.length; _i++) {
            var col = colElements_1[_i];
            col.style.width = '';
        }
    };
    ViewBase.prototype.getContentAreaElement = function () {
        return this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["CONTENT_WRAP_CLASS"]);
    };
    ViewBase.prototype.wireExpandCollapseIconEvents = function () {
        if (this.parent.resourceBase && this.parent.resourceBase.resourceCollection.length > 1) {
            var treeIcons = [].slice.call(this.element.querySelectorAll('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["RESOURCE_TREE_ICON_CLASS"]));
            for (var _i = 0, treeIcons_1 = treeIcons; _i < treeIcons_1.length; _i++) {
                var icon = treeIcons_1[_i];
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].clearEvents(icon);
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(icon, 'click', this.parent.resourceBase.onTreeIconClick, this.parent.resourceBase);
            }
        }
    };
    ViewBase.prototype.scrollToDate = function (scrollDate) {
        if (['Month', 'TimelineMonth'].indexOf(this.parent.currentView) === -1 || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(scrollDate)) {
            return;
        }
        var scrollWrap = this.getContentAreaElement();
        var tdDate = this.parent.getMsFromDate(new Date(_base_util__WEBPACK_IMPORTED_MODULE_2__["resetTime"](new Date(+scrollDate)).getTime()));
        var dateElement = scrollWrap.querySelector("." + _base_css_constant__WEBPACK_IMPORTED_MODULE_1__["WORK_CELLS_CLASS"] + "[data-date=\"" + tdDate + "\"]");
        if (this.parent.currentView === 'Month' && dateElement) {
            scrollWrap.scrollTop = dateElement.offsetTop;
        }
        if (this.parent.currentView === 'TimelineMonth' && dateElement) {
            scrollWrap.scrollLeft = dateElement.offsetLeft;
        }
    };
    ViewBase.prototype.setPersistence = function () {
        if (this.parent.enablePersistence) {
            var contentWrap = this.element.querySelector('.e-content-wrap');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(contentWrap)) {
                this.parent.scrollLeft = contentWrap.scrollLeft;
                this.parent.scrollTop = contentWrap.scrollTop;
            }
        }
    };
    ViewBase.prototype.retainScrollPosition = function () {
        if (this.parent.enablePersistence) {
            var conWrap = this.parent.element.querySelector('.e-content-wrap');
            if (!Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(conWrap) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.scrollLeft) && !Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(this.parent.scrollTop)) {
                conWrap.scrollTop = this.parent.scrollTop;
                conWrap.scrollLeft = this.parent.scrollLeft;
            }
        }
    };
    return ViewBase;
}());



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/week.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/week.js ***!
  \******************************************************************************/
/*! exports provided: Week */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Week", function() { return Week; });
/* harmony import */ var _vertical_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();

/**
 * week view
 */
var Week = /** @__PURE__ @class */ (function (_super) {
    __extends(Week, _super);
    /**
     * Constructor for week view
     */
    function Week(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-week-view';
        return _this;
    }
    /**
     * Get module name.
     */
    Week.prototype.getModuleName = function () {
        return 'week';
    };
    return Week;
}(_vertical_view__WEBPACK_IMPORTED_MODULE_0__["VerticalView"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/work-week.js":
/*!***********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/work-week.js ***!
  \***********************************************************************************/
/*! exports provided: WorkWeek */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkWeek", function() { return WorkWeek; });
/* harmony import */ var _vertical_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vertical-view */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/vertical-view.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();


/**
 * work week view
 */
var WorkWeek = /** @__PURE__ @class */ (function (_super) {
    __extends(WorkWeek, _super);
    /**
     * Constructor for work week view
     */
    function WorkWeek(par) {
        var _this = _super.call(this, par) || this;
        _this.viewClass = 'e-work-week-view';
        return _this;
    }
    WorkWeek.prototype.startDate = function () {
        var startDate = this.renderDates[0];
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            startDate = this.parent.resourceBase.getResourceRenderDates()[0];
        }
        return startDate;
    };
    WorkWeek.prototype.endDate = function () {
        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_1__["addDays"](this.renderDates[this.renderDates.length - 1], 1);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            endDate = _base_util__WEBPACK_IMPORTED_MODULE_1__["addDays"](this.parent.resourceBase.getResourceRenderDates().slice(-1)[0], 1);
        }
        return endDate;
    };
    /**
     * Get module name.
     */
    WorkWeek.prototype.getModuleName = function () {
        return 'workWeek';
    };
    return WorkWeek;
}(_vertical_view__WEBPACK_IMPORTED_MODULE_0__["VerticalView"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/year.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/year.js ***!
  \******************************************************************************/
/*! exports provided: Year */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Year", function() { return Year; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _view_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view-base */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/renderer/view-base.js");
/* harmony import */ var _event_renderer_year__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../event-renderer/year */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/event-renderer/year.js");
/* harmony import */ var _base_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/util */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/util.js");
/* harmony import */ var _base_constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base/constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/constant.js");
/* harmony import */ var _base_css_constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base/css-constant */ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/base/css-constant.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();






/**
 * year view
 */
var Year = /** @__PURE__ @class */ (function (_super) {
    __extends(Year, _super);
    /**
     * Constructor for year view
     */
    function Year(parent) {
        var _this = _super.call(this, parent) || this;
        _this.viewClass = 'e-year-view';
        _this.isInverseTableSelect = false;
        return _this;
    }
    Year.prototype.renderLayout = function (className) {
        if (this.parent.resourceBase) {
            this.parent.resourceBase.generateResourceLevels([{ renderDates: this.parent.activeView.renderDates }]);
        }
        this.setPanel(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["TABLE_WRAP_CLASS"] }));
        var viewTypeClass = this.parent.activeViewOptions.orientation === 'Horizontal' ? 'e-horizontal' : 'e-vertical';
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.element], [this.viewClass, viewTypeClass, className]);
        this.renderPanel(className);
        var calendarTable = this.createTableLayout(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["OUTER_TABLE_CLASS"]);
        this.element.appendChild(calendarTable);
        this.element.querySelector('table').setAttribute('role', 'presentation');
        var calendarTBody = calendarTable.querySelector('tbody');
        this.rowCount = this.getRowColumnCount('row');
        this.columnCount = this.getRowColumnCount('column');
        this.renderHeader(calendarTBody);
        this.renderContent(calendarTBody);
        if (this.parent.currentView !== 'Year' && this.parent.uiStateValues.isGroupAdaptive) {
            this.generateColumnLevels();
            this.renderResourceMobileLayout();
        }
        this.wireEvents(this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]), 'scroll');
        this.parent.notify(_base_constant__WEBPACK_IMPORTED_MODULE_4__["contentReady"], {});
    };
    // tslint:disable-next-line:no-empty
    Year.prototype.renderHeader = function (headerWrapper) {
    };
    Year.prototype.renderContent = function (content) {
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        content.appendChild(tr);
        var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        tr.appendChild(td);
        this.element.querySelector('tbody').appendChild(tr);
        var contentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"] });
        td.appendChild(contentWrapper);
        var calendarTable = this.createTableLayout('e-calendar-table');
        contentWrapper.appendChild(calendarTable);
        var cTr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        calendarTable.querySelector('tbody').appendChild(cTr);
        var cTd = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td');
        cTr.appendChild(cTd);
        var calendarWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-calendar-wrapper' });
        cTd.appendChild(calendarWrapper);
        var monthCollection = Array.apply(null, { length: 12 }).map(function (value, index) { return index; });
        for (var _i = 0, monthCollection_1 = monthCollection; _i < monthCollection_1.length; _i++) {
            var month = monthCollection_1[_i];
            var currentMonth = new Date(this.parent.selectedDate.getFullYear(), month, 1);
            var calendarElement = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
                className: 'e-month-calendar e-calendar',
                attrs: { 'data-role': 'calendar' }
            });
            calendarElement.appendChild(this.renderCalendarHeader(currentMonth));
            calendarElement.appendChild(this.renderCalendarContent(currentMonth));
            calendarWrapper.appendChild(calendarElement);
        }
    };
    Year.prototype.renderCalendarHeader = function (currentDate) {
        var headerWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-header e-month' });
        var headerContent = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-day e-title', innerHTML: this.getMonthName(currentDate) });
        headerWrapper.appendChild(headerContent);
        this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], { elementType: 'headerCells', element: headerContent, date: currentDate });
        return headerWrapper;
    };
    Year.prototype.renderCalendarContent = function (currentDate) {
        var dateCollection = this.getMonthDates(currentDate);
        var contentWrapper = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', { className: 'e-content e-month' });
        var contentTable = this.createTableLayout('e-calendar-table ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_TABLE_CLASS"]);
        contentWrapper.appendChild(contentTable);
        var thead = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('thead', { className: 'e-week-header' });
        var tr = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr');
        var currentWeek = _base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekFirstDate"](_base_util__WEBPACK_IMPORTED_MODULE_3__["firstDateOfMonth"](currentDate), this.parent.firstDayOfWeek);
        if (this.parent.activeViewOptions.showWeekNumber) {
            tr.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('th'));
        }
        for (var i = 0; i < _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"]; i++) {
            tr.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('th', { innerHTML: this.parent.getDayNames('narrow')[currentWeek.getDay()] }));
            currentWeek = new Date(currentWeek.getTime() + _base_util__WEBPACK_IMPORTED_MODULE_3__["MS_PER_DAY"]);
        }
        thead.appendChild(tr);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["prepend"])([thead], contentTable);
        var tbody = contentTable.querySelector('tbody');
        while (dateCollection.length > 0) {
            var weekDates = dateCollection.splice(0, _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"]);
            var tr_1 = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('tr', { attrs: { 'role': 'row' } });
            if (this.parent.activeViewOptions.showWeekNumber) {
                var weekNumber = _view_base__WEBPACK_IMPORTED_MODULE_1__["ViewHelper"].getWeekNumberContent(this.parent, weekDates);
                var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                    className: 'e-week-number',
                    attrs: { 'role': 'gridcell', 'title': 'Week ' + weekNumber },
                    innerHTML: weekNumber.toString()
                });
                tr_1.appendChild(td);
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], { elementType: 'weekNumberCells', element: td });
            }
            for (var _i = 0, weekDates_1 = weekDates; _i < weekDates_1.length; _i++) {
                var date = weekDates_1[_i];
                var td = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('td', {
                    className: 'e-cell ' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"],
                    attrs: { 'role': 'gridcell', 'aria-selected': 'false', 'data-date': date.getTime().toString() }
                });
                td.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('span', { className: 'e-day', innerHTML: date.getDate().toString() }));
                var classList = [];
                if (currentDate.getMonth() !== date.getMonth()) {
                    classList.push(_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["OTHERMONTH_CLASS"]);
                }
                if (this.isCurrentDate(date) && currentDate.getMonth() === date.getMonth()) {
                    classList = classList.concat(['e-today', 'e-selected']);
                }
                if (classList.length > 0) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([td], classList);
                }
                tr_1.appendChild(td);
                this.wireEvents(td, 'cell');
                this.parent.trigger(_base_constant__WEBPACK_IMPORTED_MODULE_4__["renderCell"], { elementType: 'workCells', element: td, date: date });
            }
            tbody.appendChild(tr_1);
        }
        return contentWrapper;
    };
    Year.prototype.createTableColGroup = function (count) {
        var colGroupEle = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('colgroup');
        for (var i = 0; i < count; i++) {
            colGroupEle.appendChild(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"])('col'));
        }
        return colGroupEle;
    };
    Year.prototype.getMonthName = function (date) {
        var month = this.parent.globalize.formatDate(date, {
            format: this.parent.activeViewOptions.dateFormat || 'MMMM',
            calendar: this.parent.getCalendarMode()
        });
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["capitalizeFirstWord"](month, 'multiple');
    };
    Year.prototype.generateColumnLevels = function () {
        var colLevels = [];
        var level = this.getDateSlots([this.parent.selectedDate], this.parent.activeViewOptions.workDays);
        if (this.parent.activeViewOptions.group.resources.length > 0) {
            colLevels = this.parent.resourceBase.generateResourceLevels(level);
            if (this.parent.uiStateValues.isGroupAdaptive) {
                var resourceLevel = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
                colLevels = [this.getDateSlots([this.parent.selectedDate], resourceLevel.workDays)];
            }
        }
        else {
            colLevels.push(level);
        }
        colLevels.pop();
        this.colLevels = colLevels;
        return colLevels;
    };
    Year.prototype.getDateSlots = function (renderDates, workDays, startHour, endHour) {
        if (startHour === void 0) { startHour = this.parent.workHours.start; }
        if (endHour === void 0) { endHour = this.parent.workHours.end; }
        var dateCol = [{
                date: renderDates[0], type: 'dateHeader', className: [_base_css_constant__WEBPACK_IMPORTED_MODULE_5__["HEADER_CELLS_CLASS"]], colSpan: 1, workDays: workDays,
                startHour: new Date(+this.parent.globalize.parseDate(startHour, { skeleton: 'Hm' })),
                endHour: new Date(+this.parent.globalize.parseDate(endHour, { skeleton: 'Hm' }))
            }];
        return dateCol;
    };
    Year.prototype.getMonthDates = function (date) {
        var startDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekFirstDate"](_base_util__WEBPACK_IMPORTED_MODULE_3__["firstDateOfMonth"](date), this.parent.firstDayOfWeek);
        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(+startDate), (6 * _base_util__WEBPACK_IMPORTED_MODULE_3__["WEEK_LENGTH"]));
        var dateCollection = [];
        for (var start = startDate; start.getTime() < endDate.getTime(); start = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](start, 1)) {
            dateCollection.push(_base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(start)));
        }
        return dateCollection;
    };
    Year.prototype.getRowColumnCount = function (type) {
        var monthCount = 12;
        var year = this.parent.selectedDate.getFullYear();
        var months = [];
        for (var month = 0; month < monthCount; month++) {
            months.push(new Date(year, month, 1).getDay() + new Date(year, month + 1, 0).getDate());
        }
        var maxCount = Math.max.apply(Math, months);
        var count;
        if (type === 'row') {
            count = this.parent.activeViewOptions.orientation === 'Horizontal' ? monthCount : maxCount;
            if (!this.parent.activeViewOptions.timeScale.enable && this.parent.activeViewOptions.orientation === 'Vertical') {
                count = 1;
            }
        }
        else {
            count = this.parent.activeViewOptions.orientation === 'Horizontal' ? maxCount : monthCount;
        }
        return count;
    };
    Year.prototype.isCurrentDate = function (date) {
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date()).getTime() === _base_util__WEBPACK_IMPORTED_MODULE_3__["resetTime"](new Date(date.getTime())).getTime();
    };
    Year.prototype.onCellClick = function (e) {
        var target = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(e.target, '.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["WORK_CELLS_CLASS"]);
        var startDate = this.parent.getDateFromElement(target);
        var endDate = _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(startDate.getTime()), 1);
        var filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
        var moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
        this.parent.quickPopup.moreEventClick(moreEventArgs, new Date());
    };
    Year.prototype.onContentScroll = function (e) {
        var target = e.target;
        var headerWrapper = this.getDatesHeaderElement();
        if (headerWrapper) {
            headerWrapper.firstElementChild.scrollLeft = target.scrollLeft;
        }
        var scrollTopSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["MONTH_HEADER_WRAPPER"] + ",." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"];
        var scrollTopElement = this.element.querySelector(scrollTopSelector);
        if (scrollTopElement) {
            scrollTopElement.scrollTop = target.scrollTop;
        }
        this.setPersistence();
    };
    Year.prototype.onScrollUiUpdate = function (args) {
        var height = this.parent.element.offsetHeight - this.getHeaderBarHeight();
        var headerWrapper = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["DATE_HEADER_CONTAINER_CLASS"]);
        if (headerWrapper) {
            height -= headerWrapper.offsetHeight;
        }
        var contentWrapper = this.element.querySelector('.' + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["CONTENT_WRAP_CLASS"]);
        if (contentWrapper) {
            contentWrapper.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height);
        }
        var leftPanelSelector = "." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["MONTH_HEADER_WRAPPER"] + ",." + _base_css_constant__WEBPACK_IMPORTED_MODULE_5__["RESOURCE_COLUMN_WRAP_CLASS"];
        var leftPanelElement = this.element.querySelector(leftPanelSelector);
        if (leftPanelElement) {
            leftPanelElement.style.height = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["formatUnit"])(height - this.getScrollXIndent(contentWrapper));
        }
        if (!this.parent.isAdaptive && headerWrapper) {
            var scrollBarWidth = _base_util__WEBPACK_IMPORTED_MODULE_3__["getScrollBarWidth"]();
            // tslint:disable:no-any
            if (contentWrapper.offsetWidth - contentWrapper.clientWidth > 0) {
                headerWrapper.firstElementChild.style[args.cssProperties.border] = scrollBarWidth > 0 ? '1px' : '0px';
                headerWrapper.style[args.cssProperties.padding] = scrollBarWidth > 0 ? scrollBarWidth - 1 + 'px' : '0px';
            }
            else {
                headerWrapper.firstElementChild.style[args.cssProperties.border] = '';
                headerWrapper.style[args.cssProperties.padding] = '';
            }
            // tslint:enable:no-any
        }
        this.setColWidth(this.getContentAreaElement());
        this.retainScrollPosition();
    };
    Year.prototype.startDate = function () {
        var startDate = new Date(this.parent.selectedDate.getFullYear(), 0, 1);
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekFirstDate"](startDate, this.parent.firstDayOfWeek);
    };
    Year.prototype.endDate = function () {
        var endDate = new Date(this.parent.selectedDate.getFullYear(), 11, 31);
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](_base_util__WEBPACK_IMPORTED_MODULE_3__["getWeekLastDate"](endDate, this.parent.firstDayOfWeek), 1);
    };
    Year.prototype.getEndDateFromStartDate = function (start) {
        var date = new Date(start.getTime());
        if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
            date = _base_util__WEBPACK_IMPORTED_MODULE_3__["lastDateOfMonth"](date);
        }
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["addDays"](new Date(date.getTime()), 1);
    };
    Year.prototype.getNextPreviousDate = function (type) {
        return _base_util__WEBPACK_IMPORTED_MODULE_3__["addYears"](this.parent.selectedDate, ((type === 'next') ? 1 : -1));
    };
    Year.prototype.getDateRangeText = function () {
        return this.parent.globalize.formatDate(this.parent.selectedDate, { skeleton: 'y' });
    };
    Year.prototype.addEventListener = function () {
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onScrollUiUpdate, this);
        this.parent.on(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.onDataReady, this);
    };
    Year.prototype.removeEventListener = function () {
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["scrollUiUpdate"], this.onScrollUiUpdate);
        this.parent.off(_base_constant__WEBPACK_IMPORTED_MODULE_4__["dataReady"], this.onDataReady);
    };
    Year.prototype.onDataReady = function (args) {
        var yearEventModule = new _event_renderer_year__WEBPACK_IMPORTED_MODULE_2__["YearEvent"](this.parent);
        yearEventModule.renderAppointments();
        this.parent.notify('events-loaded', args);
    };
    Year.prototype.wireEvents = function (element, type) {
        if (type === 'cell') {
            if (this.parent.currentView !== 'TimelineYear') {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.onCellClick, this);
            }
            else {
                _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
                if (!this.parent.isAdaptive) {
                    _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
                }
            }
        }
        else {
            _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(element, 'scroll', this.onContentScroll, this);
        }
    };
    /**
     * Get module name.
     */
    Year.prototype.getModuleName = function () {
        return 'year';
    };
    /**
     * To destroy the year.
     * @return {void}
     * @private
     */
    Year.prototype.destroy = function () {
        if (this.parent.isDestroyed) {
            return;
        }
        if (this.element) {
            if (this.parent.resourceBase) {
                this.parent.resourceBase.destroy();
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.element);
            this.element = null;
        }
    };
    return Year;
}(_view_base__WEBPACK_IMPORTED_MODULE_1__["ViewBase"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-schedule/schedule/timezone/timezone.js ***!
  \**********************************************************************************/
/*! exports provided: Timezone, timezoneData */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timezone", function() { return Timezone; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timezoneData", function() { return timezoneData; });
/**
 * Time zone
 */
var Timezone = /** @__PURE__ @class */ (function () {
    function Timezone() {
    }
    Timezone.prototype.offset = function (date, timezone) {
        var localOffset = date.getTimezoneOffset();
        try {
            var convertedDate = new Date(date.toLocaleString('en-US', { timeZone: timezone }));
            if (!isNaN(convertedDate.getTime())) {
                return ((date.getTime() - convertedDate.getTime()) / 60000) + localOffset;
            }
            return 0;
        }
        catch (error) {
            return 0;
        }
    };
    Timezone.prototype.convert = function (date, fromOffset, toOffset) {
        if (typeof fromOffset === 'string') {
            fromOffset = this.offset(date, fromOffset);
        }
        if (typeof toOffset === 'string') {
            toOffset = this.offset(date, toOffset);
        }
        var fromLocalOffset = date.getTimezoneOffset();
        date = new Date(date.getTime() + (fromOffset - toOffset) * 60000);
        var toLocalOffset = date.getTimezoneOffset();
        return new Date(date.getTime() + (toLocalOffset - fromLocalOffset) * 60000);
    };
    Timezone.prototype.add = function (date, timezone) {
        return this.convert(date, date.getTimezoneOffset(), timezone);
    };
    Timezone.prototype.remove = function (date, timezone) {
        return this.convert(date, timezone, date.getTimezoneOffset());
    };
    Timezone.prototype.removeLocalOffset = function (date) {
        return new Date(+date - (date.getTimezoneOffset() * 60000));
    };
    Timezone.prototype.getLocalTimezoneName = function () {
        return window.Intl ?
            Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' : 'UTC';
    };
    return Timezone;
}());

var timezoneData = [
    { Value: 'Pacific/Niue', Text: '(UTC-11:00) Niue' },
    { Value: 'Pacific/Pago_Pago', Text: '(UTC-11:00) Pago Pago' },
    { Value: 'Pacific/Honolulu', Text: '(UTC-10:00) Hawaii Time' },
    { Value: 'Pacific/Rarotonga', Text: '(UTC-10:00) Rarotonga' },
    { Value: 'Pacific/Tahiti', Text: '(UTC-10:00) Tahiti' },
    { Value: 'Pacific/Marquesas', Text: '(UTC-09:30) Marquesas' },
    { Value: 'America/Anchorage', Text: '(UTC-09:00) Alaska Time' },
    { Value: 'Pacific/Gambier', Text: '(UTC-09:00) Gambier' },
    { Value: 'America/Los_Angeles', Text: '(UTC-08:00) Pacific Time' },
    { Value: 'America/Tijuana', Text: '(UTC-08:00) Pacific Time - Tijuana' },
    { Value: 'America/Vancouver', Text: '(UTC-08:00) Pacific Time - Vancouver' },
    { Value: 'America/Whitehorse', Text: '(UTC-08:00) Pacific Time - Whitehorse' },
    { Value: 'Pacific/Pitcairn', Text: '(UTC-08:00) Pitcairn' },
    { Value: 'America/Denver', Text: '(UTC-07:00) Mountain Time' },
    { Value: 'America/Phoenix', Text: '(UTC-07:00) Mountain Time - Arizona' },
    { Value: 'America/Mazatlan', Text: '(UTC-07:00) Mountain Time - Chihuahua, Mazatlan' },
    { Value: 'America/Dawson_Creek', Text: '(UTC-07:00) Mountain Time - Dawson Creek' },
    { Value: 'America/Edmonton', Text: '(UTC-07:00) Mountain Time - Edmonton' },
    { Value: 'America/Hermosillo', Text: '(UTC-07:00) Mountain Time - Hermosillo' },
    { Value: 'America/Yellowknife', Text: '(UTC-07:00) Mountain Time - Yellowknife' },
    { Value: 'America/Belize', Text: '(UTC-06:00) Belize' },
    { Value: 'America/Chicago', Text: '(UTC-06:00) Central Time' },
    { Value: 'America/Mexico_City', Text: '(UTC-06:00) Central Time - Mexico City' },
    { Value: 'America/Regina', Text: '(UTC-06:00) Central Time - Regina' },
    { Value: 'America/Tegucigalpa', Text: '(UTC-06:00) Central Time - Tegucigalpa' },
    { Value: 'America/Winnipeg', Text: '(UTC-06:00) Central Time - Winnipeg' },
    { Value: 'America/Costa_Rica', Text: '(UTC-06:00) Costa Rica' },
    { Value: 'America/El_Salvador', Text: '(UTC-06:00) El Salvador' },
    { Value: 'Pacific/Galapagos', Text: '(UTC-06:00) Galapagos' },
    { Value: 'America/Guatemala', Text: '(UTC-06:00) Guatemala' },
    { Value: 'America/Managua', Text: '(UTC-06:00) Managua' },
    { Value: 'America/Cancun', Text: '(UTC-05:00) America Cancun' },
    { Value: 'America/Bogota', Text: '(UTC-05:00) Bogota' },
    { Value: 'Pacific/Easter', Text: '(UTC-05:00) Easter Island' },
    { Value: 'America/New_York', Text: '(UTC-05:00) Eastern Time' },
    { Value: 'America/Iqaluit', Text: '(UTC-05:00) Eastern Time - Iqaluit' },
    { Value: 'America/Toronto', Text: '(UTC-05:00) Eastern Time - Toronto' },
    { Value: 'America/Guayaquil', Text: '(UTC-05:00) Guayaquil' },
    { Value: 'America/Havana', Text: '(UTC-05:00) Havana' },
    { Value: 'America/Jamaica', Text: '(UTC-05:00) Jamaica' },
    { Value: 'America/Lima', Text: '(UTC-05:00) Lima' },
    { Value: 'America/Nassau', Text: '(UTC-05:00) Nassau' },
    { Value: 'America/Panama', Text: '(UTC-05:00) Panama' },
    { Value: 'America/Port-au-Prince', Text: '(UTC-05:00) Port-au-Prince' },
    { Value: 'America/Rio_Branco', Text: '(UTC-05:00) Rio Branco' },
    { Value: 'America/Halifax', Text: '(UTC-04:00) Atlantic Time - Halifax' },
    { Value: 'America/Barbados', Text: '(UTC-04:00) Barbados' },
    { Value: 'Atlantic/Bermuda', Text: '(UTC-04:00) Bermuda' },
    { Value: 'America/Boa_Vista', Text: '(UTC-04:00) Boa Vista' },
    { Value: 'America/Caracas', Text: '(UTC-04:00) Caracas' },
    { Value: 'America/Curacao', Text: '(UTC-04:00) Curacao' },
    { Value: 'America/Grand_Turk', Text: '(UTC-04:00) Grand Turk' },
    { Value: 'America/Guyana', Text: '(UTC-04:00) Guyana' },
    { Value: 'America/La_Paz', Text: '(UTC-04:00) La Paz' },
    { Value: 'America/Manaus', Text: '(UTC-04:00) Manaus' },
    { Value: 'America/Martinique', Text: '(UTC-04:00) Martinique' },
    { Value: 'America/Port_of_Spain', Text: '(UTC-04:00) Port of Spain' },
    { Value: 'America/Porto_Velho', Text: '(UTC-04:00) Porto Velho' },
    { Value: 'America/Puerto_Rico', Text: '(UTC-04:00) Puerto Rico' },
    { Value: 'America/Santo_Domingo', Text: '(UTC-04:00) Santo Domingo' },
    { Value: 'America/Thule', Text: '(UTC-04:00) Thule' },
    { Value: 'America/St_Johns', Text: '(UTC-03:30) Newfoundland Time - St. Johns' },
    { Value: 'America/Araguaina', Text: '(UTC-03:00) Araguaina' },
    { Value: 'America/Asuncion', Text: '(UTC-03:00) Asuncion' },
    { Value: 'America/Belem', Text: '(UTC-03:00) Belem' },
    { Value: 'America/Argentina/Buenos_Aires', Text: '(UTC-03:00) Buenos Aires' },
    { Value: 'America/Campo_Grande', Text: '(UTC-03:00) Campo Grande' },
    { Value: 'America/Cayenne', Text: '(UTC-03:00) Cayenne' },
    { Value: 'America/Cuiaba', Text: '(UTC-03:00) Cuiaba' },
    { Value: 'America/Fortaleza', Text: '(UTC-03:00) Fortaleza' },
    { Value: 'America/Godthab', Text: '(UTC-03:00) Godthab' },
    { Value: 'America/Maceio', Text: '(UTC-03:00) Maceio' },
    { Value: 'America/Miquelon', Text: '(UTC-03:00) Miquelon' },
    { Value: 'America/Montevideo', Text: '(UTC-03:00) Montevideo' },
    { Value: 'Antarctica/Palmer', Text: '(UTC-03:00) Palmer' },
    { Value: 'America/Paramaribo', Text: '(UTC-03:00) Paramaribo' },
    { Value: 'America/Punta_Arenas', Text: '(UTC-03:00) Punta Arenas' },
    { Value: 'America/Recife', Text: '(UTC-03:00) Recife' },
    { Value: 'Antarctica/Rothera', Text: '(UTC-03:00) Rothera' },
    { Value: 'America/Bahia', Text: '(UTC-03:00) Salvador' },
    { Value: 'America/Santiago', Text: '(UTC-03:00) Santiago' },
    { Value: 'Atlantic/Stanley', Text: '(UTC-03:00) Stanley' },
    { Value: 'America/Noronha', Text: '(UTC-02:00) Noronha' },
    { Value: 'America/Sao_Paulo', Text: '(UTC-02:00) Sao Paulo' },
    { Value: 'Atlantic/South_Georgia', Text: '(UTC-02:00) South Georgia' },
    { Value: 'Atlantic/Azores', Text: '(UTC-01:00) Azores' },
    { Value: 'Atlantic/Cape_Verde', Text: '(UTC-01:00) Cape Verde' },
    { Value: 'America/Scoresbysund', Text: '(UTC-01:00) Scoresbysund' },
    { Value: 'Africa/Abidjan', Text: '(UTC+00:00) Abidjan' },
    { Value: 'Africa/Accra', Text: '(UTC+00:00) Accra' },
    { Value: 'Africa/Bissau', Text: '(UTC+00:00) Bissau' },
    { Value: 'Atlantic/Canary', Text: '(UTC+00:00) Canary Islands' },
    { Value: 'Africa/Casablanca', Text: '(UTC+00:00) Casablanca' },
    { Value: 'America/Danmarkshavn', Text: '(UTC+00:00) Danmarkshavn' },
    { Value: 'Europe/Dublin', Text: '(UTC+00:00) Dublin' },
    { Value: 'Africa/El_Aaiun', Text: '(UTC+00:00) El Aaiun' },
    { Value: 'Atlantic/Faroe', Text: '(UTC+00:00) Faeroe' },
    { Value: 'Etc/UTC', Text: '(UTC+00:00) UTC (no daylight saving)' },
    { Value: 'Europe/Lisbon', Text: '(UTC+00:00) Lisbon' },
    { Value: 'Europe/London', Text: '(UTC+00:00) London' },
    { Value: 'Africa/Monrovia', Text: '(UTC+00:00) Monrovia' },
    { Value: 'Atlantic/Reykjavik', Text: '(UTC+00:00) Reykjavik' },
    { Value: 'UTC', Text: 'UTC' },
    { Value: 'Africa/Algiers', Text: '(UTC+01:00) Algiers' },
    { Value: 'Europe/Amsterdam', Text: '(UTC+01:00) Amsterdam' },
    { Value: 'Europe/Andorra', Text: '(UTC+01:00) Andorra' },
    { Value: 'Europe/Berlin', Text: '(UTC+01:00) Berlin' },
    { Value: 'Europe/Brussels', Text: '(UTC+01:00) Brussels' },
    { Value: 'Europe/Budapest', Text: '(UTC+01:00) Budapest' },
    { Value: 'Europe/Belgrade', Text: '(UTC+01:00) Central European Time - Belgrade' },
    { Value: 'Europe/Prague', Text: '(UTC+01:00) Central European Time - Prague' },
    { Value: 'Africa/Ceuta', Text: '(UTC+01:00) Ceuta' },
    { Value: 'Europe/Copenhagen', Text: '(UTC+01:00) Copenhagen' },
    { Value: 'Europe/Gibraltar', Text: '(UTC+01:00) Gibraltar' },
    { Value: 'Africa/Lagos', Text: '(UTC+01:00) Lagos' },
    { Value: 'Europe/Luxembourg', Text: '(UTC+01:00) Luxembourg' },
    { Value: 'Europe/Madrid', Text: '(UTC+01:00) Madrid' },
    { Value: 'Europe/Malta', Text: '(UTC+01:00) Malta' },
    { Value: 'Europe/Monaco', Text: '(UTC+01:00) Monaco' },
    { Value: 'Africa/Ndjamena', Text: '(UTC+01:00) Ndjamena' },
    { Value: 'Europe/Oslo', Text: '(UTC+01:00) Oslo' },
    { Value: 'Europe/Paris', Text: '(UTC+01:00) Paris' },
    { Value: 'Europe/Rome', Text: '(UTC+01:00) Rome' },
    { Value: 'Europe/Stockholm', Text: '(UTC+01:00) Stockholm' },
    { Value: 'Europe/Tirane', Text: '(UTC+01:00) Tirane' },
    { Value: 'Africa/Tunis', Text: '(UTC+01:00) Tunis' },
    { Value: 'Europe/Vienna', Text: '(UTC+01:00) Vienna' },
    { Value: 'Europe/Warsaw', Text: '(UTC+01:00) Warsaw' },
    { Value: 'Europe/Zurich', Text: '(UTC+01:00) Zurich' },
    { Value: 'Asia/Amman', Text: '(UTC+02:00) Amman' },
    { Value: 'Europe/Athens', Text: '(UTC+02:00) Athens' },
    { Value: 'Asia/Beirut', Text: '(UTC+02:00) Beirut' },
    { Value: 'Europe/Bucharest', Text: '(UTC+02:00) Bucharest' },
    { Value: 'Africa/Cairo', Text: '(UTC+02:00) Cairo' },
    { Value: 'Europe/Chisinau', Text: '(UTC+02:00) Chisinau' },
    { Value: 'Asia/Damascus', Text: '(UTC+02:00) Damascus' },
    { Value: 'Asia/Gaza', Text: '(UTC+02:00) Gaza' },
    { Value: 'Europe/Helsinki', Text: '(UTC+02:00) Helsinki' },
    { Value: 'Asia/Jerusalem', Text: '(UTC+02:00) Jerusalem' },
    { Value: 'Africa/Johannesburg', Text: '(UTC+02:00) Johannesburg' },
    { Value: 'Africa/Khartoum', Text: '(UTC+02:00) Khartoum' },
    { Value: 'Europe/Kiev', Text: '(UTC+02:00) Kiev' },
    { Value: 'Africa/Maputo', Text: '(UTC+02:00) Maputo' },
    { Value: 'Europe/Kaliningrad', Text: '(UTC+02:00) Moscow-01 - Kaliningrad' },
    { Value: 'Asia/Nicosia', Text: '(UTC+02:00) Nicosia' },
    { Value: 'Europe/Riga', Text: '(UTC+02:00) Riga' },
    { Value: 'Europe/Sofia', Text: '(UTC+02:00) Sofia' },
    { Value: 'Europe/Tallinn', Text: '(UTC+02:00) Tallinn' },
    { Value: 'Africa/Tripoli', Text: '(UTC+02:00) Tripoli' },
    { Value: 'Europe/Vilnius', Text: '(UTC+02:00) Vilnius' },
    { Value: 'Africa/Windhoek', Text: '(UTC+02:00) Windhoek' },
    { Value: 'Asia/Baghdad', Text: '(UTC+03:00) Baghdad' },
    { Value: 'Europe/Istanbul', Text: '(UTC+03:00) Istanbul' },
    { Value: 'Europe/Minsk', Text: '(UTC+03:00) Minsk' },
    { Value: 'Europe/Moscow', Text: '(UTC+03:00) Moscow+00 - Moscow' },
    { Value: 'Africa/Nairobi', Text: '(UTC+03:00) Nairobi' },
    { Value: 'Asia/Qatar', Text: '(UTC+03:00) Qatar' },
    { Value: 'Asia/Riyadh', Text: '(UTC+03:00) Riyadh' },
    { Value: 'Antarctica/Syowa', Text: '(UTC+03:00) Syowa' },
    { Value: 'Asia/Tehran', Text: '(UTC+03:30) Tehran' },
    { Value: 'Asia/Baku', Text: '(UTC+04:00) Baku' },
    { Value: 'Asia/Dubai', Text: '(UTC+04:00) Dubai' },
    { Value: 'Indian/Mahe', Text: '(UTC+04:00) Mahe' },
    { Value: 'Indian/Mauritius', Text: '(UTC+04:00) Mauritius' },
    { Value: 'Europe/Samara', Text: '(UTC+04:00) Moscow+01 - Samara' },
    { Value: 'Indian/Reunion', Text: '(UTC+04:00) Reunion' },
    { Value: 'Asia/Tbilisi', Text: '(UTC+04:00) Tbilisi' },
    { Value: 'Asia/Yerevan', Text: '(UTC+04:00) Yerevan' },
    { Value: 'Asia/Kabul', Text: '(UTC+04:30) Kabul' },
    { Value: 'Asia/Aqtau', Text: '(UTC+05:00) Aqtau' },
    { Value: 'Asia/Aqtobe', Text: '(UTC+05:00) Aqtobe' },
    { Value: 'Asia/Ashgabat', Text: '(UTC+05:00) Ashgabat' },
    { Value: 'Asia/Dushanbe', Text: '(UTC+05:00) Dushanbe' },
    { Value: 'Asia/Karachi', Text: '(UTC+05:00) Karachi' },
    { Value: 'Indian/Kerguelen', Text: '(UTC+05:00) Kerguelen' },
    { Value: 'Indian/Maldives', Text: '(UTC+05:00) Maldives' },
    { Value: 'Antarctica/Mawson', Text: '(UTC+05:00) Mawson' },
    { Value: 'Asia/Yekaterinburg', Text: '(UTC+05:00) Moscow+02 - Yekaterinburg' },
    { Value: 'Asia/Tashkent', Text: '(UTC+05:00) Tashkent' },
    { Value: 'Asia/Colombo', Text: '(UTC+05:30) Colombo' },
    { Value: 'Asia/Kolkata', Text: '(UTC+05:30) India Standard Time' },
    { Value: 'Asia/Katmandu', Text: '(UTC+05:45) Katmandu' },
    { Value: 'Asia/Almaty', Text: '(UTC+06:00) Almaty' },
    { Value: 'Asia/Bishkek', Text: '(UTC+06:00) Bishkek' },
    { Value: 'Indian/Chagos', Text: '(UTC+06:00) Chagos' },
    { Value: 'Asia/Dhaka', Text: '(UTC+06:00) Dhaka' },
    { Value: 'Asia/Omsk', Text: '(UTC+06:00) Moscow+03 - Omsk' },
    { Value: 'Asia/Thimphu', Text: '(UTC+06:00) Thimphu' },
    { Value: 'Antarctica/Vostok', Text: '(UTC+06:00) Vostok' },
    { Value: 'Indian/Cocos', Text: '(UTC+06:30) Cocos' },
    { Value: 'Asia/Yangon', Text: '(UTC+06:30) Rangoon' },
    { Value: 'Asia/Bangkok', Text: '(UTC+07:00) Bangkok' },
    { Value: 'Indian/Christmas', Text: '(UTC+07:00) Christmas' },
    { Value: 'Antarctica/Davis', Text: '(UTC+07:00) Davis' },
    { Value: 'Asia/Saigon', Text: '(UTC+07:00) Hanoi' },
    { Value: 'Asia/Hovd', Text: '(UTC+07:00) Hovd' },
    { Value: 'Asia/Jakarta', Text: '(UTC+07:00) Jakarta' },
    { Value: 'Asia/Krasnoyarsk', Text: '(UTC+07:00) Moscow+04 - Krasnoyarsk' },
    { Value: 'Asia/Brunei', Text: '(UTC+08:00) Brunei' },
    { Value: 'Asia/Shanghai', Text: '(UTC+08:00) China Time - Beijing' },
    { Value: 'Asia/Choibalsan', Text: '(UTC+08:00) Choibalsan' },
    { Value: 'Asia/Hong_Kong', Text: '(UTC+08:00) Hong Kong' },
    { Value: 'Asia/Kuala_Lumpur', Text: '(UTC+08:00) Kuala Lumpur' },
    { Value: 'Asia/Macau', Text: '(UTC+08:00) Macau' },
    { Value: 'Asia/Makassar', Text: '(UTC+08:00) Makassar' },
    { Value: 'Asia/Manila', Text: '(UTC+08:00) Manila' },
    { Value: 'Asia/Irkutsk', Text: '(UTC+08:00) Moscow+05 - Irkutsk' },
    { Value: 'Asia/Singapore', Text: '(UTC+08:00) Singapore' },
    { Value: 'Asia/Taipei', Text: '(UTC+08:00) Taipei' },
    { Value: 'Asia/Ulaanbaatar', Text: '(UTC+08:00) Ulaanbaatar' },
    { Value: 'Australia/Perth', Text: '(UTC+08:00) Western Time - Perth' },
    { Value: 'Asia/Pyongyang', Text: '(UTC+08:30) Pyongyang' },
    { Value: 'Asia/Dili', Text: '(UTC+09:00) Dili' },
    { Value: 'Asia/Jayapura', Text: '(UTC+09:00) Jayapura' },
    { Value: 'Asia/Yakutsk', Text: '(UTC+09:00) Moscow+06 - Yakutsk' },
    { Value: 'Pacific/Palau', Text: '(UTC+09:00) Palau' },
    { Value: 'Asia/Seoul', Text: '(UTC+09:00) Seoul' },
    { Value: 'Asia/Tokyo', Text: '(UTC+09:00) Tokyo' },
    { Value: 'Australia/Darwin', Text: '(UTC+09:30) Central Time - Darwin' },
    { Value: 'Antarctica/DumontDUrville', Text: '(UTC+10:00) Dumont D"Urville' },
    { Value: 'Australia/Brisbane', Text: '(UTC+10:00) Eastern Time - Brisbane' },
    { Value: 'Pacific/Guam', Text: '(UTC+10:00) Guam' },
    { Value: 'Asia/Vladivostok', Text: '(UTC+10:00) Moscow+07 - Vladivostok' },
    { Value: 'Pacific/Port_Moresby', Text: '(UTC+10:00) Port Moresby' },
    { Value: 'Pacific / Chuuk', Text: '(UTC+10:00) Truk' },
    { Value: 'Australia/Adelaide', Text: '(UTC+10:30) Central Time - Adelaide' },
    { Value: 'Antarctica/Casey', Text: '(UTC+11:00) Casey' },
    { Value: 'Australia/Hobart', Text: '(UTC+11:00) Eastern Time - Hobart' },
    { Value: 'Australia/Sydney', Text: '(UTC+11:00) Eastern Time - Melbourne, Sydney' },
    { Value: 'Pacific/Efate', Text: '(UTC+11:00) Efate' },
    { Value: 'Pacific/Guadalcanal', Text: '(UTC+11:00) Guadalcanal' },
    { Value: 'Pacific/Kosrae', Text: '(UTC+11:00) Kosrae' },
    { Value: 'Asia/Magadan', Text: '(UTC+11:00) Moscow+08 - Magadan' },
    { Value: 'Pacific / Norfolk', Text: '(UTC+11:00) Norfolk' },
    { Value: 'Pacific/Noumea', Text: '(UTC+11:00) Noumea' },
    { Value: 'Pacific/Pohnpei', Text: '(UTC+11:00) Ponape' },
    { Value: 'Pacific/Funafuti', Text: '(UTC+12:00) Funafuti' },
    { Value: 'Pacific/Kwajalein', Text: '(UTC+12:00) Kwajalein' },
    { Value: 'Pacific/Majuro', Text: '(UTC+12:00) Majuro' },
    { Value: 'Asia/Kamchatka', Text: '(UTC+12:00) Moscow+09 - Petropavlovsk - Kamchatskiy' },
    { Value: 'Pacific / Nauru', Text: '(UTC+12:00) Nauru' },
    { Value: 'Pacific/Tarawa', Text: '(UTC+12:00) Tarawa' },
    { Value: 'Pacific/Wake', Text: '(UTC+12:00) Wake' },
    { Value: 'Pacific/Wallis', Text: '(UTC+12:00) Wallis' },
    { Value: 'Pacific/Auckland', Text: '(UTC+13:00) Auckland' },
    { Value: 'Pacific/Enderbury', Text: '(UTC+13:00) Enderbury' },
    { Value: 'Pacific/Fakaofo', Text: '(UTC+13:00) Fakaofo' },
    { Value: 'Pacific/Fiji', Text: '(UTC+13:00) Fiji' },
    { Value: 'Pacific/Tongatapu', Text: '(UTC+13:00) Tongatapu' },
    { Value: 'Pacific/Apia', Text: '(UTC+14:00) Apia' },
    { Value: 'Pacific/Kiritimati', Text: '(UTC+14:00) Kiritimati' }
];


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/button-group.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/button-group.js ***!
  \*************************************************************************************/
/*! exports provided: createButtonGroup */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createButtonGroup", function() { return createButtonGroup; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");


/**
 * Initialize ButtonGroup CSS component with specified properties.
 * ```html
 * <div id='buttongroup'>
 * <button></button>
 * <button></button>
 * <button></button>
 * </div>
 * ```
 * ```typescript
 * createButtonGroup('#buttongroup', {
 *   cssClass: 'e-outline',
 *   buttons: [
 *       { content: 'Day' },
 *       { content: 'Week' },
 *       { content: 'Work Week'}
 *   ]
 * });
 * ```
 * @param {string} selector
 * @param {CreateButtonGroupModel} options
 * @returns HTMLElement
 */
function createButtonGroup(selector, options, createElement) {
    if (options === void 0) { options = {}; }
    var child;
    var btnElem;
    var nextChild;
    var btnModel;
    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["isNullOrUndefined"])(createElement)) {
        createElement = _ej2_base__WEBPACK_IMPORTED_MODULE_0__["createElement"];
    }
    var wrapper = document.querySelector(selector);
    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([wrapper], ['e-btn-group', 'e-css']);
    wrapper.setAttribute('role', 'group');
    var childs = wrapper.children;
    options.buttons = options.buttons || [];
    for (var i = 0, j = 0; j < childs.length; i++, j++) {
        child = childs[j];
        btnModel = options.buttons[i];
        if (btnModel !== null) {
            if (child.tagName === 'BUTTON') {
                btnElem = child;
            }
            else {
                btnElem = createElement('label');
                nextChild = childs[j + 1];
                if (nextChild) {
                    wrapper.insertBefore(btnElem, nextChild);
                }
                else {
                    wrapper.appendChild(btnElem);
                }
                if (child.id) {
                    btnElem.setAttribute('for', child.id);
                }
                if (btnModel && btnModel.disabled) {
                    child.disabled = true;
                }
                j++;
            }
            if (options.cssClass && btnModel && !btnModel.cssClass) {
                btnModel.cssClass = options.cssClass;
            }
            new _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["Button"](btnModel || {}, btnElem);
        }
    }
    return wrapper;
}


/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/index.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/index.js ***!
  \******************************************************************************/
/*! exports provided: createButtonGroup */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _button_group__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./button-group */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/button-group.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createButtonGroup", function() { return _button_group__WEBPACK_IMPORTED_MODULE_0__["createButtonGroup"]; });

/**
 * ButtonGroup modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/common.js":
/*!*************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/common.js ***!
  \*************************************************************************/
/*! exports provided: getModel, upDownKeyHandler, setBlankIconStyle, Item */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModel", function() { return getModel; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "upDownKeyHandler", function() { return upDownKeyHandler; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setBlankIconStyle", function() { return setBlankIconStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return Item; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};

/**
 * @param props
 * @param model
 */
function getModel(props, model) {
    var obj = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["extend"])({}, props);
    for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {
        var prop = _a[_i];
        if ((model).indexOf(prop) < 0) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["deleteObject"])(obj, prop);
        }
    }
    return obj;
}
/** @hidden */
function upDownKeyHandler(ul, keyCode) {
    var defaultIdx = keyCode === 40 ? 0 : ul.childElementCount - 1;
    var liIdx = defaultIdx;
    var li;
    var selectedLi = ul.querySelector('.e-selected');
    if (selectedLi) {
        selectedLi.classList.remove('e-selected');
    }
    for (var i = 0, len = ul.children.length; i < len; i++) {
        if (ul.children[i].classList.contains('e-focused')) {
            li = ul.children[i];
            liIdx = i;
            li.classList.remove('e-focused');
            keyCode === 40 ? liIdx++ : liIdx--;
            if (liIdx === (keyCode === 40 ? ul.childElementCount : -1)) {
                liIdx = defaultIdx;
            }
        }
    }
    li = ul.children[liIdx];
    liIdx = isValidLI(ul, li, liIdx, keyCode);
    if (liIdx !== -1) {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([ul.children[liIdx]], 'e-focused');
        ul.children[liIdx].focus();
    }
}
function isValidLI(ul, li, index, keyCode, count) {
    if (count === void 0) { count = 0; }
    if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
        if (index === (keyCode === 40 ? ul.childElementCount - 1 : 0)) {
            index = keyCode === 40 ? 0 : ul.childElementCount - 1;
        }
        else {
            keyCode === 40 ? index++ : index--;
        }
    }
    li = ul.children[index];
    if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
        count++;
        if (count === ul.childElementCount) {
            return index = -1;
        }
        index = isValidLI(ul, li, index, keyCode, count);
    }
    return index;
}
/** @hidden */
function setBlankIconStyle(popup) {
    var blankIconList = [].slice.call(popup.getElementsByClassName('e-blank-icon'));
    if (!blankIconList.length) {
        return;
    }
    var iconLi = popup.querySelector('.e-item:not(.e-blank-icon):not(.e-separator)');
    if (iconLi.classList.contains('e-url')) {
        iconLi = iconLi.querySelector('.e-menu-url');
    }
    var icon = iconLi.querySelector('.e-menu-icon');
    var cssProp;
    var enableRtl = popup.classList.contains('e-rtl');
    if (enableRtl) {
        cssProp = { padding: 'paddingRight', margin: 'marginLeft' };
    }
    else {
        cssProp = { padding: 'paddingLeft', margin: 'marginRight' };
    }
    // tslint:disable
    var size = parseInt(getComputedStyle(icon).fontSize, 10) + parseInt((enableRtl ? getComputedStyle(icon)[cssProp.margin] : getComputedStyle(icon)[cssProp.margin]), 10)
        + parseInt(getComputedStyle(iconLi).paddingLeft, 10) + "px";
    blankIconList.forEach(function (li) {
        if (li.classList.contains('e-url')) {
            li.querySelector('.e-menu-url').style[cssProp.padding] = size;
        }
        else {
            li.style[cssProp.padding] = size;
        }
    });
    // tslint:enable
}
/**
 * Defines the items of Split Button/DropDownButton.
 */
var Item = /** @__PURE__ @class */ (function (_super) {
    __extends(Item, _super);
    function Item() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "id", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Item.prototype, "separator", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "text", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], Item.prototype, "url", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], Item.prototype, "disabled", void 0);
    return Item;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["ChildProperty"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/index.js":
/*!************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/index.js ***!
  \************************************************************************/
/*! exports provided: getModel, upDownKeyHandler, setBlankIconStyle, Item */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/common.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getModel", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["getModel"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upDownKeyHandler", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["upDownKeyHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setBlankIconStyle", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["setBlankIconStyle"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return _common__WEBPACK_IMPORTED_MODULE_0__["Item"]; });

/**
 * Common modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/drop-down-button.js":
/*!*********************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/drop-down-button.js ***!
  \*********************************************************************************************/
/*! exports provided: DropDownButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropDownButton", function() { return DropDownButton; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../common/common */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/common.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};








var classNames = {
    DISABLED: 'e-disabled',
    FOCUS: 'e-focused',
    ICON: 'e-menu-icon',
    ITEM: 'e-item',
    POPUP: 'e-dropdown-popup',
    RTL: 'e-rtl',
    SEPARATOR: 'e-separator',
    VERTICAL: 'e-vertical'
};
/**
 * DropDownButton component is used to toggle contextual overlays for displaying list of action items.
 * It can contain both text and images.
 * ```html
 * <button id="element">DropDownButton</button>
 * ```
 * ```typescript
 * <script>
 * var dropDownButtonObj = new DropDownButton({items: [{ text: 'Action1' }, { text: 'Action2' },{ text: 'Action3' }]);
 * dropDownButtonObj.appendTo("#element");
 * </script>
 * ```
 */
var DropDownButton = /** @__PURE__ @class */ (function (_super) {
    __extends(DropDownButton, _super);
    /**
     * Constructor for creating the widget
     * @param  {DropDownButtonModel} options?
     * @param  {string|HTMLButtonElement} element?
     */
    function DropDownButton(options, element) {
        return _super.call(this, options, element) || this;
    }
    DropDownButton.prototype.preRender = function () {
        /** */
    };
    /**
     * Get the properties to be maintained in the persisted state.
     * @returns string
     */
    DropDownButton.prototype.getPersistData = function () {
        return this.addOnPersist([]);
    };
    /**
     * To open/close DropDownButton popup based on current state of the DropDownButton.
     * @returns void
     */
    DropDownButton.prototype.toggle = function () {
        this.canOpen() ? this.openPopUp() : this.closePopup();
    };
    /**
     * Initialize the Component rendering
     * @returns void
     * @private
     */
    DropDownButton.prototype.render = function () {
        this.initialize();
        if (!this.disabled) {
            this.wireEvents();
        }
        this.renderComplete();
    };
    /**
     * Adds a new item to the menu. By default, new item appends to the list as the last item,
     * but you can insert based on the text parameter.
     * @param  { ItemModel[] } items - Specifies an array of JSON data.
     * @param { string } text - Specifies the text to insert the newly added item in the menu.
     * @returns {void}.
     */
    DropDownButton.prototype.addItems = function (items, text) {
        var newItem;
        var idx = this.items.length;
        for (var j = 0, len = this.items.length; j < len; j++) {
            if (text === this.items[j].text) {
                idx = j;
                break;
            }
        }
        for (var i = items.length - 1; i >= 0; i--) {
            // tslint:disable-next-line
            newItem = new _common_common__WEBPACK_IMPORTED_MODULE_3__["Item"](this, 'items', items[i], true);
            this.items.splice(idx, 0, newItem);
        }
        if (!this.canOpen()) {
            this.createItems();
        }
    };
    /**
     * Removes the items from the menu.
     * @param  { string[] } items - Specifies an array of string to remove the items.
     * @param { string } isUniqueId - Set `true` if specified items is a collection of unique id.
     * @returns {void}.
     */
    DropDownButton.prototype.removeItems = function (items, isUniqueId) {
        var refresh = false;
        for (var i = 0, len = items.length; i < len; i++) {
            for (var j = 0, len_1 = this.items.length; j < len_1; j++) {
                if (items[i] === (isUniqueId ? this.items[j].id : this.items[j].text)) {
                    this.items.splice(j, 1);
                    refresh = true;
                    break;
                }
            }
        }
        if (refresh && this.getULElement()) {
            this.createItems();
        }
    };
    DropDownButton.prototype.createPopup = function () {
        var _a;
        var div = this.createElement('div', {
            className: classNames.POPUP,
            id: this.element.id + '-popup'
        });
        document.body.appendChild(div);
        this.dropDown = new _ej2_popups__WEBPACK_IMPORTED_MODULE_2__["Popup"](div, {
            relateTo: this.element,
            collision: { X: 'fit', Y: 'flip' },
            position: { X: 'left', Y: 'bottom' },
            targetType: 'relative',
            content: this.target ? this.getTargetElement() : '',
            enableRtl: this.enableRtl
        });
        if (this.dropDown.element.style.position === 'fixed') {
            this.dropDown.refreshPosition(this.element);
        }
        this.dropDown.hide();
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, (_a = {},
            _a['aria-haspopup'] = this.items.length || this.target ? 'true' : 'false',
            _a['aria-expanded'] = 'false',
            _a['aria-owns'] = this.getPopUpElement().id,
            _a['type'] = 'button',
            _a['aria-label'] = this.element.textContent + ' dropdownbutton',
            _a));
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([div], this.cssClass.split(' '));
        }
    };
    DropDownButton.prototype.getTargetElement = function () {
        return typeof (this.target) === 'string' ? Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["select"])(this.target) : this.target;
    };
    DropDownButton.prototype.createItems = function (appendItems) {
        var items = this.items;
        var showIcon = this.hasIcon(this.items, 'iconCss');
        var span;
        var item;
        var li;
        var eventArgs;
        var ul = this.getULElement();
        if (ul) {
            ul.innerHTML = '';
        }
        else {
            ul = this.createElement('ul', {
                attrs: { 'role': 'menu', 'tabindex': '0' }
            });
        }
        for (var i = 0; i < items.length; i++) {
            item = items[i];
            var tempItem = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(item.text) : item.text;
            li = this.createElement('li', {
                innerHTML: item.url ? '' : tempItem,
                className: item.separator ? classNames.ITEM + ' ' + classNames.SEPARATOR : classNames.ITEM,
                attrs: { 'role': 'menuItem', 'tabindex': '-1' },
                id: item.id ? item.id : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + this.getModuleName() + '-item')
            });
            if (item.url) {
                li.appendChild(this.createAnchor(item));
                li.classList.add('e-url');
            }
            if (item.iconCss) {
                span = this.createElement('span', { className: classNames.ICON + ' ' + item.iconCss });
                (item.url) ? li.childNodes[0].appendChild(span) : li.insertBefore(span, li.childNodes[0]);
            }
            else {
                if (showIcon && !item.separator) {
                    li.classList.add('e-blank-icon');
                }
            }
            if (item.disabled) {
                li.classList.add('e-disabled');
            }
            eventArgs = { item: item, element: li };
            this.trigger('beforeItemRender', eventArgs);
            ul.appendChild(li);
        }
        if (appendItems) {
            this.getPopUpElement().appendChild(ul);
        }
        if (showIcon) {
            Object(_common_common__WEBPACK_IMPORTED_MODULE_3__["setBlankIconStyle"])(this.getPopUpElement());
        }
    };
    DropDownButton.prototype.hasIcon = function (items, field) {
        for (var i = 0, len = items.length; i < len; i++) {
            if (items[i][field]) {
                return true;
            }
        }
        return false;
    };
    DropDownButton.prototype.createAnchor = function (item) {
        var tempItem = (this.enableHtmlSanitizer) ? _ej2_base__WEBPACK_IMPORTED_MODULE_0__["SanitizeHtmlHelper"].sanitize(item.text) : item.text;
        return this.createElement('a', { className: 'e-menu-text e-menu-url', innerHTML: tempItem, attrs: { 'href': item.url } });
    };
    DropDownButton.prototype.initialize = function () {
        this.button = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["Button"]({
            iconCss: this.iconCss, iconPosition: this.iconPosition, cssClass: this.cssClass, content: this.content,
            disabled: this.disabled, enableRtl: this.enableRtl, enablePersistence: this.enablePersistence
        });
        this.button.createElement = this.createElement;
        this.button.appendTo(this.element);
        if (!this.element.id) {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + this.getModuleName());
        }
        this.appendArrowSpan();
        this.createPopup();
        this.setActiveElem([this.element]);
    };
    DropDownButton.prototype.appendArrowSpan = function () {
        this.element.appendChild(this.createElement('span', {
            className: 'e-btn-icon e-icons ' + 'e-icon-' + (this.cssClass.indexOf(classNames.VERTICAL) > -1
                ? 'bottom' : 'right') + ' e-caret'
        }));
    };
    DropDownButton.prototype.setActiveElem = function (elem) {
        this.activeElem = elem;
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    DropDownButton.prototype.getModuleName = function () {
        return 'dropdown-btn';
    };
    DropDownButton.prototype.canOpen = function () {
        return this.getPopUpElement().classList.contains('e-popup-close');
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    DropDownButton.prototype.destroy = function () {
        var _this = this;
        _super.prototype.destroy.call(this);
        if (this.getModuleName() === 'dropdown-btn') {
            var attrList = void 0;
            var classList_1;
            if (this.element.querySelector('span.e-caret')) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(this.element.querySelector('span.e-caret'));
            }
            if (this.cssClass) {
                classList_1 = this.cssClass.split(' ');
            }
            this.button.destroy();
            if (classList_1) {
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], classList_1);
            }
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(this.activeElem, ['e-active']);
            attrList = this.element.getAttribute('class') ? ['aria-haspopup', 'aria-expanded', 'aria-owns', 'type']
                : ['aria-haspopup', 'aria-expanded', 'aria-owns', 'type', 'class'];
            attrList.forEach(function (key) {
                _this.element.removeAttribute(key);
            });
            this.dropDown.destroy();
            if (this.getPopUpElement()) {
                var popupEle = document.getElementById(this.getPopUpElement().id);
                if (popupEle) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([popupEle], ['e-popup-open', 'e-popup-close']);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(popupEle);
                }
            }
            if (!this.disabled) {
                this.unWireEvents();
            }
        }
    };
    DropDownButton.prototype.getPopUpElement = function () {
        return this.dropDown.element;
    };
    DropDownButton.prototype.getULElement = function () {
        return this.getPopUpElement().children[0];
    };
    DropDownButton.prototype.wireEvents = function () {
        var popupElement = this.getPopUpElement();
        this.delegateMousedownHandler = this.mousedownHandler.bind(this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(document, 'mousedown touchstart', this.delegateMousedownHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(popupElement, 'click', this.clickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'keydown', this.keyBoardHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(popupElement, 'keydown', this.keyBoardHandler, this);
        this.rippleFn = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["rippleEffect"])(popupElement, { selector: '.' + classNames.ITEM });
    };
    /** @hidden */
    DropDownButton.prototype.keyBoardHandler = function (e) {
        if (e.target === this.element && (e.keyCode === 9 || (!e.altKey && e.keyCode === 40) || e.keyCode === 38)) {
            return;
        }
        switch (e.keyCode) {
            case 38:
            case 40:
                if (e.altKey && (e.keyCode === 38 || e.keyCode === 40)) {
                    this.keyEventHandler(e);
                }
                else {
                    this.upDownKeyHandler(e);
                }
                break;
            case 9:
            case 13:
            case 27:
            case 32:
                this.keyEventHandler(e);
                break;
        }
    };
    DropDownButton.prototype.upDownKeyHandler = function (e) {
        if (this.target && (e.keyCode === 38 || e.keyCode === 40)) {
            return;
        }
        e.preventDefault();
        Object(_common_common__WEBPACK_IMPORTED_MODULE_3__["upDownKeyHandler"])(this.getULElement(), e.keyCode);
    };
    DropDownButton.prototype.keyEventHandler = function (e) {
        if (this.target && (e.keyCode === 13 || e.keyCode === 9)) {
            return;
        }
        if (e.keyCode !== 9) {
            e.preventDefault();
        }
        if (e.keyCode === 27 || e.keyCode === 38 || e.keyCode === 9) {
            if (!this.canOpen()) {
                this.closePopup(e, this.element);
            }
        }
        else {
            this.clickHandler(e);
        }
    };
    DropDownButton.prototype.getLI = function (elem) {
        return elem.tagName === 'LI' ? elem : Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(elem, 'li');
    };
    DropDownButton.prototype.mousedownHandler = function (e) {
        var trgt = e.target;
        if (!this.canOpen() && !(Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '[id="' + this.getPopUpElement().id + '"]')
            || Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '[id="' + this.element.id + '"]'))) {
            this.closePopup(e);
        }
    };
    DropDownButton.prototype.clickHandler = function (e) {
        var trgt = e.target;
        var canOpen = this.canOpen();
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '[id="' + this.element.id + '"]')) {
            if (canOpen) {
                this.openPopUp(e);
            }
            else {
                this.closePopup(e, this.activeElem[0]);
            }
        }
        else {
            if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["closest"])(trgt, '[id="' + this.getPopUpElement().id + '"]')) {
                var eventArgs = void 0;
                var liIdx = void 0;
                var item = void 0;
                var li = this.getLI(trgt);
                if (li) {
                    liIdx = Array.prototype.indexOf.call(this.getULElement().children, li);
                    item = this.items[liIdx];
                    if (item) {
                        eventArgs = { element: li, item: item };
                        this.trigger('select', eventArgs);
                    }
                    this.closePopup(e, this.activeElem[0]);
                }
            }
        }
    };
    DropDownButton.prototype.openPopUp = function (e) {
        var _this = this;
        if (e === void 0) { e = null; }
        if (!this.target) {
            this.createItems(true);
        }
        var ul = this.getULElement();
        var beforeOpenArgs = { element: ul, items: this.items, event: e, cancel: false };
        this.trigger('beforeOpen', beforeOpenArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                var ul_1 = _this.getULElement();
                _this.dropDown.show(null, _this.element);
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([_this.element], 'e-active');
                _this.element.setAttribute('aria-expanded', 'true');
                ul_1.focus();
                var openArgs = { element: ul_1, items: _this.items };
                _this.trigger('open', openArgs);
            }
        });
    };
    DropDownButton.prototype.closePopup = function (e, focusEle) {
        var _this = this;
        if (e === void 0) { e = null; }
        var ul = this.getULElement();
        var beforeCloseArgs = { element: ul, items: this.items, event: e, cancel: false };
        this.trigger('beforeClose', beforeCloseArgs, function (observedArgs) {
            if (!observedArgs.cancel) {
                var ul_2 = _this.getULElement();
                var selectedLi = ul_2.querySelector('.e-selected');
                if (selectedLi) {
                    selectedLi.classList.remove('e-selected');
                }
                _this.dropDown.hide();
                Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(_this.activeElem, 'e-active');
                _this.element.setAttribute('aria-expanded', 'false');
                if (focusEle) {
                    focusEle.focus();
                }
                var closeArgs = { element: ul_2, items: _this.items };
                _this.trigger('close', closeArgs);
                if (!_this.target && ul_2) {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ul_2);
                }
            }
        });
    };
    DropDownButton.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(document, 'mousedown touchstart', this.delegateMousedownHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.getPopUpElement(), 'click', this.clickHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'keydown', this.keyBoardHandler);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.getPopUpElement(), 'keydown', this.keyBoardHandler);
        this.rippleFn();
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {DropDownButtonModel} newProp
     * @param  {DropDownButtonModel} oldProp
     * @returns void
     * @private
     */
    DropDownButton.prototype.onPropertyChanged = function (newProp, oldProp) {
        var btnModel = ['content', 'cssClass', 'iconCss', 'iconPosition', 'disabled', 'enableRtl'];
        this.button.setProperties(Object(_common_common__WEBPACK_IMPORTED_MODULE_3__["getModel"])(newProp, btnModel));
        this.dropDown.setProperties(Object(_common_common__WEBPACK_IMPORTED_MODULE_3__["getModel"])(newProp, ['enableRtl']));
        var popupElement = this.getPopUpElement();
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'content':
                    if (!this.element.querySelector('span.e-caret')) {
                        this.appendArrowSpan();
                    }
                    break;
                case 'disabled':
                    if (newProp.disabled) {
                        this.unWireEvents();
                        if (!this.canOpen()) {
                            this.closePopup();
                        }
                    }
                    else {
                        this.wireEvents();
                    }
                    break;
                case 'cssClass':
                    if (newProp.cssClass.indexOf(classNames.VERTICAL) > -1) {
                        var arrowSpan = this.element.querySelector('span.e-caret');
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["classList"])(arrowSpan, ['e-icon-bottom'], ['e-icon-right']);
                    }
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([popupElement], oldProp.cssClass.split(' '));
                    }
                    if (newProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([popupElement], newProp.cssClass.split(' '));
                    }
                    break;
                case 'target':
                    this.dropDown.content = this.getTargetElement();
                    this.dropDown.dataBind();
                    break;
                case 'items':
                    if (this.getULElement()) {
                        this.createItems();
                    }
                    break;
            }
        }
    };
    /**
     * Sets the focus to DropDownButton
     * its native method
     * @public
     */
    DropDownButton.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DropDownButton.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DropDownButton.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownButton.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DropDownButton.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], DropDownButton.prototype, "iconPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], DropDownButton.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], _common_common__WEBPACK_IMPORTED_MODULE_3__["Item"])
    ], DropDownButton.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], DropDownButton.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "beforeItemRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], DropDownButton.prototype, "created", void 0);
    DropDownButton = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], DropDownButton);
    return DropDownButton;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Component"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/index.js":
/*!**********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/index.js ***!
  \**********************************************************************************/
/*! exports provided: DropDownButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _drop_down_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drop-down-button */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/drop-down-button.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownButton", function() { return _drop_down_button__WEBPACK_IMPORTED_MODULE_0__["DropDownButton"]; });

/**
 * DropDownButton modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/index.js":
/*!*****************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/index.js ***!
  \*****************************************************************/
/*! exports provided: getModel, upDownKeyHandler, setBlankIconStyle, Item, DropDownButton, SplitButton, Deferred, createButtonGroup, SpinSettings, AnimationSettings, ProgressButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getModel", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["getModel"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upDownKeyHandler", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["upDownKeyHandler"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setBlankIconStyle", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["setBlankIconStyle"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Item", function() { return _common_index__WEBPACK_IMPORTED_MODULE_0__["Item"]; });

/* harmony import */ var _drop_down_button_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./drop-down-button/index */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropDownButton", function() { return _drop_down_button_index__WEBPACK_IMPORTED_MODULE_1__["DropDownButton"]; });

/* harmony import */ var _split_button_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./split-button/index */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButton", function() { return _split_button_index__WEBPACK_IMPORTED_MODULE_2__["SplitButton"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Deferred", function() { return _split_button_index__WEBPACK_IMPORTED_MODULE_2__["Deferred"]; });

/* harmony import */ var _button_group_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button-group/index */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/button-group/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createButtonGroup", function() { return _button_group_index__WEBPACK_IMPORTED_MODULE_3__["createButtonGroup"]; });

/* harmony import */ var _progress_button_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./progress-button/index */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SpinSettings", function() { return _progress_button_index__WEBPACK_IMPORTED_MODULE_4__["SpinSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return _progress_button_index__WEBPACK_IMPORTED_MODULE_4__["AnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProgressButton", function() { return _progress_button_index__WEBPACK_IMPORTED_MODULE_4__["ProgressButton"]; });

/**
 * SplitButton all module
 */







/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/index.js":
/*!*********************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/index.js ***!
  \*********************************************************************************/
/*! exports provided: SpinSettings, AnimationSettings, ProgressButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _progress_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./progress-button */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/progress-button.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SpinSettings", function() { return _progress_button__WEBPACK_IMPORTED_MODULE_0__["SpinSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return _progress_button__WEBPACK_IMPORTED_MODULE_0__["AnimationSettings"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProgressButton", function() { return _progress_button__WEBPACK_IMPORTED_MODULE_0__["ProgressButton"]; });

/**
 * ProgressButton modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/progress-button.js":
/*!*******************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/progress-button/progress-button.js ***!
  \*******************************************************************************************/
/*! exports provided: SpinSettings, AnimationSettings, ProgressButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpinSettings", function() { return SpinSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationSettings", function() { return AnimationSettings; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProgressButton", function() { return ProgressButton; });
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_popups__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../ej2-popups */ "./ej2-resources/18.4.46/scripts/ej2-popups/index.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};





var HIDESPINNER = 'e-hide-spinner';
var PROGRESS = 'e-progress';
var PROGRESSACTIVE = 'e-progress-active';
var CONTENTCLS = 'e-btn-content';
/**
 * Defines the spin settings.
 */
var SpinSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(SpinSettings, _super);
    function SpinSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(null)
    ], SpinSettings.prototype, "template", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(16)
    ], SpinSettings.prototype, "width", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('Left')
    ], SpinSettings.prototype, "position", void 0);
    return SpinSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["ChildProperty"]));

/**
 * Defines the animation settings.
 */
var AnimationSettings = /** @__PURE__ @class */ (function (_super) {
    __extends(AnimationSettings, _super);
    function AnimationSettings() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(400)
    ], AnimationSettings.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('None')
    ], AnimationSettings.prototype, "effect", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('ease')
    ], AnimationSettings.prototype, "easing", void 0);
    return AnimationSettings;
}(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["ChildProperty"]));

/**
 * The ProgressButton visualizes the progression of an operation to indicate the user
 * that a process is happening in the background with visual representation.
 * ```html
 * <button id="element"></button>
 * ```
 * ```typescript
 * <script>
 * var progressButtonObj = new ProgressButton({ content: 'Progress Button' });
 * progressButtonObj.appendTo("#element");
 * </script>
 * ```
 */
var ProgressButton = /** @__PURE__ @class */ (function (_super) {
    __extends(ProgressButton, _super);
    /**
     * Constructor for creating the widget
     * @param  {ProgressButtonModel} options?
     * @param  {string|HTMLButtonElement} element?
     */
    function ProgressButton(options, element) {
        var _this = _super.call(this, options, element) || this;
        _this.step = 1;
        return _this;
    }
    ProgressButton.prototype.preRender = function () {
        _super.prototype.preRender.call(this);
    };
    /**
     * Initialize the Component rendering
     * @returns void
     * @private
     */
    ProgressButton.prototype.render = function () {
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
            this.isServerRendered = false;
        }
        _super.prototype.render.call(this);
        this.init();
        this.wireEvents();
        this.setAria();
        this.renderComplete();
    };
    /**
     * Starts the button progress at the specified percent.
     * @param percent Starts the button progress at this percent.
     * @returns void
     */
    ProgressButton.prototype.start = function (percent) {
        this.isPaused = false;
        this.startProgress(percent ? percent : this.percent, this.progressTime);
    };
    /**
     * Stops the button progress.
     * @returns void
     */
    ProgressButton.prototype.stop = function () {
        this.isPaused = true;
        cancelAnimationFrame(this.timerId);
    };
    /**
     * Complete the button progress.
     * @returns void
     */
    ProgressButton.prototype.progressComplete = function () {
        this.isPaused = false;
        this.finishProgress();
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    ProgressButton.prototype.getModuleName = function () {
        return 'progress-btn';
    };
    /**
     * Destroys the widget.
     * @returns void
     */
    ProgressButton.prototype.destroy = function () {
        var _this = this;
        var classList = [HIDESPINNER, PROGRESSACTIVE, 'e-round-corner', 'e-' + _super.prototype.getModuleName.call(this),
            'e-spin-' + this.spinSettings.position.toLowerCase()];
        var css;
        _super.prototype.destroy.call(this);
        this.unWireEvents();
        this.element.innerHTML = '';
        if (this.cssClass) {
            classList = classList.concat(this.cssClass.split(' '));
        }
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["removeClass"])([this.element], classList);
        css = this.element.getAttribute('class') ? ['aria-label', 'aria-valuemin', 'aria-valuemax', 'aria-valuenow']
            : ['aria-label', 'aria-valuemin', 'aria-valuemax', 'aria-valuenow', 'class'];
        css.forEach(function (key) {
            _this.element.removeAttribute(key);
        });
        if (this.disabled) {
            this.element.removeAttribute('disabled');
        }
    };
    ProgressButton.prototype.init = function () {
        this.element.classList.add('e-' + _super.prototype.getModuleName.call(this));
        this.setContent();
        this.createSpinner();
        if (this.enableProgress) {
            this.createProgress();
        }
    };
    ProgressButton.prototype.createSpinner = function () {
        var spinner = this.createElement('span', { className: 'e-spinner' });
        this.setSpinPosition(spinner);
        Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["createSpinner"])({
            target: spinner, width: this.spinSettings.width || 16, template: this.spinSettings.template
        }, this.createElement);
    };
    ProgressButton.prototype.getSpinner = function () {
        return this.element.getElementsByClassName('e-spinner')[0];
    };
    ProgressButton.prototype.getProgress = function () {
        return this.element.getElementsByClassName(PROGRESS)[0];
    };
    ProgressButton.prototype.setSpinPosition = function (ele) {
        var position = this.spinSettings.position || 'Left';
        if (position === 'Left' || position === 'Top') {
            this.element.insertBefore(ele, this.element.getElementsByClassName(CONTENTCLS)[0]);
        }
        else {
            this.element.appendChild(ele);
        }
        this.element.classList.add('e-spin-' + position.toLowerCase());
    };
    ProgressButton.prototype.createProgress = function () {
        this.element.appendChild(this.createElement('span', { className: PROGRESS }));
    };
    ProgressButton.prototype.setContent = function () {
        var cont;
        if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
            cont = this.content;
            if (this.enableHtmlSanitizer) {
                cont = _ej2_base__WEBPACK_IMPORTED_MODULE_1__["SanitizeHtmlHelper"].sanitize(this.content);
            }
            this.setContentIcon(cont);
        }
        else {
            cont = this.element.innerHTML;
            if (this.enableHtmlSanitizer) {
                cont = _ej2_base__WEBPACK_IMPORTED_MODULE_1__["SanitizeHtmlHelper"].sanitize(this.element.innerHTML);
            }
            this.element.innerHTML = '';
            this.element.appendChild(this.createElement('span', { className: CONTENTCLS, innerHTML: cont }));
        }
    };
    ProgressButton.prototype.setContentIcon = function (content) {
        var contElem = this.createElement('span', { className: CONTENTCLS, innerHTML: content });
        if (this.iconCss) {
            var span = this.createElement('span', { className: 'e-btn-icon ' + this.iconCss });
            if (!this.element.textContent.trim()) {
                this.element.classList.add('e-icon-btn');
            }
            else {
                span.classList.add('e-icon-' + this.iconPosition.toLowerCase());
                if (this.iconPosition === 'Top' || this.iconPosition === 'Bottom') {
                    this.element.classList.add('e-' + this.iconPosition.toLowerCase() + '-icon-btn');
                }
            }
            var node = contElem.childNodes[0];
            if (node && (this.iconPosition === 'Left' || this.iconPosition === 'Top')) {
                contElem.insertBefore(span, node);
            }
            else {
                contElem.appendChild(span);
            }
        }
        this.element.appendChild(contElem);
    };
    ProgressButton.prototype.clickHandler = function () {
        if (this.element.classList.contains(PROGRESSACTIVE)) {
            return;
        }
        this.startProgress();
    };
    ProgressButton.prototype.startProgress = function (percent, progressTime) {
        var clsList = this.element.classList;
        var isVertical = clsList.contains('e-vertical');
        clsList.add(PROGRESSACTIVE);
        if (!(clsList.contains(HIDESPINNER))) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["showSpinner"])(this.element);
        }
        this.startAnimate(Date.now(), progressTime ? progressTime : 0, progressTime ? Date.now() - (this.duration * 1 / 100) : Date.now(), percent ? percent : 0, 0, this.step, 0, isVertical);
        this.startContAnimate();
    };
    ProgressButton.prototype.startAnimate = function (timestamp, progressTime, prevTime, percent, prevPercent, step, prevProgressTime, isVertical) {
        var _this = this;
        try {
            var args = void 0;
            var timeDiff = timestamp - prevTime;
            var stepTime = this.duration * step / 100;
            var timeDiffBuffer_1 = timeDiff ? (timeDiff < stepTime ? timeDiff - stepTime : timeDiff % stepTime) : 0;
            this.progressTime = progressTime = progressTime + timeDiff - timeDiffBuffer_1;
            prevTime = timestamp - timeDiffBuffer_1;
            percent = percent + (timeDiff - timeDiffBuffer_1) / this.duration * 100;
            prevPercent = ((progressTime - prevProgressTime) % stepTime === 0 || percent === 100) ? percent : prevPercent;
            args = { percent: prevPercent, currentDuration: progressTime, step: step };
            this.eIsVertical = isVertical;
            if (percent === 0) {
                this.trigger('begin', args, function (observedArgs) {
                    _this.successCallback(observedArgs, percent, prevPercent, progressTime, prevProgressTime, timeDiffBuffer_1, prevTime);
                });
            }
            else if (percent === 100 || progressTime === this.duration) {
                this.trigger('end', args, function (observedArgs) {
                    _this.successCallback(observedArgs, percent, prevPercent, progressTime, prevProgressTime, timeDiffBuffer_1, prevTime);
                });
            }
            else {
                this.trigger('progress', args, function (observedArgs) {
                    _this.successCallback(observedArgs, percent, prevPercent, progressTime, prevProgressTime, timeDiffBuffer_1, prevTime);
                });
            }
        }
        catch (e) {
            cancelAnimationFrame(this.timerId);
            this.trigger('fail', e);
        }
    };
    ProgressButton.prototype.successCallback = function (args, perc, pPerc, prgTim, pPrgTim, timDif, pTim) {
        var _this = this;
        var percent = perc;
        var prevPercent = pPerc;
        var timeDiffBuffer = timDif;
        var progressTime = prgTim;
        var prevProgressTime = pPrgTim;
        var prevTime = pTim;
        var isVertical = this.eIsVertical;
        if (percent !== args.percent && args.percent !== prevPercent) {
            percent = args.percent;
        }
        this.percent = percent;
        this.step = args.step;
        if ((progressTime - prevProgressTime) % (this.duration * args.step / 100) === 0 || percent === 100) {
            this.timerId = requestAnimationFrame(function () {
                if (_this.enableProgress) {
                    _this.getProgress().style[isVertical ? 'height' : 'width'] = percent + '%';
                }
                _this.element.setAttribute('aria-valuenow', percent.toString());
            });
            prevPercent = percent;
            prevProgressTime = progressTime;
        }
        if (!this.isPaused) {
            if (progressTime < this.duration && percent < 100) {
                this.interval = window.setTimeout(function () {
                    _this.startAnimate(Date.now(), progressTime, prevTime, percent, prevPercent, args.step, prevProgressTime, isVertical);
                    // tslint:disable-next-line
                }, (this.duration / 100) - timeDiffBuffer);
            }
            else {
                this.interval = window.setTimeout(function () {
                    _this.progressTime = _this.percent = 0;
                    if (_this.enableProgress) {
                        _this.getProgress().style[isVertical ? 'height' : 'width'] = '0%';
                    }
                    _this.element.setAttribute('aria-valuenow', '0');
                    _this.hideSpin();
                    // tslint:disable-next-line
                }, 100);
            }
        }
    };
    ProgressButton.prototype.startContAnimate = function () {
        var _this = this;
        var ele = this.element.getElementsByClassName(CONTENTCLS)[0];
        if (this.animationSettings.effect !== 'None') {
            (new _ej2_base__WEBPACK_IMPORTED_MODULE_1__["Animation"]({})).animate(ele, {
                duration: this.animationSettings.duration,
                name: 'Progress' + this.animationSettings.effect,
                timingFunction: this.animationSettings.easing,
                begin: function () {
                    if (_this.spinSettings.position === 'Center') {
                        _this.setSpinnerSize();
                    }
                },
                end: function () {
                    ele.classList.add('e-animate-end');
                }
            });
        }
        else if (this.spinSettings.position === 'Center') {
            this.setSpinnerSize();
        }
    };
    ProgressButton.prototype.finishProgress = function () {
        var clsList = this.element.classList;
        var isVertical = clsList.contains('e-vertical');
        clsList.add(PROGRESSACTIVE);
        var args;
        var count = 100;
        for (var i = this.percent; i < count; i++) {
            i += 10;
            if (i > 100) {
                i = 100;
            }
            if (this.enableProgress) {
                this.getProgress().style[isVertical ? 'height' : 'width'] = (this.percent < 100) ? (i + '%') : '100%';
            }
        }
        this.element.setAttribute('aria-valuenow', '0');
        this.hideSpin();
        args = { step: this.step, currentDuration: this.progressTime, percent: 100 };
        clearTimeout(this.interval);
        this.trigger('end', args);
        this.progressTime = this.percent = 0;
    };
    ProgressButton.prototype.setSpinnerSize = function () {
        var ele = this.element.getElementsByClassName(CONTENTCLS)[0];
        var spinner = this.getSpinner();
        spinner.style.width = Math.max(spinner.offsetWidth, ele.offsetWidth) + 'px';
        spinner.style.height = Math.max(spinner.offsetHeight, ele.offsetHeight) + 'px';
        ele.classList.add('e-cont-animate');
    };
    ProgressButton.prototype.hideSpin = function () {
        var cont = this.element.getElementsByClassName(CONTENTCLS)[0];
        if (!(this.element.classList.contains(HIDESPINNER))) {
            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["hideSpinner"])(this.element);
        }
        this.element.classList.remove(PROGRESSACTIVE);
        if (this.animationSettings.effect !== 'None') {
            cont.classList.remove('e-animate-end');
        }
        if (this.spinSettings.position === 'Center') {
            var ele = this.getSpinner();
            cont.classList.remove('e-cont-animate');
            ele.style.width = 'auto';
            ele.style.height = 'auto';
        }
    };
    ProgressButton.prototype.setIconSpan = function () {
        var cont = this.element.getElementsByClassName(CONTENTCLS)[0];
        var iconSpan = this.element.getElementsByClassName('e-btn-icon')[0];
        if (cont.childNodes[0] && (this.iconPosition === 'Left' || this.iconPosition === 'Top')) {
            cont.insertBefore(iconSpan, cont.childNodes[0]);
        }
        else {
            cont.appendChild(iconSpan);
        }
    };
    ProgressButton.prototype.setAria = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["attributes"])(this.element, {
            'aria-label': this.element.textContent + ' progress', 'aria-valuemin': '0', 'aria-valuemax': '100', 'aria-valuenow': '0'
        });
    };
    ProgressButton.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].add(this.element, 'click', this.clickHandler, this);
    };
    ProgressButton.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_1__["EventHandler"].remove(this.element, 'click', this.clickHandler);
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {ProgressButtonModel} newProp
     * @param  {ProgressButtonModel} oldProp
     * @returns void
     * @private
     */
    ProgressButton.prototype.onPropertyChanged = function (newProp, oldProp) {
        var ele = this.element;
        var isSpinning = false;
        var clsList = this.element.querySelector('.e-spinner-pane').classList;
        if (clsList.contains('e-spin-show')) {
            isSpinning = true;
        }
        _super.prototype.onPropertyChanged.call(this, newProp, oldProp);
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'content':
                    if (Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["isBlazor"])()) {
                        var btnElem = this.element.querySelector('.e-btn-content');
                        if (this.iconCss) {
                            if (this.iconPosition === 'Left' || this.iconPosition === 'Top') {
                                btnElem.childNodes[1].textContent = this.content;
                            }
                            else {
                                btnElem.childNodes[0].textContent = this.content;
                            }
                        }
                        else {
                            btnElem.textContent = this.content;
                        }
                    }
                    else {
                        this.setContent();
                        this.createSpinner();
                        if (isSpinning) {
                            Object(_ej2_popups__WEBPACK_IMPORTED_MODULE_2__["showSpinner"])(this.element);
                            isSpinning = false;
                        }
                        if (this.enableProgress) {
                            this.createProgress();
                        }
                    }
                    ele.setAttribute('aria-label', ele.textContent + ' progress');
                    break;
                case 'iconCss':
                    if (!oldProp.iconCss) {
                        this.setIconSpan();
                    }
                    break;
                case 'iconPosition':
                    this.setIconSpan();
                    break;
                case 'enableProgress':
                    if (newProp.enableProgress) {
                        this.createProgress();
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["remove"])(this.getProgress());
                    }
                    break;
                case 'spinSettings':
                    if (newProp.spinSettings.position) {
                        ele.classList.remove('e-spin-' + oldProp.spinSettings.position.toLowerCase());
                        this.setSpinPosition(this.getSpinner());
                    }
                    if (newProp.spinSettings.template || newProp.spinSettings.width) {
                        ele.removeChild(this.getSpinner());
                        this.createSpinner();
                    }
                    break;
            }
        }
    };
    /**
     * Sets the focus to ProgressButton
     * its native method
     * @public
     */
    ProgressButton.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(false)
    ], ProgressButton.prototype, "enableProgress", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(2000)
    ], ProgressButton.prototype, "duration", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('Left')
    ], ProgressButton.prototype, "iconPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('')
    ], ProgressButton.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(false)
    ], ProgressButton.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(false)
    ], ProgressButton.prototype, "isPrimary", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('')
    ], ProgressButton.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])('')
    ], ProgressButton.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(false)
    ], ProgressButton.prototype, "isToggle", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Property"])(false)
    ], ProgressButton.prototype, "enableHtmlSanitizer", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Complex"])({}, SpinSettings)
    ], ProgressButton.prototype, "spinSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Complex"])({}, AnimationSettings)
    ], ProgressButton.prototype, "animationSettings", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], ProgressButton.prototype, "created", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], ProgressButton.prototype, "begin", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], ProgressButton.prototype, "progress", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], ProgressButton.prototype, "end", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_1__["Event"])()
    ], ProgressButton.prototype, "fail", void 0);
    ProgressButton = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_1__["NotifyPropertyChanges"]
    ], ProgressButton);
    return ProgressButton;
}(_ej2_buttons__WEBPACK_IMPORTED_MODULE_0__["Button"]));



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/index.js":
/*!******************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/index.js ***!
  \******************************************************************************/
/*! exports provided: SplitButton, Deferred */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _split_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./split-button */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/split-button.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButton", function() { return _split_button__WEBPACK_IMPORTED_MODULE_0__["SplitButton"]; });

/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Deferred", function() { return _split_button__WEBPACK_IMPORTED_MODULE_0__["Deferred"]; });

/**
 * Split Button modules
 */



/***/ }),

/***/ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/split-button.js":
/*!*************************************************************************************!*\
  !*** ./ej2-resources/18.4.46/scripts/ej2-splitbuttons/split-button/split-button.js ***!
  \*************************************************************************************/
/*! exports provided: SplitButton, Deferred */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitButton", function() { return SplitButton; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Deferred", function() { return Deferred; });
/* harmony import */ var _ej2_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../ej2-base */ "./ej2-resources/18.4.46/scripts/ej2-base/index.js");
/* harmony import */ var _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../ej2-buttons */ "./ej2-resources/18.4.46/scripts/ej2-buttons/index.js");
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../common/common */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/common/common.js");
/* harmony import */ var _drop_down_button_drop_down_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../drop-down-button/drop-down-button */ "./ej2-resources/18.4.46/scripts/ej2-splitbuttons/drop-down-button/drop-down-button.js");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
/// <reference path='../drop-down-button/drop-down-button-model.d.ts'/>






var RTL = 'e-rtl';
var TAGNAME = 'EJS-SPLITBUTTON';
/**
 * SplitButton component has primary and secondary button. Primary button is used to select
 * default action and secondary button is used to toggle contextual overlays for displaying list of
 * action items. It can contain both text and images.
 * ```html
 * <button id="element"></button>
 * ```
 * ```typescript
 * <script>
 * var splitBtnObj = new SplitButton({content: 'SplitButton'});
 * splitBtnObj.appendTo("#element");
 * </script>
 * ```
 */
var SplitButton = /** @__PURE__ @class */ (function (_super) {
    __extends(SplitButton, _super);
    /**
     * Constructor for creating the widget
     * @param  {SplitButtonModel} options?
     * @param  {string|HTMLButtonElement} element?
     */
    function SplitButton(options, element) {
        return _super.call(this, options, element) || this;
    }
    /**
     * Initialize Angular support.
     * @private
     */
    SplitButton.prototype.preRender = function () {
        var ele = this.element;
        if (ele.tagName === TAGNAME) {
            var ejInstance = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getValue"])('ej2_instances', ele);
            var btn = this.createElement('button', { attrs: { 'type': 'button' } });
            var wrapper = this.createElement(TAGNAME, { className: 'e-' + this.getModuleName() + '-wrapper' });
            for (var idx = 0, len = ele.attributes.length; idx < len; idx++) {
                btn.setAttribute(ele.attributes[idx].nodeName, ele.attributes[idx].nodeValue);
            }
            ele.parentNode.insertBefore(wrapper, ele);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["detach"])(ele);
            ele = btn;
            wrapper.appendChild(ele);
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["setValue"])('ej2_instances', ejInstance, ele);
            this.wrapper = wrapper;
            this.element = ele;
        }
        if (!this.element.id) {
            this.element.id = Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getUniqueID"])('e-' + this.getModuleName());
        }
    };
    /**
     * Initialize the Component rendering
     * @returns void
     * @private
     */
    SplitButton.prototype.render = function () {
        this.initWrapper();
        this.createPrimaryButton();
        this.renderControl();
    };
    SplitButton.prototype.renderControl = function () {
        this.createSecondaryButton();
        this.setActiveElem([this.element, this.secondaryBtnObj.element]);
        this.setAria();
        this.wireEvents();
        this.renderComplete();
    };
    /**
     * Adds a new item to the menu. By default, new item appends to the list as the last item,
     * but you can insert based on the text parameter.
     * @param  { ItemModel[] } items - Specifies an array of JSON data.
     * @param { string } text - Specifies the text to insert the newly added item in the menu.
     * @returns {void}.
     */
    SplitButton.prototype.addItems = function (items, text) {
        _super.prototype.addItems.call(this, items, text);
        this.secondaryBtnObj.items = this.items;
    };
    /**
     * Removes the items from the menu.
     * @param  { string[] } items - Specifies an array of string to remove the items.
     * @param { string } isUniqueId - Set `true` if specified items is a collection of unique id.
     * @returns {void}.
     */
    SplitButton.prototype.removeItems = function (items, isUniqueId) {
        _super.prototype.removeItems.call(this, items, isUniqueId);
        this.secondaryBtnObj.items = this.items;
    };
    SplitButton.prototype.initWrapper = function () {
        if (!this.wrapper) {
            this.wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-wrapper' });
            this.element.parentNode.insertBefore(this.wrapper, this.element);
        }
        this.element.classList.remove('e-' + this.getModuleName());
        if (this.enableRtl) {
            this.wrapper.classList.add(RTL);
        }
        if (this.cssClass) {
            Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.wrapper], this.cssClass.split(' '));
        }
    };
    SplitButton.prototype.createPrimaryButton = function () {
        var btnModel = {
            cssClass: this.cssClass,
            enableRtl: this.enableRtl,
            iconCss: this.iconCss,
            iconPosition: this.iconPosition,
            content: this.content,
            disabled: this.disabled
        };
        this.primaryBtnObj = new _ej2_buttons__WEBPACK_IMPORTED_MODULE_1__["Button"](btnModel);
        this.primaryBtnObj.createElement = this.createElement;
        this.primaryBtnObj.appendTo(this.element);
        this.element.classList.add('e-' + this.getModuleName());
        this.element.type = 'button';
        this.wrapper.appendChild(this.element);
    };
    SplitButton.prototype.createSecondaryButton = function () {
        var _this = this;
        var dropDownBtnModel;
        var btnElem;
        btnElem = this.createElement('button', {
            className: 'e-icon-btn',
            attrs: { 'tabindex': '-1' },
            id: this.element.id + '_dropdownbtn'
        });
        this.wrapper.appendChild(btnElem);
        dropDownBtnModel = {
            cssClass: this.cssClass,
            disabled: this.disabled,
            enableRtl: this.enableRtl,
            items: this.items,
            target: this.target,
        };
        dropDownBtnModel.beforeItemRender = function (args) {
            _this.trigger('beforeItemRender', args);
        };
        dropDownBtnModel.open = function (args) {
            _this.trigger('open', args);
        };
        dropDownBtnModel.close = function (args) {
            _this.trigger('close', args);
        };
        dropDownBtnModel.select = function (args) {
            _this.trigger('select', args);
        };
        dropDownBtnModel.beforeOpen = function (args) {
            var callBackPromise = new Deferred();
            _this.trigger('beforeOpen', args, function (observedArgs) {
                callBackPromise.resolve(observedArgs);
            });
            return callBackPromise;
        };
        dropDownBtnModel.beforeClose = function (args) {
            var callBackPromise = new Deferred();
            _this.trigger('beforeClose', args, function (observedArgs) {
                callBackPromise.resolve(observedArgs);
            });
            return callBackPromise;
        };
        this.secondaryBtnObj = new _drop_down_button_drop_down_button__WEBPACK_IMPORTED_MODULE_3__["DropDownButton"](dropDownBtnModel);
        this.secondaryBtnObj.createElement = this.createElement;
        this.secondaryBtnObj.appendTo(btnElem);
        this.secondaryBtnObj.dropDown.relateTo = this.wrapper;
        this.dropDown = this.secondaryBtnObj.dropDown;
        this.secondaryBtnObj.activeElem = [this.element, this.secondaryBtnObj.element];
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.getPopUpElement(), 'keydown', this.secondaryBtnObj.keyBoardHandler);
        this.secondaryBtnObj.element.querySelector('.e-btn-icon').classList.remove('e-icon-right');
    };
    SplitButton.prototype.setAria = function () {
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["attributes"])(this.element, {
            'aria-expanded': 'false', 'aria-haspopup': 'true',
            'aria-label': this.element.textContent + ' splitbutton', 'aria-owns': this.secondaryBtnObj.dropDown.element.id
        });
    };
    /**
     * Get component name.
     * @returns string
     * @private
     */
    SplitButton.prototype.getModuleName = function () {
        return 'split-btn';
    };
    /**
     * To open/close SplitButton popup based on current state of the SplitButton.
     * @returns void
     */
    SplitButton.prototype.toggle = function () {
        this.secondaryBtnObj.toggle();
    };
    SplitButton.prototype.destroy = function () {
        var _this = this;
        var classList = [RTL];
        if (this.cssClass) {
            classList = classList.concat(this.cssClass.split(' '));
        }
        if (this.element) {
            var element = document.getElementById(this.element.id);
            if (element && element.parentElement === this.wrapper) {
                if (this.wrapper.tagName === TAGNAME) {
                    this.wrapper.innerHTML = '';
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.wrapper], this.cssClass.split(' '));
                }
                else {
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.element], classList);
                    ['aria-label', 'aria-haspopup', 'aria-expanded', 'aria-owns', 'type'].forEach(function (key) {
                        _this.element.removeAttribute(key);
                    });
                    this.wrapper.parentNode.insertBefore(this.element, this.wrapper);
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["remove"])(this.wrapper);
                }
                this.unWireEvents();
            }
        }
        this.primaryBtnObj.destroy();
        this.secondaryBtnObj.destroy();
        _super.prototype.destroy.call(this);
        if (!this.element.getAttribute('class')) {
            this.element.removeAttribute('class');
        }
    };
    SplitButton.prototype.wireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.element, 'click', this.primaryBtnClickHandler, this);
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].add(this.getPopUpElement(), 'keydown', this.keyBoardHandler, this);
        new _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"](this.element, {
            keyAction: this.btnKeyBoardHandler.bind(this),
            keyConfigs: {
                altdownarrow: 'alt+downarrow'
            }
        });
    };
    SplitButton.prototype.unWireEvents = function () {
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["EventHandler"].remove(this.element, 'click', this.primaryBtnClickHandler);
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["getInstance"])(this.element, _ej2_base__WEBPACK_IMPORTED_MODULE_0__["KeyboardEvents"]).destroy();
    };
    SplitButton.prototype.primaryBtnClickHandler = function () {
        this.trigger('click', { element: this.element });
    };
    SplitButton.prototype.btnKeyBoardHandler = function (e) {
        switch (e.action) {
            case 'altdownarrow':
                this.clickHandler(e);
                break;
        }
    };
    /**
     * Called internally if any of the property value changed.
     * @param  {SplitButtonModel} newProp
     * @param  {SplitButtonModel} oldProp
     * @returns void
     */
    SplitButton.prototype.onPropertyChanged = function (newProp, oldProp) {
        var model = ['content', 'iconCss', 'iconPosition', 'cssClass', 'disabled', 'enableRtl'];
        this.primaryBtnObj.setProperties(Object(_common_common__WEBPACK_IMPORTED_MODULE_2__["getModel"])(newProp, model));
        model = ['beforeOpen', 'beforeItemRender', 'select', 'open',
            'close', 'cssClass', 'disabled', 'enableRtl'];
        if (Object.keys(newProp).indexOf('items') > -1) {
            this.secondaryBtnObj.items = newProp.items;
            this.secondaryBtnObj.dataBind();
        }
        this.secondaryBtnObj.setProperties(Object(_common_common__WEBPACK_IMPORTED_MODULE_2__["getModel"])(newProp, model));
        for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
            var prop = _a[_i];
            switch (prop) {
                case 'cssClass':
                    if (oldProp.cssClass) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.wrapper], oldProp.cssClass.split(' '));
                    }
                    Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.wrapper], newProp.cssClass.split(' '));
                    break;
                case 'enableRtl':
                    if (newProp.enableRtl) {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["addClass"])([this.wrapper], RTL);
                    }
                    else {
                        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["removeClass"])([this.wrapper], RTL);
                    }
                    break;
            }
        }
    };
    /**
     * Sets the focus to SplitButton
     * its native method
     * @public
     */
    SplitButton.prototype.focusIn = function () {
        this.element.focus();
    };
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], SplitButton.prototype, "content", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], SplitButton.prototype, "cssClass", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])(false)
    ], SplitButton.prototype, "disabled", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], SplitButton.prototype, "iconCss", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('Left')
    ], SplitButton.prototype, "iconPosition", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Collection"])([], _common_common__WEBPACK_IMPORTED_MODULE_2__["Item"])
    ], SplitButton.prototype, "items", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Property"])('')
    ], SplitButton.prototype, "target", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "beforeItemRender", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "beforeOpen", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "beforeClose", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "click", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "close", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "open", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "select", void 0);
    __decorate([
        Object(_ej2_base__WEBPACK_IMPORTED_MODULE_0__["Event"])()
    ], SplitButton.prototype, "created", void 0);
    SplitButton = __decorate([
        _ej2_base__WEBPACK_IMPORTED_MODULE_0__["NotifyPropertyChanges"]
    ], SplitButton);
    return SplitButton;
}(_drop_down_button_drop_down_button__WEBPACK_IMPORTED_MODULE_3__["DropDownButton"]));

/**
 * Deferred is used to handle asynchronous operation.
 */
var Deferred = /** @__PURE__ @class */ (function () {
    function Deferred() {
        var _this = this;
        /**
         * Promise is an object that represents a value that may not be available yet, but will be resolved at some point in the future.
         */
        this.promise = new Promise(function (resolve, reject) {
            _this.resolve = resolve;
            _this.reject = reject;
        });
        /**
         * Defines the callback function triggers when the Deferred object is rejected.
         */
        this.catch = this.promise.catch.bind(this.promise);
        /**
         * Defines the callback function triggers when the Deferred object is resolved.
         */
        this.then = this.promise.then.bind(this.promise);
    }
    return Deferred;
}());



/***/ })

/******/ });